Browse Source

下达转圈圈

java8
han\hanst 4 months ago
parent
commit
fbd25ef2b5
  1. 35
      src/views/modules/ecss/codelnotify.vue
  2. 75
      src/views/modules/ecss/del_upload_excel.vue

35
src/views/modules/ecss/codelnotify.vue

@ -83,7 +83,10 @@
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateHeaderModelDo(scope.row)">修改</a>
<a type="text" style="color: green" size="small" v-if="scope.row.notifyStatus==='已计划' && scope.row.notifyStatus!=='订单取消'" @click="xiadaChoose()">下达</a>
<a type="text" style="color: green" size="small" v-if="scope.row.notifyStatus==='已计划' && scope.row.notifyStatus!=='订单取消' && !xiadaLoading" @click="xiadaChoose(scope.row)">下达</a>
<span v-if="scope.row.notifyStatus==='已计划' && scope.row.notifyStatus!=='订单取消' && xiadaLoading && currentRow && currentRow.delNo === scope.row.delNo" style="color: green; font-size: 12px;">
<i class="el-icon-loading"></i> 下达中...
</span>
<a type="text" style="color: orange" size="small" v-if="scope.row.notifyStatus==='已下达'&& scope.row.notifyStatus!=='订单取消'" @click="jihuaEcssDel(scope.row)">取消下达</a>
<a type="text" style="color: green" size="small" v-if="scope.row.notifyStatus==='已下达' && scope.row.walMartOrderFlag==='Y'" @click="declarationCompleted(scope.row)">一键结单</a>
<a type="text" style="color: red" size="small" v-if="scope.row.notifyStatus!=='订单取消'" @click="cancelDelHeader(scope.row)">废弃</a>
@ -405,8 +408,10 @@
</el-row>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="xiadaEcssDel">确定</el-button>
<el-button type="primary" @click="walMartOrderDialog=false">关闭</el-button>
<el-button type="primary" @click="xiadaEcssDel" :loading="xiadaLoading">
{{ xiadaLoading ? '下达中...' : '确定' }}
</el-button>
<el-button type="primary" @click="walMartOrderDialog=false" :disabled="xiadaLoading">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 导入 -->
@ -544,7 +549,7 @@
stripe
highlight-current-row
border :row-style="{ height: '30px' }"
style="width: 100%;margin-top: 60px">
style="width: 100%;margin-top: 60px" class="zxClass">
<el-table-column
prop="pn"
header-align="center"
@ -772,6 +777,7 @@
dataList:[],
dataList2:[],
dataListLoading: false,
xiadaLoading: false, //
searchData: {
page: 1,
limit: 100,
@ -1880,7 +1886,10 @@
})
})
},
xiadaChoose(){
xiadaChoose(row){
//
this.currentRow = row;
if (this.dataList2.length===0) {
this.$alert('该发货通知单下没有明细无法下达!', '错误', {
confirmButtonText: '确定'
@ -1949,6 +1958,9 @@
walMartOrderFlag:this.walMartOrderFlag
}
this.$confirm('确认下达吗?', '提示').then(() => {
//
this.xiadaLoading = true;
changeEcssDelStatus(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
@ -1963,7 +1975,18 @@
confirmButtonText: '确定'
})
}
}).catch((error) => {
//
this.$alert('操作失败,请重试', '错误', {
confirmButtonText: '确定'
})
}).finally(() => {
//
this.xiadaLoading = false;
})
}).catch(() => {
//
this.xiadaLoading = false;
})
this.walMartOrderDialog=false;
},
@ -2448,7 +2471,7 @@
.warning-row td{
color: darkred !important;
}
.el-table .cell {
/deep/ .zxClass .cell {
line-height: 24px;
font-size: 12px;
height: 24px;

75
src/views/modules/ecss/del_upload_excel.vue

@ -36,7 +36,12 @@
<div v-if="showPreview" style="margin-top: 20px; margin-bottom: 30px;">
<h4>文件预览 - 按发票号汇总 ({{ previewData.length }}个发票)</h4>
<el-table :data="previewData" border style="width: 100%" max-height="400" :show-overflow-tooltip="true">
<el-table :data="previewData" border style="width: 100%" max-height="400" :show-overflow-tooltip="true" class="delClass">
<el-table-column label="操作" width="40" fixed="left">
<template slot-scope="scope">
<a type="text" size="small" style="color: red" @click="deleteRow(scope.$index, scope.row)">删除</a>
</template>
</el-table-column>
<el-table-column prop="cmcInvoice" label="发票号" width="120" fixed="left">
<template slot-scope="scope">
<span :style="scope.row.exists ? 'color: red; font-weight: bold;' : ''">
@ -109,7 +114,7 @@
</el-input>
</template>
</el-table-column>
<el-table-column label="运抵国" width="90">
<el-table-column label="运抵国" width="80">
<template slot-scope="scope">
<el-input
v-model="scope.row.selectedCnative"
@ -121,7 +126,7 @@
</el-input>
</template>
</el-table-column>
<el-table-column label="贸易国" min-width="90">
<el-table-column label="贸易国" min-width="80">
<template slot-scope="scope">
<el-input
v-model="scope.row.selectedSalesArea"
@ -151,7 +156,7 @@
:data="customerTemplateList"
stripe
highlight-current-row
border
border class="delClass"
@row-dblclick="rowDblclickTemplate"
style="width: 100%;">
<el-table-column
@ -374,6 +379,7 @@
showPreview: false, //
selectedFile: null, //
previewLoading: false, //
deletedInvoices: [], //
customSearchData: {},
customerList : [],//
customerAddrs : [],//
@ -464,6 +470,7 @@
} : null,
showPreview: this.showPreview,
previewData: this.previewData,
deletedInvoices: this.deletedInvoices,
fileList: this.fileList.map(file => ({
name: file.name,
size: file.size,
@ -487,20 +494,25 @@
if (parsedData.pageData) {
//
Object.assign(this.pageData, parsedData.pageData);
//
if (parsedData.previewData && parsedData.previewData.length > 0) {
this.previewData = parsedData.previewData;
this.showPreview = parsedData.showPreview || false;
}
//
if (parsedData.deletedInvoices) {
this.deletedInvoices = parsedData.deletedInvoices;
}
//
if (parsedData.fileList && parsedData.fileList.length > 0) {
//
this.cachedFileInfo = parsedData.fileInfo;
this.cachedFileList = parsedData.fileList;
}
return true;
}
}
@ -523,7 +535,7 @@
checkAndRestoreFileState() {
//
const uploadFiles = this.$refs.uploadFile.uploadFiles;
if (this.cachedFileInfo && this.cachedFileList.length > 0) {
//
if (uploadFiles && uploadFiles.length > 0) {
@ -531,7 +543,7 @@
const isSameFile = currentFile.name === this.cachedFileInfo.name &&
currentFile.size === this.cachedFileInfo.size &&
currentFile.lastModified === this.cachedFileInfo.lastModified;
if (isSameFile) {
//
this.selectedFile = currentFile;
@ -554,7 +566,7 @@
console.log('没有找到文件,清除预览状态');
}
}
//
this.saveToCache();
},
@ -577,7 +589,7 @@
}
// BU
this.loadFromCache();
//
this.$nextTick(() => {
this.checkAndRestoreFileState();
@ -598,6 +610,7 @@
this.previewData = []
this.showPreview = false
this.selectedFile = null
this.deletedInvoices = []
this.pageData.customerName=''
this.pageData.cnative=''
this.pageData.localShipAddress='',
@ -743,7 +756,7 @@
this.saveToCache()
//
this.visible = false
//
this.$emit('refreshTable')
},
deleteFile(){
//
@ -751,6 +764,7 @@
this.previewData = []
this.showPreview = false
this.selectedFile = null
this.deletedInvoices = []
this.cachedFileInfo = null
this.cachedFileList = []
//
@ -888,6 +902,8 @@
if (data.code === 0) {
this.previewData = data.data || []
this.showPreview = true
//
this.deletedInvoices = []
//
this.previewData.forEach(item => {
this.$set(item, 'selectedTemplate', '')
@ -940,7 +956,9 @@
const formData = new FormData()
formData.append("buNo", this.pageData.buNo)
formData.append("username", this.$store.state.user.name)
formData.append("file", this.selectedFile.raw)
formData.append("file", this.fileList[0].raw)
//
formData.append("deletedInvoices", JSON.stringify(this.deletedInvoices))
//
this.previewData.forEach((item, index) => {
formData.append(`customerName_${item.cmcInvoice}`, item.selectedCustomer)
@ -1017,6 +1035,7 @@
this.previewData = []
this.fileList = []
this.selectedFile = null
this.deletedInvoices = []
this.cachedFileInfo = null
this.cachedFileList = []
this.$refs.uploadFile.clearFiles()
@ -1030,6 +1049,7 @@
this.showPreview = false
this.selectedFile = null
this.fileList = []
this.deletedInvoices = []
this.previewLoading = false
this.cachedFileInfo = null
this.cachedFileList = []
@ -1146,6 +1166,27 @@
this.closeEditDialog()
},
//
deleteRow(index, row) {
this.$confirm(`确定要删除发票号 "${row.cmcInvoice}" 吗?删除后将不会提交到后台。`, '删除确认', {
confirmButtonText: '确定删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
if (!this.deletedInvoices.includes(row.cmcInvoice)) {
this.deletedInvoices.push(row.cmcInvoice)
}
//
this.previewData.splice(index, 1)
this.$message.success(`发票号 "${row.cmcInvoice}" 已删除`)
//
this.saveToCache()
}).catch(() => {
//
})
},
//
async downloadFile () {
let file = {
@ -1191,6 +1232,12 @@
}
</script>
<style scoped>
/deep/ .delClass .cell {
line-height: 24px !important;
font-size: 12px !important;
height: 24px !important;
}
/deep/ .customer-upload .el-upload .el-upload-dragger {
width: 580px;
}
@ -1315,6 +1362,4 @@
color: #c0c4cc;
}
</style>
Loading…
Cancel
Save