deorderdetail.vue 73 KB

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