advancePackingListModal.vue 9.5 KB

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