referOrderDataModal.vue 13 KB

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