adPaList-clothes.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <!-- 预装箱单-成衣 列表-->
  3. <div id="adPaListClothes">
  4. <!-- 查询 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="订单号">
  11. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="款号">
  16. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="品名">
  21. <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <template v-if="toggleSearchStatus">
  25. <a-col :md="6" :sm="8">
  26. <a-form-item label="单据日期">
  27. <a-range-picker
  28. style="width: 100%"
  29. v-model="timeRange"
  30. format="YYYY-MM-DD"
  31. :placeholder="['开始日期', '结束日期']"
  32. @change="onDateChange"
  33. @ok="onDateOk"
  34. />
  35. </a-form-item>
  36. </a-col>
  37. </template>
  38. <a-col :md="6" :sm="8">
  39. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  40. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  41. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  42. <a @click="handleToggleSearch" style="margin-left: 8px">
  43. {{ toggleSearchStatus ? '收起' : '展开' }}
  44. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  45. </a>
  46. </span>
  47. </a-col>
  48. </a-row>
  49. </a-form>
  50. </div>
  51. </a-card>
  52. <!-- 操作按钮区域 导出 导入 新增-->
  53. <a-card :bordered="false" style="margin:10px 0">
  54. <div class="table-operator">
  55. <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣')">导出</a-button>
  56. <a-upload
  57. productName="file"
  58. :showUploadList="false"
  59. :multiple="false"
  60. :headers="tokenHeader"
  61. :action="importExcelUrl"
  62. @change="handleImportExcel"
  63. >
  64. <a-button type="primary" icon="import">导入</a-button>
  65. </a-upload>
  66. <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
  67. </div>
  68. <!-- table rowKey="id" -->
  69. <a-table
  70. bordered
  71. :columns="adPaListClothesColumns"
  72. :data-source="adPaListClothesData"
  73. :loading="loading"
  74. :pagination="pagination"
  75. :row-key="record => record.id"
  76. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  77. @change="handleTableChange"
  78. :scroll="{ x: 1500 }"
  79. >
  80. <!-- 推送状态 -->
  81. <span slot="pushStatesSlot" slot-scope="text, record">
  82. <a-tag color="#2db7f5" v-if="record.pushStatus == '0' || record.pushStatus == null ">未推送</a-tag>
  83. <a-tag color="#87d068" v-if="record.pushStatus == '1'">推送成功</a-tag>
  84. <a-tag color="#f50" v-if="record.pushStatus == '2'">推送失败</a-tag>
  85. </span>
  86. <!-- 单据状态 -->
  87. <span slot="statusSlot" slot-scope="text, record">
  88. <a-tag color="orange" v-if="record.status == '0' || record.status == null">未提交</a-tag>
  89. <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
  90. </span>
  91. <!-- 操作 默认按钮 未提交未推送-->
  92. <span slot="operationSlot" slot-scope="text, record">
  93. <a href="javascript:void(0);" @click="itemXls('')" style="color:green">导出</a>
  94. <a-divider type="vertical" />
  95. <a-dropdown>
  96. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  97. <!-- 已保存 -->
  98. <a-menu slot="overlay" v-if="record.status == '0' || record.status == null">
  99. <a-menu-item>
  100. <a @click="details(record)">详情</a>
  101. </a-menu-item>
  102. <a-menu-item>
  103. <a @click="edit(record)">编辑</a>
  104. </a-menu-item>
  105. <a-menu-item>
  106. <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
  107. <a href="javascript:void(0);" style="color:green;">提交</a>
  108. </a-popconfirm>
  109. </a-menu-item>
  110. <a-menu-item>
  111. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
  112. <a href="javascript:void(0);" style="color:red;">删除</a>
  113. </a-popconfirm>
  114. </a-menu-item>
  115. </a-menu>
  116. <!-- 已提交 且 推送成功 -->
  117. <a-menu slot="overlay" v-if="record.pushStatus == '1' && record.status == '1'">
  118. <a-menu-item>
  119. <a @click="details(record)">详情</a>
  120. </a-menu-item>
  121. </a-menu>
  122. <!-- 已提交 且 推送失败 -->
  123. <a-menu slot="overlay" v-if="record.pushStatus == '2' && record.status == '1'">
  124. <a-menu-item>
  125. <a @click="details(record)">详情</a>
  126. </a-menu-item>
  127. <a-menu-item>
  128. <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="rePush(record)">
  129. <a href="javascript:void(0);" style="color:green;">重新推送</a>
  130. </a-popconfirm>
  131. </a-menu-item>
  132. </a-menu>
  133. <!-- 已提交 -->
  134. <a-menu slot="overlay" v-if="record.status == '1'">
  135. <a-menu-item>
  136. <a @click="details(record)">详情</a>
  137. </a-menu-item>
  138. <a-menu-item>
  139. <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
  140. <a href="javascript:void(0);" style="color:red;">取消提交</a>
  141. </a-popconfirm>
  142. </a-menu-item>
  143. <a-menu-item>
  144. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  145. <a href="javascript:void(0);" style="color:green;">推送</a>
  146. </a-popconfirm>
  147. </a-menu-item>
  148. </a-menu>
  149. <!-- 未推送 -->
  150. <a-menu slot="overlay" v-if="record.pushStatus == '0'">
  151. <a-menu-item>
  152. <a @click="details(record)">详情</a>
  153. </a-menu-item>
  154. <a-menu-item>
  155. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  156. <a href="javascript:void(0);" style="color:green;">推送</a>
  157. </a-popconfirm>
  158. </a-menu-item>
  159. </a-menu>
  160. </a-dropdown>
  161. </span>
  162. </a-table>
  163. </a-card>
  164. <!-- 抽屉 -->
  165. <div>
  166. <addAdpacking-drawer
  167. ref="addAdpackingDrawer"
  168. :fatherList="getadPaListClothes"
  169. @ok="modalFormOk"
  170. ></addAdpacking-drawer>
  171. <detailsAdpacking-drawer ref="detailsAdpackingDrawer" @ok="modalFormOk"></detailsAdpacking-drawer>
  172. </div>
  173. </div>
  174. </template>
  175. <script>
  176. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  177. import JEllipsis from '@/components/jeecg/JEllipsis'
  178. import moment from 'moment'
  179. import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
  180. import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
  181. import { getadPaList, itemByMainId } from '@api/document/advance-packingList.js'
  182. export default {
  183. productName: 'AdPaListClothes', // 预装箱单-成衣
  184. mixins: [JeecgListMixin],
  185. components: { JEllipsis, moment, addAdpackingDrawer, detailsAdpackingDrawer },
  186. data() {
  187. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  188. return {
  189. loading: false, // 表格加载
  190. id: '',
  191. timeRange:'',
  192. // 表头
  193. adPaListClothesColumns: [
  194. {
  195. title: '款号',
  196. dataIndex: 'itemNumber',
  197. width: 120,
  198. fixed: 'left',
  199. className: 'replacecolor'
  200. },
  201. {
  202. title: '订单号',
  203. dataIndex: 'orderNumber',
  204. width: 120,
  205. fixed: 'left',
  206. className: 'replacecolor'
  207. },
  208. {
  209. title: '客户(简称)',
  210. dataIndex: 'customer',
  211. width: 100,
  212. fixed: 'left',
  213. className: 'replacecolor'
  214. },
  215. {
  216. title: '预发货日期',
  217. dataIndex: 'scheduledShipDate',
  218. width: 120,
  219. customRender: text => {
  220. return moment(text).format('YYYY-MM-DD')
  221. },
  222. className: 'replacecolor'
  223. },
  224. {
  225. title: '小po',
  226. dataIndex: 'smallPo',
  227. width: 100,
  228. className: 'replacecolor'
  229. },
  230. {
  231. title: '分销点',
  232. dataIndex: 'distributionPoint',
  233. width: 120,
  234. className: 'replacecolor'
  235. },
  236. {
  237. title: '存货名称',
  238. dataIndex: 'inventoryName',
  239. width: 120,
  240. className: 'replacecolor'
  241. },
  242. {
  243. title: '颜色',
  244. dataIndex: 'color',
  245. width: 180,
  246. className: 'replacecolor'
  247. },
  248. {
  249. title: '采购/委外订单号',
  250. dataIndex: 'spurOrSubOrder',
  251. width: 220,
  252. className: 'replacecolor'
  253. },
  254. {
  255. title: '订单类型',
  256. dataIndex: 'orderType',
  257. width: 100,
  258. className: 'replacecolor'
  259. },
  260. {
  261. title: '工厂单价',
  262. dataIndex: 'factoryUnitPrice',
  263. width: 100,
  264. className: 'replacecolor'
  265. },
  266. {
  267. title: '数量(按合并规则累计)',
  268. dataIndex: 'totalQuantity',
  269. width: 200,
  270. className: 'replacecolor'
  271. },
  272. {
  273. title: '箱数',
  274. dataIndex: 'boxNumber',
  275. width: 100,
  276. className: 'replacecolor'
  277. },
  278. {
  279. title: '总净重',
  280. dataIndex: 'totalNetWeight',
  281. width: 100,
  282. className: 'replacecolor'
  283. },
  284. {
  285. title: '总毛重',
  286. dataIndex: 'totalGrossWeight',
  287. width: 100,
  288. className: 'replacecolor'
  289. },
  290. {
  291. title: '总体积',
  292. dataIndex: 'totalVolume',
  293. width: 100,
  294. className: 'replacecolor'
  295. },
  296. {
  297. title: '总价',
  298. dataIndex: 'totalPrice',
  299. width: 100,
  300. className: 'replacecolor'
  301. },
  302. {
  303. title: '集装箱代号',
  304. dataIndex: 'containerCode',
  305. width: 120,
  306. className: 'replacecolor'
  307. },
  308. {
  309. title: '集装箱号',
  310. dataIndex: 'containerNumber',
  311. width: 120,
  312. className: 'replacecolor'
  313. },
  314. {
  315. title: '预托书号',
  316. dataIndex: 'depositaryReceiptNo',
  317. width: 100,
  318. className: 'replacecolor'
  319. },
  320. {
  321. title: '成衣工厂',
  322. dataIndex: 'garmentFactory',
  323. width: 160,
  324. className: 'replacecolor'
  325. },
  326. {
  327. title: '推送状态',
  328. dataIndex: 'pushStatus',
  329. width: 90,
  330. scopedSlots: { customRender: 'pushStatesSlot' },
  331. fixed: 'right',
  332. className: 'replacecolor'
  333. },
  334. {
  335. title: '单据状态',
  336. dataIndex: 'status',
  337. width: 90,
  338. scopedSlots: { customRender: 'statusSlot' },
  339. fixed: 'right',
  340. className: 'replacecolor'
  341. },
  342. {
  343. title: '原因',
  344. dataIndex: 'memo',
  345. width: 220,
  346. fixed: 'right',
  347. customRender: t => ellipsis(t),
  348. className: 'replacecolor'
  349. },
  350. {
  351. title: '操作',
  352. dataIndex: 'operation',
  353. scopedSlots: { customRender: 'operationSlot' },
  354. width: 160,
  355. fixed: 'right',
  356. className: 'replacecolor'
  357. }
  358. ],
  359. adPaListClothesData: [],
  360. queryParam: {
  361. // pageNo: '',
  362. // orderNumber: '',
  363. // itemNumber: '',
  364. // productName: '' // 品名
  365. },
  366. pagination: {
  367. // total: '',
  368. // current: 0,
  369. // pageSize: 0
  370. },
  371. selectedRowKeys: [], // 勾选航
  372. dateFormat: 'YYYY-MM-DD'
  373. }
  374. },
  375. created() {
  376. this.getadPaListClothes()
  377. },
  378. methods: {
  379. // 分页查询 预装箱单-成衣
  380. getadPaListClothes() {
  381. this.$nextTick(() => {
  382. getadPaList(this.queryParam).then(res => {
  383. if (res.success) {
  384. this.adPaListClothesData = [];
  385. if (res.result.records != null){
  386. this.adPaListClothesData = res.result.records;
  387. }
  388. this.pagination = {
  389. total: res.result.total,
  390. current: res.result.current,
  391. pageSize: res.result.size
  392. }
  393. }
  394. })
  395. })
  396. },
  397. // 编辑
  398. edit(record) {
  399. console.log(record);
  400. itemByMainId({id:record.id}).then(res => {
  401. if (res.success) {
  402. console.log(res.result);
  403. this.$refs.addAdpackingDrawer.visible = true;
  404. this.$refs.addAdpackingDrawer.addAdpacking = res.result; //接口参数
  405. }else{
  406. this.$message.error("获取记录详情失败");
  407. }
  408. });
  409. },
  410. // 详情
  411. details(record) {
  412. this.$refs.detailsAdpackingDrawer.visible = true
  413. this.$refs.detailsAdpackingDrawer.record = record //接口参数
  414. this.$refs.detailsAdpackingDrawer.getDetailsById()
  415. },
  416. // 新增
  417. addAdpacking() {
  418. this.$refs.addAdpackingDrawer.visible = true;
  419. },
  420. // 列表导出
  421. handleExportXls(fileName) {
  422. console.log('需导出的fileName:', fileName)
  423. const params = this.dyeLossRateData
  424. console.log('导出参数', params)
  425. // downFile('/scas/dyeLoss/excel', params).then(data => {
  426. // if (!data) {
  427. // this.$message.warning('文件下载失败')
  428. // return
  429. // }
  430. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  431. // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  432. // } else {
  433. // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  434. // let link = document.createElement('a')
  435. // link.style.display = 'none'
  436. // link.href = url
  437. // link.setAttribute('download', fileName + '.xls')
  438. // document.body.appendChild(link)
  439. // link.click()
  440. // document.body.removeChild(link) // 下载完成移除元素
  441. // window.URL.revokeObjectURL(url) // 释放掉blob对象
  442. // }
  443. // })
  444. },
  445. // 删除
  446. handleDelete(record) {
  447. console.log('点击删除项id:', record.id)
  448. this.$nextTick(() => {
  449. deleteAdPaList({ id: record.id }).then(res => {
  450. console.log('res:', res)
  451. this.getadPaListClothes()
  452. this.$message.success('删除成功')
  453. })
  454. })
  455. },
  456. searchQuery() {
  457. this.queryParam.pageNo = ''
  458. this.getadPaListClothes()
  459. },
  460. searchReset() {
  461. this.queryParam = {}
  462. this.getadPaListClothes()
  463. },
  464. // 操作 单条数据导出
  465. itemXls() {},
  466. // 提交
  467. submit() {},
  468. // 选中行
  469. onSelectChange(keys, rows) {
  470. this.selectedRowKeys = keys
  471. this.selectedRows = rows
  472. },
  473. handleTableChange(pagination, filters, sorter) {
  474. // console.log('当前页信息>>>>',pagination)
  475. this.queryParam.pageNo = pagination.current
  476. this.getadPaListClothes()
  477. },
  478. aa() {},
  479. onDateChange(value, dateString) {
  480. this.queryParam.startTime = dateString[0]
  481. this.queryParam.endTime = dateString[1]
  482. },
  483. },
  484. computed: {
  485. // 导入
  486. importExcelUrl() {
  487. // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  488. },
  489. // 选中项
  490. rowSelection() {
  491. return {
  492. onChange: (selectedRowKeys, selectedRows) => {
  493. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  494. },
  495. getCheckboxProps: record => ({
  496. props: {
  497. disabled: record.title === 'Disabled User',
  498. // Column configuration not to be checked
  499. title: record.title
  500. }
  501. })
  502. }
  503. }
  504. }
  505. }
  506. </script>
  507. <style lang="less" scoped>
  508. @import '~@assets/less/common.less';
  509. @import '~@assets/less/overwriter.less';
  510. /deep/ .ant-table-thead > tr > th {
  511. text-align: center;
  512. // font-weight: 700;
  513. }
  514. /deep/ .ant-table-tbody {
  515. text-align: center;
  516. }
  517. // /deep/ th.replacecolor {
  518. // background-color: #ccc;
  519. // }
  520. </style>