matchPage.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  1. <template>
  2. <div>
  3. <Toptitle title="匹配">
  4. <Button
  5. @click="handleAutoMatching"
  6. v-if="currencyTag == 1"
  7. type="primary"
  8. style="margin-right: 10px"
  9. >自动匹配</Button
  10. >
  11. <!-- <Button @click="back" v-else type="primary" style="margin-right: 10px"
  12. >撤销匹配</Button
  13. > -->
  14. <Button @click="back" type="primary" ghost style="margin-right: 10px"
  15. >返回</Button
  16. >
  17. </Toptitle>
  18. <div class="top-info">
  19. <Row align="middle">
  20. <Col span="4">
  21. <span>项目编号:</span><span>{{ info.project_number }}</span>
  22. </Col>
  23. <Col span="4"
  24. ><span>项目名称:</span><span>{{ info.project_name }}</span>
  25. </Col>
  26. <Col span="6" v-if="currencyTag == 1">
  27. <span>图号:</span>
  28. <span>
  29. <Select
  30. filterable
  31. multiple
  32. transfer
  33. filter-by-label
  34. v-model="info.image_number"
  35. :max-tag-count="2"
  36. style="width: 200px"
  37. >
  38. <Option
  39. v-for="(item, index) in urlSelectList"
  40. :key="index"
  41. :label="item"
  42. :value="item"
  43. ></Option>
  44. </Select>
  45. </span>
  46. </Col>
  47. <Col span="6" v-if="currencyTag == 1">
  48. <span>产品名称:</span>
  49. <span>
  50. <Select
  51. filterable
  52. multiple
  53. transfer
  54. filter-by-label
  55. v-model="info.product_name"
  56. :max-tag-count="2"
  57. style="width: 200px"
  58. >
  59. <Option
  60. v-for="(item, index) in productList"
  61. :key="index"
  62. :label="item"
  63. :value="item"
  64. ></Option>
  65. </Select>
  66. </span>
  67. </Col>
  68. <Col span="4" v-if="currencyTag == 1">
  69. <Button @click="handleSearchUnmatchedInfo" type="primary"
  70. >确认</Button
  71. >
  72. </Col>
  73. </Row>
  74. </div>
  75. <div class="context-tabs">
  76. <Tabs type="card" @on-click="handleTabsClick" v-model="currencyTag">
  77. <!-- <Button
  78. @click="back"
  79. type="primary"
  80. size="small"
  81. slot="extra"
  82. v-show="currencyTag == 1"
  83. >
  84. 匹配
  85. </Button> -->
  86. <TabPane label="本次未匹配" name="1">
  87. <Row>
  88. <Col
  89. span="16"
  90. style="border-top: 1px solid #adb5bd;border-right: 1px solid #adb5bd;padding:10px"
  91. >
  92. <div>
  93. <h1>码单信息</h1>
  94. <div class="context-unmatched-sheet">
  95. <div
  96. v-for="url_info in unmatchedObj.urlList"
  97. :key="url_info.id"
  98. style="padding-top:10px"
  99. >
  100. <Row type="flex" align="middle">
  101. <Col span="4">
  102. <span>图号:</span><span>{{ url_info.image_number }}</span>
  103. </Col>
  104. <Col span="6">
  105. <span>产品名称:</span
  106. ><span>{{ url_info.product_name }}</span>
  107. </Col>
  108. <Col span="4" offset="6">
  109. <span>
  110. 总计
  111. <span style="color:red">{{
  112. url_info.product_detail_num
  113. }}</span>
  114. 条数据
  115. </span>
  116. </Col>
  117. <Col span="4">
  118. <Button
  119. @click="handleShowCurrencySheet(url_info)"
  120. size="small"
  121. type="text"
  122. >{{ url_info.isCurrenct ? "收缩" : "展开" }}</Button
  123. >
  124. <Icon
  125. size="20"
  126. :type="
  127. url_info.isCurrenct
  128. ? 'md-arrow-dropdown'
  129. : 'md-arrow-dropright'
  130. "
  131. style="vertical-align: middle;"
  132. />
  133. </Col>
  134. </Row>
  135. <div
  136. v-if="url_info.isCurrenct"
  137. class="context-unmatched-sheet-search"
  138. >
  139. <Row type="flex" align="middle">
  140. <Col span="6">
  141. <span>特殊尺寸:</span>
  142. <span>
  143. <Select
  144. filterable
  145. filter-by-label
  146. transfer
  147. v-model="info.wool_size"
  148. size="small"
  149. style="width: 120px"
  150. >
  151. <Option
  152. v-for="(item, index) in wool_size"
  153. :key="index"
  154. :label="item"
  155. :value="item"
  156. ></Option>
  157. </Select>
  158. </span>
  159. </Col>
  160. <Col span="6">
  161. <span>部件名称:</span>
  162. <span>
  163. <Select
  164. filterable
  165. multiple
  166. filter-by-label
  167. transfer
  168. v-model="info.part_name"
  169. :max-tag-count="2"
  170. size="small"
  171. style="width: 120px"
  172. >
  173. <Option
  174. v-for="(item, index) in part_name"
  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. filter-by-label
  188. transfer
  189. v-model="info.cut_size"
  190. size="small"
  191. style="width: 120px"
  192. >
  193. <Option
  194. v-for="(item, index) in cut_size"
  195. :key="index"
  196. :label="item"
  197. :value="item"
  198. ></Option>
  199. </Select>
  200. </span>
  201. </Col>
  202. <Col span="6">
  203. <Button
  204. @click="getSheetDetailList(url_info)"
  205. size="small"
  206. type="primary"
  207. >
  208. 搜索
  209. </Button>
  210. </Col>
  211. </Row>
  212. </div>
  213. <div
  214. v-if="url_info.isCurrenct"
  215. class="context-unmatched-sheet-table"
  216. >
  217. <div
  218. v-for="table_info in unmatchedObj.part_list"
  219. :key="table_info.id"
  220. >
  221. <div>
  222. <Row type="flex" align="middle">
  223. <Col span="10" style="padding:10px 0">
  224. <span>匹配信息:</span>
  225. <span
  226. v-for="(match_info, index) in table_info.key
  227. .list"
  228. :key="index"
  229. >
  230. {{ match_info.key }}:{{ match_info.value }}
  231. </span>
  232. <span>{{ table_info.key.num }}组</span>
  233. </Col>
  234. <Col span="3" offset="11">
  235. 总计{{ table_info.part_list.length }}条数据
  236. </Col>
  237. </Row>
  238. </div>
  239. <div>
  240. <Table
  241. :columns="unmatchedSheetTableColumns"
  242. border
  243. :max-height="500"
  244. @on-selection-change="handleSelectChange"
  245. :data="table_info.part_list"
  246. ></Table>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </Col>
  254. <Col span="8">
  255. <div style="border-top: 1px solid #adb5bd;padding:10px">
  256. <h1>房间信息</h1>
  257. <div class="context-unmatched-room">
  258. <div
  259. v-for="url_info in unmatchedObj.urlList"
  260. :key="url_info.id"
  261. style="padding-top:10px"
  262. >
  263. <Row type="flex" align="middle">
  264. <Col span="4">
  265. <span>图号:</span><span>{{ url_info.image_number }}</span>
  266. </Col>
  267. <Col span="8">
  268. <span>产品名称:</span
  269. ><span>{{ url_info.product_name }}</span>
  270. </Col>
  271. <Col span="6" offset="2">
  272. <span>
  273. 总计
  274. <span style="color:red">{{
  275. url_info.house_num
  276. }}</span>
  277. 条数据
  278. </span>
  279. </Col>
  280. <Col span="4">
  281. <Button
  282. @click="handleShowCurrencySheet(url_info)"
  283. size="small"
  284. type="text"
  285. >{{ url_info.isCurrenct ? "收缩" : "展开" }}</Button
  286. >
  287. <Icon
  288. size="20"
  289. :type="
  290. url_info.isCurrenct
  291. ? 'md-arrow-dropdown'
  292. : 'md-arrow-dropright'
  293. "
  294. style="vertical-align: middle;"
  295. />
  296. </Col>
  297. </Row>
  298. <div
  299. v-if="url_info.isCurrenct"
  300. class="context-unmatched-room-search"
  301. >
  302. <Row type="flex" align="middle">
  303. <Col span="12" style="padding:10px 0">
  304. <span>区域名称:</span>
  305. <span>
  306. <Select
  307. filterable
  308. multiple
  309. filter-by-label
  310. transfer
  311. v-model="info.region"
  312. :max-tag-count="2"
  313. size="small"
  314. style="width: 120px"
  315. >
  316. <Option
  317. v-for="(item, index) in regionList"
  318. :key="index"
  319. :label="item"
  320. :value="item"
  321. ></Option>
  322. </Select>
  323. </span>
  324. </Col>
  325. <Col span="12" style="padding:10px 0">
  326. <span>房号:</span>
  327. <span>
  328. <Select
  329. filterable
  330. multiple
  331. filter-by-label
  332. transfer
  333. v-model="info.number"
  334. :max-tag-count="2"
  335. size="small"
  336. style="width: 120px"
  337. >
  338. <Option
  339. v-for="(item, index) in number"
  340. :key="index"
  341. :label="item"
  342. :value="item"
  343. ></Option>
  344. </Select>
  345. </span>
  346. </Col>
  347. <Col span="12" style="padding:10px 0">
  348. <span>特殊尺寸:</span>
  349. <span>
  350. <Select
  351. filterable
  352. filter-by-label
  353. transfer
  354. v-model="info.wool_size"
  355. size="small"
  356. style="width: 120px"
  357. >
  358. <Option
  359. v-for="(item, index) in wool_size"
  360. :key="index"
  361. :label="item"
  362. :value="item"
  363. ></Option>
  364. </Select>
  365. </span>
  366. </Col>
  367. <Col span="12" style="padding:10px 0">
  368. <Button
  369. @click="getSheetDetailList(url_info)"
  370. size="small"
  371. type="primary"
  372. >搜索</Button
  373. >
  374. </Col>
  375. </Row>
  376. </div>
  377. <div
  378. v-if="url_info.isCurrenct"
  379. class="context-unmatched-room-table"
  380. >
  381. <div>
  382. <Table
  383. :columns="unmatchedRoomTableColumnsUsed"
  384. border
  385. :max-height="500"
  386. @on-selection-change="handleSelectChange"
  387. :data="unmatchedRoomList.house_list"
  388. ></Table>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </Col>
  395. </Row>
  396. </TabPane>
  397. <TabPane label="本次已匹配" name="2">
  398. <Row type="flex" align="middle" style="padding:10px 0">
  399. <Col span="4">
  400. <span>图号:</span>
  401. <span>
  402. <Select
  403. filterable
  404. multiple
  405. filter-by-label
  406. transfer
  407. v-model="matchedInfo.image_number"
  408. :max-tag-count="2"
  409. size="small"
  410. style="width: 150px"
  411. >
  412. <Option
  413. v-for="(item, index) in urlMatchedList"
  414. :key="index"
  415. :label="item"
  416. :value="item"
  417. ></Option>
  418. </Select>
  419. </span>
  420. </Col>
  421. <Col span="4">
  422. <span>产品名称:</span>
  423. <span>
  424. <Select
  425. filterable
  426. multiple
  427. filter-by-label
  428. transfer
  429. v-model="matchedInfo.product_name"
  430. :max-tag-count="2"
  431. size="small"
  432. style="width: 150px"
  433. >
  434. <Option
  435. v-for="(item, index) in productMatchedList"
  436. :key="index"
  437. :label="item"
  438. :value="item"
  439. ></Option>
  440. </Select>
  441. </span>
  442. </Col>
  443. <Col span="2">
  444. <Button
  445. @click="handleMatchedListInit"
  446. size="small"
  447. type="primary"
  448. >
  449. 搜索
  450. </Button>
  451. </Col>
  452. </Row>
  453. <div
  454. v-for="matched_info in matchedList"
  455. :key="matched_info.number"
  456. class="matched-block"
  457. >
  458. <Row>
  459. <Col span="2">
  460. <Checkbox
  461. v-model="matched_info.isSelect"
  462. @on-change="handleMatchedSelectAll"
  463. >全选</Checkbox
  464. >
  465. </Col>
  466. <Col span="2">
  467. <span>图号:{{ matched_info.image_number }}</span>
  468. </Col>
  469. <Col span="6">
  470. <span>产品名称:{{ matched_info.product_name }}</span>
  471. </Col>
  472. <Col span="2" offset="10">
  473. 总计
  474. <span style="color:red">{{ matched_info.num }}</span>
  475. 条数据
  476. </Col>
  477. <Col span="2">
  478. <Button
  479. @click="handleShowCurrencyMatched(matched_info)"
  480. size="small"
  481. type="text"
  482. >{{ matched_info.isCurrenct ? "收缩" : "展开" }}</Button
  483. >
  484. <Icon
  485. size="20"
  486. :type="
  487. matched_info.isCurrenct
  488. ? 'md-arrow-dropdown'
  489. : 'md-arrow-dropright'
  490. "
  491. style="vertical-align: middle;"
  492. />
  493. </Col>
  494. </Row>
  495. <Row style="margin-top:20px" v-if="matched_info.isCurrenct">
  496. <Col span="4">
  497. <span>区域名称:</span>
  498. <span>
  499. <Select
  500. filterable
  501. multiple
  502. transfer
  503. filter-by-label
  504. v-model="matchedInfo.region"
  505. :max-tag-count="2"
  506. size="small"
  507. style="width: 150px"
  508. >
  509. <Option
  510. v-for="(item, index) in regionMatchedList"
  511. :key="index"
  512. :label="item"
  513. :value="item"
  514. ></Option>
  515. </Select>
  516. </span>
  517. </Col>
  518. <Col span="4">
  519. <span>房号:</span>
  520. <span>
  521. <Select
  522. filterable
  523. multiple
  524. transfer
  525. filter-by-label
  526. v-model="matchedInfo.number"
  527. :max-tag-count="2"
  528. size="small"
  529. style="width: 150px"
  530. >
  531. <Option
  532. v-for="(item, index) in numberMatchedList"
  533. :key="index"
  534. :label="item"
  535. :value="item"
  536. ></Option>
  537. </Select>
  538. </span>
  539. </Col>
  540. <Col span="4">
  541. <span>部件名称:</span>
  542. <span>
  543. <Select
  544. filterable
  545. multiple
  546. transfer
  547. filter-by-label
  548. v-model="matchedInfo.part_name"
  549. :max-tag-count="2"
  550. size="small"
  551. style="width: 150px"
  552. >
  553. <Option
  554. v-for="(item, index) in partNameMatchedList"
  555. :key="index"
  556. :label="item"
  557. :value="item"
  558. ></Option>
  559. </Select>
  560. </span>
  561. </Col>
  562. <Col span="2">
  563. <Button @click="getMatchedDetailList(matched_info)" size="small" type="primary">
  564. 搜索
  565. </Button>
  566. </Col>
  567. </Row>
  568. <div v-if="matched_info.isCurrenct">
  569. <div
  570. v-for="(matched_detail, index) in matchedDetailList"
  571. :key="index"
  572. >
  573. <Row type="flex" align="middle">
  574. <Col span="10" style="padding:10px 0">
  575. <span>匹配信息:</span>
  576. <span
  577. v-for="(matched_info, index) in matched_detail.special"
  578. :key="index"
  579. >
  580. {{ matched_info.key }}:{{ matched_info.value }}
  581. </span>
  582. <span>{{ matched_detail.num }}组</span>
  583. </Col>
  584. </Row>
  585. <Table
  586. :columns="matchedSheetTableColumns"
  587. border
  588. :ref="'matched' + index"
  589. :max-height="500"
  590. @on-selection-change="handleMatchedSelectChange"
  591. :data="matched_detail.detail"
  592. >
  593. <template slot="setSlot" slot-scope="{ row, index }">
  594. <a @click="handleMatchedSet(row, index, 5)">撤销匹配 </a>
  595. </template>
  596. </Table>
  597. </div>
  598. </div>
  599. </div>
  600. </TabPane>
  601. </Tabs>
  602. </div>
  603. </div>
  604. </template>
  605. <script>
  606. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  607. // 例如:import 《组件名称》 from '《组件路径》';
  608. export default {
  609. name: "",
  610. components: {},
  611. props: {},
  612. // import引入的组件需要注入到对象中才能使用
  613. data() {
  614. // 这里存放数据
  615. return {
  616. currencyTag: "1", //当前分页
  617. info: {
  618. id: this.$route.query.id,
  619. project_number: this.$route.query.project_number,
  620. project_name: this.$route.query.project_name,
  621. cut_size: "",
  622. number: "",
  623. part_name: "",
  624. region: "",
  625. wool_size: "",
  626. image_number: [],
  627. product_name: [],
  628. },
  629. matchedInfo: {
  630. id: this.$route.query.id,
  631. image_number: [],
  632. product_name: [],
  633. },
  634. cut_size: [], //精裁尺寸 未匹配
  635. number: [], //房号 未匹配
  636. part_name: [], //部件名称 未匹配
  637. regionList: [], //区域名称 未匹配
  638. wool_size: [], //毛料尺寸 未匹配
  639. urlSelectList: [], //图号列表 未匹配
  640. productList: [], //产品列表 未匹配
  641. urlMatchedList: [], //图号列表 已匹配
  642. productMatchedList: [], //产品列表 已匹配
  643. regionMatchedList: [], //区域列表 已匹配
  644. numberMatchedList: [], //房号列表 已匹配
  645. partNameMatchedList: [], //部件列表 已匹配
  646. unmatchedObj: {
  647. urlList: [], //图号列表
  648. part_list: [
  649. { part_list: [{ title: 1 }], key: { list: [], num: null } },
  650. { part_list: [{ title: 1 }], key: { list: [], num: null } },
  651. ], //当前图号下表格列表
  652. }, //码单信息
  653. unmatchedRoomList: {
  654. urlList: [], //图号列表
  655. house_list: [{ title: 1 }], //当前图号下表格列表
  656. }, //房间信息
  657. matchedList: [
  658. {
  659. number: "123",
  660. product_name: "321",
  661. isSelect: false,
  662. product_detail_num: 1,
  663. detail: [
  664. {
  665. title: "333",
  666. },
  667. ],
  668. },
  669. {
  670. number: "aaa",
  671. product_name: "vvv",
  672. isSelect: true,
  673. product_detail_num: 2,
  674. detail: [
  675. {
  676. title: "ddd",
  677. },
  678. ],
  679. },
  680. ],
  681. matchedDetailList: [],
  682. unmatchedSheetTableColumns: [
  683. { title: "全选", align: "center", minWidth: 60, type: "selection" },
  684. { title: "序号", align: "center", type: "index", minWidth: 60 },
  685. { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
  686. { title: "行号", align: "center", key: "line", minWidth: 60 },
  687. { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
  688. {
  689. title: "原材料",
  690. align: "center",
  691. minWidth: 80,
  692. render: (h, params) => {
  693. return h("span", {}, params.row.board1 + params.row.board2);
  694. },
  695. },
  696. { title: "木皮2", align: "center", key: "skin2", minWidth: 60 },
  697. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 80 },
  698. {
  699. title: "原料数量",
  700. align: "center",
  701. key: "wool_number",
  702. minWidth: 80,
  703. },
  704. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 80 },
  705. {
  706. title: "零部件数量",
  707. align: "center",
  708. key: "cut_number",
  709. minWidth: 90,
  710. },
  711. {
  712. title: "未匹配数量",
  713. align: "center",
  714. key: "unbind_number",
  715. minWidth: 90,
  716. },
  717. { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
  718. { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
  719. { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
  720. ], //未匹配码单表头
  721. unmatchedRoomTableColumns: [
  722. { title: "全选", align: "center", minWidth: 60, type: "selection" },
  723. { title: "序号", align: "center", type: "index", minWidth: 60 },
  724. { title: "区域", align: "center", key: "region", minWidth: 60 },
  725. { title: "房号", align: "center", key: "house_number", minWidth: 60 },
  726. ], //未匹配房间表头
  727. unmatchedRoomTableColumnsUsed: [],
  728. matchedSheetTableColumns: [
  729. { title: "全选", align: "center", minWidth: 60, type: "selection" },
  730. { title: "序号", align: "center", type: "index", minWidth: 60 },
  731. { title: "区域名称", align: "center", key: "region", minWidth: 100 },
  732. { title: "房号", align: "center", key: "house_number", minWidth: 60 },
  733. { title: "部件名称", align: "center", key: "part_name", minWidth: 80 },
  734. { title: "行号", align: "center", key: "line", minWidth: 60 },
  735. { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
  736. {
  737. title: "原材料",
  738. align: "center",
  739. minWidth: 80,
  740. render: (h, params) => {
  741. return h("span", {}, params.row.board1 + params.row.board2);
  742. },
  743. },
  744. { title: "木皮2", align: "center", key: "skin2", minWidth: 80 },
  745. { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 80 },
  746. {
  747. title: "原料数量",
  748. align: "center",
  749. key: "wool_number",
  750. minWidth: 80,
  751. },
  752. { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 80 },
  753. {
  754. title: "零部件数量",
  755. align: "center",
  756. key: "cut_number",
  757. minWidth: 90,
  758. },
  759. { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
  760. { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
  761. { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
  762. {
  763. title: "操作",
  764. align: "center",
  765. key: "title",
  766. minWidth: 80,
  767. slot: "setSlot",
  768. },
  769. ], //匹配表头
  770. unmatchedSelectedList: [],
  771. matchedSelectedList: [],
  772. };
  773. },
  774. // 生命周期 - 创建完成(可以访问当前this实例)
  775. created() {},
  776. // 生命周期 - 挂载完成(可以访问DOM元素)
  777. mounted() {
  778. this.handleSearchUnmatchedInfo();
  779. },
  780. methods: {
  781. back() {
  782. this.$router.go(-1);
  783. },
  784. handleSelectChange(selection) {
  785. this.unmatchedSelectedList = this.unmatchedSelectedList.concat(
  786. selection.map((v) => {
  787. return v.product_title;
  788. })
  789. );
  790. },
  791. handleMatchedSelectChange(selection) {
  792. this.matchedSelectedList = this.matchedSelectedList.concat(
  793. selection.map((v) => {
  794. return v.cut_order_product_id;
  795. })
  796. );
  797. console.log("this.matchedSelectedList :>> ", this.matchedSelectedList);
  798. },
  799. handleTabsClick(name) {
  800. name == 2 && this.handleMatchedListInit();
  801. },
  802. handleMatchedListInit() {
  803. this.axios
  804. .get("/api/bst_matching_on_product_list", {
  805. params: {
  806. id: this.info.id,
  807. image_number: this.matchedInfo.image_number,
  808. product_name: this.matchedInfo.product_name,
  809. },
  810. })
  811. .then((res) => {
  812. res.data.list.map((v) => {
  813. v.isCurrenct = false;
  814. });
  815. this.matchedList = res.data.list;
  816. this.urlMatchedList = res.data.image_number;
  817. this.productMatchedList = res.data.product_name;
  818. });
  819. },
  820. handleShowCurrencySheet(row) {
  821. if (row.isCurrenct) {
  822. row.isCurrenct = !row.isCurrenct;
  823. } else {
  824. this.unmatchedObj.urlList.map((v) => (v.isCurrenct = false));
  825. row.isCurrenct = true;
  826. }
  827. this.getSheetDetailList(row);
  828. },
  829. handleShowCurrencyMatched(row) {
  830. if (row.isCurrenct) {
  831. row.isCurrenct = !row.isCurrenct;
  832. } else {
  833. this.matchedList.map((v) => (v.isCurrenct = false));
  834. row.isCurrenct = true;
  835. }
  836. this.getMatchedDetailList(row);
  837. },
  838. getSheetDetailList(row) {
  839. row.isCurrenct &&
  840. this.axios
  841. .get("/api/bst_matching_un_product_detail", {
  842. params: {
  843. cut_order_product_id: row.id,
  844. id: this.info.id,
  845. cut_size: this.info.cut_size,
  846. number: this.info.number,
  847. part_name: this.info.part_name,
  848. region: this.info.region,
  849. wool_size: this.info.wool_size,
  850. },
  851. })
  852. .then((res) => {
  853. this.unmatchedObj.part_list = res.data.part_list;
  854. this.unmatchedRoomList.house_list = res.data.house_list;
  855. this.unmatchedRoomTableColumnsUsed = this.unmatchedRoomTableColumns.concat(
  856. res.data.head_word.map((v) => {
  857. return { title: v, align: "center", key: v, minWidth: 60 };
  858. })
  859. );
  860. this.cut_size = res.data.search_word.cut_size;
  861. this.number = res.data.search_word.number;
  862. this.part_name = res.data.search_word.part_name;
  863. this.regionList = res.data.search_word.region;
  864. this.wool_size = res.data.search_word.wool_size;
  865. });
  866. },
  867. getMatchedDetailList(row) {
  868. row.isCurrenct &&
  869. this.axios
  870. .get("/api/bst_matching_on_product_detail", {
  871. params: {
  872. cut_order_product_id: row.id || 14,
  873. id: this.matchedInfo.id,
  874. number: this.matchedInfo.number,
  875. part_name: this.matchedInfo.part_name,
  876. region: this.matchedInfo.region,
  877. },
  878. })
  879. .then((res) => {
  880. this.regionMatchedList = res.data.region;
  881. this.numberMatchedList = res.data.number;
  882. this.partNameMatchedList = res.data.part_name;
  883. this.matchedDetailList = res.data.list;
  884. });
  885. },
  886. handleSearchUnmatchedInfo() {
  887. this.axios({
  888. method: "get",
  889. url: "/api/bst_matching_un_product_list",
  890. params: {
  891. id: this.info.id,
  892. image_number: this.info.image_number,
  893. product_name: this.info.product_name,
  894. },
  895. }).then((res) => {
  896. if (res.code == 200) {
  897. console.log("res :>> ", res);
  898. res.data.list.map((v) => (v.isCurrenct = false));
  899. this.unmatchedObj.urlList = res.data.list;
  900. this.urlSelectList = res.data.image_number;
  901. this.productList = res.data.product_name;
  902. }
  903. });
  904. },
  905. handleAutoMatching() {
  906. this.axios
  907. .post("/api/matching_product_house", {
  908. id: this.info.id,
  909. image_number: this.info.image_number,
  910. product_title: this.info.product_name,
  911. })
  912. .then((res) => {
  913. if (res.code == 200) {
  914. this.$Message.success(res.msg);
  915. this.handleSearchUnmatchedInfo();
  916. }
  917. });
  918. },
  919. handleMatchedSelectAll(bool) {
  920. for (let index = 0; index < this.matchedDetailList.length; index++) {
  921. // const element = this.matchedDetailList[index];
  922. this.$refs["matched" + index][0].selectAll(bool);
  923. // console.log('this.$refs :>> ', this.$refs['matched'+index]);
  924. }
  925. },
  926. handleMatchedSet(row, index, type) {
  927. switch (type) {
  928. case 5:
  929. this.axios
  930. .get("/api/bst_cancer_matching", {
  931. params: {
  932. cut_order_product_id: row.cut_order_product_id,
  933. },
  934. })
  935. .then((res) => {
  936. if (res.code == 200) {
  937. this.$Message.success(res.msg);
  938. console.log(res);
  939. }
  940. });
  941. break;
  942. }
  943. },
  944. },
  945. // 监听属性 类似于data概念
  946. computed: {},
  947. // 监控data中的数据变化
  948. watch: {},
  949. beforeCreate() {}, // 生命周期 - 创建之前
  950. beforeMount() {}, // 生命周期 - 挂载之前
  951. beforeUpdate() {}, // 生命周期 - 更新之前
  952. updated() {}, // 生命周期 - 更新之后
  953. beforeDestroy() {}, // 生命周期 - 销毁之前
  954. destroyed() {}, // 生命周期 - 销毁完成
  955. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  956. };
  957. </script>
  958. <style lang="scss" scoped>
  959. .top-info {
  960. padding: 10px;
  961. font-size: 18px;
  962. }
  963. .context-tabs {
  964. position: relative;
  965. max-height: 650px;
  966. overflow: hidden;
  967. overflow-y: auto;
  968. padding: 15px;
  969. margin: 10px;
  970. margin-bottom: 30px;
  971. border-radius: 5px;
  972. box-shadow: 1px 1px 5px 1px #999;
  973. // 未匹配样式
  974. .context-unmatched-sheet-table,
  975. .context-unmatched-room-table {
  976. }
  977. .context-unmatched-sheet-search,
  978. .context-unmatched-room-search {
  979. padding: 10px 0;
  980. }
  981. // 匹配样式
  982. .matched-block {
  983. padding: 15px;
  984. margin-bottom: 30px;
  985. background-color: #e9ecef;
  986. border-radius: 5px;
  987. }
  988. }
  989. /deep/.ivu-tabs-nav-scroll {
  990. display: flex;
  991. justify-content: center;
  992. }
  993. /deep/.ivu-table-cell {
  994. padding: 0;
  995. }
  996. </style>