Browse Source

缓存发货通知单导入的一些数据

java8
han\hanst 5 months ago
parent
commit
6648d526a1
  1. 2
      src/views/modules/ecss/codelnotify.vue
  2. 2
      src/views/modules/ecss/codelnotifyConfirm.vue
  3. 112
      src/views/modules/ecss/del_upload_excel.vue

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

@ -96,7 +96,7 @@
fixed="left" fixed="left"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.notifyStatus!=='订单取消'" @click="updateHeaderModelDo(scope.row)">修改</a>
<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!=='订单取消'" @click="xiadaChoose()">下达</a>
<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: orange" size="small" v-if="scope.row.notifyStatus==='已下达'&& scope.row.notifyStatus!=='订单取消'" @click="jihuaEcssDel(scope.row)">取消下达</a>
<a type="text" style="color: red" size="small" v-if="scope.row.notifyStatus!=='订单取消'" @click="cancelDelHeader(scope.row)">废弃</a> <a type="text" style="color: red" size="small" v-if="scope.row.notifyStatus!=='订单取消'" @click="cancelDelHeader(scope.row)">废弃</a>

2
src/views/modules/ecss/codelnotifyConfirm.vue

@ -70,7 +70,7 @@
fixed="left" fixed="left"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.notifyStatus==='仓库已确认' || scope.row.notifyStatus==='已报关'" @click="updateModelOpen(scope.row)">修改</a>
<a type="text" size="small" v-if="scope.row.notifyStatus==='已报关'" @click="updateModelOpen(scope.row)">修改</a>
<a type="text" size="small" v-if="scope.row.notifyStatus==='已下达'" @click="confirmModelOpen(scope.row)">仓库确认</a> <a type="text" size="small" v-if="scope.row.notifyStatus==='已下达'" @click="confirmModelOpen(scope.row)">仓库确认</a>
<a type="text" size="small" v-if="scope.row.notifyStatus==='仓库已确认'" @click="cancerConfirm(scope.row)">取消确认</a> <a type="text" size="small" v-if="scope.row.notifyStatus==='仓库已确认'" @click="cancerConfirm(scope.row)">取消确认</a>
</template> </template>

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

@ -33,7 +33,7 @@
</span> </span>
</template> </template>
<el-input type="textarea" <el-input type="textarea"
:rows="2" v-model="pageData.customerName" ></el-input>
:rows="2" v-model="pageData.customerName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -44,7 +44,7 @@
</span> </span>
</template> </template>
<el-input type="textarea" <el-input type="textarea"
:rows="2" v-model="pageData.overseasShipper" ></el-input>
:rows="2" v-model="pageData.overseasShipper"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -56,7 +56,7 @@
</span> </span>
</template> </template>
<el-input type="textarea" <el-input type="textarea"
:rows="3" v-model="pageData.localShipAddress" ></el-input>
:rows="3" v-model="pageData.localShipAddress"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -68,7 +68,7 @@
</span> </span>
</template> </template>
<el-input type="textarea" <el-input type="textarea"
:rows="3" v-model="pageData.overseasAddress" ></el-input>
:rows="3" v-model="pageData.overseasAddress"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="margin-top: 60px"> <el-col :span="24" style="margin-top: 60px">
@ -227,13 +227,95 @@
localShipAddressFlag:false, localShipAddressFlag:false,
overseasShipperFlag:false, overseasShipperFlag:false,
overseasAddressFlag:false, overseasAddressFlag:false,
cacheKey: '', //
cacheTimer: null, //
}
},
watch: {
// pageData
pageData: {
handler: function(newVal, oldVal) {
//
if (this.visible && this.cacheKey) {
this.saveToCache();
}
},
deep: true
}
},
beforeDestroy() {
//
if (this.cacheTimer) {
clearTimeout(this.cacheTimer);
} }
}, },
methods: { methods: {
//
generateCacheKey() {
const userId = this.$store.state.user.id || this.$store.state.user.name;
return `ecss_del_upload_cache_${userId}`;
},
//
saveToCache() {
//
if (this.cacheTimer) {
clearTimeout(this.cacheTimer);
}
// 500ms
this.cacheTimer = setTimeout(() => {
try {
const cacheData = {
pageData: {
buNo: this.pageData.buNo,
customerName: this.pageData.customerName,
localShipAddress: this.pageData.localShipAddress,
overseasShipper: this.pageData.overseasShipper,
overseasAddress: this.pageData.overseasAddress,
cnative: this.pageData.cnative,
salesArea: this.pageData.salesArea,
}
};
localStorage.setItem(this.cacheKey, JSON.stringify(cacheData));
} catch (error) {
console.warn('保存缓存失败:', error);
}
}, 500);
},
//
loadFromCache() {
try {
const cachedData = localStorage.getItem(this.cacheKey);
if (cachedData) {
const parsedData = JSON.parse(cachedData);
if (parsedData.pageData) {
//
Object.assign(this.pageData, parsedData.pageData);
return true;
}
}
} catch (error) {
console.warn('加载缓存失败:', error);
}
return false;
},
//
clearCache() {
try {
localStorage.removeItem(this.cacheKey);
} catch (error) {
console.warn('清除缓存失败:', error);
}
},
// //
init () { init () {
this.fileList = [] this.fileList = []
this.cacheKey = this.generateCacheKey();
let tempData = { let tempData = {
username: this.$store.state.user.name, username: this.$store.state.user.name,
} }
@ -244,18 +326,27 @@
this.pageData.buNo=data.row2[0].buNo this.pageData.buNo=data.row2[0].buNo
} }
} }
// BU
this.loadFromCache();
}) })
getCustomerList({}).then(({data}) => { getCustomerList({}).then(({data}) => {
// //
if (data && data.code === 0) { if (data && data.code === 0) {
this.customerList=data.rows this.customerList=data.rows
} }
}); });
this.pageData.customerName=''
this.pageData.cnative=''
this.pageData.localShipAddress='',
this.pageData.overseasShipper='',
this.pageData.overseasAddress='',
//
if (!this.loadFromCache()) {
this.pageData.customerName=''
this.pageData.cnative=''
this.pageData.localShipAddress='',
this.pageData.overseasShipper='',
this.pageData.overseasAddress='',
this.pageData.salesArea=''
}
this.customerPersons=[] this.customerPersons=[]
this.customerAddrs=[] this.customerAddrs=[]
// //
@ -338,6 +429,7 @@
this.deleteFile() this.deleteFile()
// //
this.visible = false this.visible = false
//
}, },
deleteFile(){ deleteFile(){
this.fileList = [] this.fileList = []
@ -392,6 +484,8 @@
saveEcssCoDelNotifyByExcel(formData).then(({data}) => { saveEcssCoDelNotifyByExcel(formData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
//
this.clearCache()
// //
this.closeDialog() this.closeDialog()
} else { } else {

Loading…
Cancel
Save