referOrderDataModal.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <a-modal
  3. title="参照订单数据"
  4. v-model="referOrderDataModVis"
  5. :confirmLoading="confirmLoading"
  6. @ok="onSubmit"
  7. @cancel="handleCancel"
  8. width="90%"
  9. >
  10. <!-- tabel 加载 -->
  11. <a-spin :spinning="confirmLoading">
  12. <!-- 查询 -->
  13. <div class="table-page-search-wrapper">
  14. <a-form layout="inline" @keyup.enter.native="searchQuery">
  15. <a-row :gutter="24">
  16. <a-col :md="5" :sm="8">
  17. <a-form-item label="账套">
  18. <j-search-select-tag
  19. placeholder="请选择账套"
  20. v-model="queryParam.account"
  21. dict="view_account,account,account">
  22. </j-search-select-tag>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="5" :sm="8">
  26. <a-form-item label="款号">
  27. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="5" :sm="8">
  31. <a-form-model-item label="类型">
  32. <a-select v-model="queryParam.flourOrGarment">
  33. <a-select-option value="">请选择</a-select-option>
  34. <a-select-option value="1">成衣</a-select-option>
  35. <a-select-option value="0">面辅料</a-select-option>
  36. </a-select>
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :md="5" :sm="8">
  40. <a-form-item label="预发货日期">
  41. <a-range-picker
  42. style="width: 100%"
  43. :mode="rangeMode"
  44. :placeholder="['开始日期', '结束日期']"
  45. :value="range"
  46. format = "YYYY-MM-DD"
  47. @change="rangeSelectChange"
  48. />
  49. </a-form-item>
  50. </a-col>
  51. <template v-if="toggleSearchStatus">
  52. <a-col :md="5" :sm="8">
  53. <a-form-item label="业务员">
  54. <!-- <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input> -->
  55. <j-search-select-tag
  56. placeholder="请选择业务员"
  57. v-model="queryParam.salesman"
  58. dict="view_salesman,salesman,salesman">
  59. </j-search-select-tag>
  60. </a-form-item>
  61. </a-col>
  62. <!-- <a-col :md="5" :sm="8">
  63. <a-form-item label="客户">
  64. <j-search-select-tag
  65. placeholder="请选择客户"
  66. v-model="queryParam.customerName"
  67. dict="view_customer,customerfullname,customerfullname">
  68. </j-search-select-tag>
  69. </a-form-item>
  70. </a-col> -->
  71. <a-col :md="5" :sm="8">
  72. <a-form-item label="小po">
  73. <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
  74. </a-form-item>
  75. </a-col>
  76. <a-col :md="5" :sm="8">
  77. <a-form-model-item label="是否被参照">
  78. <a-select v-model="queryParam.refer">
  79. <a-select-option value="1">是</a-select-option>
  80. <a-select-option value="0">否</a-select-option>
  81. </a-select>
  82. </a-form-model-item>
  83. </a-col>
  84. <a-col :md="5" :sm="8">
  85. <a-form-item label="订单日期">
  86. <a-range-picker
  87. style="width: 100%"
  88. :mode="dataRangeMode"
  89. :placeholder="['开始日期', '结束日期']"
  90. :value="dateRange"
  91. format = "YYYY-MM-DD"
  92. @change="dateRangeSelectChange"
  93. />
  94. </a-form-item>
  95. </a-col>
  96. </template>
  97. <a-col :md="4" :sm="8">
  98. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  99. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  100. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  101. <a @click="handleToggleSearch" style="margin-left: 8px">
  102. {{ toggleSearchStatus ? '收起' : '展开' }}
  103. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  104. </a>
  105. </span>
  106. </a-col>
  107. </a-row>
  108. </a-form>
  109. </div>
  110. <!-- 勾选表 :row-key="record => record.id" { pageSize: 50 } , y: 800 -->
  111. <a-table
  112. bordered
  113. size="small"
  114. rowKey="id"
  115. v-if="orderListData"
  116. :columns="referOerderColumns"
  117. :data-source="orderListData"
  118. :loading="loading"
  119. :pagination="false"
  120. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  121. @change="handleTableChange"
  122. :scroll="{ x: 1500, y:450 }"
  123. >
  124. </a-table>
  125. <h3>共选择 {{selectedNumber}} 条</h3>
  126. </a-spin>
  127. </a-modal>
  128. </template>
  129. <script>
  130. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  131. import JEllipsis from '@/components/jeecg/JEllipsis'
  132. import moment from 'moment'
  133. import { randomUUID } from '@/utils/util'
  134. import { queryOrderData, confimOrderData,addShipmentList } from '@api/document/shipmentList'
  135. export default {
  136. name: 'ReferOrderDataModal', // 参照订单数据弹框
  137. mixins: [JeecgListMixin],
  138. components: { JEllipsis, moment },
  139. data() {
  140. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  141. return {
  142. selectedRowKeys: [],
  143. selectedRows: [], // 勾选项
  144. selectedNumber:0,//勾选条数
  145. loading: false, // 表格加载
  146. fatherData:[],
  147. // 表头
  148. referOerderColumns: [
  149. {
  150. title: '订单号',
  151. dataIndex: 'orderNumber',
  152. width: 180,
  153. // fixed: 'left',
  154. ellipsis: true,
  155. className: 'replacecolor'
  156. },
  157. {
  158. title: '款号',
  159. dataIndex: 'itemNumber',
  160. width: 150,
  161. // fixed: 'left',
  162. ellipsis: true,
  163. className: 'replacecolor'
  164. },
  165. {
  166. title: '预发货日期',
  167. dataIndex: 'preDeliveryDate',
  168. width: 120,
  169. ellipsis: true,
  170. className: 'replacecolor'
  171. },
  172. {
  173. title: '小po',
  174. dataIndex: 'smallPo',
  175. width: 100,
  176. ellipsis: true,
  177. className: 'replacecolor'
  178. },
  179. // 账套替换
  180. // {
  181. // title: '账套',
  182. // dataIndex: 'account',
  183. // width: 80,
  184. // className: 'replacecolor'
  185. // },
  186. // {
  187. // title: '预完工日期',
  188. // dataIndex: 'preCompletionDate',
  189. // width: 120,
  190. // className: 'replacecolor'
  191. // },
  192. {
  193. title: 'packId',
  194. dataIndex: 'packId',
  195. width: 120,
  196. ellipsis: true,
  197. className: 'replacecolor'
  198. },
  199. {
  200. title: '分销点',
  201. dataIndex: 'distributionPoint',
  202. width: 120,
  203. ellipsis: true,
  204. className: 'replacecolor'
  205. },
  206. {
  207. title: '存货编码',
  208. dataIndex: 'inventoryCode',
  209. width: 120,
  210. ellipsis: true,
  211. className: 'replacecolor'
  212. },
  213. {
  214. title: '存货名称',
  215. dataIndex: 'inventoryName',
  216. ellipsis: true,
  217. width: 250,
  218. className: 'replacecolor'
  219. },
  220. {
  221. title: '颜色',
  222. dataIndex: 'colour',
  223. width: 160,
  224. ellipsis: true,
  225. className: 'replacecolor'
  226. },
  227. // {
  228. // title: '尺码',
  229. // dataIndex: 'size',
  230. // width: 100,
  231. // className: 'replacecolor'
  232. // },
  233. {
  234. title: '配码规格',
  235. dataIndex: 'codingRules',
  236. width: 180,
  237. ellipsis: true,
  238. className: 'replacecolor'
  239. },
  240. {
  241. title: '箱数',
  242. dataIndex: 'boxNumber',
  243. width: 100,
  244. ellipsis: true,
  245. className: 'replacecolor'
  246. },
  247. {
  248. title: '数量',
  249. dataIndex: 'quantity',
  250. width: 100,
  251. ellipsis: true,
  252. className: 'replacecolor'
  253. },
  254. {
  255. title: '订单剩余数量',
  256. dataIndex: 'surplusNum',
  257. width: 120,
  258. ellipsis: true,
  259. className: 'replacecolor'
  260. },
  261. // {
  262. // title: '含税单价',
  263. // dataIndex: 'unitPriceIncludingTax',
  264. // width: 100,
  265. // className: 'replacecolor'
  266. // },
  267. {
  268. title: '成衣工厂',
  269. dataIndex: 'garmentFactory',
  270. width: 100,
  271. ellipsis: true,
  272. className: 'replacecolor'
  273. },
  274. // {
  275. // title: '成衣件数',
  276. // dataIndex: 'garmentNmb',
  277. // width: 100,
  278. // className: 'replacecolor'
  279. // },
  280. // {
  281. // title: '业务类型',
  282. // dataIndex: 'businessTypeText',
  283. // width: 100,
  284. // className: 'replacecolor'
  285. // },
  286. // {
  287. // title: '客户订单',
  288. // dataIndex: 'customerOrderNumber',
  289. // width: 100,
  290. // className: 'replacecolor'
  291. // },
  292. // {
  293. // title: '销售类型',
  294. // dataIndex: 'salesTypeText',
  295. // width: 100,
  296. // className: 'replacecolor'
  297. // },
  298. {
  299. title: '客户简称',
  300. dataIndex: 'customerAbbreviation',
  301. width: 220,
  302. align: 'left',
  303. ellipsis: true,
  304. className: 'replacecolor'
  305. },
  306. // {
  307. // title: '供应商编码',
  308. // dataIndex: 'supplierCode',
  309. // width: 100,
  310. // className: 'replacecolor'
  311. // },
  312. {
  313. title: '供应商',
  314. dataIndex: 'supplier',
  315. width: 120,
  316. ellipsis: true,
  317. className: 'replacecolor'
  318. },
  319. // {
  320. // title: '汇率',
  321. // dataIndex: 'exchangeRate',
  322. // width: 100,
  323. // className: 'replacecolor'
  324. // },
  325. // {
  326. // title: '整单合计',
  327. // dataIndex: 'wholeOrderTotal',
  328. // width: 100,
  329. // className: 'replacecolor'
  330. // },
  331. // {
  332. // title: '销售部门',
  333. // dataIndex: 'salesDepartment',
  334. // width: 120,
  335. // className: 'replacecolor'
  336. // },
  337. // {
  338. // title: '业务员',
  339. // dataIndex: 'salesman',
  340. // width: 120,
  341. // className: 'replacecolor'
  342. // },
  343. // {
  344. // title: '币种',
  345. // dataIndex: 'currencyText',
  346. // width: 100,
  347. // className: 'replacecolor'
  348. // },
  349. // {
  350. // title: '品牌方',
  351. // dataIndex: 'brandSide',
  352. // width: 120,
  353. // className: 'replacecolor'
  354. // },
  355. // {
  356. // title: '第三方',
  357. // dataIndex: 'thirdParty',
  358. // width: 220,
  359. // align: 'left',
  360. // className: 'replacecolor'
  361. // },
  362. // {
  363. // title: '定金比例(%)',
  364. // dataIndex: 'depositRatio',
  365. // width: 100,
  366. // className: 'replacecolor'
  367. // },
  368. // {
  369. // title: '定金',
  370. // dataIndex: 'deposit',
  371. // width: 100,
  372. // className: 'replacecolor'
  373. // },
  374. // {
  375. // title: '协同路线',
  376. // dataIndex: 'collaborativeRoute',
  377. // width: 100,
  378. // className: 'replacecolor'
  379. // },
  380. // {
  381. // title: '付款条件',
  382. // dataIndex: 'termOfPayment',
  383. // width: 120,
  384. // customRender: t => ellipsis(t),
  385. // className: 'replacecolor'
  386. // },
  387. // {
  388. // title: '最终客户',
  389. // dataIndex: 'endCustomer',
  390. // width: 120,
  391. // className: 'replacecolor'
  392. // },
  393. // {
  394. // title: '订单备注',
  395. // dataIndex: 'orderRemarks',
  396. // width: 280,
  397. // customRender: t => ellipsis(t),
  398. // className: 'replacecolor'
  399. // },
  400. // {
  401. // title: '价格备注',
  402. // dataIndex: 'priceRemarks',
  403. // width: 280,
  404. // customRender: t => ellipsis(t),
  405. // className: 'replacecolor'
  406. // },
  407. // {
  408. // title: '订单变更说明',
  409. // dataIndex: 'orderChangeDescription',
  410. // width: 220,
  411. // customRender: t => ellipsis(t),
  412. // className: 'replacecolor'
  413. // },
  414. // {
  415. // title: '订单日期',
  416. // dataIndex: 'orderDate',
  417. // width: 120,
  418. // className: 'replacecolor'
  419. // },
  420. // {
  421. // title: '订单主表ID',
  422. // dataIndex: 'syOrderDataId',
  423. // width: 120,
  424. // // fixed: 'right',
  425. // className: 'replacecolor1'
  426. // },
  427. // {
  428. // title: '订单子表ID',
  429. // dataIndex: 'syOrderDataItemId',
  430. // width: 450,
  431. // // fixed: 'right',
  432. // className: 'replacecolor'
  433. // }
  434. ],
  435. orderListData: [], //订单数据
  436. confirmLoading: false,
  437. referOrderDataModVis: false,
  438. error:'', // 选中数据不符合的字段名
  439. errorIdentical:[],//选中多行数据客户、分销点不同字段
  440. // errorFather: '', //选中数据与已有数据不同集合
  441. garmentArr:[],//选中数据的成衣工厂集合
  442. customerArr:[],//选中数据的客户简称集合
  443. // 查询条件
  444. queryParam: {
  445. // itemNumber: '', // 订单号
  446. // smallPo:'',//小po
  447. // account: '', //账套
  448. // pageSize:100,
  449. // preDeliveryDateS:'', //预发货开始日期
  450. // preDeliveryDateE:'', //预发货结束日期
  451. // flourOrGarment:'', //类型
  452. // startDeliveryDate :'',
  453. // endDeliveryDate : ''
  454. // pageNo: '', // 初始页
  455. // pageSize: '-1' // 每页显示条数
  456. },
  457. // 分页
  458. pagination: {},
  459. confimList: [], //勾选的订单数组
  460. propList: [], //需要给新增页的数据
  461. dateRange:[],
  462. range:[],//预发货日期数组
  463. dataRangeMode:['date','date'],
  464. rangeMode:['date','date'],
  465. }
  466. },
  467. // 接收父组件 方法
  468. // props: {},
  469. created() {
  470. // this.getOrderList()
  471. // this.defalutDate()
  472. },
  473. methods: {
  474. moment,
  475. // 参照订单数据 查询
  476. getOrderList() {
  477. this.confirmLoading = true;
  478. // if (this.queryParam.preDeliveryDate != ""){
  479. // this.queryParam.preDeliveryDate = this.queryParam.preDeliveryDate.format('YYYY-MM-DD');
  480. // }
  481. this.$nextTick(() => {
  482. queryOrderData(this.queryParam).then(res => {
  483. this.confirmLoading = false;
  484. if (res.success) {
  485. for (var i=0; i<res.result.records.length;i++){
  486. res.result.records[i].id = randomUUID();
  487. }
  488. this.orderListData = res.result.records
  489. this.orderListData.map(item =>{
  490. item.boxNumber = Number(item.boxNumber).toFixed(0)
  491. })
  492. this.pagination = {
  493. total: res.result.total,
  494. current: res.result.current,
  495. pageSize: res.result.size
  496. }
  497. }
  498. })
  499. })
  500. },
  501. // 弹框确定
  502. onSubmit() {
  503. this.dataSet( this.selectedRows)
  504. var vv = this.selectedRows[0]
  505. // if(this.fatherData.length !== 0){
  506. // this.fatherDataSet(this.fatherData,vv)
  507. // }
  508. if (this.selectedRowKeys.length == 0) {
  509. this.$message.error('请勾选订单数据')
  510. } else if(this.selectedRows !== 1 && this.error !==''){
  511. this.$message.error(this.error+'至少一项不相同!');
  512. this.error = ''
  513. }else if(this.queryParam.account == '901' && this.garmentArr.includes("")){
  514. this.$message.error('含有成衣工厂为空的数据,请重新选择!');
  515. }else if(this.queryParam.account == '903' && !((this.customerArr.length==1 && this.customerArr[0] == '香港森语') || (this.customerArr.length==1 && this.customerArr[0] == 'International Apparel Group'))){
  516. this.$message.error('含有客户简称不为香港森语的数据,请重新选择!');
  517. }else{
  518. var garment = ''
  519. if(this.queryParam.flourOrGarment == 1){
  520. garment = '成衣'
  521. }else {
  522. garment = '面料'
  523. }
  524. this.loading = true
  525. addShipmentList({itemId:this.confimList,readyFabric:garment}).then(res => {
  526. if (res.success) {
  527. this.loading = false
  528. // this.referOrderDataModVis = false;
  529. this.$message.success('添加成功')
  530. this.$emit('close',this.queryParam.flourOrGarment)
  531. this.close()
  532. }else {
  533. this.$message.error('res.message')
  534. }
  535. })
  536. }
  537. },
  538. //参照数据选择多条时
  539. dataSet(){
  540. this.confimList = []
  541. this.garmentArr = []
  542. this.customerArr = []
  543. var orderTest = [],
  544. poTest = [],
  545. preDeliveryTest = [],
  546. preCompletionTest = [],
  547. itemNumberTest = [],
  548. inventoryCodeTest = [],
  549. inventoryNameTest = [],
  550. colourTest = [],
  551. sizeTest = [],
  552. custorTest = [],
  553. distributionPointTest = []
  554. this.selectedRows.map(item=>{
  555. this.confimList.push(item.syOrderDataItemId);
  556. orderTest.push(item.orderNumber)
  557. poTest.push(item.smallPo)
  558. preDeliveryTest.push(item.preDeliveryDate)
  559. preCompletionTest.push(item.preCompletionDate)
  560. itemNumberTest.push(item.itemNumber)
  561. inventoryCodeTest.push(item.inventoryCode)
  562. inventoryNameTest.push(item.inventoryName)
  563. colourTest.push(item.colour)
  564. sizeTest.push(item.size)
  565. custorTest.push(item.customerName)
  566. distributionPointTest.push(item.distributionPoint)
  567. this.garmentArr.push(item.garmentFactory)
  568. this.customerArr.push(item.customerAbbreviation)
  569. })
  570. debugger
  571. this.customerArr = [...new Set(this.customerArr)]
  572. if([...new Set(orderTest)].length == 1 && [...new Set(poTest)].length == 1 &&[...new Set(preDeliveryTest)].length == 1&&
  573. [...new Set(preCompletionTest)].length == 1 && [...new Set(itemNumberTest)].length == 1 &&[...new Set(inventoryCodeTest)].length !== 1&&
  574. [...new Set(inventoryNameTest)].length == 1 && [...new Set(colourTest)].length == 1 &&[...new Set(sizeTest)].length == 1){
  575. this.error = '订单号,小po,预发货日期,预完工日期,款号,存货编码,存货名称,颜色,尺码'
  576. }
  577. if([...new Set(custorTest)].length !== 1){this.errorIdentical.push('客户名称不相同')}
  578. if([...new Set(distributionPointTest)].length !== 1){this.errorIdentical.push('分销点')}
  579. },
  580. //已有参考列表
  581. // fatherDataSet(fathers,sons){
  582. // var father = fathers[0]
  583. // if(father.orderNumber === sons.orderNumber && father.smallPo === sons.smallPo && father.preDeliveryDate === sons.preDeliveryDate &&
  584. // father.preCompletionDate === sons.preCompletionDate && father.itemNumber === sons.itemNumber && father.inventoryCode === sons.inventoryCode &&
  585. // father.inventoryName === sons.inventoryName && father.colour === sons.colour && father.size === sons.size) {
  586. // this.errorFather = '订单号,小po,预发货日期,预完工日期,款号,存货编码,存货名称,颜色,尺码'
  587. // }
  588. // // if(father.orderNumber !== sons.orderNumber){this.errorFather.push('订单号')}
  589. // // if(father.smallPo !== sons.smallPo){this.errorFather.push('小po')}
  590. // // if(father.preDeliveryDate !== sons.preDeliveryDate){this.errorFather.push('预发货日期')}
  591. // // if(father.preCompletionDate !== sons.preCompletionDate){this.errorFather.push('预完工日期')}
  592. // // if(father.itemNumber !== sons.itemNumber){this.errorFather.push('款号')}
  593. // // if(father.inventoryCode !== sons.inventoryCode){this.errorFather.push('存货编码')}
  594. // // if(father.inventoryName !== sons.inventoryName){this.errorFather.push('存货名称')}
  595. // // if(father.colour !== sons.colour){this.errorFather.push('颜色')}
  596. // // if(father.size !== sons.size){this.errorFather.push('尺码')}
  597. // },
  598. handleTableChange(pagination, filters, sorter) {
  599. this.queryParam.pageNo = pagination.current;
  600. this.getOrderList();
  601. },
  602. searchQuery() {
  603. this.toggleSearchStatus = false
  604. if(this.queryParam.flourOrGarment === '' || !this.queryParam.hasOwnProperty('flourOrGarment')){
  605. this.$message.error('请选择查询类型!');
  606. }else if(this.queryParam.account === '' || !this.queryParam.hasOwnProperty('account')){
  607. this.$message.error('请选择账套号!');
  608. }else{
  609. if(this.range.length == 2){
  610. var separator = "-"; //日期分隔符
  611. var startDates = this.queryParam.preDeliveryDateS.split(separator);
  612. var endDates = this.queryParam.preDeliveryDateE.split(separator);
  613. var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);
  614. var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);
  615. var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
  616. if(timeInterval > 31 ){
  617. this.$message.error('预发货时间区间超过31天,请重新选择!');
  618. this.range = []
  619. this.queryParam.preDeliveryDateS = ''
  620. this.queryParam.preDeliveryDateE = ''
  621. }else{
  622. this.queryParam.pageNo = '';
  623. this.getOrderList();
  624. }
  625. }else {
  626. this.queryParam.pageNo = ''
  627. this.getOrderList();
  628. }
  629. }
  630. this.defulatSelect()
  631. },
  632. // 重置
  633. searchReset() {
  634. this.queryParam = {}
  635. // this.queryParam.customerName = '';
  636. this.dateRange = [];
  637. this.range = [];
  638. this.orderListData = []
  639. this.defulatSelect()
  640. // this.$emit('default-reset')
  641. },
  642. // 选中行
  643. onSelectChange(keys, rows) {
  644. this.selectedRowKeys = keys;
  645. this.selectedRows = rows;
  646. this.selectedNumber = rows.length
  647. },
  648. //选中行恢复默认
  649. defulatSelect(){
  650. this.selectedRowKeys = [];
  651. this.selectedRows = [];
  652. this.selectedNumber = 0
  653. },
  654. close() {
  655. this.referOrderDataModVis = false;
  656. this.searchReset();
  657. },
  658. handleCancel() {
  659. this.close();
  660. },
  661. // 时间发生变化的回调,发生在用户选择时间时
  662. dateRangeSelectChange(value) {
  663. this.dateRange = value;
  664. if (value.length == 0){
  665. this.queryParam.startDeliveryDate = "";
  666. this.queryParam.endDeliveryDate = "";
  667. }else{
  668. this.queryParam.startDeliveryDate = value[0].format('YYYY-MM-DD');
  669. this.queryParam.endDeliveryDate = value[1].format('YYYY-MM-DD');
  670. }
  671. },
  672. rangeSelectChange(value) {
  673. this.range = value
  674. if (value.length == 0){
  675. this.queryParam.preDeliveryDateS = "";
  676. this.queryParam.preDeliveryDateE = "";
  677. }else{
  678. this.queryParam.preDeliveryDateS = value[0].format('YYYY-MM-DD');
  679. this.queryParam.preDeliveryDateE = value[1].format('YYYY-MM-DD');
  680. }
  681. }
  682. },
  683. computed: {
  684. // 选中项
  685. rowSelection() {
  686. return {
  687. onChange: (selectedRowKeys, selectedRows) => {
  688. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  689. },
  690. getCheckboxProps: record => ({
  691. props: {
  692. disabled: record.title === 'Disabled User',
  693. // Column configuration not to be checked
  694. title: record.title
  695. }
  696. })
  697. }
  698. }
  699. }
  700. }
  701. </script>
  702. <style lang="less" scoped>
  703. @import '~@assets/less/common.less';
  704. /deep/ .ant-table-thead > tr > th {
  705. text-align: center;
  706. // font-weight: 700;
  707. }
  708. /deep/ .ant-table-tbody {
  709. text-align: center;
  710. }
  711. /deep/ .ant-table-fixed-left table, .ant-table-fixed-right table{
  712. width: min-content;
  713. }
  714. // /deep/ th.replacecolor1 {
  715. // display: none;
  716. // }
  717. </style>