matchPage.vue 33 KB

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