referShipmentDetailsModal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <a-modal
  3. title="参照出运明细"
  4. v-model="referShipDetModVis"
  5. :confirmLoading="confirmLoading"
  6. @ok="onSubmit"
  7. @cancel="handleCancel"
  8. width="86%"
  9. style="top:330px;left:100px;"
  10. >
  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.documentNo"></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.customer"
  26. dict="view_customer,customername,customername">
  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-select v-model="queryParam.status" style="width: 200px" placeholder="请选择发货情况" >
  33. <a-select-option value="n">超量发货</a-select-option>
  34. <a-select-option value="y">正常</a-select-option>
  35. </a-select>
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="8">
  39. <a-form-item label="业务员">
  40. <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
  41. </a-form-item>
  42. </a-col>
  43. <template v-if="toggleSearchStatus">
  44. <a-col :md="6" :sm="8">
  45. <a-form-item label="成衣工厂">
  46. <a-input placeholder="请输入成衣工厂" v-model="queryParam.garmentFactory"></a-input>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :md="6" :sm="8">
  50. <a-form-item label="Po">
  51. <a-input placeholder="请输入Po" v-model="queryParam.smallPo"></a-input>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-item label="分销点">
  56. <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input>
  57. </a-form-item>
  58. </a-col>
  59. <a-col :md="6" :sm="8">
  60. <a-form-item label="预发货日期">
  61. <a-range-picker
  62. :placeholder="['开始时间', '结束时间']"
  63. format="YYYY-MM-DD"
  64. style="width: 100%"
  65. v-model="preDeliveryDate"
  66. @change="onDateChange"
  67. />
  68. </a-form-item>
  69. </a-col>
  70. </template>
  71. <a-col :md="6" :sm="8">
  72. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  73. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  74. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  75. <a @click="handleToggleSearch" style="margin-left: 8px">
  76. {{ toggleSearchStatus ? '收起' : '展开' }}
  77. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  78. </a>
  79. </span>
  80. </a-col>
  81. </a-row>
  82. </a-form>
  83. </div>
  84. <!-- table -->
  85. <a-table
  86. bordered
  87. size="small"
  88. rowKey="groupId"
  89. v-if="data"
  90. :columns="columns"
  91. :data-source="data"
  92. :loading="loading"
  93. :pagination="pagination"
  94. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  95. @change="handleTableChange"
  96. :scroll="{ x: 1500 }"
  97. >
  98. </a-table>
  99. <h3>共选择 {{selectedNumber}} 条</h3>
  100. </a-spin>
  101. </a-modal>
  102. </template>
  103. <script>
  104. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  105. import JEllipsis from '@/components/jeecg/JEllipsis'
  106. import moment from 'moment'
  107. import { shipList } from '@api/document/advance-packingList.js'
  108. export default {
  109. name: 'ReferShipmentDetailsModal',
  110. mixins: [JeecgListMixin],
  111. components: { JEllipsis, moment },
  112. data() {
  113. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  114. return {
  115. selectedRowKeys: [], // 勾选行
  116. selectedRows: [], // 勾选项
  117. selectedNumber:0,//勾选条数
  118. loading: false, // 表格加载
  119. preDeliveryDate: [], //预发货日期
  120. // 表头
  121. columns: [
  122. {
  123. title: '单据号',
  124. dataIndex: 'documentNo',
  125. width: 160,
  126. // fixed: 'left',
  127. ellipsis: true,
  128. className: 'replacecolor'
  129. },
  130. {
  131. title: '销售订单号',
  132. dataIndex: 'orderNumber',
  133. width: 120,
  134. // fixed: 'left',
  135. ellipsis: true,
  136. className: 'replacecolor'
  137. },
  138. {
  139. title: '客户简称',
  140. dataIndex: 'customerAbbreviation',
  141. width: 120,
  142. ellipsis: true,
  143. className: 'replacecolor'
  144. },
  145. {
  146. title: '部门',
  147. dataIndex: 'salesDepartment',
  148. width: 120,
  149. ellipsis: true,
  150. className: 'replacecolor'
  151. },
  152. {
  153. title: '业务员',
  154. dataIndex: 'salesman',
  155. width: 100,
  156. ellipsis: true,
  157. className: 'replacecolor'
  158. },
  159. {
  160. title: '小po',
  161. dataIndex: 'smallPo',
  162. width: 120,
  163. ellipsis: true,
  164. className: 'replacecolor'
  165. },
  166. {
  167. title: 'Pack Id',
  168. dataIndex: 'packId',
  169. width: 120,
  170. ellipsis: true,
  171. className: 'replacecolor'
  172. },
  173. {
  174. title: '分销点',
  175. dataIndex: 'distributionPoint',
  176. width: 120,
  177. ellipsis: true,
  178. className: 'replacecolor'
  179. },
  180. {
  181. title: '款号',
  182. dataIndex: 'itemNumber',
  183. width: 120,
  184. ellipsis: true,
  185. className: 'replacecolor'
  186. },
  187. {
  188. title: '数量(合计)',
  189. dataIndex: 'shipmentQuantity',
  190. width: 100,
  191. ellipsis: true,
  192. className: 'replacecolor'
  193. },
  194. // {
  195. // title: '创建时间',
  196. // dataIndex: 'createTime',
  197. // align: 'center',
  198. // sorter: true,
  199. // customRender: text => {
  200. // return moment(text).format('YYYY-MM-DD')
  201. // }
  202. // },
  203. {
  204. title: '预发货日期',
  205. dataIndex: 'preDeliveryDate',
  206. width: 120,
  207. ellipsis: true,
  208. className: 'replacecolor'
  209. },
  210. // {
  211. // title: '预完工日期',
  212. // dataIndex: 'preCompletionDate',
  213. // width: 120,
  214. // className: 'replacecolor'
  215. // },
  216. {
  217. title: '存货名称',
  218. dataIndex: 'inventoryName',
  219. width: 220,
  220. ellipsis: true,
  221. className: 'replacecolor'
  222. },
  223. // {
  224. // title: '单价(销售)',
  225. // dataIndex: 'salesUnitPrice',
  226. // width: 120,
  227. // className: 'replacecolor'
  228. // },
  229. // {
  230. // title: '采购/委外订单号',
  231. // dataIndex: 'purOrSubOrder',
  232. // width: 140,
  233. // className: 'replacecolor'
  234. // },
  235. // {
  236. // title: '订单类型',
  237. // dataIndex: 'orderType',
  238. // width: 120,
  239. // className: 'replacecolor'
  240. // },
  241. // {
  242. // // (采购/委外单价)
  243. // title: '工厂单价',
  244. // dataIndex: 'factoryUnitPrice',
  245. // width: 100,
  246. // className: 'replacecolor'
  247. // },
  248. // {
  249. // // (单证维护)
  250. // title: '申报要素',
  251. // dataIndex: 'declarationElements',
  252. // width: 120,
  253. // customRender: t => ellipsis(t),
  254. // className: 'replacecolor'
  255. // },
  256. // {
  257. // // (存货自定义项)
  258. // title: '套装件数',
  259. // dataIndex: 'numberOfSets',
  260. // width: 100,
  261. // className: 'replacecolor'
  262. // },
  263. // {
  264. // title: '是否TC功能',
  265. // dataIndex: 'isTc',
  266. // // 0 否 、 1 是
  267. // width: 90,
  268. // className: 'replacecolor'
  269. // },
  270. // {
  271. // title: 'HScode',
  272. // dataIndex: 'hsCode',
  273. // width: 120,
  274. // className: 'replacecolor'
  275. // },
  276. // {
  277. // title: '中文品名',
  278. // dataIndex: 'chineseName',
  279. // width: 120,
  280. // className: 'replacecolor'
  281. // },
  282. // {
  283. // title: '英文品名',
  284. // dataIndex: 'englishProductName',
  285. // width: 120,
  286. // className: 'replacecolor'
  287. // },
  288. {
  289. title: '成衣工厂',
  290. dataIndex: 'garmentFactory',
  291. width: 120,
  292. ellipsis: true,
  293. className: 'replacecolor'
  294. },
  295. // {
  296. // title: '报关单价',
  297. // dataIndex: 'customsDeclarationUnitPrice',
  298. // width: 120,
  299. // className: 'replacecolor'
  300. // }
  301. ],
  302. data: [],
  303. confirmLoading: false,
  304. referShipDetModVis: false,
  305. // 查询条件
  306. queryParam: {
  307. status:'y',
  308. },
  309. // 分页
  310. pagination: {
  311. // total: 0,
  312. // current: 0,
  313. // pageSize: 0
  314. }
  315. }
  316. },
  317. // 接收父组件 方法
  318. // props: {
  319. // father: {
  320. // type: Function,
  321. // default: null
  322. // }
  323. // },
  324. created() {
  325. this.getShipData()
  326. },
  327. methods: {
  328. //参照发运明细数据
  329. getShipData() {
  330. this.$nextTick(() => {
  331. shipList(this.queryParam).then(res => {
  332. // console.log('参照订单数据res', res)
  333. if (res.success) {
  334. this.data = [];
  335. if (res.result.records != null){
  336. this.data = res.result.records;
  337. this.data.map(item=>{
  338. if(item.isTc === "1"){
  339. item.isTc = '是'
  340. }else if(item.isTc === "0"){
  341. item.isTc = '否'
  342. }
  343. })
  344. }
  345. this.pagination = {
  346. total: res.result.total,
  347. current: res.result.current,
  348. pageSize: res.result.size
  349. }
  350. }
  351. })
  352. })
  353. },
  354. // 弹框确定
  355. onSubmit() {
  356. if (this.selectedRowKeys.length == 0) {
  357. this.$message.error('请勾选发运明细')
  358. } else {
  359. // console.log('需要传给父组件的数据', this.selectedRows)
  360. // bao父组件指定的传数据绑定的函数 || this.selectedRows子组件给父组件传递的数据
  361. var msg = "选中记录后,会清除编辑的内容。";
  362. this.$message.info(msg);
  363. this.$emit('bao', this.selectedRows)
  364. // this.referShipDetModVis = false
  365. // this.selectedRowKeys = []
  366. // this.selectedRows = []
  367. this.close()
  368. }
  369. },
  370. // 弹框查询按钮
  371. searchQuery() {
  372. this.toggleSearchStatus = false
  373. this.queryParam.pageNo = ''
  374. this.getShipData()
  375. },
  376. // 重置
  377. searchReset() {
  378. this.queryParam = {
  379. status:'y'
  380. }
  381. this.preDeliveryDate = []
  382. this.getShipData()
  383. },
  384. close() {
  385. this.$emit('close')
  386. this.referShipDetModVis = false
  387. this.selectedRowKeys = []
  388. this.data = []
  389. this.selectedNumber = 0
  390. this.queryParam = {
  391. status:'y'
  392. }
  393. this.preDeliveryDate = []
  394. this.getShipData()
  395. },
  396. handleCancel() {
  397. this.close()
  398. },
  399. // 选中行
  400. onSelectChange(keys, rows) {
  401. this.selectedRowKeys = keys
  402. this.selectedRows = rows
  403. if (this.selectedRows.length > 1) {
  404. this.$message.error("只能勾选一条参照数据!")
  405. this.selectedRowKeys.pop()
  406. this.selectedRow.pop()
  407. }
  408. this.selectedNumber = rows.length
  409. },
  410. handleTableChange(pagination, filters, sorter) {
  411. this.queryParam.pageNo = pagination.current
  412. this.getShipData()
  413. },
  414. onDateChange(value, dateString) {
  415. this.queryParam.startDate = dateString[0]
  416. this.queryParam.endDate = dateString[1]
  417. },
  418. },
  419. computed: {
  420. // 选中项
  421. rowSelection() {
  422. return {
  423. onChange: (selectedRowKeys, selectedRows) => {
  424. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  425. },
  426. getCheckboxProps: record => ({
  427. props: {
  428. disabled: record.title === 'Disabled User',
  429. // Column configuration not to be checked
  430. title: record.title
  431. }
  432. })
  433. }
  434. }
  435. }
  436. }
  437. </script>
  438. <style lang="less" scoped>
  439. @import '~@assets/less/common.less';
  440. @import '~@assets/less/overwriter.less';
  441. /deep/ .ant-table-thead > tr > th {
  442. text-align: center;
  443. // font-weight: 700;
  444. }
  445. /deep/ .ant-table-tbody {
  446. text-align: center;
  447. }
  448. /deep/ th.replacecolor {
  449. background-color: #ccc !important;
  450. }
  451. /deep/ .ant-table-fixed-left table, .ant-table-fixed-right table{
  452. width: min-content;
  453. }
  454. </style>