adPaList-clothes.vue 17 KB

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