referOrderDataModal.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  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="6" :sm="8">
  17. <a-form-item label="订单号">
  18. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :md="6" :sm="8">
  22. <a-form-item label="账套">
  23. <j-search-select-tag
  24. placeholder="请选择账套"
  25. v-model="queryParam.account"
  26. dict="view_account,account,account">
  27. </j-search-select-tag>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-item label="业务员">
  32. <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
  33. </a-form-item>
  34. </a-col>
  35. <template v-if="toggleSearchStatus">
  36. <a-col :md="6" :sm="8">
  37. <a-form-item label="客户">
  38. <j-search-select-tag
  39. placeholder="请选择客户"
  40. v-model="queryParam.customerName"
  41. dict="view_customer,customerfullname,customerfullname">
  42. </j-search-select-tag>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-item label="订单日期">
  47. <a-range-picker
  48. style="width: 100%"
  49. :mode="dataRangeMode"
  50. :placeholder="['开始日期', '结束日期']"
  51. :value="dateRange"
  52. format = "YYYY-MM-DD"
  53. @change="dateRangeSelectChange"
  54. />
  55. </a-form-item>
  56. </a-col>
  57. <a-col :md="6" :sm="8">
  58. <a-form-model-item label="类型">
  59. <a-select v-model="queryParam.flourOrGarment">
  60. <a-select-option value="">请选择</a-select-option>
  61. <a-select-option value="1">成衣</a-select-option>
  62. <a-select-option value="0">面辅料</a-select-option>
  63. </a-select>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="6" :sm="8">
  67. <a-form-model-item label="预发货日期">
  68. <a-date-picker
  69. placeholder="请选择预发货日期"
  70. format="YYYY-MM-DD"
  71. style="width:100%;"
  72. v-model="queryParam.preDeliveryDate"
  73. />
  74. </a-form-model-item>
  75. </a-col>
  76. </template>
  77. <a-col :md="6" :sm="8">
  78. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  79. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  80. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  81. <a @click="handleToggleSearch" style="margin-left: 8px">
  82. {{ toggleSearchStatus ? '收起' : '展开' }}
  83. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  84. </a>
  85. </span>
  86. </a-col>
  87. </a-row>
  88. </a-form>
  89. </div>
  90. <!-- 勾选表 :row-key="record => record.id" { pageSize: 50 } , y: 800 -->
  91. <a-table
  92. bordered
  93. size="small"
  94. rowKey="id"
  95. v-if="orderListData"
  96. :columns="referOerderColumns"
  97. :data-source="orderListData"
  98. :loading="loading"
  99. :pagination="pagination"
  100. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  101. @change="handleTableChange"
  102. :scroll="{ x: 1500, y:450 }"
  103. >
  104. </a-table>
  105. </a-spin>
  106. </a-modal>
  107. </template>
  108. <script>
  109. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  110. import JEllipsis from '@/components/jeecg/JEllipsis'
  111. import moment from 'moment'
  112. import { randomUUID } from '@/utils/util'
  113. import { queryOrderData, confimOrderData } from '@api/document/shipmentList'
  114. export default {
  115. name: 'ReferOrderDataModal', // 参照订单数据弹框
  116. mixins: [JeecgListMixin],
  117. components: { JEllipsis, moment },
  118. data() {
  119. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  120. return {
  121. selectedRowKeys: [],
  122. selectedRows: {}, // 勾选项
  123. loading: false, // 表格加载
  124. // 表头
  125. referOerderColumns: [
  126. {
  127. title: '订单号',
  128. dataIndex: 'orderNumber',
  129. width: 180,
  130. fixed: 'left',
  131. className: 'replacecolor'
  132. },
  133. {
  134. title: '款号',
  135. dataIndex: 'itemNumber',
  136. width: 150,
  137. fixed: 'left',
  138. className: 'replacecolor'
  139. },
  140. {
  141. title: '小po',
  142. dataIndex: 'smallPo',
  143. width: 100,
  144. className: 'replacecolor'
  145. },
  146. // 账套替换
  147. {
  148. title: '账套',
  149. dataIndex: 'account',
  150. width: 80,
  151. className: 'replacecolor'
  152. },
  153. {
  154. title: '预发货日期',
  155. dataIndex: 'preDeliveryDate',
  156. width: 120,
  157. className: 'replacecolor'
  158. },
  159. {
  160. title: '预完工日期',
  161. dataIndex: 'preCompletionDate',
  162. width: 120,
  163. className: 'replacecolor'
  164. },
  165. {
  166. title: 'packId',
  167. dataIndex: 'packId',
  168. width: 120,
  169. className: 'replacecolor'
  170. },
  171. {
  172. title: '分销点',
  173. dataIndex: 'distributionPoint',
  174. width: 120,
  175. className: 'replacecolor'
  176. },
  177. {
  178. title: '存货编码',
  179. dataIndex: 'inventoryCode',
  180. width: 120,
  181. className: 'replacecolor'
  182. },
  183. {
  184. title: '存货名称',
  185. dataIndex: 'inventoryName',
  186. customRender: t => ellipsis(t),
  187. width: 250,
  188. className: 'replacecolor'
  189. },
  190. {
  191. title: '颜色',
  192. dataIndex: 'colour',
  193. width: 160,
  194. customRender: t => ellipsis(t),
  195. className: 'replacecolor'
  196. },
  197. // {
  198. // title: '尺码',
  199. // dataIndex: 'size',
  200. // width: 100,
  201. // className: 'replacecolor'
  202. // },
  203. {
  204. title: '配码规格',
  205. dataIndex: 'codingRules',
  206. width: 180,
  207. className: 'replacecolor'
  208. },
  209. {
  210. title: '箱数',
  211. dataIndex: 'boxNumber',
  212. width: 100,
  213. className: 'replacecolor'
  214. },
  215. {
  216. title: '数量',
  217. dataIndex: 'quantity',
  218. width: 100,
  219. className: 'replacecolor'
  220. },
  221. {
  222. title: '订单剩余数量',
  223. dataIndex: 'surplusNum',
  224. width: 120,
  225. className: 'replacecolor'
  226. },
  227. {
  228. title: '含税单价',
  229. dataIndex: 'unitPriceIncludingTax',
  230. width: 100,
  231. className: 'replacecolor'
  232. },
  233. {
  234. title: '成衣工厂',
  235. dataIndex: 'garmentFactory',
  236. width: 100,
  237. className: 'replacecolor'
  238. },
  239. {
  240. title: '成衣件数',
  241. dataIndex: 'garmentNmb',
  242. width: 100,
  243. className: 'replacecolor'
  244. },
  245. {
  246. title: '业务类型',
  247. dataIndex: 'businessTypeText',
  248. width: 100,
  249. className: 'replacecolor'
  250. },
  251. {
  252. title: '客户订单',
  253. dataIndex: 'customerOrderNumber',
  254. width: 100,
  255. className: 'replacecolor'
  256. },
  257. {
  258. title: '销售类型',
  259. dataIndex: 'salesTypeText',
  260. width: 100,
  261. className: 'replacecolor'
  262. },
  263. {
  264. title: '客户简称',
  265. dataIndex: 'customerAbbreviation',
  266. width: 220,
  267. align: 'left',
  268. className: 'replacecolor'
  269. },
  270. {
  271. title: '客户名称',
  272. dataIndex: 'customerName',
  273. customRender: t => ellipsis(t),
  274. width: 220,
  275. className: 'replacecolor'
  276. },
  277. {
  278. title: '供应商编码',
  279. dataIndex: 'supplierCode',
  280. width: 100,
  281. className: 'replacecolor'
  282. },
  283. {
  284. title: '供应商',
  285. dataIndex: 'supplier',
  286. width: 120,
  287. className: 'replacecolor'
  288. },
  289. {
  290. title: '汇率',
  291. dataIndex: 'exchangeRate',
  292. width: 100,
  293. className: 'replacecolor'
  294. },
  295. {
  296. title: '整单合计',
  297. dataIndex: 'wholeOrderTotal',
  298. width: 100,
  299. className: 'replacecolor'
  300. },
  301. {
  302. title: '销售部门',
  303. dataIndex: 'salesDepartment',
  304. width: 120,
  305. className: 'replacecolor'
  306. },
  307. {
  308. title: '业务员',
  309. dataIndex: 'salesman',
  310. width: 120,
  311. className: 'replacecolor'
  312. },
  313. {
  314. title: '币种',
  315. dataIndex: 'currencyText',
  316. width: 100,
  317. className: 'replacecolor'
  318. },
  319. {
  320. title: '品牌方',
  321. dataIndex: 'brandSide',
  322. width: 120,
  323. className: 'replacecolor'
  324. },
  325. {
  326. title: '第三方',
  327. dataIndex: 'thirdParty',
  328. width: 220,
  329. align: 'left',
  330. className: 'replacecolor'
  331. },
  332. {
  333. title: '定金比例(%)',
  334. dataIndex: 'depositRatio',
  335. width: 100,
  336. className: 'replacecolor'
  337. },
  338. {
  339. title: '定金',
  340. dataIndex: 'deposit',
  341. width: 100,
  342. className: 'replacecolor'
  343. },
  344. {
  345. title: '协同路线',
  346. dataIndex: 'collaborativeRoute',
  347. width: 100,
  348. className: 'replacecolor'
  349. },
  350. {
  351. title: '付款条件',
  352. dataIndex: 'termOfPayment',
  353. width: 120,
  354. customRender: t => ellipsis(t),
  355. className: 'replacecolor'
  356. },
  357. {
  358. title: '最终客户',
  359. dataIndex: 'endCustomer',
  360. width: 120,
  361. className: 'replacecolor'
  362. },
  363. {
  364. title: '订单备注',
  365. dataIndex: 'orderRemarks',
  366. width: 280,
  367. customRender: t => ellipsis(t),
  368. className: 'replacecolor'
  369. },
  370. {
  371. title: '价格备注',
  372. dataIndex: 'priceRemarks',
  373. width: 280,
  374. customRender: t => ellipsis(t),
  375. className: 'replacecolor'
  376. },
  377. {
  378. title: '订单变更说明',
  379. dataIndex: 'orderChangeDescription',
  380. width: 220,
  381. customRender: t => ellipsis(t),
  382. className: 'replacecolor'
  383. },
  384. {
  385. title: '订单日期',
  386. dataIndex: 'orderDate',
  387. width: 120,
  388. className: 'replacecolor'
  389. },
  390. {
  391. title: '订单主表ID',
  392. dataIndex: 'syOrderDataId',
  393. width: 120,
  394. // fixed: 'right',
  395. className: 'replacecolor1'
  396. },
  397. {
  398. title: '订单子表ID',
  399. dataIndex: 'syOrderDataItemId',
  400. width: 450,
  401. // fixed: 'right',
  402. className: 'replacecolor'
  403. }
  404. ],
  405. orderListData: [], //订单数据
  406. confirmLoading: false,
  407. referOrderDataModVis: false,
  408. // 查询条件
  409. queryParam: {
  410. orderNumber: '', // 订单号
  411. account: '', //账套
  412. pageSize:100,
  413. preDeliveryDate:'', //预发货日期
  414. flourOrGarment:'', //类型
  415. // pageNo: '', // 初始页
  416. // pageSize: '-1' // 每页显示条数
  417. },
  418. // 分页
  419. pagination: {},
  420. confimList: [], //勾选的订单数组
  421. propList: [], //需要给新增页的数据
  422. dateRange:[],
  423. dataRangeMode:['date','date'],
  424. }
  425. },
  426. // 接收父组件 方法
  427. // props: {},
  428. created() {
  429. this.getOrderList()
  430. },
  431. methods: {
  432. // 参照订单数据 查询
  433. getOrderList() {
  434. this.confirmLoading = true;
  435. if (this.queryParam.preDeliveryDate != ""){
  436. this.queryParam.preDeliveryDate = this.queryParam.preDeliveryDate.format('YYYY-MM-DD');
  437. }
  438. this.$nextTick(() => {
  439. queryOrderData(this.queryParam).then(res => {
  440. this.confirmLoading = false;
  441. if (res.success) {
  442. for (var i=0; i<res.result.records.length;i++){
  443. res.result.records[i].id = randomUUID();
  444. }
  445. this.orderListData = res.result.records
  446. this.pagination = {
  447. total: res.result.total,
  448. current: res.result.current,
  449. pageSize: res.result.size
  450. }
  451. }
  452. })
  453. })
  454. },
  455. // 弹框确定
  456. onSubmit() {
  457. this.confimList = [];
  458. if (this.selectedRowKeys.length == 0) {
  459. this.$message.error('请勾选订单数据')
  460. } else {
  461. this.selectedRows.forEach(item => {
  462. this.confimList.push(item.syOrderDataItemId);
  463. })
  464. confimOrderData(this.confimList).then(res => {
  465. if (res.success) {
  466. this.propList = res.result;
  467. this.$emit('bao', this.propList);
  468. }
  469. })
  470. this.referOrderDataModVis = false;
  471. this.selectedRowKeys = [];
  472. this.selectedRows = [];
  473. this.searchReset();
  474. }
  475. },
  476. handleTableChange(pagination, filters, sorter) {
  477. this.queryParam.pageNo = pagination.current;
  478. this.getOrderList();
  479. },
  480. searchQuery() {
  481. this.queryParam.pageNo = '';
  482. this.getOrderList();
  483. },
  484. // 重置
  485. searchReset() {
  486. this.queryParam.orderNumber = '';
  487. this.queryParam.account = '';
  488. this.queryParam.salesman = '';
  489. this.queryParam.customerName = '';
  490. this.dateRange = [];
  491. this.queryParam.flourOrGarment = '';
  492. this.queryParam.preDeliveryDate = '';
  493. this.getOrderList();
  494. this.selectedRowKeys = [];
  495. this.selectedRows = [];
  496. },
  497. // 选中行
  498. onSelectChange(keys, rows) {
  499. this.selectedRowKeys = keys;
  500. this.selectedRows = rows;
  501. },
  502. close() {
  503. this.$emit('close')
  504. this.referOrderDataModVis = false;
  505. this.selectedRowKeys = [];
  506. this.orderListData = [];
  507. this.searchReset();
  508. },
  509. handleCancel() {
  510. this.close();
  511. },
  512. // 时间发生变化的回调,发生在用户选择时间时
  513. dateRangeSelectChange(value) {
  514. this.dateRange = value;
  515. if (value.length == 0){
  516. this.queryParam.startDeliveryDate = "";
  517. this.queryParam.endDeliveryDate = "";
  518. }else{
  519. this.queryParam.startDeliveryDate = value[0].format('YYYY-MM-DD');
  520. this.queryParam.endDeliveryDate = value[1].format('YYYY-MM-DD');
  521. }
  522. },
  523. },
  524. computed: {
  525. // 选中项
  526. rowSelection() {
  527. return {
  528. onChange: (selectedRowKeys, selectedRows) => {
  529. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  530. },
  531. getCheckboxProps: record => ({
  532. props: {
  533. disabled: record.title === 'Disabled User',
  534. // Column configuration not to be checked
  535. title: record.title
  536. }
  537. })
  538. }
  539. }
  540. }
  541. }
  542. </script>
  543. <style lang="less" scoped>
  544. @import '~@assets/less/common.less';
  545. /deep/ .ant-table-thead > tr > th {
  546. text-align: center;
  547. // font-weight: 700;
  548. }
  549. /deep/ .ant-table-tbody {
  550. text-align: center;
  551. }
  552. // /deep/ th.replacecolor1 {
  553. // display: none;
  554. // }
  555. </style>