referShipmentDetailsModal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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. </a-spin>
  100. </a-modal>
  101. </template>
  102. <script>
  103. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  104. import JEllipsis from '@/components/jeecg/JEllipsis'
  105. import moment from 'moment'
  106. import { shipList } from '@api/document/advance-packingList.js'
  107. export default {
  108. name: 'ReferShipmentDetailsModal',
  109. mixins: [JeecgListMixin],
  110. components: { JEllipsis, moment },
  111. data() {
  112. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  113. return {
  114. selectedRowKeys: [], // 勾选行
  115. selectedRows: {}, // 勾选项
  116. loading: false, // 表格加载
  117. preDeliveryDate: [], //预发货日期
  118. // 表头
  119. columns: [
  120. {
  121. title: '单据号',
  122. dataIndex: 'documentNo',
  123. width: 160,
  124. fixed: 'left',
  125. className: 'replacecolor'
  126. },
  127. {
  128. title: '销售订单号',
  129. dataIndex: 'orderNumber',
  130. width: 120,
  131. fixed: 'left',
  132. className: 'replacecolor'
  133. },
  134. {
  135. title: '客户简称',
  136. dataIndex: 'customerAbbreviation',
  137. width: 120,
  138. className: 'replacecolor'
  139. },
  140. {
  141. title: '部门',
  142. dataIndex: 'salesDepartment',
  143. width: 120,
  144. className: 'replacecolor'
  145. },
  146. {
  147. title: '业务员',
  148. dataIndex: 'salesman',
  149. width: 100,
  150. className: 'replacecolor'
  151. },
  152. {
  153. title: '小po',
  154. dataIndex: 'smallPo',
  155. width: 120,
  156. className: 'replacecolor'
  157. },
  158. {
  159. title: 'Pack Id',
  160. dataIndex: 'packId',
  161. width: 120,
  162. className: 'replacecolor'
  163. },
  164. {
  165. title: '分销点',
  166. dataIndex: 'distributionPoint',
  167. width: 120,
  168. className: 'replacecolor'
  169. },
  170. {
  171. title: '款号',
  172. dataIndex: 'itemNumber',
  173. width: 120,
  174. className: 'replacecolor'
  175. },
  176. {
  177. title: '数量(合计)',
  178. dataIndex: 'shipmentQuantity',
  179. width: 100,
  180. className: 'replacecolor'
  181. },
  182. // {
  183. // title: '创建时间',
  184. // dataIndex: 'createTime',
  185. // align: 'center',
  186. // sorter: true,
  187. // customRender: text => {
  188. // return moment(text).format('YYYY-MM-DD')
  189. // }
  190. // },
  191. {
  192. title: '预发货日期',
  193. dataIndex: 'preDeliveryDate',
  194. width: 120,
  195. className: 'replacecolor'
  196. },
  197. // {
  198. // title: '预完工日期',
  199. // dataIndex: 'preCompletionDate',
  200. // width: 120,
  201. // className: 'replacecolor'
  202. // },
  203. {
  204. title: '存货名称',
  205. dataIndex: 'inventoryName',
  206. width: 220,
  207. className: 'replacecolor'
  208. },
  209. // {
  210. // title: '单价(销售)',
  211. // dataIndex: 'salesUnitPrice',
  212. // width: 120,
  213. // className: 'replacecolor'
  214. // },
  215. // {
  216. // title: '采购/委外订单号',
  217. // dataIndex: 'purOrSubOrder',
  218. // width: 140,
  219. // className: 'replacecolor'
  220. // },
  221. // {
  222. // title: '订单类型',
  223. // dataIndex: 'orderType',
  224. // width: 120,
  225. // className: 'replacecolor'
  226. // },
  227. // {
  228. // // (采购/委外单价)
  229. // title: '工厂单价',
  230. // dataIndex: 'factoryUnitPrice',
  231. // width: 100,
  232. // className: 'replacecolor'
  233. // },
  234. // {
  235. // // (单证维护)
  236. // title: '申报要素',
  237. // dataIndex: 'declarationElements',
  238. // width: 120,
  239. // customRender: t => ellipsis(t),
  240. // className: 'replacecolor'
  241. // },
  242. // {
  243. // // (存货自定义项)
  244. // title: '套装件数',
  245. // dataIndex: 'numberOfSets',
  246. // width: 100,
  247. // className: 'replacecolor'
  248. // },
  249. // {
  250. // title: '是否TC功能',
  251. // dataIndex: 'isTc',
  252. // // 0 否 、 1 是
  253. // width: 90,
  254. // className: 'replacecolor'
  255. // },
  256. // {
  257. // title: 'HScode',
  258. // dataIndex: 'hsCode',
  259. // width: 120,
  260. // className: 'replacecolor'
  261. // },
  262. // {
  263. // title: '中文品名',
  264. // dataIndex: 'chineseName',
  265. // width: 120,
  266. // className: 'replacecolor'
  267. // },
  268. // {
  269. // title: '英文品名',
  270. // dataIndex: 'englishProductName',
  271. // width: 120,
  272. // className: 'replacecolor'
  273. // },
  274. {
  275. title: '成衣工厂',
  276. dataIndex: 'garmentFactory',
  277. width: 120,
  278. className: 'replacecolor'
  279. },
  280. // {
  281. // title: '报关单价',
  282. // dataIndex: 'customsDeclarationUnitPrice',
  283. // width: 120,
  284. // className: 'replacecolor'
  285. // }
  286. ],
  287. data: [],
  288. confirmLoading: false,
  289. referShipDetModVis: false,
  290. // 查询条件
  291. queryParam: {
  292. status:'y',
  293. },
  294. // 分页
  295. pagination: {
  296. // total: 0,
  297. // current: 0,
  298. // pageSize: 0
  299. }
  300. }
  301. },
  302. // 接收父组件 方法
  303. // props: {
  304. // father: {
  305. // type: Function,
  306. // default: null
  307. // }
  308. // },
  309. created() {
  310. this.getShipData()
  311. },
  312. methods: {
  313. //参照发运明细数据
  314. getShipData() {
  315. this.$nextTick(() => {
  316. shipList(this.queryParam).then(res => {
  317. // console.log('参照订单数据res', res)
  318. if (res.success) {
  319. this.data = [];
  320. if (res.result.records != null){
  321. this.data = res.result.records;
  322. this.data.map(item=>{
  323. if(item.isTc === "1"){
  324. item.isTc = '是'
  325. }else if(item.isTc === "0"){
  326. item.isTc = '否'
  327. }
  328. })
  329. }
  330. this.pagination = {
  331. total: res.result.total,
  332. current: res.result.current,
  333. pageSize: res.result.size
  334. }
  335. }
  336. })
  337. })
  338. },
  339. // 弹框确定
  340. onSubmit() {
  341. if (this.selectedRowKeys.length == 0) {
  342. this.$message.error('请勾选发运明细')
  343. } else {
  344. // console.log('需要传给父组件的数据', this.selectedRows)
  345. // bao父组件指定的传数据绑定的函数 || this.selectedRows子组件给父组件传递的数据
  346. var msg = "选中记录后,会清除编辑的内容。";
  347. this.$message.info(msg);
  348. this.$emit('bao', this.selectedRows)
  349. this.referShipDetModVis = false
  350. this.selectedRowKeys = []
  351. this.selectedRows = []
  352. this.close()
  353. }
  354. },
  355. // 弹框查询按钮
  356. searchQuery() {
  357. this.queryParam.pageNo = ''
  358. this.getShipData()
  359. },
  360. // 重置
  361. searchReset() {
  362. this.queryParam = {
  363. status:'y'
  364. }
  365. this.preDeliveryDate = []
  366. this.getShipData()
  367. },
  368. close() {
  369. this.$emit('close')
  370. this.referShipDetModVis = false
  371. this.selectedRowKeys = []
  372. this.data = []
  373. this.queryParam = {
  374. status:'y'
  375. }
  376. this.preDeliveryDate = []
  377. this.getShipData()
  378. },
  379. handleCancel() {
  380. this.close()
  381. },
  382. // 选中行
  383. onSelectChange(keys, rows) {
  384. this.selectedRowKeys = keys
  385. this.selectedRows = rows
  386. if (this.selectedRows.length > 1) {
  387. this.$message.error("只能勾选一条参照数据!")
  388. this.selectedRowKeys.pop()
  389. }
  390. },
  391. handleTableChange(pagination, filters, sorter) {
  392. this.queryParam.pageNo = pagination.current
  393. this.getShipData()
  394. },
  395. onDateChange(value, dateString) {
  396. this.queryParam.startDate = dateString[0]
  397. this.queryParam.endDate = dateString[1]
  398. },
  399. },
  400. computed: {
  401. // 选中项
  402. rowSelection() {
  403. return {
  404. onChange: (selectedRowKeys, selectedRows) => {
  405. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  406. },
  407. getCheckboxProps: record => ({
  408. props: {
  409. disabled: record.title === 'Disabled User',
  410. // Column configuration not to be checked
  411. title: record.title
  412. }
  413. })
  414. }
  415. }
  416. }
  417. }
  418. </script>
  419. <style lang="less" scoped>
  420. @import '~@assets/less/common.less';
  421. @import '~@assets/less/overwriter.less';
  422. /deep/ .ant-table-thead > tr > th {
  423. text-align: center;
  424. // font-weight: 700;
  425. }
  426. /deep/ .ant-table-tbody {
  427. text-align: center;
  428. }
  429. /deep/ th.replacecolor {
  430. background-color: #ccc !important;
  431. }
  432. </style>