deorderdetail.vue 85 KB

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