deorderdetail.vue 72 KB

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