referShipmentDetailsModal.vue 13 KB

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