referencePrePacklist.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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. this.queryParam.pageSize = 100
  334. //if (this.queryParam.preDeliveryDate != undefined && this.queryParam.preDeliveryDate != "")
  335. orderSpltList(this.queryParam).then(res => {
  336. if (res.success) {
  337. this.advancePackingListData = res.result.records;
  338. this.advancePackingListData.map(item =>{
  339. var str =item.preDeliveryDate
  340. var n=str.split(" ");
  341. item.preDeliveryDate = n[0]
  342. })
  343. this.pagination = {
  344. total: res.result.total,
  345. current: res.result.current,
  346. pageSize: res.result.size
  347. }
  348. }else {
  349. that.$message.error(res.message);
  350. }
  351. })
  352. })
  353. },
  354. // 弹框查询按钮
  355. searchQuery() {
  356. this.toggleSearchStatus = false
  357. this.queryParam.pageNo = ''
  358. this.getAdvancePackingListData()
  359. this.defulatSelect()
  360. },
  361. // 重置
  362. searchReset() {
  363. this.queryParam = {}
  364. this.preDeliveryDate = []
  365. this.getAdvancePackingListData()
  366. this.defulatSelect()
  367. // this.getShipmentList()
  368. },
  369. // 弹框确定
  370. onSubmit() {
  371. if (this.selectedRowKeys.length == 0) {
  372. this.$message.error('请选择数据');
  373. } else{
  374. var id = this.selectedRowKeys.toString()
  375. queryOrderData({ids:id}).then(res => {
  376. if (res.success) {
  377. this.loading = false
  378. this.$emit('callback', this.selectedRowKeys);
  379. this.close()
  380. }else {
  381. this.$message.error('res.message')
  382. }
  383. })
  384. }
  385. // if(this.selectedRowKeys.length == 1){
  386. // this.$emit('callback', this.selectedRowKeys);
  387. // this.close()
  388. // var msg = "选中记录后,会清除编辑的内容。";
  389. // this.$message.info(msg);
  390. // }else {
  391. // this.$message.error('只能选择一行数据!');
  392. // }
  393. },
  394. close() {
  395. this.$emit('close')
  396. this.queryParam ={}
  397. this.preDeliveryDate = []
  398. this.defulatSelect()
  399. this.referencePrePacklist = false
  400. },
  401. handleCancel() {
  402. this.close()
  403. },
  404. handleTableChange(pagination, filters, sorter) {
  405. this.queryParam.pageNo = pagination.current
  406. this.getAdvancePackingListData()
  407. },
  408. // 选中行
  409. onSelectChange(keys, rows) {
  410. this.selectedRowKeys = keys;
  411. this.selectedNumber = rows.length
  412. },
  413. //选中行恢复默认
  414. defulatSelect(){
  415. this.selectedRowKeys = [];
  416. // this.selectedRows = [];
  417. this.selectedNumber = 0
  418. },
  419. onDateChange(value, dateString) {
  420. this.queryParam.stratDate = dateString[0]
  421. this.queryParam.endDate = dateString[1]
  422. },
  423. },
  424. computed: {
  425. }
  426. }
  427. </script>
  428. <style lang="less" scoped>
  429. @import '~@assets/less/common.less';
  430. @import '~@assets/less/overwriter.less';
  431. /deep/ .ant-table-thead > tr > th {
  432. text-align: center;
  433. // font-weight: 700;
  434. }
  435. /deep/ .ant-table-tbody {
  436. text-align: center;
  437. }
  438. // /deep/ th.replacecolor {
  439. // background-color: #ccc;
  440. // }
  441. </style>