referencePrePacklist.vue 14 KB

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