From ffca658cb6a955487db433cc2bd08af9c1585df9 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Thu, 18 May 2023 17:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modular/main/BookingLedger.js | 24 ++++++ src/components/Table/index.js | 28 +++++-- src/views/main/BookingLedger/list/index.vue | 82 ++++++++++++++++++--- 3 files changed, 116 insertions(+), 18 deletions(-) diff --git a/src/api/modular/main/BookingLedger.js b/src/api/modular/main/BookingLedger.js index 0625b4b..83f937d 100644 --- a/src/api/modular/main/BookingLedger.js +++ b/src/api/modular/main/BookingLedger.js @@ -872,3 +872,27 @@ export function downloadBookingConfirm(parameter) { data: parameter }) } + +export function downloadDraft(parameter) { + return axios({ + url: '/BookingValueAdded/DownloadDraft', + method: 'post', + data: parameter + }) +} + +export function checkUpdateETA(parameter) { + return axios({ + url: '/BookingValueAdded/CheckUpdateETA', + method: 'post', + data: parameter + }) +} + +export function checkUpdateManifestNo(parameter) { + return axios({ + url: '/BookingValueAdded/CheckUpdateManifestNo', + method: 'post', + data: parameter + }) +} diff --git a/src/components/Table/index.js b/src/components/Table/index.js index e42b8a4..f321855 100644 --- a/src/components/Table/index.js +++ b/src/components/Table/index.js @@ -16,7 +16,7 @@ export default { selectedRows: [], selectedRowKeys: [], - + sortObj: { DescSort: '' }, localLoading: false, localDataSource: [], localPagination: Object.assign({}, this.pagination), @@ -136,6 +136,10 @@ export default { })) || false this.needTotalList = this.initTotalList(this.columns) + this.sortObj = { + DescSort: '', + field: '' + } this.loadData() // this.columnsSetting = this.columns // 记录选择显示的列,以当前路由为key @@ -165,6 +169,7 @@ export default { * @param Boolean bool */ refresh(bool = false) { + console.log(this.sortObj) bool && (this.localPagination = Object.assign( {}, @@ -182,9 +187,10 @@ export default { * @param {Object} sorter 排序条件 */ loadData(pagination, filters, sorter) { - console.log(pagination) this.localLoading = true - + if (sorter) { + this.sortObj = sorter + } const parameter = Object.assign( { pageNo: @@ -194,16 +200,24 @@ export default { (this.showPagination && this.localPagination.pageSize) || this.pageSize }, - (sorter && sorter.field && { SortField: sorter.field }) || {}, - (sorter && sorter.order && { sortOrder: sorter.order }) || {}, + (this.sortObj && this.sortObj.field && { SortField: this.sortObj.field }) || {}, { ...filters } ) - if (sorter && sorter.order === 'descend') { + if (this.sortObj && this.sortObj.order === 'descend' && this.sortObj.field) { parameter.DescSort = true + this.sortObj.DescSort = true } else { - parameter.DescSort = false + if (this.sortObj && this.sortObj.field) { + parameter.DescSort = false + this.sortObj.DescSort = false + } else { + delete parameter.DescSort + if (this.sortObj) { + this.sortObj.DescSort = '' + } + } } const result = this.data(parameter) // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 30cb138..f12ab04 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -101,16 +101,16 @@ 船公司文件 - BC下载 + BC下载 - DRAFT下载 + DRAFT下载 - 到港时间更新 + 到港时间更新 - 舱位分配查询 + 舱位分配查询 @@ -659,15 +659,16 @@ @cancel="bcFileFlag=false" >
- 时间{{ bcFile.executeTime }} - {{ bcFile.batchTotal }} +
时间{{ bcFile.executeTime }}
+ {{ bcFile.batchTotal }}
-
+
{{ item.bno }} {{ item.msg }}
+
{{ bcFile.msg }}
@@ -698,7 +699,10 @@ import { DeleteBookingOrder, ExcuteShippingOrderCompareBatch, GetTenantLineList, - downloadBookingConfirm + downloadBookingConfirm, + downloadDraft, + checkUpdateETA, + checkUpdateManifestNo } from '@/api/modular/main/BookingLedger' import initData from './modules/initData' @@ -807,7 +811,7 @@ export default { destinationData: [], RcarrierData: [], RecentlyCarrierData: [], - bcFile: {}, + bcFile: { ext: [] }, bcFileFlag: false } }, @@ -910,7 +914,7 @@ export default { // } } }, - handleDownByBc() { + handleDownByBc(type) { const select = this.$refs.xGrid.getCheckboxRecords() const pkIdArr = select.map((item, index) => { return item.id @@ -919,7 +923,8 @@ export default { this.$message.error('请至少选择一条数据') return false } else { - downloadBookingConfirm(pkIdArr) + if (type === 1) { + downloadBookingConfirm(pkIdArr) .then((res) => { if (res.success) { this.bcFileFlag = true @@ -931,6 +936,49 @@ export default { .catch((err) => { console.log(err) }) + } + if (type === 2) { + downloadDraft(pkIdArr) + .then((res) => { + if (res.success) { + this.bcFileFlag = true + this.bcFile = res.data + } else { + this.$message.error(res.message) + } + }) + .catch((err) => { + console.log(err) + }) + } + if (type === 3) { + checkUpdateETA(pkIdArr) + .then((res) => { + if (res.success) { + this.bcFileFlag = true + this.bcFile = res.data + } else { + this.$message.error(res.message) + } + }) + .catch((err) => { + console.log(err) + }) + } + if (type === 4) { + checkUpdateManifestNo(pkIdArr) + .then((res) => { + if (res.success) { + this.bcFileFlag = true + this.bcFile = res.data + } else { + this.$message.error(res.message) + } + }) + .catch((err) => { + console.log(err) + }) + } } }, // 批量编辑 @@ -1464,6 +1512,15 @@ export default { handledbclick({ row }) { this.editColumns(row) }, + handleCopy() { + const text = this.$refs.bcBox.innerText + var cInput = document.createElement('input'); + cInput.value = text; + document.body.appendChild(cInput); + cInput.select(); // 选取文本框内容 + document.execCommand('copy'); + document.body.removeChild(cInput); + }, editColumns(row) { this.$router.push({ name: 'BookingDetail', query: { id: row.id, type: row.carrierid, mblno: row.mblno } }) }, @@ -3014,6 +3071,9 @@ export default { border-bottom:1px dashed black; padding-bottom: 5px; margin-bottom: 10px; + display: flex; + align-items: center; + justify-content: space-between; } .bc-box{ max-height: 200px;