deorderdetail.vue 85 KB

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