referShipDetailsModal.vue 13 KB

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