deorderdetail.vue 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702
  1. <template>
  2. <div class="BidSystemProductDeOrderDeorderdetail">
  3. <Toptitle :title="type == 1 ? '拆单编辑' : '拆单详情'">
  4. <slot name="titleButton">
  5. <Button
  6. @click="goback()"
  7. type="primary"
  8. ghost
  9. style="margin-right: 10px"
  10. >返回</Button
  11. >
  12. <Button
  13. @click="postData()"
  14. type="primary"
  15. v-if="type == 1"
  16. ghost
  17. style="margin-right: 10px"
  18. >保存</Button
  19. >
  20. </slot>
  21. </Toptitle>
  22. <div class="top_info">
  23. <div><span>产品名称:</span>{{ formData.title }}</div>
  24. <div><span>计量单位:</span>{{ formData.unit }}</div>
  25. <div><span>数量:</span>{{ formData.num }}</div>
  26. <!-- <div><span>价格:</span>{{ formData.price }}</div> -->
  27. <div><span>规格:</span>{{ formData.measure }}</div>
  28. <div><span>工艺属性:</span>{{ formData.process_property }}</div>
  29. <div style="overflow:hidden;">
  30. <span>图纸:</span>
  31. <div>
  32. <span
  33. v-for="item in formData.url"
  34. :key="item"
  35. @click="checkImg(formData.url)"
  36. >
  37. <img :src="$store.state.ip + item" alt="" />
  38. </span>
  39. </div>
  40. </div>
  41. <div><span>图号:</span>{{ formData.url_number }}</div>
  42. <div><span>备注:</span>{{ formData.remark }}</div>
  43. </div>
  44. <div class="similar_product">
  45. <!-- <div>
  46. <span>价格:</span>
  47. <Input
  48. type="text"
  49. size="small"
  50. :disabled="type == 2"
  51. v-model="formData.real_price"
  52. style="width: 150px; margin-right: 10px"
  53. placeholder="请输入价格"
  54. />
  55. </div> -->
  56. <div>
  57. <span>型号:</span>
  58. <Input
  59. type="text"
  60. size="small"
  61. :disabled="type == 2"
  62. v-model="formData.model"
  63. style="width: 150px; margin-right: 10px"
  64. placeholder="请输入型号"
  65. />
  66. </div>
  67. <div>
  68. <div
  69. style="
  70. display: flex;
  71. align-items: center;
  72. width: 100%;
  73. margin-right: 10px;
  74. "
  75. >
  76. <Dropdown>
  77. <a :disabled="type == 2">选择产品分类</a>
  78. <DropdownMenu slot="list">
  79. <Downtree
  80. @childByValue="handleClick"
  81. :parent="productTypes"
  82. ></Downtree>
  83. </DropdownMenu>
  84. </Dropdown>
  85. <a
  86. :disabled="type == 2"
  87. style="margin-left: 20px"
  88. v-if="nowSelectObj.title"
  89. >{{ nowSelectObj.title || "" }}</a
  90. >
  91. </div>
  92. </div>
  93. <Button
  94. @click="handleSimilarProductShow"
  95. type="primary"
  96. :disabled="type == 2"
  97. style="margin-right: 10px"
  98. >选择相似产品</Button
  99. >
  100. </div>
  101. <div
  102. class="parts"
  103. v-for="(partsItem, partsIndex) in formData.parts"
  104. :key="partsIndex"
  105. >
  106. <div class="parts_title">
  107. <h2>部件{{ partsIndex + 1 }}</h2>
  108. <div>
  109. <Button
  110. @click="handlePartAdd(partsItem, partsIndex)"
  111. type="success"
  112. size="small"
  113. :disabled="type == 2"
  114. style="margin-right: 10px"
  115. >新增部件</Button
  116. >
  117. <Button
  118. @click="handlePartCopy(partsItem, partsIndex)"
  119. type="primary"
  120. :disabled="type == 2"
  121. size="small"
  122. style="margin-right: 10px"
  123. >复制部件</Button
  124. >
  125. <Button
  126. @click="handlePartDele(partsItem, partsIndex)"
  127. v-show="formData.parts.length > 1"
  128. type="error"
  129. :disabled="type == 2"
  130. size="small"
  131. style="margin-right: 10px"
  132. >删除部件</Button
  133. >
  134. </div>
  135. </div>
  136. <div class="parts_top">
  137. <Form :model="partsItem" :label-width="100">
  138. <FormItem label="部件分类名称:">
  139. <Select
  140. v-model="partsItem.parts_type"
  141. size="small"
  142. clearable
  143. filterable
  144. :disabled="type == 2"
  145. @on-change="(e) => handlePartsSelect(e, partsItem)"
  146. style="width: 150px"
  147. >
  148. <Option
  149. v-for="sitem in partsList"
  150. :key="sitem.id"
  151. :label="sitem.title"
  152. :value="sitem.id"
  153. >
  154. </Option>
  155. </Select>
  156. </FormItem>
  157. <FormItem label="标签:">
  158. <RadioGroup v-model="partsItem.pay_state" size="small">
  159. <Radio :label="1" :disabled="type == 2">是</Radio>
  160. <Radio :label="0" :disabled="type == 2">否</Radio>
  161. </RadioGroup>
  162. </FormItem>
  163. <FormItem label="部件名称:">
  164. <Select
  165. v-model="partsItem.part_id"
  166. size="small"
  167. clearable
  168. filterable
  169. allow-create
  170. label-in-value
  171. :disabled="type == 2"
  172. @on-create="(e) => handlePartTitleCreate(partsItem, e)"
  173. @on-change="(e) => handlePartsNameSelect(partsItem, e)"
  174. style="width: 150px"
  175. >
  176. <Option
  177. v-for="sitem in partsItem.partsNameList"
  178. :key="sitem.id"
  179. :label="sitem.title"
  180. :value="sitem.id"
  181. >
  182. </Option>
  183. </Select>
  184. </FormItem>
  185. <FormItem label="单位:">
  186. <Input
  187. type="text"
  188. size="small"
  189. :disabled="type == 2"
  190. v-model="partsItem.company"
  191. style="width: 150px"
  192. placeholder="请输入单位"
  193. />
  194. </FormItem>
  195. <!-- <FormItem label="工艺组合名称:">
  196. <Select
  197. v-model="partsItem.processCombination"
  198. size="small"
  199. clearable
  200. filterable
  201. allow-create
  202. label-in-value
  203. :disabled="type == 2"
  204. @on-create="(e) => handleProcessRouteCreate(partsItem, e)"
  205. @on-change="(e) => handleProcessRouteSelect(partsItem, e)"
  206. style="width: 150px"
  207. >
  208. <Option
  209. v-for="sitem in partsItem.partsProcessRouteList"
  210. :key="sitem.id"
  211. :label="sitem.title"
  212. :value="sitem.id"
  213. >
  214. </Option>
  215. </Select>
  216. </FormItem> -->
  217. <!-- <FormItem label="工艺价格:">
  218. <Input
  219. type="text"
  220. size="small"
  221. :disabled="!partsItem.isAddProcessRoute || type == 2"
  222. v-model="partsItem.process_price"
  223. style="width: 150px"
  224. placeholder="请输入工艺价格"
  225. />
  226. </FormItem> -->
  227. <FormItem label="高:">
  228. <Input
  229. type="text"
  230. size="small"
  231. @on-focus="openKey(partsIndex, -1, 'long', partsItem)"
  232. :disabled="type == 2"
  233. v-model="partsItem.long"
  234. style="width: 150px"
  235. placeholder="请输入高"
  236. />
  237. </FormItem>
  238. <FormItem label="宽:">
  239. <Input
  240. type="text"
  241. size="small"
  242. @on-focus="openKey(partsIndex, -1, 'wide', partsItem)"
  243. :disabled="type == 2"
  244. v-model="partsItem.wide"
  245. style="width: 150px"
  246. placeholder="请输入宽"
  247. />
  248. </FormItem>
  249. <FormItem label="厚:">
  250. <Input
  251. type="text"
  252. size="small"
  253. @on-focus="openKey(partsIndex, -1, 'thick', partsItem)"
  254. :disabled="type == 2"
  255. v-model="partsItem.thick"
  256. style="width: 150px"
  257. placeholder="请输入厚"
  258. />
  259. </FormItem>
  260. <FormItem label="产值比例(%):">
  261. <Input
  262. type="text"
  263. size="small"
  264. :disabled="type == 2"
  265. @on-blur="(e) => handleProportionEdit(e, partsItem, partsIndex)"
  266. v-model="partsItem.proportion"
  267. style="width: 150px"
  268. placeholder="请输入产值比"
  269. />
  270. </FormItem>
  271. <FormItem
  272. v-for="item of partsItem.ProcessAttrList"
  273. :key="item.id"
  274. :label="(item.name || item.title) + ':'"
  275. >
  276. <Select
  277. v-model="item.selected_value"
  278. size="small"
  279. clearable
  280. filterable
  281. :disabled="type == 2"
  282. @on-change="(e) => handleProcessSelect(partsItem, e)"
  283. style="width: 150px"
  284. >
  285. <OptionGroup
  286. v-for="OptionGroup in item.cld"
  287. :key="OptionGroup.type_title"
  288. :label="OptionGroup.type_title"
  289. >
  290. <Option
  291. v-for="Option in OptionGroup.list"
  292. :value="Option.id"
  293. :key="Option.id"
  294. >{{ Option.title }}</Option
  295. >
  296. </OptionGroup>
  297. <Option
  298. v-for="sitem in item.partsNameList"
  299. :key="sitem.id"
  300. :label="sitem.title"
  301. :value="sitem.id"
  302. >
  303. </Option>
  304. </Select>
  305. </FormItem>
  306. </Form>
  307. </div>
  308. <div class="parts_content">
  309. <!-- <span>工艺属性:</span>
  310. <div
  311. class="hierarchy"
  312. v-for="(item, index) of partsItem.ProcessAttrList"
  313. :key="item.id"
  314. >
  315. <span>{{ item.name || item.title }}(单选):</span>
  316. <div
  317. v-for="_item in item.cld"
  318. class="radio-g"
  319. :key="_item.type_title"
  320. >
  321. <div class="tit_box">
  322. <span :class="['box-us']" @click="setBoxChange(item, _item)">{{
  323. _item.type_title
  324. }}</span>
  325. </div>
  326. <div class="radio-box">
  327. <div
  328. v-for="__item in _item.list"
  329. @click="
  330. setRadioChange(_item, __item, index, partsItem, item.cld)
  331. "
  332. :class="['radio-us', __item.show ? 'radio-us-foc' : '']"
  333. :key="__item.id"
  334. >
  335. {{ __item.title }}
  336. </div>
  337. </div>
  338. </div>
  339. </div> -->
  340. <div style="display:flex;justify-content: space-between;">
  341. <div style="padding: 10px 0">
  342. <span>工艺路线:</span>
  343. <Button
  344. :disabled="!partsItem.isAddProcessRoute || type == 2"
  345. @click="editRouter(partsItem, partsIndex)"
  346. >选择工艺路线</Button
  347. >
  348. {{ partsItem.process_name }}
  349. </div>
  350. <div style="padding: 10px 0">
  351. <Button
  352. type="primary"
  353. @click="handleProcessLineShow(partsItem, partsIndex)"
  354. >{{ partsItem.isShowProcessLine ? "收起" : "展开" }}</Button
  355. >
  356. </div>
  357. </div>
  358. <div class="parts_content_lineTable">
  359. <Table
  360. :columns="partsProcessLineColumns"
  361. border
  362. :data="partsItem.partsProcessLineTableData"
  363. >
  364. <template slot="timeSlot" slot-scope="{ index }">
  365. <Input
  366. v-model="partsItem.partsProcessLineTableData[index].time"
  367. />
  368. </template>
  369. <template slot="wagesSlot" slot-scope="{ index }">
  370. <Input
  371. v-model="partsItem.partsProcessLineTableData[index].wages"
  372. />
  373. </template>
  374. <template slot="capacitySlot" slot-scope="{ index }">
  375. <Input
  376. v-model="partsItem.partsProcessLineTableData[index].capacity"
  377. />
  378. </template>
  379. </Table>
  380. </div>
  381. <div class="parts_content_part">
  382. <span>零部件添加</span>
  383. <Button
  384. @click="handlePartWoodAdd(partsIndex)"
  385. type="primary"
  386. size="small"
  387. ghost
  388. :disabled="!partsItem.isAddPart || type == 2"
  389. style="margin-right: 10px"
  390. >新增木板</Button
  391. >
  392. </div>
  393. <div class="parts_content_partTable">
  394. <Table
  395. :columns="partsPartColumns"
  396. border
  397. :data="partsItem.partsWoodTableData"
  398. >
  399. <template slot-scope="{ index }" slot="partNameSet">
  400. <Input
  401. placeholder="名称"
  402. :disabled="!partsItem.isAddPart || type == 2"
  403. v-model="partsItem.partsWoodTableData[index].spare_parts"
  404. />
  405. </template>
  406. <template slot-scope="{ row, index }" slot="partSpare_partsSet">
  407. <div>
  408. <Select
  409. filterable
  410. clearable
  411. :disabled="!partsItem.isAddPart || type == 2"
  412. label-in-value
  413. @on-change="changeSe($event, index, partsIndex, row)"
  414. v-model="partsItem.partsWoodTableData[index].material_id"
  415. >
  416. <Option
  417. :data-unit="item.unit"
  418. :tag="item.high"
  419. v-for="item of materialWoodList"
  420. :key="item.id"
  421. :value="item.id"
  422. :label="item.title"
  423. ></Option>
  424. </Select>
  425. </div>
  426. </template>
  427. <template slot-scope="{ index }" slot="partNumberSet">
  428. <Input
  429. placeholder="数量"
  430. :disabled="!partsItem.isAddPart || type == 2"
  431. v-model="partsItem.partsWoodTableData[index].number"
  432. />
  433. </template>
  434. <template slot-scope="{ index }" slot="partLongSet">
  435. <Input
  436. @on-focus="openKey(partsIndex, index, 'long', partsItem)"
  437. :disabled="!partsItem.isAddPart || type == 2"
  438. placeholder="高"
  439. v-model="partsItem.partsWoodTableData[index].long"
  440. />
  441. </template>
  442. <template slot-scope="{ index }" slot="partWideSet">
  443. <Input
  444. @on-focus="openKey(partsIndex, index, 'wide', partsItem)"
  445. :disabled="!partsItem.isAddPart || type == 2"
  446. placeholder="宽"
  447. v-model="partsItem.partsWoodTableData[index].wide"
  448. />
  449. </template>
  450. <template slot-scope="{ index }" slot="partRequirementSet">
  451. <Select
  452. placeholder="工艺要求"
  453. filterable
  454. clearable
  455. :disabled="!partsItem.isAddPart || type == 2"
  456. v-model="
  457. partsItem.partsWoodTableData[index]
  458. .technological_requirement_id
  459. "
  460. >
  461. <Option
  462. v-for="item in processRequireList"
  463. :key="item.id"
  464. :value="item.id"
  465. :label="item.title"
  466. ></Option>
  467. </Select>
  468. </template>
  469. <template slot-scope="{ index }" slot="partSub_numSet">
  470. <Select
  471. placeholder="贴面数"
  472. filterable
  473. clearable
  474. :disabled="!partsItem.isAddPart || type == 2"
  475. v-model="partsItem.partsWoodTableData[index].sub_num"
  476. >
  477. <Option :value="0" label="0"></Option>
  478. <Option :value="1" label="1"></Option>
  479. <Option :value="2" label="2"></Option>
  480. </Select>
  481. </template>
  482. <template slot-scope="{ index }" slot="partVeneer_idSet">
  483. <Select
  484. placeholder="贴木皮"
  485. filterable
  486. clearable
  487. :disabled="!partsItem.isAddPart || type == 2"
  488. v-model="partsItem.partsWoodTableData[index].veneer_id"
  489. >
  490. <Option
  491. v-for="item in materialWoodSkinList"
  492. :key="item.id"
  493. :value="item.id"
  494. :label="item.title"
  495. ></Option>
  496. </Select>
  497. </template>
  498. <template slot-scope="{ index }" slot="partPaint_idSet">
  499. <Select
  500. placeholder="油漆"
  501. filterable
  502. clearable
  503. :disabled="!partsItem.isAddPart || type == 2"
  504. v-model="partsItem.partsWoodTableData[index].paint_id"
  505. >
  506. <Option
  507. v-for="item in materialPaintList"
  508. :key="item.id"
  509. :value="item.id"
  510. :label="item.title"
  511. ></Option>
  512. </Select>
  513. </template>
  514. <template slot-scope="{ index }" slot="partLabelSet">
  515. <Select
  516. placeholder="标签"
  517. filterable
  518. clearable
  519. :disabled="!partsItem.isAddPart || type == 2"
  520. v-model="partsItem.partsWoodTableData[index].label"
  521. >
  522. <Option :value="1" label="小芯片"></Option>
  523. <Option :value="2" label="大芯片"></Option>
  524. <Option :value="3" label="否"></Option>
  525. <Option :value="4" label="标签"></Option>
  526. </Select>
  527. </template>
  528. <template slot-scope="{ index }" slot="partPrint_numSet">
  529. <Input
  530. placeholder="打印数量"
  531. :disabled="!partsItem.isAddPart || type == 2"
  532. v-model="partsItem.partsWoodTableData[index].print_num"
  533. />
  534. </template>
  535. <template slot="partSet" slot-scope="{ row, index }">
  536. <a
  537. style="margin: 0 5px"
  538. :disabled="!partsItem.isAddPart || type == 2"
  539. @click="handlePartWoodCopy(row, index, partsIndex)"
  540. >复制</a
  541. >
  542. <a
  543. :style="
  544. !partsItem.isAddPart || type == 2
  545. ? 'margin: 0 5px; color: #ccc'
  546. : 'margin: 0 5px; color: red'
  547. "
  548. :disabled="!partsItem.isAddPart || type == 2"
  549. @click="handlePartWoodDele(row, index, partsIndex)"
  550. >删除</a
  551. >
  552. </template>
  553. </Table>
  554. </div>
  555. <div class="parts_content_metals">
  556. <Button
  557. @click="handlePartMetalsAdd(partsIndex)"
  558. type="primary"
  559. size="small"
  560. :disabled="!partsItem.isAddPart || type == 2"
  561. ghost
  562. style="margin-right: 10px"
  563. >新增五金</Button
  564. >
  565. </div>
  566. <div class="parts_content_metalsTable">
  567. <Table
  568. :columns="partsMetalseColunms"
  569. border
  570. :data="partsItem.partsMetalseData"
  571. >
  572. <template slot="metalSpare_partsSet" slot-scope="{ index }">
  573. <Select
  574. filterable
  575. clearable
  576. :disabled="!partsItem.isAddPart || type == 2"
  577. @on-change="changeMetal($event, index, partsIndex)"
  578. label-in-value
  579. placeholder="请选择"
  580. v-model="partsItem.partsMetalseData[index].material_id"
  581. >
  582. <Option
  583. v-for="item in metalsList"
  584. :key="item.id"
  585. :data-unit="item.unit"
  586. :value="item.id"
  587. :label="item.title"
  588. ></Option>
  589. </Select>
  590. </template>
  591. <template slot-scope="{ index }" slot="metalNumberSet">
  592. <Input
  593. placeholder="数量"
  594. :disabled="!partsItem.isAddPart || type == 2"
  595. v-model="partsItem.partsMetalseData[index].number"
  596. />
  597. </template>
  598. <template slot-scope="{ index }" slot="metalPriceSet">
  599. <Input
  600. placeholder="单价"
  601. :disabled="!partsItem.isAddPart || type == 2"
  602. v-model="partsItem.partsMetalseData[index].price"
  603. />
  604. </template>
  605. <template slot="metalTotal_priceSet" slot-scope="{ row }">
  606. {{ row.number * row.price }}
  607. </template>
  608. <template slot="metalsSet" slot-scope="{ row, index }">
  609. <a
  610. style="margin: 0 5px"
  611. :disabled="!partsItem.isAddPart || type == 2"
  612. @click="handlePartMetalsCopy(row, index, partsIndex)"
  613. >复制</a
  614. >
  615. <a
  616. :style="
  617. !partsItem.isAddPart || type == 2
  618. ? 'margin: 0 5px; color: #ccc'
  619. : 'margin: 0 5px; color: red'
  620. "
  621. :disabled="!partsItem.isAddPart || type == 2"
  622. @click="handlePartMetalsDele(row, index, partsIndex)"
  623. >删除</a
  624. >
  625. </template>
  626. </Table>
  627. </div>
  628. </div>
  629. </div>
  630. <li v-for="item in formData.parts" v-show="false" :key="item.id"></li>
  631. <!-- 相似产品弹窗 -->
  632. <el-dialog
  633. title="选择相似产品"
  634. :visible.sync="showSimilarProductModal"
  635. :close-on-click-modal="false"
  636. :close-on-press-escape="false"
  637. class="similarProductModal"
  638. width="1000px"
  639. :before-close="handleClose"
  640. >
  641. <Form :label-width="100" :model="similarProductData">
  642. <FormItem label="产品分类">
  643. <el-cascader
  644. clearable
  645. v-model="similarProductData.type_id"
  646. size="small"
  647. style="width: 120px"
  648. :show-all-levels="false"
  649. :options="PDTTypeList"
  650. :props="{
  651. expandTrigger: 'hover',
  652. children: 'child',
  653. value: 'id',
  654. label: 'title',
  655. checkStrictly: true,
  656. emitPath: false,
  657. }"
  658. ></el-cascader>
  659. <!-- <Select
  660. v-model="similarProductData.type_name"
  661. placeholder="请选择"
  662. style="width: 120px"
  663. size="small"
  664. >
  665. <Option
  666. v-for="item in PDTTypeList"
  667. :value="item.title"
  668. :key="item.title"
  669. :label="item.title"
  670. ></Option>
  671. </Select> -->
  672. </FormItem>
  673. <FormItem label="产品名称:">
  674. <Input
  675. type="text"
  676. size="small"
  677. clearable
  678. v-model="similarProductData.title"
  679. style="width: 120px"
  680. />
  681. </FormItem>
  682. <FormItem label="产品型号">
  683. <Input
  684. type="text"
  685. size="small"
  686. clearable
  687. v-model="similarProductData.model"
  688. placeholder="请输入"
  689. style="width: 120px"
  690. />
  691. </FormItem>
  692. <FormItem label="图号:">
  693. <Input
  694. type="text"
  695. size="small"
  696. clearable
  697. v-model="similarProductData.url_number"
  698. style="width: 120px"
  699. />
  700. </FormItem>
  701. <Button
  702. type="primary"
  703. style="margin: 0 10px"
  704. @click="handleSimilarProductSearch"
  705. >搜索</Button
  706. >
  707. </Form>
  708. <Table
  709. :columns="similarProductColunms"
  710. border
  711. highlight-row
  712. :disabled-hover="true"
  713. @on-current-change="handleSimilarProductSelected"
  714. :loading="similarProductLoading"
  715. :data="similarProductData.similarProductList"
  716. >
  717. </Table>
  718. <div class="page">
  719. <Page
  720. @on-change="changeSimilarProductPage"
  721. :current="similarProductData.page_index"
  722. show-total
  723. :total="similarProductData.total"
  724. size="small"
  725. :page_size="similarProductData.page_size"
  726. />
  727. </div>
  728. <div class="modal-footer" slot="footer">
  729. <Button
  730. style="margin-right:10px"
  731. @click="showSimilarProductModal = false"
  732. >取消</Button
  733. >
  734. <Button
  735. type="primary"
  736. @click="handleSimilarProductConfirm(tempSimilarProductData.id)"
  737. >确认</Button
  738. >
  739. </div>
  740. </el-dialog>
  741. <!-- 选择工艺路线弹窗 -->
  742. <Modal
  743. class-name="vertical-center-modal"
  744. v-model="showProcessLineModal"
  745. title="选择工艺路线"
  746. >
  747. <div class="modal_process_route">
  748. <div class="modal_process_route_top">
  749. <div>
  750. <span>工艺路线名称:</span>
  751. <Input
  752. v-model="tempProcessLine.title"
  753. style="width: 120px"
  754. placeholder="请输入"
  755. />
  756. </div>
  757. <Button
  758. type="primary"
  759. @click="handleSearchProcessLine(tempProcessLine.title)"
  760. >搜索</Button
  761. >
  762. </div>
  763. <div class="modal_process_route_content">
  764. <Table
  765. border
  766. :columns="processLineColumns"
  767. :data="processLineTableData"
  768. >
  769. <template slot="processLineSet" slot-scope="{ row, index }">
  770. <a style="margin: 0 5px" @click="handleProcessLineSet(row, index)"
  771. >选择</a
  772. >
  773. </template>
  774. </Table>
  775. </div>
  776. </div>
  777. </Modal>
  778. <Modal
  779. class-name="vertical-center-modal vertical-center-modal1"
  780. v-model="showProcessLineDetailModal"
  781. width="80%"
  782. :mask-closable="false"
  783. title="工艺路线"
  784. >
  785. <div class="modal_process_route modal_process_route1">
  786. <div>
  787. <span style="width: 100px">id: </span
  788. ><Input
  789. v-model="info.id"
  790. disabled
  791. placeholder="自动生成"
  792. style="width: 150px"
  793. size="small"
  794. />
  795. </div>
  796. <div>
  797. <span style="width: 100px">工艺路线名称: </span
  798. ><Input
  799. v-model="info.title"
  800. placeholder="请输入工艺路线名称"
  801. size="small"
  802. style="width: 250px"
  803. />
  804. </div>
  805. </div>
  806. <div class="modal_content">
  807. <div class="modal_content_left">
  808. <span>已选:</span>
  809. <SlickList
  810. :distance="10"
  811. :lockToContainerEdges="true"
  812. axis="x,y,xy"
  813. lockAxis="xy"
  814. v-model="selectTags"
  815. class="SortableList"
  816. @input="getChangeLists"
  817. >
  818. <SlickItem
  819. style="z-index: 9999"
  820. v-for="(item, key) of selectTags"
  821. :key="key"
  822. class="SortableItem"
  823. :index="key"
  824. >
  825. <Tooltip>
  826. <div slot="content">
  827. <p>工时:{{ item.time }}</p>
  828. <p>工价:{{ item.wages }}</p>
  829. <p>产能:{{ item.capacity }}</p>
  830. </div>
  831. <div class="tag-modal">
  832. <div class="before">{{ key + 1 }}</div>
  833. <Tag
  834. @on-close="closeTag(key, selectTags, item)"
  835. color="primary"
  836. type="border"
  837. closable
  838. >{{ item.title }}</Tag
  839. >
  840. </div>
  841. </Tooltip>
  842. </SlickItem>
  843. </SlickList>
  844. </div>
  845. <div class="modal_content_right">
  846. <div v-for="(item, index) of info.bps" :key="index">
  847. <div v-if="item.cld && item.cld.length > 0">
  848. <span style="font-weight:bold">{{ item.title }}</span>
  849. <div
  850. style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
  851. >
  852. <div
  853. v-for="(_item, _index) in item.cld"
  854. :key="_index"
  855. :style="
  856. _item.p_id
  857. ? [{ 'margin-left': '10px' }]
  858. : [{ 'margin-left': '10px' }, { width: '100%' }]
  859. "
  860. >
  861. <div v-if="_item.cld && _item.cld.length > 0">
  862. <div>
  863. <div style="font-weight:bold;width:100%">
  864. {{ _item.title }}:
  865. </div>
  866. <div
  867. style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
  868. >
  869. <div
  870. v-for="(__item, __index) in _item.cld"
  871. :key="__index"
  872. :style="
  873. __item.p_id
  874. ? [{ 'margin-left': '10px' }]
  875. : [{ 'margin-left': '10px' }, { width: '100%' }]
  876. "
  877. >
  878. <div v-if="__item.cld && __item.cld.length > 0">
  879. <span style="font-weight:bold"
  880. >{{ __item.title }}:</span
  881. >
  882. <div
  883. style="display: flex;justify-content: flex-start;flex-wrap: wrap;"
  884. >
  885. <Tooltip
  886. v-for="(___item, ___index) of __item.cld"
  887. :key="___index"
  888. >
  889. <div slot="content">
  890. <p>工时:{{ ___item.time }}</p>
  891. <p>工价:{{ ___item.wages }}</p>
  892. <p>产能:{{ ___item.capacity }}</p>
  893. </div>
  894. <Checkbox
  895. @on-change="
  896. changeCheck($event, ___item, selectTags)
  897. "
  898. v-model="___item.show"
  899. style="padding: 0px 5px"
  900. >{{ ___item.title }}</Checkbox
  901. >
  902. </Tooltip>
  903. </div>
  904. </div>
  905. <div v-else>
  906. <Tooltip v-if="__item.p_id">
  907. <div slot="content">
  908. <p>工时:{{ __item.time }}</p>
  909. <p>工价:{{ __item.wages }}</p>
  910. <p>产能:{{ __item.capacity }}</p>
  911. </div>
  912. <Checkbox
  913. @on-change="
  914. changeCheck($event, __item, selectTags)
  915. "
  916. v-model="__item.show"
  917. style="padding: 0px 5px"
  918. >{{ __item.title }}</Checkbox
  919. >
  920. </Tooltip>
  921. </div>
  922. </div>
  923. </div>
  924. </div>
  925. </div>
  926. <div v-else>
  927. <Tooltip v-if="_item.p_id">
  928. <div slot="content">
  929. <p>工时:{{ _item.time }}</p>
  930. <p>工价:{{ _item.wages }}</p>
  931. <p>产能:{{ _item.capacity }}</p>
  932. </div>
  933. <Checkbox
  934. @on-change="changeCheck($event, _item, selectTags)"
  935. v-model="_item.show"
  936. style="padding: 0px 5px"
  937. >{{ _item.title }}</Checkbox
  938. >
  939. </Tooltip>
  940. <!-- <span v-else>{{ _item.title }}</span> -->
  941. </div>
  942. </div>
  943. </div>
  944. </div>
  945. <!-- <div v-else>{{ item.title }}</div> -->
  946. </div>
  947. </div>
  948. </div>
  949. <div slot="footer">
  950. <Button
  951. @click="
  952. showProcessLineDetailModal = false;
  953. showProcessLineModal = true;
  954. "
  955. type="primary"
  956. ghost
  957. >取消</Button
  958. >
  959. <Button @click="saveTableData()" type="primary">确定</Button>
  960. </div>
  961. </Modal>
  962. <!-- 输入框弹窗 -->
  963. <Modal
  964. v-model="showKey"
  965. :width="1250"
  966. :mask-closable="false"
  967. :closable="false"
  968. >
  969. <div>
  970. <KeyBoard
  971. :rightData="measureList"
  972. @cancel="cancelKey"
  973. @success="successKey"
  974. class="key-co"
  975. />
  976. </div>
  977. <div slot="footer"></div>
  978. </Modal>
  979. </div>
  980. </template>
  981. <script>
  982. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  983. // 例如:import 《组件名称》 from '《组件路径》';
  984. import { SlickList, SlickItem } from "vue-slicksort";
  985. import KeyBoard from "../../../components/keyboard/index";
  986. import Downtree from "../../../components/drowDown/index";
  987. export default {
  988. name: "BidSystemProductDeOrderDeorderdetail",
  989. components: {
  990. SlickList,
  991. SlickItem,
  992. KeyBoard,
  993. Downtree,
  994. },
  995. props: {},
  996. // import引入的组件需要注入到对象中才能使用
  997. data() {
  998. // 这里存放数据
  999. return {
  1000. // 1拆单 2详情
  1001. type: this.$route.query.type,
  1002. formData: {
  1003. title: "", //产品名称
  1004. num: "", //数量
  1005. // price: "", //价格
  1006. measure: "", //规格
  1007. process_property: "", //工艺属性
  1008. url: [], //图纸
  1009. url_number: "", //图号
  1010. remark: "", //备注
  1011. parts: [
  1012. //产品列表
  1013. {
  1014. isAddPart: true, //是否为新增部件
  1015. isAddProcessRoute: true, //是否为新增工艺组合
  1016. long: "",
  1017. width: "",
  1018. thick: "",
  1019. parts_type: "", //部件分类名称
  1020. pay_state: "", //标签
  1021. part_id: "", //部件名称
  1022. company: "", //单位
  1023. processCombination: "", //工艺组合名称
  1024. process_price: "", //工艺价格
  1025. proportion: "", //产值比例
  1026. properties: [], //工艺属性
  1027. ProcessAttrList: [
  1028. {
  1029. id: "",
  1030. cld: [{ id: "", title: "" }],
  1031. },
  1032. ], //工艺属性列表
  1033. partsProcessLineTableData: [
  1034. // {
  1035. // id: '',
  1036. // type: '',
  1037. // title: '',
  1038. // time: '',
  1039. // wages: '',
  1040. // capacity: '',
  1041. // }
  1042. ], //工艺路线表格
  1043. partsWoodTableData: [
  1044. {
  1045. title: "",
  1046. spare_parts: "",
  1047. number: "",
  1048. company: "",
  1049. long: "",
  1050. wide: "",
  1051. thick: "",
  1052. technological_requirement_id: "",
  1053. sub_num: "",
  1054. veneer_id: "",
  1055. paint_id: "",
  1056. label: "",
  1057. print_num: "",
  1058. },
  1059. ], //木板表格
  1060. partsMetalseData: [
  1061. {
  1062. spare_parts: "",
  1063. number: "",
  1064. company: "",
  1065. price: "",
  1066. total_price: "",
  1067. },
  1068. ], //五金表格
  1069. partsNameList: [{ id: "", title: "" }], //部件名称列表
  1070. partsProcessRouteList: [{ id: "", title: "" }], //工艺组合名称列表
  1071. checkBox: [],
  1072. },
  1073. ],
  1074. },
  1075. tempProcessLine: {
  1076. title: "",
  1077. },
  1078. processLineTableData: [],
  1079. processRouteId: "",
  1080. processRouteName: "",
  1081. partsProcessLineColumns: [
  1082. { title: "序号", type: "index", minWidth: 30, align: "center" },
  1083. { title: "工序名称", key: "title", align: "center" },
  1084. { title: "工时", key: "time", align: "center", slot: "timeSlot" },
  1085. { title: "工价", key: "wages", align: "center", slot: "wagesSlot" },
  1086. {
  1087. title: "产能",
  1088. key: "capacity",
  1089. align: "center",
  1090. slot: "capacitySlot",
  1091. },
  1092. ], //工艺路线表头
  1093. partsPartColumns: [
  1094. {
  1095. title: "名称",
  1096. key: "spare_parts",
  1097. align: "center",
  1098. minWidth: 120,
  1099. slot: "partNameSet",
  1100. },
  1101. {
  1102. title: "木板",
  1103. key: "title",
  1104. align: "center",
  1105. minWidth: 120,
  1106. slot: "partSpare_partsSet",
  1107. },
  1108. {
  1109. title: "数量",
  1110. key: "number",
  1111. align: "center",
  1112. minWidth: 100,
  1113. slot: "partNumberSet",
  1114. },
  1115. { title: "单位", key: "company", align: "center", minWidth: 80 },
  1116. {
  1117. title: "高",
  1118. key: "long",
  1119. align: "center",
  1120. minWidth: 120,
  1121. slot: "partLongSet",
  1122. },
  1123. {
  1124. title: "宽",
  1125. key: "wide",
  1126. align: "center",
  1127. minWidth: 120,
  1128. slot: "partWideSet",
  1129. },
  1130. { title: "厚", key: "thick", align: "center", minWidth: 120 },
  1131. {
  1132. title: "工艺要求",
  1133. key: "technological_requirement_id",
  1134. align: "center",
  1135. minWidth: 140,
  1136. slot: "partRequirementSet",
  1137. },
  1138. {
  1139. title: "贴面数",
  1140. key: "sub_num",
  1141. align: "center",
  1142. minWidth: 120,
  1143. slot: "partSub_numSet",
  1144. },
  1145. {
  1146. title: "贴木皮名称",
  1147. key: "veneer_id",
  1148. align: "center",
  1149. minWidth: 140,
  1150. slot: "partVeneer_idSet",
  1151. },
  1152. {
  1153. title: "油漆组合",
  1154. key: "paint_id",
  1155. align: "center",
  1156. minWidth: 140,
  1157. slot: "partPaint_idSet",
  1158. },
  1159. {
  1160. title: "标签",
  1161. key: "label",
  1162. align: "center",
  1163. minWidth: 120,
  1164. slot: "partLabelSet",
  1165. },
  1166. {
  1167. title: "打印数量",
  1168. key: "print_num",
  1169. align: "center",
  1170. minWidth: 100,
  1171. slot: "partPrint_numSet",
  1172. },
  1173. {
  1174. title: "操作",
  1175. key: "name",
  1176. align: "center",
  1177. slot: "partSet",
  1178. fixed: "right",
  1179. minWidth: 140,
  1180. },
  1181. ], //零部件表头
  1182. processLineColumns: [
  1183. { title: "ID", align: "center", key: "id" },
  1184. { title: "工艺路线名称", align: "center", key: "title" },
  1185. { title: "操作", align: "center", key: "id", slot: "processLineSet" },
  1186. ],
  1187. partsMetalseColunms: [
  1188. {
  1189. title: "五金",
  1190. key: "material_id",
  1191. align: "center",
  1192. minWidth: 80,
  1193. slot: "metalSpare_partsSet",
  1194. },
  1195. {
  1196. title: "数量",
  1197. key: "number",
  1198. align: "center",
  1199. minWidth: 80,
  1200. slot: "metalNumberSet",
  1201. },
  1202. { title: "单位", key: "company", align: "center", minWidth: 80 },
  1203. {
  1204. title: "单价",
  1205. key: "price",
  1206. align: "center",
  1207. minWidth: 80,
  1208. slot: "metalPriceSet",
  1209. },
  1210. {
  1211. title: "总价",
  1212. key: "total_price",
  1213. align: "center",
  1214. minWidth: 80,
  1215. slot: "metalTotal_priceSet",
  1216. },
  1217. {
  1218. title: "操作",
  1219. key: "name",
  1220. align: "center",
  1221. minWidth: 80,
  1222. slot: "metalsSet",
  1223. },
  1224. ], //五金表头
  1225. showSimilarProductModal: false,
  1226. similarProductLoading: false,
  1227. PDTTypeList: [{ id: "", title: "" }], //产品分类列表
  1228. ProcessAttrList: [], //工艺属性列表
  1229. partsList: [{ id: "", title: "" }], //部件分类名称列表
  1230. similarProductData: {
  1231. type_id: "",
  1232. title: "",
  1233. model: "",
  1234. url_number: "",
  1235. similarProductList: [
  1236. {
  1237. type: "",
  1238. title: "",
  1239. model: "",
  1240. url_number: "",
  1241. },
  1242. ],
  1243. page_index: 1,
  1244. page_size: 10,
  1245. total: 0,
  1246. },
  1247. similarProductColunms: [
  1248. {
  1249. title: "选择",
  1250. key: "",
  1251. align: "center",
  1252. minWidth: 60,
  1253. render: (h, params) => {
  1254. let id = params.row.id;
  1255. let flag = false;
  1256. if (this.tempSimilarProductData.id == id) {
  1257. flag = true;
  1258. } else {
  1259. flag = false;
  1260. }
  1261. let self = this;
  1262. return h("div", [
  1263. h("Radio", {
  1264. props: {
  1265. value: flag,
  1266. },
  1267. on: {
  1268. "on-change": () => {
  1269. self.tempSimilarProductData = params.row;
  1270. },
  1271. },
  1272. }),
  1273. ]);
  1274. },
  1275. },
  1276. { title: "产品分类", key: "type_name", align: "center", minWidth: 80 },
  1277. { title: "产品名称", key: "title", align: "center", minWidth: 80 },
  1278. { title: "产品型号", key: "model", align: "center", minWidth: 80 },
  1279. { title: "图号", key: "url_number", align: "center", minWidth: 80 },
  1280. ],
  1281. processLineData: {
  1282. title: "",
  1283. processLineList: [
  1284. {
  1285. id: "",
  1286. title: "",
  1287. },
  1288. ],
  1289. page_index: 1,
  1290. page_size: 10,
  1291. total: 0,
  1292. },
  1293. processLineColunms: [
  1294. { title: "ID", key: "name", align: "center", minWidth: 80 },
  1295. { title: "工艺路线名称", key: "name", align: "center", minWidth: 80 },
  1296. {
  1297. title: "操作",
  1298. key: "name",
  1299. align: "center",
  1300. minWidth: 80,
  1301. slot: "processLineSet",
  1302. },
  1303. ],
  1304. showProcessLineModal: false,
  1305. showProcessLineDetailModal: false,
  1306. showKey: false,
  1307. processLineLoading: false,
  1308. tempSimilarProductData: {},
  1309. tempProcessLineData: {},
  1310. order_no: this.$route.query.order_no,
  1311. orders_area_product_detail_id: this.$route.query
  1312. .orders_area_product_detail_id,
  1313. selectTags: [], //已选列表
  1314. info: {
  1315. title: "",
  1316. price: "",
  1317. parts_id: "",
  1318. id: null,
  1319. properties: [], //工序号
  1320. procedure: [], //工艺属性id
  1321. ProcessAttrList: [],
  1322. bps: [],
  1323. },
  1324. tempSelectedPartIndex: 0,
  1325. // 工艺属性暂存
  1326. tempProcessAttrList: [],
  1327. // 输入框弹窗
  1328. measureList: [
  1329. // { e_title: 'H', title: '高', id: 1, sort: 0 },
  1330. // { e_title: 'W', title: '宽', id: 1, sort: 0 },
  1331. // { e_title: 'D', title: '深', id: 1, sort: 0 },
  1332. ],
  1333. attrIndex: "",
  1334. attrName: "",
  1335. materialWoodList: [], // 木板列表
  1336. processRequireList: [], // 工艺要求列表
  1337. materialWoodSkinList: [], // 木皮列表
  1338. materialPaintList: [], // 油漆列表
  1339. metalsList: [], // 五金列表
  1340. productTypes: [],
  1341. nowSelectObj: {},
  1342. temp_info_bps: [],
  1343. process_name: "",
  1344. // 判断工艺路线是否新增
  1345. isNewProcess: false,
  1346. };
  1347. },
  1348. // 生命周期 - 创建完成(可以访问当前this实例)
  1349. created() {
  1350. // 获取产品分类
  1351. this.axios("/api/parts_product_list").then((res) => {
  1352. this.productTypes = res.data;
  1353. });
  1354. this.axios("/api/bp_list").then((res) => {
  1355. this.info.bps = res.data;
  1356. for (const key in this.info.bps) {
  1357. const element = this.info.bps[key];
  1358. element.cld &&
  1359. element.cld.length > 0 &&
  1360. element.cld.forEach((z) => {
  1361. z.show = false;
  1362. z.cld &&
  1363. z.cld.length > 0 &&
  1364. z.cld.forEach((elem) => {
  1365. elem.show = false;
  1366. elem.cld &&
  1367. elem.cld.length > 0 &&
  1368. elem.cld.forEach((el) => {
  1369. el.show = false;
  1370. });
  1371. });
  1372. });
  1373. }
  1374. this.temp_info_bps = JSON.parse(JSON.stringify(this.info.bps));
  1375. });
  1376. this.axios("/api/bpp_list_new").then((res) => {
  1377. // res.data.map((v) => {
  1378. // if (v.select) {
  1379. // v.cld.map((z) => {
  1380. // v.select.map((k) => {
  1381. // z.show = k == z.id ? true : false;
  1382. // });
  1383. // });
  1384. // } else {
  1385. // v.cld.map((v) => (v.show = false));
  1386. // }
  1387. // });
  1388. this.tempProcessAttrList = JSON.parse(JSON.stringify(res.data));
  1389. this.formData.parts.forEach((element) => {
  1390. element.ProcessAttrList = res.data;
  1391. });
  1392. });
  1393. },
  1394. // 生命周期 - 挂载完成(可以访问DOM元素)
  1395. mounted() {
  1396. // 获取产品分类列表
  1397. this.axios("/api/parts_product_list").then((res) => {
  1398. this.PDTTypeList = res.data;
  1399. });
  1400. // 获取工艺要求列表
  1401. this.axios("/api/technological_requirement").then((res) => {
  1402. this.processRequireList = res.data.data;
  1403. });
  1404. // 获取贴木皮列表
  1405. this.axios("/api/material", { params: { sub_type_id: 2 } }).then((res) => {
  1406. this.materialWoodSkinList = res.data.data;
  1407. });
  1408. // 获取油漆列表
  1409. this.axios("/api/material_combination").then((res) => {
  1410. this.materialPaintList = res.data.data;
  1411. });
  1412. // 获取五金列表
  1413. this.axios("/api/material", { params: { sub_type_id: 5 } }).then((res) => {
  1414. this.metalsList = res.data.data;
  1415. });
  1416. // 获取部件分类列表
  1417. this.axios("/api/basics_parts_index").then((res) => {
  1418. this.partsList = res.data.data;
  1419. });
  1420. // 获取木板列表
  1421. this.axios("/api/material", { params: { sub_type_id: 1 } }).then((res) => {
  1422. this.materialWoodList = res.data.data;
  1423. });
  1424. this.initData(this.order_no, this.orders_area_product_detail_id);
  1425. },
  1426. methods: {
  1427. initData(order_no, orders_area_product_detail_id) {
  1428. this.axios({
  1429. method: "get",
  1430. url: "/api/order_area_explode_detail",
  1431. params: {
  1432. order_no,
  1433. orders_area_product_detail_id,
  1434. },
  1435. }).then((res) => {
  1436. this.formData = res.data;
  1437. // this.formData.basic_product_id = 8;
  1438. // 获取产品分类、测量字段
  1439. this.handleMatchBP(this.productTypes, this.formData.basic_product_id);
  1440. this.handleClick(JSON.stringify(this.nowSelectObj));
  1441. if (this.formData.parts.length == 0) {
  1442. this.formData.parts = [
  1443. {
  1444. isAddPart: true, //是否为新增部件
  1445. isAddProcessRoute: true, //是否为新增工艺组合
  1446. long: "",
  1447. width: "",
  1448. thick: "",
  1449. parts_type: "", //部件分类名称
  1450. pay_state: "", //标签
  1451. part_id: "", //部件名称
  1452. company: "", //单位
  1453. processCombination: "", //工艺组合名称
  1454. process_price: "", //工艺价格
  1455. proportion: "", //产值比例
  1456. properties: [], //工艺属性
  1457. isShowProcessLine: true, //是否展示工艺路线
  1458. ProcessAttrList: JSON.parse(
  1459. JSON.stringify(this.tempProcessAttrList)
  1460. ), //工艺属性列表
  1461. partsProcessLineTableData: [], //工艺路线表格
  1462. partsWoodTableData: [
  1463. {
  1464. title: "",
  1465. spare_parts: "",
  1466. number: "",
  1467. company: "",
  1468. long: "",
  1469. wide: "",
  1470. thick: "",
  1471. technological_requirement_id: "",
  1472. sub_num: "",
  1473. veneer_id: "",
  1474. paint_id: "",
  1475. label: "",
  1476. print_num: "",
  1477. },
  1478. ], //木板表格
  1479. partsMetalseData: [
  1480. {
  1481. spare_parts: "",
  1482. number: "",
  1483. company: "",
  1484. price: "",
  1485. total_price: "",
  1486. },
  1487. ], //五金表格
  1488. partsNameList: [{ id: "", title: "" }], //部件名称列表
  1489. partsProcessRouteList: [{ id: "", title: "" }], //工艺组合名称列表
  1490. checkBox: [],
  1491. },
  1492. ];
  1493. } else {
  1494. this.handleSimilarProductConfirm(res.data.product_id, this.formData);
  1495. }
  1496. });
  1497. },
  1498. handleMatchBP(array, id) {
  1499. array.forEach((element, index) => {
  1500. if (element.id != id) {
  1501. if (element.child && element.child.length > 0) {
  1502. return this.handleMatchBP(element.child, id);
  1503. }
  1504. } else {
  1505. this.nowSelectObj = element;
  1506. }
  1507. });
  1508. },
  1509. getChangeLists(e) {},
  1510. saveTableData(row, index) {
  1511. if (this.isNewProcess) {
  1512. let temparr = [];
  1513. this.selectTags.forEach((el) => {
  1514. temparr.push(el.id);
  1515. });
  1516. this.axios({
  1517. method: "post",
  1518. url: "/api/technological_route_edit",
  1519. data: {
  1520. id: "",
  1521. title: this.info.title,
  1522. procedure_id: temparr.join(","),
  1523. },
  1524. }).then((res) => {
  1525. if (res.code == 200) {
  1526. this.formData.parts[
  1527. this.tempSelectedPartIndex
  1528. ].partsProcessLineTableData = [];
  1529. this.formData.parts[
  1530. this.tempSelectedPartIndex
  1531. ].partsProcessLineTableData = this.formData.parts[
  1532. this.tempSelectedPartIndex
  1533. ].partsProcessLineTableData.concat(this.selectTags);
  1534. this.showProcessLineDetailModal = false;
  1535. this.formData.parts[
  1536. this.tempSelectedPartIndex
  1537. ].process_name = this.info.title;
  1538. }
  1539. });
  1540. } else {
  1541. this.formData.parts[
  1542. this.tempSelectedPartIndex
  1543. ].partsProcessLineTableData = [];
  1544. this.formData.parts[
  1545. this.tempSelectedPartIndex
  1546. ].partsProcessLineTableData = this.formData.parts[
  1547. this.tempSelectedPartIndex
  1548. ].partsProcessLineTableData.concat(this.selectTags);
  1549. this.showProcessLineDetailModal = false;
  1550. this.formData.parts[
  1551. this.tempSelectedPartIndex
  1552. ].process_name = this.info.title;
  1553. }
  1554. },
  1555. // 删除工艺路线列表项
  1556. handleProcessLineDele(row, i, index) {
  1557. let formData = JSON.parse(JSON.stringify(this.formData));
  1558. formData.parts[index].partsProcessLineTableData.splice(i, 1);
  1559. this.formData = formData;
  1560. },
  1561. //选择相似产品
  1562. handleSimilarProductShow() {
  1563. this.showSimilarProductModal = true;
  1564. this.similarProductLoading = true;
  1565. this.similarProductData.type_id = "";
  1566. this.similarProductData.title = "";
  1567. this.similarProductData.model = "";
  1568. this.similarProductData.url_number = "";
  1569. this.axios("/api/product", {
  1570. params: {
  1571. type_id: this.similarProductData.type_id,
  1572. title: this.similarProductData.title,
  1573. model: this.similarProductData.model,
  1574. url_number: this.similarProductData.url_number,
  1575. page_size: this.similarProductData.page_size,
  1576. page_index: this.similarProductData.page_index,
  1577. },
  1578. }).then((res) => {
  1579. this.similarProductLoading = false;
  1580. this.similarProductData.similarProductList = res.data.data;
  1581. this.similarProductData.total = res.data.total;
  1582. });
  1583. },
  1584. changeSimilarProductPage(e) {
  1585. this.similarProductLoading = true;
  1586. this.axios("/api/product", {
  1587. params: {
  1588. type_name: this.similarProductData.type_name,
  1589. title: this.similarProductData.title,
  1590. model: this.similarProductData.model,
  1591. url_number: this.similarProductData.url_number,
  1592. page_size: this.similarProductData.page_size,
  1593. page_index: e,
  1594. },
  1595. }).then((res) => {
  1596. this.similarProductLoading = false;
  1597. this.similarProductData.similarProductList = res.data.data;
  1598. this.similarProductData.similarProductList.forEach((el) => {
  1599. el.selected = false;
  1600. });
  1601. this.similarProductData.total = res.data.total;
  1602. });
  1603. },
  1604. handleSimilarProductSearch() {
  1605. this.similarProductLoading = true;
  1606. this.axios("/api/product", {
  1607. params: {
  1608. type_id: this.similarProductData.type_id,
  1609. title: this.similarProductData.title,
  1610. model: this.similarProductData.model,
  1611. url_number: this.similarProductData.url_number,
  1612. page_size: this.similarProductData.page_size,
  1613. page_index: this.similarProductData.page_index,
  1614. },
  1615. }).then((res) => {
  1616. this.similarProductLoading = false;
  1617. this.similarProductData.similarProductList = res.data.data;
  1618. this.similarProductData.similarProductList.forEach((el) => {
  1619. el.selected = false;
  1620. });
  1621. this.similarProductData.total = res.data.total;
  1622. });
  1623. },
  1624. // 产值比校验
  1625. handleProportionEdit(e, row, index) {
  1626. // e.target.value
  1627. },
  1628. handleSimilarProductSelected(row, oldrow) {
  1629. this.tempSimilarProductData = row;
  1630. },
  1631. handleSimilarProductConfirm(id, isEditItem) {
  1632. if (id) {
  1633. this.axios({
  1634. method: "get",
  1635. url: "/api/product",
  1636. params: {
  1637. id,
  1638. },
  1639. }).then((res) => {
  1640. if (res.code == 200) {
  1641. res.data.part.forEach((element) => {
  1642. this.formData.parts.forEach((ele) => {
  1643. if (element.part_id == ele.part_id) {
  1644. element.process_ids = ele.process_ids;
  1645. element.route_id = ele.route_id;
  1646. element.produce_list = ele.produce_list;
  1647. element.process_list = ele.process_list;
  1648. }
  1649. });
  1650. });
  1651. this.formData.parts = res.data.part;
  1652. //label
  1653. // this.formData.title = res.data.title;
  1654. // this.formData.unit = res.data.unit;
  1655. // this.formData.remark = res.data.remark;
  1656. // this.formData.url = res.data.url;
  1657. // this.formData.url_number = res.data.url_number;
  1658. // this.formData.measure = res.data.measure_id
  1659. // if (isEditItem) {
  1660. // res.data.part.forEach((element, index) => {
  1661. // Object.assign(element, this.formData.parts[index]);
  1662. // });
  1663. // }
  1664. this.formData.parts.map((element) => {
  1665. element.partsProcessLineTableData = [];
  1666. element.proportion = element.ratio;
  1667. element.wide = element.formula_w;
  1668. element.thick = element.formula_h;
  1669. element.long = element.formula_l;
  1670. element.isShowProcessLine = true;
  1671. element.ProcessAttrList = JSON.parse(
  1672. JSON.stringify(this.tempProcessAttrList)
  1673. ); //工艺属性列表
  1674. this.axios("/api/parts_detail", {
  1675. params: { id: element.part_id },
  1676. }).then((re) => {
  1677. // element.company = re.data.company
  1678. element.isAddPart = true;
  1679. element.isAddProcessRoute = true;
  1680. element.parts_type = re.data.p_id;
  1681. // element.part_id = re.data.title
  1682. this.axios({
  1683. method: "get",
  1684. url: "/api/parts_index",
  1685. params: {
  1686. bp_id: element.parts_type,
  1687. },
  1688. }).then((r) => {
  1689. element.partsNameList = r.data.data;
  1690. if (isEditItem) {
  1691. let item = isEditItem;
  1692. // let item = JSON.parse(JSON.stringify(isEditItem));
  1693. item.parts.forEach((element) => {
  1694. element.processCombination = element.route_id;
  1695. let obj = { value: element.route_id, label: "" };
  1696. this.handleProcessRouteSelect(element, obj);
  1697. });
  1698. isEditItem = item;
  1699. }
  1700. this.$forceUpdate();
  1701. });
  1702. element.company = re.data.company;
  1703. // element.partsNameList = [{ id: re.data.id, title: re.data.title }]
  1704. element.pay_state = re.data.label;
  1705. // element.partsWoodTableData = re.data.detail;
  1706. this.showSimilarProductModal = false;
  1707. });
  1708. let obj = { value: element.part_id };
  1709. this.handlePartsNameSelect(element, obj);
  1710. });
  1711. }
  1712. });
  1713. } else {
  1714. this.showSimilarProductModal = false;
  1715. }
  1716. },
  1717. //选择部件分类名称
  1718. handlePartsSelect(e, item) {
  1719. this.axios({
  1720. method: "get",
  1721. url: "/api/parts_index",
  1722. params: {
  1723. bp_id: e,
  1724. },
  1725. })
  1726. .then((res) => {
  1727. this.$nextTick(() => {
  1728. item.part_id = "";
  1729. item.partsNameList = res.data.data;
  1730. this.$forceUpdate();
  1731. });
  1732. })
  1733. .catch((err) => {});
  1734. },
  1735. //新增部件名称
  1736. handlePartTitleCreate(item, val) {
  1737. item.partsNameList.push({
  1738. id: val,
  1739. title: val,
  1740. });
  1741. this.$forceUpdate();
  1742. },
  1743. //新增工艺组合名称
  1744. handleProcessRouteCreate(item, val) {
  1745. //////
  1746. item.isAddProcessRoute = true;
  1747. item.ProcessAttrList = JSON.parse(
  1748. JSON.stringify(this.tempProcessAttrList)
  1749. );
  1750. // 新增工艺组合,展示所有工艺
  1751. item.ProcessAttrList.map((item) => {
  1752. item.cld &&
  1753. item.cld.length > 0 &&
  1754. item.cld.map((level1) => {
  1755. level1.list &&
  1756. level1.list.length > 0 &&
  1757. level1.list.map((level2) => {
  1758. level2.display = true;
  1759. });
  1760. });
  1761. });
  1762. if (!item.partsProcessRouteList) {
  1763. item.partsProcessRouteList = [];
  1764. }
  1765. item.partsProcessRouteList.push({
  1766. id: val,
  1767. title: val,
  1768. });
  1769. this.$forceUpdate();
  1770. },
  1771. // 部件名称
  1772. handlePartsNameSelect(item, val) {
  1773. if (val) {
  1774. if (val.label != val.value) {
  1775. item.isAddPart = false;
  1776. this.axios({
  1777. method: "get",
  1778. url: "/api/parts_detail",
  1779. params: {
  1780. id: val.value,
  1781. },
  1782. }).then((res) => {
  1783. item.pay_state = res.data.label;
  1784. item.company = res.data.company;
  1785. item.ProcessAttrList = this.tempProcessAttrList;
  1786. item.partsWoodTableData ? "" : (item.partsWoodTableData = []);
  1787. item.partsMetalseData ? "" : (item.partsMetalseData = []);
  1788. item.partsWoodTableData = res.data.detail.filter(
  1789. (v) => v.type_id == 1 || v.type_id == 2
  1790. );
  1791. item.partsMetalseData = res.data.detail.filter(
  1792. (v) => v.type_id == 5
  1793. );
  1794. this.axios({
  1795. method: "get",
  1796. url: "/api/process_route_index",
  1797. params: {
  1798. part_id: val.value,
  1799. },
  1800. })
  1801. .then((re) => {
  1802. this.$nextTick(() => {
  1803. item.partsProcessRouteList = re.data.detail;
  1804. this.$forceUpdate();
  1805. });
  1806. })
  1807. .catch((err) => {});
  1808. });
  1809. } else {
  1810. item.isAddPart = true;
  1811. // item.ProcessAttrList = this.tempProcessAttrList;
  1812. // item.partsWoodTableData = [];
  1813. // item.partsMetalseData = [];
  1814. // item.process_name = "";
  1815. }
  1816. }
  1817. },
  1818. // 选择工艺组合名称
  1819. handleProcessRouteSelect(item, val) {
  1820. if (val) {
  1821. // item.ProcessAttrList.map((level0) => {
  1822. // level0.cld &&
  1823. // level0.cld.length > 0 &&
  1824. // level0.cld.map((level1) => {
  1825. // level1.list &&
  1826. // level1.list.length > 0 &&
  1827. // level1.list.map((level2) => {
  1828. // level2.display = true;
  1829. // });
  1830. // });
  1831. // });
  1832. // if (val.label != val.value) {
  1833. item.isAddProcessRoute = false;
  1834. this.axios({
  1835. method: "get",
  1836. url: "/api/process_route_detail",
  1837. params: {
  1838. id: val.value,
  1839. },
  1840. }).then((res) => {
  1841. this.info = res.data;
  1842. this.info.bps = this.temp_info_bps;
  1843. item.process_price = res.data.price;
  1844. this.selectTags = res.data.produce_list;
  1845. const selectTagsId = this.selectTags.map((item) => item.id);
  1846. item.ProcessAttrList = res.data.list;
  1847. console.log("item.ProcessAttrList :>> ", item.ProcessAttrList);
  1848. console.log("item.process_list :>> ", item.process_list);
  1849. item.process_list.map((v) => {
  1850. item.ProcessAttrList.map((c) => {
  1851. if (c.name == v.name) {
  1852. c.selected_value = v.id * 1;
  1853. }
  1854. });
  1855. });
  1856. item.process_name = res.data.technological_route_title;
  1857. item.properties = res.data.pp_id.split(","); ///存在问题
  1858. this.info.bps.forEach((v) => {
  1859. v.cld &&
  1860. v.cld.length > 0 &&
  1861. v.cld.forEach((z) => {
  1862. z.show = selectTagsId.includes(z.id);
  1863. z.cld &&
  1864. z.cld.length > 0 &&
  1865. z.cld.forEach((elem) => {
  1866. elem.show = selectTagsId.includes(elem.id);
  1867. elem.cld &&
  1868. elem.cld.length > 0 &&
  1869. elem.cld.forEach((ele) => {
  1870. ele.show = selectTagsId.includes(ele.id);
  1871. ele.cld &&
  1872. ele.cld.length > 0 &&
  1873. ele.cld.forEach((el) => {
  1874. el.show = selectTagsId.includes(el.id);
  1875. });
  1876. });
  1877. });
  1878. });
  1879. });
  1880. if (item.produce_list && item.produce_list.length > 0) {
  1881. item.produce_list.map((v) => (v.wages = v.price));
  1882. item.partsProcessLineTableData = item.produce_list;
  1883. } else {
  1884. item.partsProcessLineTableData = this.selectTags;
  1885. }
  1886. });
  1887. // } else {
  1888. // item.isAddProcessRoute = true;
  1889. // }
  1890. }
  1891. },
  1892. handleProcessSelect(){
  1893. },
  1894. handleProcessLineShow(item, index) {
  1895. item.isShowProcessLine
  1896. ? (document.getElementsByClassName("parts_content_lineTable")[
  1897. index
  1898. ].style.height = "89px")
  1899. : (document.getElementsByClassName("parts_content_lineTable")[
  1900. index
  1901. ].style.height = "auto");
  1902. item.isShowProcessLine = !item.isShowProcessLine;
  1903. this.$forceUpdate();
  1904. },
  1905. //选择工艺路线
  1906. editRouter(item, index) {
  1907. // 重新打开则重新判定是否为新增工艺路线
  1908. this.isNewProcess = false;
  1909. this.showProcessLineModal = true;
  1910. this.tempSelectedPartIndex = index;
  1911. this.handleSearchProcessLine(this.tempProcessLine.title);
  1912. },
  1913. handleSearchProcessLine(title) {
  1914. this.axios({
  1915. method: "get",
  1916. url: "/api/technological_route",
  1917. params: {
  1918. title,
  1919. },
  1920. }).then((res) => {
  1921. this.processLineTableData = res.data.data;
  1922. });
  1923. },
  1924. changeCheck(e, item, selectArray) {
  1925. // 一旦更改便标记为新增工艺路线
  1926. this.isNewProcess = true;
  1927. //复选框选中与非选中同时同步tag标签跟随操作
  1928. item.show = e;
  1929. if (e) {
  1930. selectArray.push(item);
  1931. } else {
  1932. let id = item.id;
  1933. let id_index = selectArray.findIndex((v) => v.id == id);
  1934. selectArray.splice(id_index, 1);
  1935. }
  1936. },
  1937. closeTag(key, arr, row) {
  1938. //取消tag标签展示操作并同步下方的复选框ui同步
  1939. for (const key in this.info.bps) {
  1940. const element = this.info.bps[key];
  1941. element.cld.map((p) => {
  1942. p.id == row.id ? (p.show = false) : "";
  1943. p.cld &&
  1944. p.cld.length > 0 &&
  1945. p.cld.map((q) => {
  1946. q.id == row.id ? (q.show = false) : "";
  1947. q.cld &&
  1948. q.cld.length > 0 &&
  1949. q.cld.map((r) => {
  1950. r.id == row.id ? (r.show = false) : "";
  1951. r.cld &&
  1952. r.cld.length > 0 &&
  1953. r.cld.map((s) => {
  1954. s.id == row.id ? (s.show = false) : "";
  1955. });
  1956. });
  1957. });
  1958. });
  1959. }
  1960. arr.splice(key, 1);
  1961. },
  1962. setBoxChange(parent, child) {
  1963. return;
  1964. // const { type } = this.$route.query;
  1965. // if (type == 3) {
  1966. // return;
  1967. // }
  1968. // child.show = !child.show;
  1969. // child.list.forEach((element) => {
  1970. // element.show = child.show;
  1971. // });
  1972. },
  1973. setRadioChange(parent, child, index, parts, cld) {
  1974. if (this.type == 1) {
  1975. if (parts.isAddProcessRoute) {
  1976. cld.forEach((element) => {
  1977. element.list.forEach((elem) => {
  1978. elem.id != child.id && (elem.show = false);
  1979. });
  1980. });
  1981. child.show = !child.show;
  1982. parts.properties[index] = child.id;
  1983. }
  1984. }
  1985. this.$forceUpdate();
  1986. },
  1987. // setRadioChange(parent, child) {
  1988. // const { type } = this.$route.query;
  1989. // if (type == 3) {
  1990. // return;
  1991. // }
  1992. // // let flag = true;
  1993. // parent.list.forEach((element) => {
  1994. // element.show = false
  1995. // if (!element.show) {
  1996. // // flag = false;
  1997. // }
  1998. // });
  1999. // child.show = !child.show;
  2000. // console.log('child.show :>> ', child.show);
  2001. // // parent.show = flag;
  2002. // this.$forceUpdate();
  2003. // },
  2004. handleProcessLineSet(row, index) {
  2005. this.process_name = row.title;
  2006. this.info.id = row.id;
  2007. this.info.title = row.title;
  2008. this.info.procedure_id = row.procedure_id;
  2009. this.selectTags = [];
  2010. const arr = this.info.procedure_id
  2011. ? this.info.procedure_id.split(",")
  2012. : [];
  2013. for (const key in this.info.bps) {
  2014. const el = this.info.bps[key];
  2015. el.cld.forEach((z) => {
  2016. z.show = false;
  2017. z.cld &&
  2018. z.cld.length > 0 &&
  2019. z.cld.forEach((elem) => {
  2020. elem.show = false;
  2021. elem.cld &&
  2022. elem.cld.length > 0 &&
  2023. elem.cld.forEach((ele) => {
  2024. ele.show = false;
  2025. });
  2026. });
  2027. });
  2028. }
  2029. for (let index = 0; index < arr.length; index++) {
  2030. const element = arr[index];
  2031. this.info.bps.map((lv1) => {
  2032. lv1.cld &&
  2033. lv1.cld.length > 0 &&
  2034. lv1.cld.map((lv2) => {
  2035. if (lv2.id == element) {
  2036. lv2.show = true;
  2037. lv2.p_id && this.selectTags.push(lv2);
  2038. }
  2039. lv2.cld &&
  2040. lv2.cld.length > 0 &&
  2041. lv2.cld.map((lv3) => {
  2042. if (lv3.id == element) {
  2043. lv3.show = true;
  2044. lv3.p_id && this.selectTags.push(lv3);
  2045. }
  2046. lv3.cld &&
  2047. lv3.cld.length > 0 &&
  2048. lv3.cld.map((lv4) => {
  2049. if (lv4.id == element) {
  2050. lv4.show = true;
  2051. lv4.p_id && this.selectTags.push(lv4);
  2052. }
  2053. });
  2054. });
  2055. });
  2056. });
  2057. }
  2058. this.showProcessLineDetailModal = true;
  2059. this.showProcessLineModal = false;
  2060. },
  2061. changeProcessLineSize() {},
  2062. changeProcessLinePage() {},
  2063. handleProcessLineConfirm() {},
  2064. handleProcessLineSearch() {},
  2065. handlePartAdd(item, index) {
  2066. let obj = {
  2067. isAddPart: true,
  2068. isAddProcessRoute: true,
  2069. long: "",
  2070. width: "",
  2071. thick: "",
  2072. parts_type: "", //部件分类名称
  2073. pay_state: "", //标签
  2074. part_id: "", //部件名称
  2075. company: "", //单位
  2076. processCombination: "", //工艺组合名称
  2077. process_price: "", //工艺价格
  2078. ProcessAttrList: JSON.parse(JSON.stringify(this.tempProcessAttrList)), //工艺属性列表
  2079. partsProcessLineTableData: [
  2080. {
  2081. id: "",
  2082. type: "",
  2083. title: "",
  2084. time: "",
  2085. wages: "",
  2086. capacity: "",
  2087. },
  2088. ], //工艺路线表格
  2089. partsWoodTableData: [
  2090. {
  2091. title: "",
  2092. spare_parts: "",
  2093. number: "",
  2094. company: "",
  2095. long: "",
  2096. wide: "",
  2097. thick: "",
  2098. technological_requirement_id: "",
  2099. sub_num: "",
  2100. veneer_id: "",
  2101. paint_id: "",
  2102. label: "",
  2103. print_num: "",
  2104. },
  2105. ], //零部件表格
  2106. partsMetalseData: [
  2107. {
  2108. spare_parts: "",
  2109. number: "",
  2110. company: "",
  2111. price: "",
  2112. total_price: "",
  2113. },
  2114. ], //五金表格
  2115. partsNameList: [{ id: "", title: "" }], //部件名称列表
  2116. checkBox: [],
  2117. keyUseType: 0,
  2118. };
  2119. this.formData.parts.splice(index + 1, 0, obj);
  2120. },
  2121. handlePartCopy(item, index) {
  2122. let obj = JSON.parse(JSON.stringify(item));
  2123. // this.formData.parts.splice(index, 0, obj);
  2124. this.formData.parts.push(obj);
  2125. },
  2126. handlePartDele(item, index) {
  2127. this.formData.parts.splice(index, 1);
  2128. },
  2129. handlePartWoodAdd(index) {
  2130. let formData = JSON.parse(JSON.stringify(this.formData));
  2131. formData.parts[index].partsWoodTableData.push({
  2132. type_id: 1,
  2133. title: "",
  2134. spare_parts: "",
  2135. number: "",
  2136. company: "",
  2137. long: "",
  2138. wide: "",
  2139. thick: "",
  2140. technological_requirement_id: "",
  2141. sub_num: "",
  2142. veneer_id: "",
  2143. paint_id: "",
  2144. label: "",
  2145. print_num: "",
  2146. });
  2147. this.formData = formData;
  2148. },
  2149. handlePartWoodCopy(row, index, parentIndex) {
  2150. this.$nextTick(() => {
  2151. let obj = JSON.parse(
  2152. JSON.stringify(
  2153. this.formData.parts[parentIndex].partsWoodTableData[index]
  2154. )
  2155. );
  2156. this.formData.parts[parentIndex].partsWoodTableData.splice(
  2157. index + 1,
  2158. 0,
  2159. obj
  2160. );
  2161. // this.formData.parts[parentIndex].partsWoodTableData.push(obj)
  2162. this.$forceUpdate();
  2163. });
  2164. },
  2165. handlePartWoodDele(row, index, parentIndex) {
  2166. this.formData.parts[parentIndex].partsWoodTableData.splice(index, 1);
  2167. },
  2168. handlePartMetalsAdd(index) {
  2169. let formData = JSON.parse(JSON.stringify(this.formData));
  2170. if (formData.parts[index].partsMetalseData == undefined) {
  2171. formData.parts[index].partsMetalseData = [];
  2172. }
  2173. formData.parts[index].partsMetalseData.push({
  2174. type_id: 2,
  2175. spare_parts: "",
  2176. number: "",
  2177. company: "",
  2178. price: "",
  2179. total_price: "",
  2180. });
  2181. this.formData = formData;
  2182. },
  2183. handlePartMetalsCopy(row, index, parentIndex) {
  2184. let obj = JSON.parse(JSON.stringify(row));
  2185. this.formData.parts[parentIndex].partsMetalseData.splice(
  2186. index + 1,
  2187. 0,
  2188. obj
  2189. );
  2190. },
  2191. handleClose(done) {
  2192. done();
  2193. },
  2194. handlePartMetalsDele(row, index, parentIndex) {
  2195. this.formData.parts[parentIndex].partsMetalseData.splice(index, 1);
  2196. },
  2197. handleProcessLineSelected() {},
  2198. async postData() {
  2199. let sum = 0;
  2200. this.formData.parts.forEach((element) => {
  2201. sum += element.proportion * 1;
  2202. });
  2203. const BJ_name = this.formData.parts.map((item) => {
  2204. return item.part_id;
  2205. });
  2206. const atfer_BJ_name = Array.from(new Set(BJ_name));
  2207. if (atfer_BJ_name.length != BJ_name.length) {
  2208. return this.$Message.error("部件名称存在重复");
  2209. }
  2210. if (sum != 100) {
  2211. this.$Message.error("产值比之和须为100");
  2212. } else {
  2213. // 部件保存
  2214. let save_sucess = true;
  2215. for (let i in this.formData.parts) {
  2216. let element = this.formData.parts[i];
  2217. let flag = false;
  2218. element.partsNameList.forEach((ele) => {
  2219. if (element.part_id == ele.id && ele.id == ele.title) {
  2220. flag = true;
  2221. }
  2222. });
  2223. if (flag) {
  2224. let result = await this.axios({
  2225. method: "post",
  2226. url: "/api/order_area_explode_part",
  2227. data: {
  2228. top: {
  2229. p_id: element.parts_type,
  2230. bp_id: this.nowSelectObj.id, //相似产品
  2231. company: element.company,
  2232. label: element.pay_state,
  2233. title: element.part_id,
  2234. },
  2235. op: "add",
  2236. detail: [
  2237. ...element.partsWoodTableData,
  2238. ...element.partsMetalseData,
  2239. ],
  2240. },
  2241. });
  2242. if (result.code == 200) {
  2243. element.part_id = result.data.id;
  2244. // 工艺路线保存 partsProcessLineTableData
  2245. let bool = true;
  2246. // element.partsProcessRouteList.forEach((ele) => {
  2247. // if (
  2248. // element.processCombination == ele.id &&
  2249. // ele.id == ele.title
  2250. // ) {
  2251. // bool = true;
  2252. // }
  2253. // });
  2254. let properties = element.ProcessAttrList.map((v) => {
  2255. console.log('v :>> ', v);
  2256. return { name: v.name, value: v.selected_value||'' };
  2257. });
  2258. // element.partsProcessLineTableData.forEach(async (el, idx) => {
  2259. // if (idx == element.length - 1) {
  2260. // procedure += el.id + "";
  2261. // } else {
  2262. // procedure += el.id + ",";
  2263. // }
  2264. // });
  2265. if (bool) {
  2266. let res = await this.axios({
  2267. method: "post",
  2268. url: "/api/order_area_explode_process",
  2269. data: {
  2270. parts_id: element.part_id,
  2271. price: element.process_price || 0,
  2272. properties,
  2273. title: element.processCombination,
  2274. procedure: element.partsProcessLineTableData,
  2275. op: "add",
  2276. },
  2277. });
  2278. element.route_id = res.data.id;
  2279. element.part_id = result.data.id;
  2280. } else {
  2281. element.route_id = element.processCombination;
  2282. }
  2283. } else {
  2284. save_sucess = false;
  2285. }
  2286. } else {
  2287. // 工艺路线保存 partsProcessLineTableData
  2288. let bool = true;
  2289. // element.partsProcessRouteList.forEach((ele) => {
  2290. // if (element.processCombination == ele.id && ele.id == ele.title) {
  2291. // bool = true;
  2292. // }
  2293. // });
  2294. let properties = element.ProcessAttrList.map((v) => {
  2295. return { name: v.name, value: v.selected_value||'' };
  2296. });
  2297. if (bool) {
  2298. let res = await this.axios({
  2299. method: "post",
  2300. url: "/api/order_area_explode_process",
  2301. data: {
  2302. parts_id: element.part_id, /////
  2303. price: element.process_price || 0,
  2304. properties,
  2305. title: element.processCombination || "",
  2306. procedure: element.partsProcessLineTableData,
  2307. op: "add",
  2308. },
  2309. });
  2310. if (res.code == 200) {
  2311. element.route_id = res.data.id;
  2312. } else {
  2313. save_sucess = false;
  2314. }
  2315. } else {
  2316. element.route_id = element.processCombination;
  2317. }
  2318. }
  2319. }
  2320. this.formData.parts.forEach((element) => {
  2321. element.processCombination = element.processCombination || "";
  2322. element.properties = element.processCombination || "";
  2323. element.detail = [
  2324. ...element.partsWoodTableData,
  2325. ...element.partsMetalseData,
  2326. ];
  2327. });
  2328. // 产品编辑保存
  2329. if (save_sucess) {
  2330. await this.axios({
  2331. method: "post",
  2332. url: "/api/order_area_explode_save",
  2333. data: {
  2334. ...this.formData,
  2335. order_no: this.$route.query.order_no,
  2336. oa_id: this.$route.query.oa_id,
  2337. orders_area_product_detail_id: this.$route.query
  2338. .orders_area_product_detail_id,
  2339. },
  2340. }).then((res) => {
  2341. if (res.code == 200) {
  2342. this.$Message.success(res.msg);
  2343. this.goback();
  2344. }
  2345. });
  2346. }
  2347. }
  2348. },
  2349. goback() {
  2350. this.$router.go(-1);
  2351. },
  2352. successKey(str) {
  2353. if (this.keyUseType == 1) {
  2354. this.formData.parts[this.attrParentindex].partsWoodTableData[
  2355. this.attrIndex
  2356. ][this.attrName] = str;
  2357. // this.$set(this.formData.parts[this.attrParentindex].partsWoodTableData[this.attrIndex],[this.attrName], str)
  2358. } else {
  2359. this.formData.parts[this.attrParentindex][this.attrName] = str;
  2360. }
  2361. this.showKey = false;
  2362. },
  2363. cancelKey() {
  2364. this.showKey = false;
  2365. },
  2366. openKey(partsIndex, index, attr, partsItem) {
  2367. // this.axios({
  2368. // method: "get",
  2369. // url: "/api/basics_product_list",
  2370. // params: {
  2371. // id: partsItem.part_id,
  2372. // },
  2373. // })
  2374. // .then((res) => {
  2375. // res.data.forEach((element) => {
  2376. // if (element.id == partsItem.part_id) {
  2377. // this.measureList = element.measure;
  2378. // }
  2379. // });
  2380. this.showKey = true;
  2381. this.attrParentindex = partsIndex;
  2382. if (index != -1) {
  2383. this.attrIndex = index;
  2384. this.keyUseType = 1;
  2385. } else {
  2386. this.keyUseType = 2;
  2387. }
  2388. this.attrName = attr;
  2389. // })
  2390. },
  2391. changeSe(e, n, partsIndex, row) {
  2392. let event = window.event;
  2393. let unit = event.target.dataset.unit;
  2394. // row.company = unit ? unit : ''
  2395. // row.thick = e.tag
  2396. // row.title = e.title
  2397. this.formData.parts[partsIndex].partsWoodTableData[n].company = unit
  2398. ? unit
  2399. : "";
  2400. this.formData.parts[partsIndex].partsWoodTableData[n].thick = e.tag;
  2401. this.formData.parts[partsIndex].partsWoodTableData[n].title = e.title;
  2402. },
  2403. changeMetal(e, n, partsIndex) {
  2404. let event = window.event;
  2405. let unit = event.target.dataset.unit;
  2406. this.formData.parts[partsIndex].partsMetalseData[n].company = unit
  2407. ? unit
  2408. : "";
  2409. },
  2410. handleMetalTotalPriceChange(row) {
  2411. row.total_price = 1 * row.price * row.number;
  2412. },
  2413. handleClick(e) {
  2414. let data = JSON.parse(e);
  2415. this.nowSelectObj = data;
  2416. this.info.bp_id = this.nowSelectObj.id;
  2417. this.axios("/api/basics_product_list", {
  2418. params: { id: this.nowSelectObj.id },
  2419. }).then((res) => {
  2420. res.data.forEach((element) => {
  2421. if (element.id == this.nowSelectObj.id) {
  2422. this.measureList = element.measure;
  2423. }
  2424. });
  2425. });
  2426. },
  2427. checkImg(item) {
  2428. let list = [];
  2429. item.forEach((el) => {
  2430. list.push({ img_url: el });
  2431. });
  2432. // this.axios('/api/orders_img', { params: { id: this.order_area_product_id, type: 1 } }).then(res => {
  2433. // if (res.code == 200) {
  2434. this.$previewImg({
  2435. list,
  2436. baseUrl: this.$store.state.ip,
  2437. baseImgField: "img_url",
  2438. baseTitleField: "",
  2439. });
  2440. // }
  2441. // })
  2442. },
  2443. },
  2444. // 监听属性 类似于data概念
  2445. computed: {},
  2446. // 监控data中的数据变化
  2447. watch: {},
  2448. beforeCreate() {}, // 生命周期 - 创建之前
  2449. beforeMount() {}, // 生命周期 - 挂载之前
  2450. beforeUpdate() {}, // 生命周期 - 更新之前
  2451. updated() {}, // 生命周期 - 更新之后
  2452. beforeDestroy() {}, // 生命周期 - 销毁之前
  2453. destroyed() {}, // 生命周期 - 销毁完成
  2454. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  2455. };
  2456. </script>
  2457. <style lang="scss" scoped>
  2458. .BidSystemProductDeOrderDeorderdetail {
  2459. position: relative;
  2460. overflow: hidden;
  2461. overflow-y: auto;
  2462. .top_info {
  2463. display: flex;
  2464. justify-content: flex-start;
  2465. align-items: center;
  2466. flex-wrap: wrap;
  2467. padding: 10px;
  2468. span {
  2469. min-width: 40px;
  2470. margin-right: 5px;
  2471. }
  2472. div {
  2473. display: flex;
  2474. justify-content: flex-start;
  2475. align-items: center;
  2476. width: 200px;
  2477. padding: 10px;
  2478. img {
  2479. max-width: 60px;
  2480. }
  2481. }
  2482. }
  2483. .similar_product {
  2484. position: relative;
  2485. padding: 15px;
  2486. margin-bottom: 30px;
  2487. border-radius: 5px;
  2488. box-shadow: 1px 1px 5px 1px #999;
  2489. display: flex;
  2490. justify-content: flex-start;
  2491. align-items: center;
  2492. }
  2493. .parts {
  2494. position: relative;
  2495. padding: 15px;
  2496. margin-bottom: 30px;
  2497. border-radius: 5px;
  2498. box-shadow: 1px 1px 5px 1px #999;
  2499. /deep/ .ivu-form-item {
  2500. display: inline-block;
  2501. width: 350px;
  2502. }
  2503. .parts_title {
  2504. display: flex;
  2505. justify-content: space-between;
  2506. }
  2507. .parts_content {
  2508. font-size: 14px;
  2509. .parts_content_attr {
  2510. display: flex;
  2511. justify-content: flex-start;
  2512. align-items: center;
  2513. flex-wrap: wrap;
  2514. // width: 350px;
  2515. span {
  2516. width: 80px;
  2517. text-align: center;
  2518. }
  2519. div {
  2520. display: flex;
  2521. width: 100%;
  2522. justify-content: flex-start;
  2523. align-items: center;
  2524. margin: 5px 0;
  2525. span {
  2526. margin: 0 5px;
  2527. }
  2528. }
  2529. }
  2530. .parts_content_line {
  2531. // width: 350px;
  2532. padding-left: 17px;
  2533. span {
  2534. margin-right: 5px;
  2535. }
  2536. }
  2537. .parts_content_lineTable,
  2538. .parts_content_partTable,
  2539. .parts_content_metalsTable {
  2540. margin: 10px 0;
  2541. }
  2542. .parts_content_part {
  2543. span {
  2544. margin-right: 5px;
  2545. }
  2546. }
  2547. .parts_content_lineTable {
  2548. overflow: hidden;
  2549. }
  2550. }
  2551. }
  2552. }
  2553. .similarProductModal,
  2554. .ProcessLineModal {
  2555. /deep/ .ivu-form-item {
  2556. display: inline-block;
  2557. width: 220px;
  2558. }
  2559. }
  2560. .page {
  2561. display: flex;
  2562. justify-content: center;
  2563. margin-top: 10px;
  2564. }
  2565. .hierarchy {
  2566. .radio-g {
  2567. padding: 10px 0;
  2568. display: flex;
  2569. justify-content: flex-start;
  2570. align-items: center;
  2571. .radio-box {
  2572. display: flex;
  2573. flex-wrap: wrap;
  2574. justify-content: flex-start;
  2575. border-left: 1px solid #3764ff;
  2576. .radio-us {
  2577. background: #fff;
  2578. padding: 5px 20px;
  2579. margin: 5px;
  2580. margin-right: 18px;
  2581. color: #3764ff;
  2582. border-radius: 15px;
  2583. border: 1px solid #3764ff;
  2584. cursor: pointer;
  2585. }
  2586. .radio-us-foc {
  2587. color: #fff;
  2588. background: #3764ff;
  2589. border: 1px solid #3764ff;
  2590. }
  2591. }
  2592. .tit_box {
  2593. .box-us {
  2594. background: #fff;
  2595. padding: 5px 20px;
  2596. margin: 5px;
  2597. margin-right: 18px;
  2598. color: #3764ff;
  2599. border-radius: 5px;
  2600. border: 1px solid #3764ff;
  2601. cursor: pointer;
  2602. width: 100px;
  2603. display: inline-block;
  2604. text-align: center;
  2605. }
  2606. .box-us-foc {
  2607. color: #fff;
  2608. background: #3764ff;
  2609. border: 1px solid #3764ff;
  2610. }
  2611. }
  2612. .radio-us-none {
  2613. display: none;
  2614. }
  2615. }
  2616. }
  2617. .modal_process_route1 {
  2618. display: flex;
  2619. justify-content: space-around;
  2620. }
  2621. .modal_process_route {
  2622. .modal_process_route_top {
  2623. display: flex;
  2624. justify-content: space-around;
  2625. padding: 10px 0;
  2626. }
  2627. }
  2628. /deep/ .ivu-table-wrapper {
  2629. overflow: visible;
  2630. }
  2631. /deep/ .ivu-modal {
  2632. .modal_process_route_content {
  2633. max-height: 600px;
  2634. position: relative;
  2635. overflow: hidden;
  2636. overflow-y: auto;
  2637. }
  2638. }
  2639. .SortableList {
  2640. // display: flex;
  2641. // justify-content: flex-start;
  2642. // align-items: center;
  2643. // flex-wrap: wrap;
  2644. .SortableItem {
  2645. .tag-modal {
  2646. display: flex;
  2647. align-items: center;
  2648. .before {
  2649. width: 20px;
  2650. background: #3764ff;
  2651. height: 24px;
  2652. border-radius: 5px 0 0 5px;
  2653. display: flex;
  2654. justify-content: center;
  2655. align-items: center;
  2656. color: #fff;
  2657. }
  2658. }
  2659. }
  2660. }
  2661. /deep/.ivu-modal-body {
  2662. height: 750px;
  2663. overflow: auto;
  2664. }
  2665. .modal_content {
  2666. display: flex;
  2667. justify-content: space-around;
  2668. height: 100%;
  2669. .modal_content_left {
  2670. max-width: 40%;
  2671. min-width: 30%;
  2672. border-right: 1px solid #d8d8d8;
  2673. }
  2674. .modal_content_right {
  2675. width: 60%;
  2676. max-height: 700px;
  2677. padding-left: 10px;
  2678. overflow: hidden;
  2679. overflow-y: auto;
  2680. font-size: 18px;
  2681. }
  2682. }
  2683. .vertical-center-modal1 {
  2684. display: flex;
  2685. align-items: center;
  2686. justify-content: center;
  2687. .ivu-modal {
  2688. top: 0;
  2689. }
  2690. }
  2691. /deep/.el-input--small .el-input__inner {
  2692. height: 24px;
  2693. line-height: 24px;
  2694. }
  2695. </style>