matchPage.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347
  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: "compose_name", minWidth: 100 },
  818. { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
  819. { title: "行号", align: "center", key: "line", minWidth: 70 },
  820. { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
  821. {
  822. title: "原材料",
  823. align: "center",
  824. minWidth: 80,
  825. render: (h, params) => {
  826. return h("span", {}, params.row.board1 + (params.row.board2?(';'+params.row.board2):''));
  827. },
  828. },
  829. { title: "木皮2", align: "center", key: "skin2", minWidth: 60 },
  830. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 80 },
  831. {
  832. title: "原料数量",
  833. align: "center",
  834. key: "wool_number",
  835. minWidth: 80,
  836. },
  837. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 80 },
  838. {
  839. title: "零部件数量",
  840. align: "center",
  841. key: "cut_number",
  842. minWidth: 90,
  843. },
  844. {
  845. title: "未匹配数量",
  846. align: "center",
  847. key: "unbind_number",
  848. minWidth: 90,
  849. },
  850. { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
  851. { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
  852. { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
  853. ], //未匹配码单表头
  854. unmatchedRoomTableColumns: [
  855. { title: "全选", align: "center", minWidth: 60, type: "selection" },
  856. { title: "序号", align: "center", type: "index", minWidth: 60 },
  857. { title: "区域", align: "center", key: "region", minWidth: 60 },
  858. { title: "楼栋", align: "center", key: "house", minWidth: 60 },
  859. { title: "单元", align: "center", key: "unit", minWidth: 60 },
  860. { title: "楼层", align: "center", key: "layer", minWidth: 60 },
  861. { title: "房号", align: "center", key: "number", minWidth: 60 },
  862. ], //未匹配房间表头
  863. unmatchedRoomTableColumnsUsed: [],
  864. matchedSheetTableColumns: [
  865. // { title: "全选", align: "center", minWidth: 60, type: "selection" },
  866. { title: "序号", align: "center", type: "index", minWidth: 60 },
  867. // { title: "组合名称", align: "center", key:'compose_name', minWidth: 100 },
  868. { title: "区域名称", align: "center", key: "region", minWidth: 100 },
  869. { title: "房号", align: "center", key: "house_number", minWidth: 100 },
  870. { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
  871. { title: "行号", align: "center", key: "line", minWidth: 80 },
  872. { title: "木皮1", align: "center", key: "skin1", minWidth: 100 },
  873. {
  874. title: "原材料",
  875. align: "center",
  876. minWidth: 100,
  877. render: (h, params) => {
  878. return h("span", {}, params.row.board1 + (params.row.board2?(';'+params.row.board2):''));
  879. },
  880. },
  881. { title: "木皮2", align: "center", key: "skin2", minWidth: 100 },
  882. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 100 },
  883. {
  884. title: "原料数量",
  885. align: "center",
  886. key: "wool_number",
  887. minWidth: 80,
  888. },
  889. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 100 },
  890. {
  891. title: "零部件数量",
  892. align: "center",
  893. key: "num",
  894. minWidth: 80,
  895. },
  896. { title: "贴皮面积", align: "center", key: "stick", minWidth: 100 },
  897. { title: "精裁面积", align: "center", key: "cut", minWidth: 100 },
  898. { title: "工艺要求", align: "center", key: "remark", minWidth: 60 },
  899. // {
  900. // title: "操作",
  901. // align: "center",
  902. // key: "title",
  903. // minWidth: 80,
  904. // slot: "setSlot",
  905. // },
  906. ], //匹配表头
  907. unmatchedRoomTableColumnsModal: [],
  908. unmatchedSelectedList: [],
  909. matchedSelectedList: [],
  910. showHandingMatchModal: false,
  911. isMatchedSelectAll: false,
  912. matchedReopenTag: "",
  913. matchedReopenList: [],
  914. isClickMatch: true,
  915. };
  916. },
  917. // 生命周期 - 创建完成(可以访问当前this实例)
  918. created() {},
  919. // 生命周期 - 挂载完成(可以访问DOM元素)
  920. mounted() {
  921. this.handleSearchUnmatchedInfo();
  922. },
  923. methods: {
  924. back() {
  925. this.$router.go(-1);
  926. },
  927. handleSelectChange(selection) {
  928. this.unmatchedSelectedList = selection;
  929. this.unmatchedSelectedList.map((v) => (v.num = ""));
  930. },
  931. handleMatchedSelectChange(selection) {
  932. this.matchedSelectedList = this.matchedSelectedList.concat(
  933. selection.map((v) => {
  934. return v.cut_order_product_id;
  935. })
  936. );
  937. },
  938. handleTabsClick(name) {
  939. name == 2 && this.handleMatchedListInit();
  940. name == 1 && this.handleSearchUnmatchedInfo();
  941. },
  942. handleMatchedListInit() {
  943. this.axios
  944. .get("/api/bst_matching_on_product_list", {
  945. params: {
  946. id: this.info.id,
  947. image_number: this.matchedInfo.image_number,
  948. product_name: this.matchedInfo.product_name,
  949. },
  950. })
  951. .then((res) => {
  952. res.data.list.map((v) => {
  953. v.isCurrenct = false;
  954. });
  955. this.matchedList = res.data.list;
  956. this.urlMatchedList = res.data.image_number;
  957. this.productMatchedList = res.data.product_name;
  958. });
  959. },
  960. handleShowCurrencySheet(row, type) {
  961. if (row.isCurrenct) {
  962. row.isCurrenct = !row.isCurrenct;
  963. } else {
  964. this.unmatchedObj.urlList.map((v) => (v.isCurrenct = false));
  965. row.isCurrenct = true;
  966. this.matchedReopenTag = row.id;
  967. }
  968. this.getSheetDetailList(row, type);
  969. },
  970. handleHiddenSheetDetail(row) {
  971. if (row.isHidden) {
  972. row.isHidden = !row.isHidden;
  973. } else {
  974. row.isHidden = true;
  975. }
  976. this.matchedReopenList = [];
  977. this.unmatchedObj.part_list.map((v) => {
  978. if (v.isHidden) {
  979. this.matchedReopenList.push(
  980. v.key.list
  981. .map((w) => {
  982. return w.value;
  983. })
  984. .join("*")
  985. );
  986. }
  987. });
  988. console.log(`this.matchedReopenList`, this.matchedReopenList);
  989. this.$forceUpdate();
  990. },
  991. handleHiddenMatchedDetail(row) {
  992. if (row.isHidden) {
  993. row.isHidden = !row.isHidden;
  994. } else {
  995. row.isHidden = true;
  996. }
  997. this.$forceUpdate();
  998. },
  999. handleShowCurrencyMatched(row) {
  1000. if (row.isCurrenct) {
  1001. row.isCurrenct = !row.isCurrenct;
  1002. } else {
  1003. this.matchedList.map((v) => (v.isCurrenct = false));
  1004. row.isCurrenct = true;
  1005. }
  1006. this.getMatchedDetailList(row);
  1007. },
  1008. getSheetDetailList(row, type) {
  1009. switch (type) {
  1010. case 1:
  1011. row.isCurrenct &&
  1012. this.axios
  1013. .post("/api/bst_matching_un_product_detail", {
  1014. cut_order_product_id: row.id,
  1015. id: this.info.id,
  1016. cut_size: this.info.cut_size,
  1017. number: this.info.number,
  1018. part_name: this.info.part_name,
  1019. region: this.info.region,
  1020. wool_size1: this.info.wool_size1,
  1021. key: this.matchedReopenList,
  1022. })
  1023. .then((res) => {
  1024. console.log(`123`, 123);
  1025. this.unmatchedObj.part_list = [];
  1026. this.unmatchedObj.part_list = res.data.part_list;
  1027. this.unmatchedObj.part_list = res.data.part_list;
  1028. this.unmatchedObj.part_list.forEach((v) => {
  1029. v.isHidden = true;
  1030. });
  1031. this.unmatchedRoomList.house_list = [];
  1032. this.unmatchedRoomList.house_list = res.data.house_list;
  1033. this.unmatchedRoomList.house_list.forEach((v) => {
  1034. this.unmatchedObj.part_list[0].key.list.forEach((item) => {
  1035. v[item.key] = item.value;
  1036. });
  1037. });
  1038. this.unmatchedRoomTableColumnsUsed = this.unmatchedRoomTableColumns.concat(
  1039. res.data.head_word.map((v) => {
  1040. return { title: v, align: "center", key: v, minWidth: 60 };
  1041. })
  1042. );
  1043. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsUsed.concat(
  1044. {
  1045. title: "匹配数量",
  1046. align: "center",
  1047. minWidth: 60,
  1048. slot: "numSlot",
  1049. }
  1050. );
  1051. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(
  1052. 1
  1053. );
  1054. this.cut_size = res.data.search_word.cut_size;
  1055. this.number = res.data.search_word.number;
  1056. this.part_name = res.data.search_word.part_name;
  1057. this.regionList = res.data.search_word.region;
  1058. this.wool_size1 = res.data.search_word.wool_size1;
  1059. this.wool_size2 = res.data.search_word.wool_size2;
  1060. this.unmatchedObj.part_list.map((v) => {
  1061. if (v.state == 1) {
  1062. v.isHidden = true;
  1063. }
  1064. });
  1065. this.$forceUpdate();
  1066. });
  1067. break;
  1068. case 2:
  1069. row.isCurrenct &&
  1070. this.axios
  1071. .post("/api/bst_matching_un_product_detail", {
  1072. cut_order_product_id: row.id,
  1073. id: this.info.id,
  1074. cut_size: this.info.cut_size,
  1075. number: this.info.number,
  1076. part_name: this.info.part_name,
  1077. region: this.info.region,
  1078. wool_size2: this.info.wool_size2,
  1079. key: this.matchedReopenList,
  1080. })
  1081. .then((res) => {
  1082. this.unmatchedRoomList.house_list = res.data.house_list;
  1083. this.unmatchedRoomTableColumnsUsed = this.unmatchedRoomTableColumns.concat(
  1084. res.data.head_word.map((v) => {
  1085. return { title: v, align: "center", key: v, minWidth: 60 };
  1086. })
  1087. );
  1088. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsUsed.concat(
  1089. {
  1090. title: "匹配数量",
  1091. align: "center",
  1092. minWidth: 60,
  1093. slot: "numSlot",
  1094. }
  1095. );
  1096. this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(
  1097. 1
  1098. );
  1099. this.cut_size = res.data.search_word.cut_size;
  1100. this.number = res.data.search_word.number;
  1101. this.part_name = res.data.search_word.part_name;
  1102. this.regionList = res.data.search_word.region;
  1103. this.wool_size1 = res.data.search_word.wool_size1;
  1104. this.wool_size2 = res.data.search_word.wool_size2;
  1105. this.unmatchedObj.part_list.map((v) => {
  1106. if (v.state == 1) {
  1107. v.isHidden = true;
  1108. }
  1109. });
  1110. this.$forceUpdate();
  1111. });
  1112. break;
  1113. }
  1114. },
  1115. getMatchedDetailList(row) {
  1116. row.isCurrenct &&
  1117. this.axios
  1118. .get("/api/bst_matching_on_product_detail", {
  1119. params: {
  1120. cut_order_product_id: row.id || 14,
  1121. id: this.matchedInfo.id,
  1122. number: this.matchedInfo.number,
  1123. part_name: this.matchedInfo.part_name,
  1124. region: this.matchedInfo.region,
  1125. },
  1126. })
  1127. .then((res) => {
  1128. this.regionMatchedList = res.data.region;
  1129. this.numberMatchedList = res.data.number;
  1130. this.partNameMatchedList = res.data.part_name;
  1131. this.matchedDetailList = res.data.list;
  1132. });
  1133. },
  1134. handleSearchUnmatchedInfo() {
  1135. this.axios({
  1136. method: "get",
  1137. url: "/api/bst_matching_un_product_list",
  1138. params: {
  1139. id: this.info.id,
  1140. image_number: this.info.image_number,
  1141. product_name: this.info.product_name,
  1142. },
  1143. }).then((res) => {
  1144. if (res.code == 200) {
  1145. let data = [];
  1146. res.data.list.map((v) => (v.isCurrenct = false));
  1147. res.data.list.forEach((element) => {
  1148. if (element.number != 0) {
  1149. data.push(element);
  1150. }
  1151. });
  1152. this.unmatchedObj.urlList = data;
  1153. this.urlSelectList = res.data.image_number;
  1154. this.productList = res.data.product_name;
  1155. this.unmatchedSelectedList = [];
  1156. this.unmatchedObj.urlList.map((v) => {
  1157. if (v.id == this.matchedReopenTag) {
  1158. v.isCurrenct = true;
  1159. if (this.isClickMatch) {
  1160. this.getSheetDetailList(v, 1);
  1161. }
  1162. }
  1163. });
  1164. this.$forceUpdate();
  1165. }
  1166. });
  1167. },
  1168. handleHandingMatchAVG() {
  1169. let num = parseInt(
  1170. this.currentChooseNumber / this.unmatchedSelectedList.length
  1171. );
  1172. this.unmatchedSelectedList.map((v) => {
  1173. v.num = num;
  1174. });
  1175. this.unmatchedSelectedList = JSON.parse(
  1176. JSON.stringify(this.unmatchedSelectedList)
  1177. );
  1178. this.handleHandingMatchNumChange();
  1179. },
  1180. handleIsAllowHandingMatch() {
  1181. if (this.unmatchedSelectedList.length < 1 || !this.currentChooseNumber) {
  1182. return this.$Message.warning("请选择");
  1183. }
  1184. if (this.currentChooseNumber < this.unmatchedSelectedList.length) {
  1185. return this.$Message.warning("未匹配数量不足,请重新选择");
  1186. }
  1187. this.showHandingMatchModal = true;
  1188. },
  1189. handleHandingMatchNumChange() {
  1190. let sum = 0;
  1191. this.unmatchedSelectedList.map((v) => {
  1192. sum += v.num * 1;
  1193. });
  1194. this.currentChooseNumberUsed = sum;
  1195. },
  1196. handleAutoMatching() {
  1197. this.axios
  1198. .post("/api/matching_product_house", {
  1199. id: this.info.id,
  1200. image_number: this.info.image_number,
  1201. product_title: this.info.product_name,
  1202. })
  1203. .then((res) => {
  1204. if (res.code == 200) {
  1205. this.$Message.success(res.msg);
  1206. this.handleSearchUnmatchedInfo();
  1207. }
  1208. });
  1209. },
  1210. handleHandingMatch() {
  1211. const house = this.unmatchedSelectedList.map((v) => {
  1212. return { cut_order_product_room_id: v.id, num: v.num };
  1213. });
  1214. this.axios
  1215. .post("/api/bst_hand_matching", {
  1216. cut_order_product_detail_id: this.currentChooseId,
  1217. house,
  1218. })
  1219. .then((res) => {
  1220. if (res.code == 200) {
  1221. this.$Message.success(res.msg);
  1222. this.showHandingMatchModal = false;
  1223. this.currentChooseId = "";
  1224. this.currentChooseNumber = 0;
  1225. this.currentChooseNumberUsed = 0;
  1226. this.currentChooseTitle = "";
  1227. this.unmatchedSelectedList = [];
  1228. this.isClickMatch = true;
  1229. this.handleSearchUnmatchedInfo();
  1230. }
  1231. });
  1232. },
  1233. handleMatchedSelectAll() {
  1234. this.isMatchedSelectAll = !this.isMatchedSelectAll;
  1235. this.matchedList.map((v) => {
  1236. if (v.produce_status == 0) {
  1237. v.isSelect = this.isMatchedSelectAll;
  1238. this.matchedSelectedList.push(v.id);
  1239. }
  1240. });
  1241. },
  1242. handleMatchedSelect(row, e) {
  1243. row.isSelect = e;
  1244. let flag = true;
  1245. this.matchedSelectedList = [];
  1246. this.matchedList.map((v) => {
  1247. if (v.produce_status == 0) {
  1248. if (v.isSelect) {
  1249. this.matchedSelectedList.push(v.id);
  1250. } else {
  1251. flag = false;
  1252. }
  1253. }
  1254. });
  1255. this.isMatchedSelectAll = flag;
  1256. },
  1257. handleMatchedSet(row, index, type) {
  1258. if (this.matchedSelectedList.length == 0) {
  1259. return this.$Message.warning("请选择");
  1260. }
  1261. switch (type) {
  1262. case 5:
  1263. if (index == -1) {
  1264. this.matchedSelectedList = [row.id];
  1265. } else {
  1266. this.matchedSelectedList = [];
  1267. this.matchedList.map((v) => {
  1268. v.isSelect && this.matchedSelectedList.push(v.id);
  1269. });
  1270. }
  1271. this.axios
  1272. .post("/api/bst_cancer_matching", {
  1273. cut_order_product_id: this.matchedSelectedList,
  1274. })
  1275. .then((res) => {
  1276. if (res.code == 200) {
  1277. this.$Message.success(res.msg);
  1278. this.handleMatchedListInit();
  1279. this.isMatchedSelectAll = false;
  1280. }
  1281. });
  1282. break;
  1283. }
  1284. },
  1285. },
  1286. // 监听属性 类似于data概念
  1287. computed: {},
  1288. // 监控data中的数据变化
  1289. watch: {},
  1290. beforeCreate() {}, // 生命周期 - 创建之前
  1291. beforeMount() {}, // 生命周期 - 挂载之前
  1292. beforeUpdate() {}, // 生命周期 - 更新之前
  1293. updated() {}, // 生命周期 - 更新之后
  1294. beforeDestroy() {}, // 生命周期 - 销毁之前
  1295. destroyed() {}, // 生命周期 - 销毁完成
  1296. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  1297. };
  1298. </script>
  1299. <style lang="scss" scoped>
  1300. .top-info {
  1301. padding: 10px;
  1302. font-size: 18px;
  1303. }
  1304. .context-tabs {
  1305. position: relative;
  1306. max-height: 80%;
  1307. overflow: hidden;
  1308. overflow-y: auto;
  1309. padding: 15px;
  1310. margin: 10px;
  1311. margin-bottom: 30px;
  1312. border-radius: 5px;
  1313. box-shadow: 1px 1px 5px 1px #999;
  1314. // 未匹配样式
  1315. .context-unmatched-sheet-table,
  1316. .context-unmatched-room-table {
  1317. }
  1318. .context-unmatched-sheet-search,
  1319. .context-unmatched-room-search {
  1320. padding: 10px 0;
  1321. }
  1322. // 匹配样式
  1323. .matched-block {
  1324. padding: 15px;
  1325. margin-bottom: 30px;
  1326. background-color: #e9ecef;
  1327. border-radius: 5px;
  1328. }
  1329. }
  1330. /deep/.ivu-tabs-nav-scroll {
  1331. display: flex;
  1332. justify-content: center;
  1333. }
  1334. /deep/.ivu-table-cell {
  1335. padding: 0;
  1336. }
  1337. .sheet-block,
  1338. .room-block {
  1339. max-height: 100%;
  1340. overflow: hidden;
  1341. overflow-y: auto;
  1342. }
  1343. </style>