matchPage.vue 45 KB

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