referencePrePacklist.vue 11 KB

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