referencePrePacklist.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. <j-search-select-tag
  20. placeholder="请选择客户简称"
  21. v-model="queryParam.customerAbbreviation"
  22. dict="view_customer,customer,customer">
  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.smallPo"></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.itemNumber"></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="pagination"
  69. row-key="id"
  70. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  71. @change="handleTableChange"
  72. bordered
  73. :scroll="{ x: 2000 }"
  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 { orderSpltList } from '@api/document/packing-list/packinglist-clothes.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. customer: '', //客户
  96. preDeliveryDate: '', // 预发货日期
  97. smallPo: '' , // 小PO
  98. distributionPoint: '' , //分销点
  99. itemNumber: '', //款号
  100. pageNo:1,
  101. },
  102. selectedRowKeys: [], // 勾选航
  103. loading: false, // 表格加载
  104. // 表头
  105. advancePackingListColumns: [
  106. {
  107. title: '款号',
  108. dataIndex: 'itemNumber',
  109. width: 120,
  110. fixed: 'left',
  111. className: 'replacecolor'
  112. },
  113. {
  114. title: '客户简称',
  115. dataIndex: 'customerAbbreviation',
  116. width: 120,
  117. fixed: 'left',
  118. customRender: t => ellipsis(t),
  119. className: 'replacecolor'
  120. },
  121. {
  122. title: '预发货日期',
  123. dataIndex: 'preDeliveryDate',
  124. width: 120,
  125. className: 'replacecolor'
  126. },
  127. {
  128. title: '小PO',
  129. dataIndex: 'smallPo',
  130. width: 120,
  131. customRender: t => ellipsis(t),
  132. className: 'replacecolor'
  133. },
  134. // {
  135. // title: '创建时间',
  136. // dataIndex: 'createTime',
  137. // align: 'center',
  138. // sorter: true,
  139. // customRender: text => {
  140. // return moment(text).format('YYYY-MM-DD')
  141. // }
  142. // },
  143. {
  144. title: '分销点',
  145. dataIndex: 'distributionPoint',
  146. width: 120,
  147. customRender: t => ellipsis(t),
  148. className: 'replacecolor'
  149. },
  150. {
  151. title: '备注',
  152. dataIndex: 'u8Remarks',
  153. width: 150,
  154. customRender: t => ellipsis(t),
  155. className: 'replacecolor'
  156. },
  157. {
  158. title: '客户',
  159. dataIndex: 'customer',
  160. width: 250,
  161. customRender: t => ellipsis(t),
  162. className: 'replacecolor'
  163. },
  164. {
  165. title: '存货名称',
  166. dataIndex: 'inventoryName',
  167. width: 150,
  168. customRender: t => ellipsis(t),
  169. className: 'replacecolor'
  170. },
  171. {
  172. title: '颜色',
  173. dataIndex: 'colour',
  174. width: 120,
  175. customRender: t => ellipsis(t),
  176. className: 'replacecolor'
  177. },
  178. {
  179. title: '采购/委外订单号',
  180. dataIndex: 'spurOrSubOrder',
  181. width: 200,
  182. customRender: t => ellipsis(t),
  183. className: 'replacecolor'
  184. },
  185. {
  186. title: '工厂单价',
  187. dataIndex: 'factoryUnitPrice',
  188. width: 120,
  189. className: 'replacecolor'
  190. },
  191. {
  192. title: '箱数',
  193. dataIndex: 'totalBoxes',
  194. width: 90,
  195. className: 'replacecolor'
  196. },
  197. {
  198. title: '数量(按合并规则累计)',
  199. dataIndex: 'total',
  200. width: 200,
  201. className: 'replacecolor'
  202. },
  203. {
  204. title: '订单类型',
  205. dataIndex: 'orderType',
  206. width: 120,
  207. className: 'replacecolor'
  208. },
  209. {
  210. title: '集装箱代号',
  211. dataIndex: 'containerCode',
  212. width: 120,
  213. className: 'replacecolor'
  214. },
  215. {
  216. title: '集装箱号',
  217. dataIndex: 'containerNumber',
  218. width: 120,
  219. className: 'replacecolor'
  220. },
  221. {
  222. title: '总净重',
  223. dataIndex: 'totalNetWeight',
  224. width: 90,
  225. className: 'replacecolor'
  226. },
  227. {
  228. title: '总毛重',
  229. dataIndex: 'totalGrossWeight',
  230. width: 90,
  231. className: 'replacecolor'
  232. },
  233. {
  234. title: '总体积',
  235. dataIndex: 'totalVolume',
  236. width: 90,
  237. className: 'replacecolor'
  238. },
  239. {
  240. title: '总价',
  241. dataIndex: 'totalPrice',
  242. width: 90,
  243. className: 'replacecolor'
  244. },
  245. ],
  246. advancePackingListData: [],
  247. pagination: {
  248. // total: '',
  249. // current: 0,
  250. // pageSize: 0
  251. },
  252. // orderDataform: this.$form.createForm(this),
  253. confirmLoading: false,
  254. referencePrePacklist: false
  255. }
  256. },
  257. // 接收父组件 方法
  258. props: {
  259. father: {
  260. type: Function,
  261. default: null
  262. }
  263. },
  264. created() {
  265. },
  266. methods: {
  267. //参考数据
  268. getAdvancePackingListData() {
  269. this.$nextTick(() => {
  270. //if (this.queryParam.preDeliveryDate != undefined && this.queryParam.preDeliveryDate != "")
  271. orderSpltList(this.queryParam).then(res => {
  272. if (res.success) {
  273. this.advancePackingListData = res.result.records;
  274. this.pagination = {
  275. total: res.result.total,
  276. current: res.result.current,
  277. pageSize: res.result.size
  278. }
  279. }else {
  280. that.$message.error(res.message);
  281. }
  282. })
  283. })
  284. },
  285. // 弹框查询按钮
  286. searchQuery() {
  287. this.queryParam.pageNo = 1
  288. this.getAdvancePackingListData()
  289. },
  290. // 重置
  291. searchReset() {
  292. this.queryParam = {}
  293. this.getAdvancePackingListData()
  294. // this.getShipmentList()
  295. },
  296. // 弹框确定
  297. onSubmit() {
  298. if (this.selectedRowKeys.length == 0) {
  299. this.$message.error('请选择数据');
  300. } else if(this.selectedRowKeys.length == 1){
  301. this.$emit('callback', this.selectedRowKeys);
  302. this.referencePrePacklist = false;
  303. var msg = "选中记录后,会清除编辑的内容。";
  304. this.$message.info(msg);
  305. this.selectedRowKeys = [];
  306. }else {
  307. this.$message.error('只能选择一行数据!');
  308. }
  309. },
  310. close() {
  311. this.$emit('close')
  312. this.referencePrePacklist = false
  313. },
  314. handleCancel() {
  315. this.selectedRowKeys = [];
  316. this.close()
  317. },
  318. handleTableChange(pagination, filters, sorter) {
  319. this.queryParam.pageNo = pagination.current
  320. this.getAdvancePackingListData()
  321. },
  322. // 选中行
  323. onSelectChange(keys, rows) {
  324. this.selectedRowKeys = keys;
  325. console.log(rows)
  326. debugger
  327. },
  328. deliveryDateChange(value, dateString) {
  329. this.queryParam.preDeliveryDate = dateString
  330. },
  331. },
  332. computed: {
  333. }
  334. }
  335. </script>
  336. <style lang="less" scoped>
  337. @import '~@assets/less/common.less';
  338. @import '~@assets/less/overwriter.less';
  339. /deep/ .ant-table-thead > tr > th {
  340. text-align: center;
  341. // font-weight: 700;
  342. }
  343. /deep/ .ant-table-tbody {
  344. text-align: center;
  345. }
  346. // /deep/ th.replacecolor {
  347. // background-color: #ccc;
  348. // }
  349. </style>