matchPage.vue 46 KB

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