matchPage.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. <template>
  2. <div>
  3. <Toptitle title="匹配">
  4. <Button
  5. @click="handleAutoMatching"
  6. v-show="currencyTag == 1"
  7. type="primary"
  8. style="margin-right: 10px"
  9. >自动匹配</Button
  10. >
  11. <Button
  12. v-show="currencyTag != 1"
  13. @click="handleMatchedSelectAll(isMatchedSelectAll)"
  14. type="primary"
  15. :ghost="!isMatchedSelectAll"
  16. style="margin-right: 10px"
  17. >{{ isMatchedSelectAll ? "取消选中" : "全部选中" }}</Button
  18. >
  19. <Button
  20. @click="handleMatchedSet({}, 0, 5)"
  21. v-show="currencyTag != 1"
  22. type="primary"
  23. style="margin-right: 10px"
  24. >撤销匹配</Button
  25. >
  26. <Button @click="back" type="primary" ghost style="margin-right: 10px"
  27. >返回</Button
  28. >
  29. </Toptitle>
  30. <div class="top-info">
  31. <Row align="middle" type="flex" justify="start">
  32. <Col style="margin-right:20px">
  33. <span>项目编号:</span><span>{{ info.project_number }}</span>
  34. </Col>
  35. <Col style="margin-right:20px">
  36. <span>项目名称:</span><span>{{ info.project_name }}</span>
  37. </Col>
  38. <Col style="margin-right:20px" v-if="currencyTag == 1">
  39. <span>图号:</span>
  40. <span>
  41. <Select
  42. filterable
  43. multiple
  44. clearable
  45. transfer
  46. filter-by-label
  47. v-model="info.image_number"
  48. :max-tag-count="2"
  49. style="width: 200px"
  50. >
  51. <Option
  52. v-for="(item, index) in urlSelectList"
  53. :key="index"
  54. :label="item"
  55. :value="item"
  56. ></Option>
  57. </Select>
  58. </span>
  59. </Col>
  60. <Col style="margin-right:20px" v-if="currencyTag == 1">
  61. <span>产品名称:</span>
  62. <span>
  63. <Select
  64. filterable
  65. multiple
  66. clearable
  67. transfer
  68. filter-by-label
  69. v-model="info.product_name"
  70. :max-tag-count="2"
  71. style="width: 200px"
  72. >
  73. <Option
  74. v-for="(item, index) in productList"
  75. :key="index"
  76. :label="item"
  77. :value="item"
  78. ></Option>
  79. </Select>
  80. </span>
  81. </Col>
  82. <Col style="margin-right:20px" v-if="currencyTag == 1">
  83. <Button
  84. @click="
  85. handleSearchUnmatchedInfo();
  86. isClickMatch = false;
  87. "
  88. type="primary"
  89. >
  90. 确认
  91. </Button>
  92. </Col>
  93. </Row>
  94. </div>
  95. <div class="context-tabs">
  96. <Tabs type="card" @on-click="handleTabsClick" v-model="currencyTag">
  97. <Button
  98. @click="handleIsAllowHandingMatch"
  99. type="primary"
  100. size="small"
  101. slot="extra"
  102. v-show="currencyTag == 1"
  103. >
  104. 匹配
  105. </Button>
  106. <TabPane label="未匹配" name="1">
  107. <Row>
  108. <Col
  109. span="16"
  110. style="border-top: 1px solid #adb5bd;border-right: 1px solid #adb5bd;padding:10px"
  111. >
  112. <div class="sheet-block">
  113. <h1>码单信息</h1>
  114. <div class="context-unmatched-sheet">
  115. <div
  116. v-for="url_info in unmatchedObj.urlList"
  117. :key="url_info.id"
  118. v-show="url_info.product_detail_num > 0"
  119. style="padding-top:10px"
  120. >
  121. <Row type="flex" align="middle">
  122. <Col span="4">
  123. <span>图号:</span>
  124. <span>{{ url_info.image_number }}</span>
  125. </Col>
  126. <Col span="4">
  127. <span>产品名称:</span>
  128. <span>{{ url_info.product_name }}</span>
  129. </Col>
  130. <Col span="4">
  131. <span>批量数:</span>
  132. <span>{{ url_info.number }}</span>
  133. </Col>
  134. <Col span="2">
  135. <span>区域:</span>
  136. <span>{{ url_info.region }}</span>
  137. </Col>
  138. <Col span="2" offset="4">
  139. <span>
  140. 总计
  141. <span style="color:red">{{
  142. url_info.product_detail_num
  143. }}</span>
  144. 条数据
  145. </span>
  146. </Col>
  147. <Col span="4">
  148. <Button
  149. @click="handleShowCurrencySheet(url_info, 1)"
  150. size="small"
  151. type="text"
  152. >
  153. {{ url_info.isCurrenct ? "收缩" : "展开" }}
  154. </Button>
  155. <Icon
  156. size="20"
  157. :type="
  158. url_info.isCurrenct
  159. ? 'md-arrow-dropdown'
  160. : 'md-arrow-dropright'
  161. "
  162. style="vertical-align: middle;"
  163. />
  164. </Col>
  165. </Row>
  166. <div
  167. v-if="url_info.isCurrenct"
  168. class="context-unmatched-sheet-search"
  169. >
  170. <Row type="flex" align="middle">
  171. <Col span="6">
  172. <span>特殊尺寸:</span>
  173. <span>
  174. <Select
  175. filterable
  176. filter-by-label
  177. transfer
  178. clearable
  179. v-model="info.wool_size1"
  180. size="small"
  181. style="width: 120px"
  182. >
  183. <Option
  184. v-for="(item, index) in wool_size1"
  185. :key="index"
  186. :label="item"
  187. :value="item"
  188. ></Option>
  189. </Select>
  190. </span>
  191. </Col>
  192. <Col span="6">
  193. <span>部件名称:</span>
  194. <span>
  195. <Select
  196. filterable
  197. multiple
  198. filter-by-label
  199. clearable
  200. transfer
  201. v-model="info.part_name"
  202. :max-tag-count="2"
  203. size="small"
  204. style="width: 120px"
  205. >
  206. <Option
  207. v-for="(item, index) in part_name"
  208. :key="index"
  209. :label="item"
  210. :value="item"
  211. ></Option>
  212. </Select>
  213. </span>
  214. </Col>
  215. <Col span="6">
  216. <span>精裁尺寸:</span>
  217. <span>
  218. <Select
  219. filterable
  220. filter-by-label
  221. clearable
  222. transfer
  223. v-model="info.cut_size"
  224. size="small"
  225. style="width: 120px"
  226. >
  227. <Option
  228. v-for="(item, index) in cut_size"
  229. :key="index"
  230. :label="item"
  231. :value="item"
  232. ></Option>
  233. </Select>
  234. </span>
  235. </Col>
  236. <Col span="6">
  237. <Button
  238. @click="getSheetDetailList(url_info, 1)"
  239. size="small"
  240. type="primary"
  241. >
  242. 搜索
  243. </Button>
  244. </Col>
  245. </Row>
  246. </div>
  247. <div
  248. v-if="url_info.isCurrenct"
  249. class="context-unmatched-sheet-table"
  250. >
  251. <div
  252. v-for="table_info in unmatchedObj.part_list"
  253. :key="table_info.id"
  254. >
  255. <div>
  256. <Row type="flex" align="middle">
  257. <Col span="10" style="padding:10px 0">
  258. <span>匹配信息:</span>
  259. <span
  260. v-for="(match_info, index) in table_info.key
  261. .list"
  262. :key="index"
  263. >
  264. {{ match_info.key }}={{ match_info.value }}
  265. </span>
  266. <span>{{ table_info.key.num }}组</span>
  267. </Col>
  268. <Col span="3" offset="8">
  269. 总计{{ table_info.part_list.length }}条数据
  270. </Col>
  271. <Col span="3">
  272. <Button
  273. @click="handleHiddenSheetDetail(table_info)"
  274. size="small"
  275. type="text"
  276. >
  277. {{ !table_info.isHidden ? "展开2" : "收缩" }}
  278. </Button>
  279. </Col>
  280. </Row>
  281. </div>
  282. <div v-show="table_info.isHidden">
  283. <Table
  284. :columns="unmatchedSheetTableColumns"
  285. border
  286. :max-height="500"
  287. :data="table_info.part_list"
  288. ></Table>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </Col>
  296. <Col span="8">
  297. <div
  298. class="room-block"
  299. style="border-top: 1px solid #adb5bd;padding:10px"
  300. >
  301. <h1>房间信息</h1>
  302. <div class="context-unmatched-room">
  303. <div
  304. v-for="url_info in unmatchedObj.urlList"
  305. v-show="url_info.house_num > 0"
  306. :key="url_info.id"
  307. style="padding-top:10px"
  308. >
  309. <Row type="flex" align="middle">
  310. <Col span="4">
  311. <span>图号:</span
  312. ><span>{{ url_info.image_number }}</span>
  313. </Col>
  314. <Col span="8">
  315. <span>产品名称:</span
  316. ><span>{{ url_info.product_name }}</span>
  317. </Col>
  318. <Col span="6" offset="2">
  319. <span>
  320. 总计
  321. <span style="color:red">{{
  322. url_info.house_num
  323. }}</span>
  324. 条数据
  325. </span>
  326. </Col>
  327. <Col span="4">
  328. <Button
  329. @click="handleShowCurrencySheet(url_info, 2)"
  330. size="small"
  331. type="text"
  332. >{{ url_info.isCurrenct ? "收缩" : "展开" }}</Button
  333. >
  334. <Icon
  335. size="20"
  336. :type="
  337. url_info.isCurrenct
  338. ? 'md-arrow-dropdown'
  339. : 'md-arrow-dropright'
  340. "
  341. style="vertical-align: middle;"
  342. />
  343. </Col>
  344. </Row>
  345. <Row>
  346. <Col span="4">
  347. <span>批量数:</span>
  348. <span>{{ url_info.number }}</span>
  349. </Col>
  350. </Row>
  351. <div
  352. v-if="url_info.isCurrenct"
  353. class="context-unmatched-room-search"
  354. >
  355. <Row type="flex" align="middle">
  356. <Col span="12" style="padding:10px 0">
  357. <span>区域名称:</span>
  358. <span>
  359. <Select
  360. filterable
  361. multiple
  362. filter-by-label
  363. clearable
  364. transfer
  365. v-model="info.region"
  366. :max-tag-count="2"
  367. size="small"
  368. style="width: 120px"
  369. >
  370. <Option
  371. v-for="(item, index) in regionList"
  372. :key="index"
  373. :label="item"
  374. :value="item"
  375. ></Option>
  376. </Select>
  377. </span>
  378. </Col>
  379. <Col span="12" style="padding:10px 0">
  380. <span>房号:</span>
  381. <span>
  382. <Select
  383. filterable
  384. multiple
  385. filter-by-label
  386. clearable
  387. transfer
  388. v-model="info.number"
  389. :max-tag-count="2"
  390. size="small"
  391. style="width: 120px"
  392. >
  393. <Option
  394. v-for="(item, index) in number"
  395. :key="index"
  396. :label="item"
  397. :value="item"
  398. ></Option>
  399. </Select>
  400. </span>
  401. </Col>
  402. <Col span="12" style="padding:10px 0">
  403. <span>特殊尺寸:</span>
  404. <span>
  405. <Select
  406. filterable
  407. filter-by-label
  408. clearable
  409. transfer
  410. v-model="info.wool_size2"
  411. size="small"
  412. style="width: 120px"
  413. >
  414. <Option
  415. v-for="(item, index) in wool_size2"
  416. :key="index"
  417. :label="item"
  418. :value="item"
  419. ></Option>
  420. </Select>
  421. </span>
  422. </Col>
  423. <Col span="12" style="padding:10px 0">
  424. <Button
  425. @click="getSheetDetailList(url_info, 2)"
  426. size="small"
  427. type="primary"
  428. >搜索</Button
  429. >
  430. </Col>
  431. </Row>
  432. </div>
  433. <div
  434. v-if="url_info.isCurrenct"
  435. class="context-unmatched-room-table"
  436. >
  437. <div>
  438. <Table
  439. :columns="unmatchedRoomTableColumnsUsed"
  440. border
  441. :max-height="500"
  442. @on-selection-change="handleSelectChange"
  443. :data="unmatchedRoomList.house_list"
  444. ></Table>
  445. </div>
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. </Col>
  451. </Row>
  452. </TabPane>
  453. <TabPane label="已匹配" name="2">
  454. <Row type="flex" align="middle" style="padding:10px 0">
  455. <Col span="4">
  456. <span>图号:</span>
  457. <span>
  458. <Select
  459. filterable
  460. multiple
  461. clearable
  462. filter-by-label
  463. transfer
  464. v-model="matchedInfo.image_number"
  465. :max-tag-count="2"
  466. size="small"
  467. style="width: 150px"
  468. >
  469. <Option
  470. v-for="(item, index) in urlMatchedList"
  471. :key="index"
  472. :label="item"
  473. :value="item"
  474. ></Option>
  475. </Select>
  476. </span>
  477. </Col>
  478. <Col span="4">
  479. <span>产品名称:</span>
  480. <span>
  481. <Select
  482. filterable
  483. multiple
  484. filter-by-label
  485. clearable
  486. transfer
  487. v-model="matchedInfo.product_name"
  488. :max-tag-count="2"
  489. size="small"
  490. style="width: 150px"
  491. >
  492. <Option
  493. v-for="(item, index) in productMatchedList"
  494. :key="index"
  495. :label="item"
  496. :value="item"
  497. ></Option>
  498. </Select>
  499. </span>
  500. </Col>
  501. <Col span="2">
  502. <Button
  503. @click="handleMatchedListInit"
  504. size="small"
  505. type="primary"
  506. >
  507. 搜索
  508. </Button>
  509. </Col>
  510. </Row>
  511. <div
  512. v-for="matched_info in matchedList"
  513. :key="matched_info.number"
  514. class="matched-block"
  515. >
  516. <Row>
  517. <Col span="2">
  518. <Checkbox
  519. v-show="matched_info.produce_status == 0"
  520. v-model="matched_info.isSelect"
  521. @on-change="(e) => handleMatchedSelect(matched_info, e)"
  522. >选择</Checkbox
  523. >
  524. </Col>
  525. <Col span="2">
  526. <span>图号:{{ matched_info.image_number }}</span>
  527. </Col>
  528. <Col span="4">
  529. <span>产品名称:{{ matched_info.product_name }}</span>
  530. </Col>
  531. <Col span="2">
  532. <span>区域:{{ matched_info.region }}</span>
  533. </Col>
  534. <Col span="2" offset="8">
  535. <Button
  536. @click="handleMatchedSet(matched_info, -1, 5)"
  537. type="primary"
  538. size="small"
  539. :disabled="matched_info.produce_status > 0"
  540. style="margin-right: 10px"
  541. >撤销匹配</Button
  542. >
  543. </Col>
  544. <Col span="2">
  545. 总计
  546. <span style="color:red">{{ matched_info.num }}</span>
  547. 条数据
  548. </Col>
  549. <Col span="2">
  550. <Button
  551. @click="handleShowCurrencyMatched(matched_info)"
  552. size="small"
  553. type="text"
  554. >{{ matched_info.isCurrenct ? "收缩" : "展开" }}</Button
  555. >
  556. <Icon
  557. size="20"
  558. :type="
  559. matched_info.isCurrenct
  560. ? 'md-arrow-dropdown'
  561. : 'md-arrow-dropright'
  562. "
  563. style="vertical-align: middle;"
  564. />
  565. </Col>
  566. </Row>
  567. <Row style="margin-top:20px" v-if="matched_info.isCurrenct">
  568. <Col span="4">
  569. <span>区域名称:</span>
  570. <span>
  571. <Select
  572. filterable
  573. multiple
  574. transfer
  575. clearable
  576. filter-by-label
  577. v-model="matchedInfo.region"
  578. :max-tag-count="2"
  579. size="small"
  580. style="width: 150px"
  581. >
  582. <Option
  583. v-for="(item, index) in regionMatchedList"
  584. :key="index"
  585. :label="item"
  586. :value="item"
  587. ></Option>
  588. </Select>
  589. </span>
  590. </Col>
  591. <Col span="4">
  592. <span>房号:</span>
  593. <span>
  594. <Select
  595. filterable
  596. multiple
  597. transfer
  598. clearable
  599. filter-by-label
  600. v-model="matchedInfo.number"
  601. :max-tag-count="2"
  602. size="small"
  603. style="width: 150px"
  604. >
  605. <Option
  606. v-for="(item, index) in numberMatchedList"
  607. :key="index"
  608. :label="item"
  609. :value="item"
  610. ></Option>
  611. </Select>
  612. </span>
  613. </Col>
  614. <Col span="4">
  615. <span>部件名称:</span>
  616. <span>
  617. <Select
  618. filterable
  619. multiple
  620. transfer
  621. clearable
  622. filter-by-label
  623. v-model="matchedInfo.part_name"
  624. :max-tag-count="2"
  625. size="small"
  626. style="width: 150px"
  627. >
  628. <Option
  629. v-for="(item, index) in partNameMatchedList"
  630. :key="index"
  631. :label="item"
  632. :value="item"
  633. ></Option>
  634. </Select>
  635. </span>
  636. </Col>
  637. <Col span="2">
  638. <Button
  639. @click="getMatchedDetailList(matched_info)"
  640. size="small"
  641. type="primary"
  642. >
  643. 搜索
  644. </Button>
  645. </Col>
  646. </Row>
  647. <div v-if="matched_info.isCurrenct">
  648. <div
  649. v-for="(matched_detail, index) in matchedDetailList"
  650. :key="index"
  651. >
  652. <Row type="flex" align="middle">
  653. <Col span="10" style="padding:10px 0">
  654. <span>匹配信息:</span>
  655. <span
  656. v-for="(matched_info, index) in matched_detail.special"
  657. :key="index"
  658. >
  659. {{ matched_info.key }}={{ matched_info.value }}
  660. </span>
  661. <span>{{ matched_detail.num }}组</span>
  662. </Col>
  663. <Col span="2" offset="12" style="padding:10px 0">
  664. <Button
  665. @click="handleHiddenMatchedDetail(matched_detail)"
  666. size="small"
  667. type="text"
  668. >
  669. {{ !matched_detail.isHidden ? "展开" : "收缩" }}
  670. </Button>
  671. </Col>
  672. </Row>
  673. <Table
  674. v-show="matched_detail.isHidden"
  675. :columns="matchedSheetTableColumns"
  676. border
  677. :ref="'matched' + index"
  678. :max-height="500"
  679. :data="matched_detail.detail"
  680. >
  681. <!-- @on-selection-change="handleMatchedSelectChange" -->
  682. <!-- <template slot="setSlot" slot-scope="{ row, index }">
  683. <a @click="handleMatchedSet(row, index, 5)">撤销匹配 </a>
  684. </template> -->
  685. </Table>
  686. </div>
  687. </div>
  688. </div>
  689. </TabPane>
  690. </Tabs>
  691. </div>
  692. <Modal width="80" v-model="showHandingMatchModal" title="手动匹配确认">
  693. <div>
  694. <Row style="padding:10px 0 ">
  695. <Col span="8">部件名称:{{ currentChooseTitle }}</Col>
  696. <Col span="6">未匹配数量:{{ currentChooseNumber }}</Col>
  697. <Col span="4"
  698. >余:{{ currentChooseNumber - currentChooseNumberUsed }}</Col
  699. >
  700. <Col span="4" offset="2">
  701. <Button size="small" @click="handleHandingMatchAVG">
  702. 平均分配
  703. </Button>
  704. </Col>
  705. </Row>
  706. </div>
  707. <div>
  708. <Table
  709. :columns="unmatchedRoomTableColumnsModal"
  710. border
  711. :max-height="500"
  712. :data="unmatchedSelectedList"
  713. >
  714. <template slot="numSlot" slot-scope="{ index }">
  715. <Input
  716. @on-change="handleHandingMatchNumChange"
  717. v-model="unmatchedSelectedList[index].num"
  718. />
  719. </template>
  720. </Table>
  721. </div>
  722. <div slot="footer">
  723. <Button @click="showHandingMatchModal = false">取消</Button>
  724. <Button type="primary" @click="handleHandingMatch">确定</Button>
  725. </div>
  726. </Modal>
  727. </div>
  728. </template>
  729. <script>
  730. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  731. // 例如:import 《组件名称》 from '《组件路径》';
  732. export default {
  733. name: "",
  734. components: {},
  735. props: {},
  736. // import引入的组件需要注入到对象中才能使用
  737. data() {
  738. // 这里存放数据
  739. return {
  740. currencyTag: "1", //当前分页
  741. info: {
  742. id: this.$route.query.id,
  743. project_number: this.$route.query.project_number,
  744. project_name: this.$route.query.project_name,
  745. cut_size: "",
  746. number: "",
  747. part_name: "",
  748. region: "",
  749. wool_size1: "",
  750. wool_size2: "",
  751. image_number: [],
  752. product_name: [],
  753. },
  754. matchedInfo: {
  755. id: this.$route.query.id,
  756. image_number: [],
  757. product_name: [],
  758. },
  759. cut_size: [], //精裁尺寸 未匹配
  760. number: [], //房号 未匹配
  761. part_name: [], //部件名称 未匹配
  762. regionList: [], //区域名称 未匹配
  763. wool_size1: [], //毛料尺寸 未匹配
  764. wool_size2: [], //毛料尺寸 已匹配
  765. urlSelectList: [], //图号列表 未匹配
  766. productList: [], //产品列表 未匹配
  767. urlMatchedList: [], //图号列表 已匹配
  768. productMatchedList: [], //产品列表 已匹配
  769. regionMatchedList: [], //区域列表 已匹配
  770. numberMatchedList: [], //房号列表 已匹配
  771. partNameMatchedList: [], //部件列表 已匹配
  772. unmatchedObj: {
  773. urlList: [], //图号列表
  774. part_list: [], //当前图号下表格列表
  775. }, //码单信息
  776. unmatchedRoomList: {
  777. urlList: [], //图号列表
  778. house_list: [{ title: 1 }], //当前图号下表格列表
  779. }, //房间信息
  780. currentChooseId: "", //选中码单信息中的ID
  781. currentChooseNumber: 0, //选中码单信息中的ID
  782. currentChooseTitle: "", //选中码单信息中的ID
  783. currentChooseNumberUsed: "",
  784. matchedList: [],
  785. matchedDetailList: [],
  786. unmatchedSheetTableColumns: [
  787. {
  788. title: "选择",
  789. align: "center",
  790. minWidth: 60,
  791. render: (h, params) => {
  792. let id = params.row.id;
  793. let flag = false;
  794. if (this.currentChooseId == id) {
  795. flag = true;
  796. } else {
  797. flag = false;
  798. }
  799. let self = this;
  800. return h("div", [
  801. h("Radio", {
  802. props: {
  803. value: flag,
  804. },
  805. on: {
  806. "on-change": () => {
  807. self.currentChooseId = params.row.id;
  808. self.currentChooseNumber = params.row.unbind_number;
  809. self.currentChooseTitle = params.row.part_name;
  810. },
  811. },
  812. }),
  813. ]);
  814. },
  815. },
  816. { title: "序号", align: "center", type: "index", minWidth: 60 },
  817. { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
  818. { title: "行号", align: "center", key: "line", minWidth: 70 },
  819. { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
  820. {
  821. title: "原材料",
  822. align: "center",
  823. minWidth: 80,
  824. render: (h, params) => {
  825. return h("span", {}, params.row.board1 + ";" + params.row.board2);
  826. },
  827. },
  828. { title: "木皮2", align: "center", key: "skin2", minWidth: 60 },
  829. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 80 },
  830. {
  831. title: "原料数量",
  832. align: "center",
  833. key: "wool_number",
  834. minWidth: 80,
  835. },
  836. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 80 },
  837. {
  838. title: "零部件数量",
  839. align: "center",
  840. key: "cut_number",
  841. minWidth: 90,
  842. },
  843. {
  844. title: "未匹配数量",
  845. align: "center",
  846. key: "unbind_number",
  847. minWidth: 90,
  848. },
  849. { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
  850. { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
  851. { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
  852. ], //未匹配码单表头
  853. unmatchedRoomTableColumns: [
  854. { title: "全选", align: "center", minWidth: 60, type: "selection" },
  855. { title: "序号", align: "center", type: "index", minWidth: 60 },
  856. { title: "区域", align: "center", key: "region", minWidth: 60 },
  857. { title: "楼栋", align: "center", key: "house", minWidth: 60 },
  858. { title: "单元", align: "center", key: "unit", minWidth: 60 },
  859. { title: "楼层", align: "center", key: "layer", minWidth: 60 },
  860. { title: "房号", align: "center", key: "number", minWidth: 60 },
  861. ], //未匹配房间表头
  862. unmatchedRoomTableColumnsUsed: [],
  863. matchedSheetTableColumns: [
  864. // { title: "全选", align: "center", minWidth: 60, type: "selection" },
  865. { title: "序号", align: "center", type: "index", minWidth: 60 },
  866. { title: "区域名称", align: "center", key: "region", minWidth: 100 },
  867. { title: "房号", align: "center", key: "house_number", minWidth: 100 },
  868. { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
  869. { title: "行号", align: "center", key: "line", minWidth: 80 },
  870. { title: "木皮1", align: "center", key: "skin1", minWidth: 100 },
  871. {
  872. title: "原材料",
  873. align: "center",
  874. minWidth: 100,
  875. render: (h, params) => {
  876. return h("span", {}, params.row.board1 + ";" + params.row.board2);
  877. },
  878. },
  879. { title: "木皮2", align: "center", key: "skin2", minWidth: 100 },
  880. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 100 },
  881. {
  882. title: "原料数量",
  883. align: "center",
  884. key: "wool_number",
  885. minWidth: 80,
  886. },
  887. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 100 },
  888. {
  889. title: "零部件数量",
  890. align: "center",
  891. key: "num",
  892. minWidth: 80,
  893. },
  894. { title: "贴皮面积", align: "center", key: "stick", minWidth: 100 },
  895. { title: "精裁面积", align: "center", key: "cut", minWidth: 100 },
  896. { title: "工艺要求", align: "center", key: "remark", minWidth: 60 },
  897. // {
  898. // title: "操作",
  899. // align: "center",
  900. // key: "title",
  901. // minWidth: 80,
  902. // slot: "setSlot",
  903. // },
  904. ], //匹配表头
  905. unmatchedRoomTableColumnsModal: [],
  906. unmatchedSelectedList: [],
  907. matchedSelectedList: [],
  908. showHandingMatchModal: false,
  909. isMatchedSelectAll: false,
  910. matchedReopenTag: "",
  911. matchedReopenList: [],
  912. isClickMatch: true,
  913. };
  914. },
  915. // 生命周期 - 创建完成(可以访问当前this实例)
  916. created() {},
  917. // 生命周期 - 挂载完成(可以访问DOM元素)
  918. mounted() {
  919. this.handleSearchUnmatchedInfo();
  920. },
  921. methods: {
  922. back() {
  923. this.$router.go(-1);
  924. },
  925. handleSelectChange(selection) {
  926. this.unmatchedSelectedList = selection;
  927. this.unmatchedSelectedList.map((v) => (v.num = ""));
  928. },
  929. handleMatchedSelectChange(selection) {
  930. this.matchedSelectedList = this.matchedSelectedList.concat(
  931. selection.map((v) => {
  932. return v.cut_order_product_id;
  933. })
  934. );
  935. },
  936. handleTabsClick(name) {
  937. name == 2 && this.handleMatchedListInit();
  938. name == 1 && this.handleSearchUnmatchedInfo();
  939. },
  940. handleMatchedListInit() {
  941. this.axios
  942. .get("/api/bst_matching_on_product_list", {
  943. params: {
  944. id: this.info.id,
  945. image_number: this.matchedInfo.image_number,
  946. product_name: this.matchedInfo.product_name,
  947. },
  948. })
  949. .then((res) => {
  950. res.data.list.map((v) => {
  951. v.isCurrenct = false;
  952. });
  953. this.matchedList = res.data.list;
  954. this.urlMatchedList = res.data.image_number;
  955. this.productMatchedList = res.data.product_name;
  956. });
  957. },
  958. handleShowCurrencySheet(row, type) {
  959. if (row.isCurrenct) {
  960. row.isCurrenct = !row.isCurrenct;
  961. } else {
  962. this.unmatchedObj.urlList.map((v) => (v.isCurrenct = false));
  963. row.isCurrenct = true;
  964. this.matchedReopenTag = row.id;
  965. }
  966. this.getSheetDetailList(row, type);
  967. },
  968. handleHiddenSheetDetail(row) {
  969. if (row.isHidden) {
  970. row.isHidden = !row.isHidden;
  971. } else {
  972. row.isHidden = true;
  973. }
  974. this.matchedReopenList = [];
  975. this.unmatchedObj.part_list.map((v) => {
  976. if (v.isHidden) {
  977. this.matchedReopenList.push(
  978. v.key.list
  979. .map((w) => {
  980. return w.value;
  981. })
  982. .join("*")
  983. );
  984. }
  985. });
  986. console.log(`this.matchedReopenList`, this.matchedReopenList);
  987. this.$forceUpdate();
  988. },
  989. handleHiddenMatchedDetail(row) {
  990. if (row.isHidden) {
  991. row.isHidden = !row.isHidden;
  992. } else {
  993. row.isHidden = true;
  994. }
  995. this.$forceUpdate();
  996. },
  997. handleShowCurrencyMatched(row) {
  998. if (row.isCurrenct) {
  999. row.isCurrenct = !row.isCurrenct;
  1000. } else {
  1001. this.matchedList.map((v) => (v.isCurrenct = false));
  1002. row.isCurrenct = true;
  1003. }
  1004. this.getMatchedDetailList(row);
  1005. },
  1006. getSheetDetailList(row, type) {
  1007. switch (type) {
  1008. case 1:
  1009. row.isCurrenct &&
  1010. this.axios
  1011. .post("/api/bst_matching_un_product_detail", {
  1012. cut_order_product_id: row.id,
  1013. id: this.info.id,
  1014. cut_size: this.info.cut_size,
  1015. number: this.info.number,
  1016. part_name: this.info.part_name,
  1017. region: this.info.region,
  1018. wool_size1: this.info.wool_size1,
  1019. key: this.matchedReopenList,
  1020. })
  1021. .then((res) => {
  1022. console.log(`123`, 123);
  1023. this.unmatchedObj.part_list = [];
  1024. this.unmatchedObj.part_list = res.data.part_list;
  1025. this.unmatchedObj.part_list = res.data.part_list;
  1026. this.unmatchedObj.part_list.forEach((v) => {
  1027. v.isHidden = true;
  1028. });
  1029. this.unmatchedRoomList.house_list = [];
  1030. this.unmatchedRoomList.house_list = res.data.house_list;
  1031. this.unmatchedRoomList.house_list.forEach((v) => {
  1032. this.unmatchedObj.part_list[0].key.list.forEach((item) => {
  1033. v[item.key] = item.value;
  1034. });
  1035. });
  1036. this.unmatchedRoomTableColumnsUsed = this.unmatchedRoomTableColumns.concat(
  1037. res.data.head_word.map((v) => {
  1038. return { title: v, align: "center", key: v, minWidth: 60 };
  1039. })
  1040. );
  1041. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsUsed.concat(
  1042. {
  1043. title: "匹配数量",
  1044. align: "center",
  1045. minWidth: 60,
  1046. slot: "numSlot",
  1047. }
  1048. );
  1049. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(
  1050. 1
  1051. );
  1052. this.cut_size = res.data.search_word.cut_size;
  1053. this.number = res.data.search_word.number;
  1054. this.part_name = res.data.search_word.part_name;
  1055. this.regionList = res.data.search_word.region;
  1056. this.wool_size1 = res.data.search_word.wool_size1;
  1057. this.wool_size2 = res.data.search_word.wool_size2;
  1058. this.unmatchedObj.part_list.map((v) => {
  1059. if (v.state == 1) {
  1060. v.isHidden = true;
  1061. }
  1062. });
  1063. this.$forceUpdate();
  1064. });
  1065. break;
  1066. case 2:
  1067. row.isCurrenct &&
  1068. this.axios
  1069. .post("/api/bst_matching_un_product_detail", {
  1070. cut_order_product_id: row.id,
  1071. id: this.info.id,
  1072. cut_size: this.info.cut_size,
  1073. number: this.info.number,
  1074. part_name: this.info.part_name,
  1075. region: this.info.region,
  1076. wool_size2: this.info.wool_size2,
  1077. key: this.matchedReopenList,
  1078. })
  1079. .then((res) => {
  1080. this.unmatchedRoomList.house_list = res.data.house_list;
  1081. this.unmatchedRoomTableColumnsUsed = this.unmatchedRoomTableColumns.concat(
  1082. res.data.head_word.map((v) => {
  1083. return { title: v, align: "center", key: v, minWidth: 60 };
  1084. })
  1085. );
  1086. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsUsed.concat(
  1087. {
  1088. title: "匹配数量",
  1089. align: "center",
  1090. minWidth: 60,
  1091. slot: "numSlot",
  1092. }
  1093. );
  1094. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(
  1095. 1
  1096. );
  1097. this.cut_size = res.data.search_word.cut_size;
  1098. this.number = res.data.search_word.number;
  1099. this.part_name = res.data.search_word.part_name;
  1100. this.regionList = res.data.search_word.region;
  1101. this.wool_size1 = res.data.search_word.wool_size1;
  1102. this.wool_size2 = res.data.search_word.wool_size2;
  1103. this.unmatchedObj.part_list.map((v) => {
  1104. if (v.state == 1) {
  1105. v.isHidden = true;
  1106. }
  1107. });
  1108. this.$forceUpdate();
  1109. });
  1110. break;
  1111. }
  1112. },
  1113. getMatchedDetailList(row) {
  1114. row.isCurrenct &&
  1115. this.axios
  1116. .get("/api/bst_matching_on_product_detail", {
  1117. params: {
  1118. cut_order_product_id: row.id || 14,
  1119. id: this.matchedInfo.id,
  1120. number: this.matchedInfo.number,
  1121. part_name: this.matchedInfo.part_name,
  1122. region: this.matchedInfo.region,
  1123. },
  1124. })
  1125. .then((res) => {
  1126. this.regionMatchedList = res.data.region;
  1127. this.numberMatchedList = res.data.number;
  1128. this.partNameMatchedList = res.data.part_name;
  1129. this.matchedDetailList = res.data.list;
  1130. });
  1131. },
  1132. handleSearchUnmatchedInfo() {
  1133. this.axios({
  1134. method: "get",
  1135. url: "/api/bst_matching_un_product_list",
  1136. params: {
  1137. id: this.info.id,
  1138. image_number: this.info.image_number,
  1139. product_name: this.info.product_name,
  1140. },
  1141. }).then((res) => {
  1142. if (res.code == 200) {
  1143. let data = [];
  1144. res.data.list.map((v) => (v.isCurrenct = false));
  1145. res.data.list.forEach((element) => {
  1146. if (element.number != 0) {
  1147. data.push(element);
  1148. }
  1149. });
  1150. this.unmatchedObj.urlList = data;
  1151. this.urlSelectList = res.data.image_number;
  1152. this.productList = res.data.product_name;
  1153. this.unmatchedSelectedList = [];
  1154. this.unmatchedObj.urlList.map((v) => {
  1155. if (v.id == this.matchedReopenTag) {
  1156. v.isCurrenct = true;
  1157. if (this.isClickMatch) {
  1158. this.getSheetDetailList(v, 1);
  1159. }
  1160. }
  1161. });
  1162. this.$forceUpdate();
  1163. }
  1164. });
  1165. },
  1166. handleHandingMatchAVG() {
  1167. let num = parseInt(
  1168. this.currentChooseNumber / this.unmatchedSelectedList.length
  1169. );
  1170. this.unmatchedSelectedList.map((v) => {
  1171. v.num = num;
  1172. });
  1173. this.unmatchedSelectedList = JSON.parse(
  1174. JSON.stringify(this.unmatchedSelectedList)
  1175. );
  1176. this.handleHandingMatchNumChange();
  1177. },
  1178. handleIsAllowHandingMatch() {
  1179. if (this.unmatchedSelectedList.length < 1 || !this.currentChooseNumber) {
  1180. return this.$Message.warning("请选择");
  1181. }
  1182. if (this.currentChooseNumber < this.unmatchedSelectedList.length) {
  1183. return this.$Message.warning("未匹配数量不足,请重新选择");
  1184. }
  1185. this.showHandingMatchModal = true;
  1186. },
  1187. handleHandingMatchNumChange() {
  1188. let sum = 0;
  1189. this.unmatchedSelectedList.map((v) => {
  1190. sum += v.num * 1;
  1191. });
  1192. this.currentChooseNumberUsed = sum;
  1193. },
  1194. handleAutoMatching() {
  1195. this.axios
  1196. .post("/api/matching_product_house", {
  1197. id: this.info.id,
  1198. image_number: this.info.image_number,
  1199. product_title: this.info.product_name,
  1200. })
  1201. .then((res) => {
  1202. if (res.code == 200) {
  1203. this.$Message.success(res.msg);
  1204. this.handleSearchUnmatchedInfo();
  1205. }
  1206. });
  1207. },
  1208. handleHandingMatch() {
  1209. const house = this.unmatchedSelectedList.map((v) => {
  1210. return { cut_order_product_room_id: v.id, num: v.num };
  1211. });
  1212. this.axios
  1213. .post("/api/bst_hand_matching", {
  1214. cut_order_product_detail_id: this.currentChooseId,
  1215. house,
  1216. })
  1217. .then((res) => {
  1218. if (res.code == 200) {
  1219. this.$Message.success(res.msg);
  1220. this.showHandingMatchModal = false;
  1221. this.currentChooseId = "";
  1222. this.currentChooseNumber = 0;
  1223. this.currentChooseNumberUsed = 0;
  1224. this.currentChooseTitle = "";
  1225. this.unmatchedSelectedList = [];
  1226. this.isClickMatch = true;
  1227. this.handleSearchUnmatchedInfo();
  1228. }
  1229. });
  1230. },
  1231. handleMatchedSelectAll() {
  1232. this.isMatchedSelectAll = !this.isMatchedSelectAll;
  1233. this.matchedList.map((v) => {
  1234. if (v.produce_status == 0) {
  1235. v.isSelect = this.isMatchedSelectAll;
  1236. this.matchedSelectedList.push(v.id);
  1237. }
  1238. });
  1239. },
  1240. handleMatchedSelect(row, e) {
  1241. row.isSelect = e;
  1242. let flag = true;
  1243. this.matchedSelectedList = [];
  1244. this.matchedList.map((v) => {
  1245. if (v.produce_status == 0) {
  1246. if (v.isSelect) {
  1247. this.matchedSelectedList.push(v.id);
  1248. } else {
  1249. flag = false;
  1250. }
  1251. }
  1252. });
  1253. this.isMatchedSelectAll = flag;
  1254. },
  1255. handleMatchedSet(row, index, type) {
  1256. if (this.matchedSelectedList.length == 0) {
  1257. return this.$Message.warning("请选择");
  1258. }
  1259. switch (type) {
  1260. case 5:
  1261. if (index == -1) {
  1262. this.matchedSelectedList = [row.id];
  1263. } else {
  1264. this.matchedSelectedList = [];
  1265. this.matchedList.map((v) => {
  1266. v.isSelect && this.matchedSelectedList.push(v.id);
  1267. });
  1268. }
  1269. this.axios
  1270. .post("/api/bst_cancer_matching", {
  1271. cut_order_product_id: this.matchedSelectedList,
  1272. })
  1273. .then((res) => {
  1274. if (res.code == 200) {
  1275. this.$Message.success(res.msg);
  1276. this.handleMatchedListInit();
  1277. this.isMatchedSelectAll = false;
  1278. }
  1279. });
  1280. break;
  1281. }
  1282. },
  1283. },
  1284. // 监听属性 类似于data概念
  1285. computed: {},
  1286. // 监控data中的数据变化
  1287. watch: {},
  1288. beforeCreate() {}, // 生命周期 - 创建之前
  1289. beforeMount() {}, // 生命周期 - 挂载之前
  1290. beforeUpdate() {}, // 生命周期 - 更新之前
  1291. updated() {}, // 生命周期 - 更新之后
  1292. beforeDestroy() {}, // 生命周期 - 销毁之前
  1293. destroyed() {}, // 生命周期 - 销毁完成
  1294. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  1295. };
  1296. </script>
  1297. <style lang="scss" scoped>
  1298. .top-info {
  1299. padding: 10px;
  1300. font-size: 18px;
  1301. }
  1302. .context-tabs {
  1303. position: relative;
  1304. max-height: 80%;
  1305. overflow: hidden;
  1306. overflow-y: auto;
  1307. padding: 15px;
  1308. margin: 10px;
  1309. margin-bottom: 30px;
  1310. border-radius: 5px;
  1311. box-shadow: 1px 1px 5px 1px #999;
  1312. // 未匹配样式
  1313. .context-unmatched-sheet-table,
  1314. .context-unmatched-room-table {
  1315. }
  1316. .context-unmatched-sheet-search,
  1317. .context-unmatched-room-search {
  1318. padding: 10px 0;
  1319. }
  1320. // 匹配样式
  1321. .matched-block {
  1322. padding: 15px;
  1323. margin-bottom: 30px;
  1324. background-color: #e9ecef;
  1325. border-radius: 5px;
  1326. }
  1327. }
  1328. /deep/.ivu-tabs-nav-scroll {
  1329. display: flex;
  1330. justify-content: center;
  1331. }
  1332. /deep/.ivu-table-cell {
  1333. padding: 0;
  1334. }
  1335. .sheet-block,
  1336. .room-block {
  1337. max-height: 100%;
  1338. overflow: hidden;
  1339. overflow-y: auto;
  1340. }
  1341. </style>