matchPage.vue 43 KB

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