referencePrePacklist.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <a-modal
  3. title="参照预装箱单"
  4. v-model="referencePrePacklist"
  5. :confirmLoading="confirmLoading"
  6. @ok="onSubmit"
  7. @cancel="handleCancel"
  8. width="86%"
  9. style="top:330px;left:100px;"
  10. >
  11. <!-- tabel 加载 -->
  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.customerAbbreviation"></a-input> -->
  20. <j-search-select-tag
  21. placeholder="请选择客户简称"
  22. v-model="queryParam.customerAbbreviation"
  23. dict="view_customer,customername,customername">
  24. </j-search-select-tag>
  25. </a-form-item>
  26. </a-col>
  27. <a-col :md="6" :sm="8">
  28. <a-form-item label="预发货日期">
  29. <a-range-picker
  30. :placeholder="['开始时间', '结束时间']"
  31. format="YYYY-MM-DD"
  32. style="width: 100%"
  33. v-model="preDeliveryDate"
  34. @change="onDateChange"
  35. />
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="8">
  39. <a-form-item label="小PO">
  40. <a-input placeholder="请输入小PO" v-model="queryParam.smallPo"></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.distributionPoint"></a-input>
  47. </a-form-item>
  48. </a-col> -->
  49. <a-col :md="6" :sm="8">
  50. <a-form-item label="款号">
  51. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  52. </a-form-item>
  53. </a-col>
  54. <!-- <a-col :md="6" :sm="8">
  55. <a-form-item label="是否被参照">
  56. <a-select v-model="queryParam.isReference" style="width: 200px" placeholder="请选择发货情况" >
  57. <a-select-option value="n">未被参照</a-select-option>
  58. <a-select-option value="y">已被参照</a-select-option>
  59. </a-select>
  60. </a-form-item>
  61. </a-col> -->
  62. <a-col :md="6" :sm="8">
  63. <a-form-item label="发货情况">
  64. <a-select v-model="queryParam.orderStatus" style="width: 200px" placeholder="请选择发货情况" >
  65. <a-select-option value="n">超发</a-select-option>
  66. <a-select-option value="y">正常</a-select-option>
  67. </a-select>
  68. </a-form-item>
  69. </a-col>
  70. <a-col :md="6" :sm="8">
  71. <a-form-item label="预托书号">
  72. <a-input placeholder="请输入预托书号" v-model="queryParam.depositaryReceiptNo"></a-input>
  73. </a-form-item>
  74. </a-col>
  75. </template>
  76. <a-col :md="6" :sm="8">
  77. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  78. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  79. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  80. <a @click="handleToggleSearch" style="margin-left: 8px">
  81. {{ toggleSearchStatus ? '收起' : '展开' }}
  82. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  83. </a>
  84. </span>
  85. </a-col>
  86. </a-row>
  87. </a-form>
  88. </div>
  89. <!-- table , y: 300 -->
  90. <div class="anotherTable">
  91. <a-table
  92. :columns="advancePackingListColumns"
  93. :data-source="advancePackingListData"
  94. :loading="loading"
  95. :pagination="pagination"
  96. row-key="id"
  97. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  98. @change="handleTableChange"
  99. bordered
  100. :scroll="{ x: 1500,y:400 }"
  101. size="small"
  102. >
  103. </a-table>
  104. <h3>共选择 {{selectedNumber}} 条</h3>
  105. </div>
  106. </a-spin>
  107. </a-modal>
  108. </template>
  109. <script>
  110. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  111. import JEllipsis from '@/components/jeecg/JEllipsis'
  112. import moment from 'moment'
  113. import { orderSpltList,queryOrderData } from '@api/document/packing-list/packinglist-clothes.js'
  114. export default {
  115. name: 'AdvancePackingListModal', // 参照预装箱单 弹框
  116. mixins: [JeecgListMixin],
  117. components: { JEllipsis, moment },
  118. data() {
  119. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  120. return {
  121. // 查询条件
  122. queryParam: {
  123. // customer: '', //客户
  124. // // preDeliveryDate: '', // 预发货日期\
  125. // stratDate:'',
  126. // endDate:'',
  127. // smallPo: '' , // 小PO
  128. // distributionPoint: '' , //分销点
  129. // itemNumber: '', //款号
  130. // pageNo:1,
  131. // isReference:'', // 是否被参照
  132. },
  133. preDeliveryDate:[],
  134. selectedNumber:0,
  135. selectedRowKeys: [], // 勾选航
  136. loading: false, // 表格加载
  137. // 表头
  138. advancePackingListColumns: [
  139. {
  140. title: '款号',
  141. dataIndex: 'itemNumber',
  142. width: 120,
  143. ellipsis: true,
  144. // fixed: 'left',
  145. className: 'replacecolor',
  146. },
  147. {
  148. title: '客户简称',
  149. dataIndex: 'customerAbbreviation',
  150. width: 120,
  151. // fixed: 'left',
  152. // customRender: t => ellipsis(t),
  153. ellipsis: true,
  154. className: 'replacecolor'
  155. },
  156. {
  157. title: '预发货日期',
  158. dataIndex: 'preDeliveryDate',
  159. width: 120,
  160. ellipsis: true,
  161. className: 'replacecolor'
  162. },
  163. {
  164. title: '小PO',
  165. dataIndex: 'smallPo',
  166. width: 120,
  167. // customRender: t => ellipsis(t),
  168. ellipsis: true,
  169. className: 'replacecolor'
  170. },
  171. // {
  172. // title: '创建时间',
  173. // dataIndex: 'createTime',
  174. // align: 'center',
  175. // sorter: true,
  176. // customRender: text => {
  177. // return moment(text).format('YYYY-MM-DD')
  178. // }
  179. // },
  180. {
  181. title: '分销点',
  182. dataIndex: 'distributionPoint',
  183. width: 120,
  184. ellipsis: true,
  185. // customRender: t => ellipsis(t),
  186. className: 'replacecolor'
  187. },
  188. // {
  189. // title: '客户',
  190. // dataIndex: 'customer',
  191. // width: 250,
  192. // customRender: t => ellipsis(t),
  193. // className: 'replacecolor'
  194. // },
  195. {
  196. title: '存货名称',
  197. dataIndex: 'inventoryName',
  198. width: 150,
  199. ellipsis: true,
  200. // customRender: t => ellipsis(t),
  201. className: 'replacecolor'
  202. },
  203. {
  204. title: '颜色',
  205. dataIndex: 'colour',
  206. width: 120,
  207. ellipsis: true,
  208. // customRender: t => ellipsis(t),
  209. className: 'replacecolor'
  210. },
  211. {
  212. title: '采购/委外订单号',
  213. dataIndex: 'spurOrSubOrder',
  214. width: 200,
  215. ellipsis: true,
  216. // customRender: t => ellipsis(t),
  217. className: 'replacecolor'
  218. },
  219. // {
  220. // title: '工厂单价',
  221. // dataIndex: 'factoryUnitPrice',
  222. // width: 120,
  223. // className: 'replacecolor'
  224. // },
  225. {
  226. title: '箱数',
  227. dataIndex: 'totalBoxes',
  228. width: 90,
  229. ellipsis: true,
  230. className: 'replacecolor'
  231. },
  232. {
  233. title: '数量(按合并规则累计)',
  234. dataIndex: 'total',
  235. width: 200,
  236. className: 'replacecolor',
  237. ellipsis: true,
  238. },
  239. // {
  240. // title: '订单类型',
  241. // dataIndex: 'orderType',
  242. // width: 120,
  243. // className: 'replacecolor'
  244. // },
  245. {
  246. title: '集装箱代号',
  247. dataIndex: 'containerCode',
  248. width: 120,
  249. ellipsis: true,
  250. className: 'replacecolor'
  251. },
  252. {
  253. title: '集装箱号',
  254. dataIndex: 'containerNumber',
  255. width: 120,
  256. ellipsis: true,
  257. className: 'replacecolor'
  258. },
  259. {
  260. title: '预托书号',
  261. dataIndex: 'depositaryReceiptNo',
  262. width: 120,
  263. ellipsis: true,
  264. className: 'replacecolor'
  265. },
  266. {
  267. title: '总净重',
  268. dataIndex: 'totalNetWeight',
  269. width: 90,
  270. ellipsis: true,
  271. className: 'replacecolor'
  272. },
  273. {
  274. title: '总毛重',
  275. dataIndex: 'totalGrossWeight',
  276. width: 90,
  277. ellipsis: true,
  278. className: 'replacecolor'
  279. },
  280. {
  281. title: '总体积',
  282. dataIndex: 'totalVolume',
  283. width: 90,
  284. ellipsis: true,
  285. className: 'replacecolor'
  286. },
  287. {
  288. title: '成衣工厂',
  289. dataIndex: 'garmentFactory',
  290. width: 90,
  291. ellipsis: true,
  292. className: 'replacecolor'
  293. },
  294. {
  295. title: '备注',
  296. dataIndex: 'u8Remarks',
  297. width: 150,
  298. // customRender: t => ellipsis(t),
  299. ellipsis: true,
  300. className: 'replacecolor'
  301. }
  302. // {
  303. // title: '总价',
  304. // dataIndex: 'totalPrice',
  305. // width: 90,
  306. // className: 'replacecolor'
  307. // },
  308. ],
  309. advancePackingListData: [],
  310. pagination: {
  311. // total: '',
  312. // current: 0,
  313. // pageSize: 0
  314. },
  315. // orderDataform: this.$form.createForm(this),
  316. confirmLoading: false,
  317. referencePrePacklist: false
  318. }
  319. },
  320. // 接收父组件 方法
  321. props: {
  322. father: {
  323. type: Function,
  324. default: null
  325. }
  326. },
  327. created() {
  328. },
  329. methods: {
  330. //参考数据
  331. getAdvancePackingListData() {
  332. this.$nextTick(() => {
  333. //if (this.queryParam.preDeliveryDate != undefined && this.queryParam.preDeliveryDate != "")
  334. orderSpltList(this.queryParam).then(res => {
  335. if (res.success) {
  336. this.advancePackingListData = res.result.records;
  337. this.advancePackingListData.map(item =>{
  338. var str =item.preDeliveryDate
  339. var n=str.split(" ");
  340. item.preDeliveryDate = n[0]
  341. })
  342. this.pagination = {
  343. total: res.result.total,
  344. current: res.result.current,
  345. pageSize: res.result.size
  346. }
  347. }else {
  348. that.$message.error(res.message);
  349. }
  350. })
  351. })
  352. },
  353. // 弹框查询按钮
  354. searchQuery() {
  355. this.toggleSearchStatus = false
  356. this.queryParam.pageNo = ''
  357. this.getAdvancePackingListData()
  358. this.defulatSelect()
  359. },
  360. // 重置
  361. searchReset() {
  362. this.queryParam = {}
  363. this.preDeliveryDate = []
  364. this.getAdvancePackingListData()
  365. this.defulatSelect()
  366. // this.getShipmentList()
  367. },
  368. // 弹框确定
  369. onSubmit() {
  370. if (this.selectedRowKeys.length == 0) {
  371. this.$message.error('请选择数据');
  372. } else{
  373. var id = this.selectedRowKeys.toString()
  374. queryOrderData({ids:id}).then(res => {
  375. if (res.success) {
  376. this.loading = false
  377. this.$emit('callback', this.selectedRowKeys);
  378. this.close()
  379. }else {
  380. this.$message.error('res.message')
  381. }
  382. })
  383. }
  384. // if(this.selectedRowKeys.length == 1){
  385. // this.$emit('callback', this.selectedRowKeys);
  386. // this.close()
  387. // var msg = "选中记录后,会清除编辑的内容。";
  388. // this.$message.info(msg);
  389. // }else {
  390. // this.$message.error('只能选择一行数据!');
  391. // }
  392. },
  393. close() {
  394. this.$emit('close')
  395. this.queryParam ={}
  396. this.preDeliveryDate = []
  397. this.defulatSelect()
  398. this.referencePrePacklist = false
  399. },
  400. handleCancel() {
  401. this.close()
  402. },
  403. handleTableChange(pagination, filters, sorter) {
  404. this.queryParam.pageNo = pagination.current
  405. this.getAdvancePackingListData()
  406. },
  407. // 选中行
  408. onSelectChange(keys, rows) {
  409. this.selectedRowKeys = keys;
  410. this.selectedNumber = rows.length
  411. },
  412. //选中行恢复默认
  413. defulatSelect(){
  414. this.selectedRowKeys = [];
  415. // this.selectedRows = [];
  416. this.selectedNumber = 0
  417. },
  418. onDateChange(value, dateString) {
  419. this.queryParam.stratDate = dateString[0]
  420. this.queryParam.endDate = dateString[1]
  421. },
  422. },
  423. computed: {
  424. }
  425. }
  426. </script>
  427. <style lang="less" scoped>
  428. @import '~@assets/less/common.less';
  429. @import '~@assets/less/overwriter.less';
  430. /deep/ .ant-table-thead > tr > th {
  431. text-align: center;
  432. // font-weight: 700;
  433. }
  434. /deep/ .ant-table-tbody {
  435. text-align: center;
  436. }
  437. // /deep/ th.replacecolor {
  438. // background-color: #ccc;
  439. // }
  440. </style>