合包管理页开发完成;运单寄件上传和运单签收图片上传页面新增运单号校验逻辑;

This commit is contained in:
liuyp 2024-05-30 16:24:07 +08:00
parent 0a66a14821
commit a5bd7c879e
3 changed files with 157 additions and 59 deletions

View File

@ -62,7 +62,7 @@
v-hasPermi="['emis:emisTmsPack:add']"
>新增合包</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -72,7 +72,7 @@
@click="handleAdd"
v-hasPermi="['emis:emisTmsPack:edit']"
>修改</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
@ -80,7 +80,7 @@
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleAdd"
@click="handleDeleteCoPack"
v-hasPermi="['emis:emisTmsPack:remove']"
>删除</el-button>
</el-col>
@ -164,7 +164,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@click="CoPack(scope.row)"
v-hasPermi="['emis:emisTmsPack:remove']"
>删除</el-button> -->
</template>
@ -532,6 +532,12 @@ export default {
tempCoPackList:[],
coSelection:[],
//区分当前是新增还是修改
coPackType:'',
// 临时存储已有合包的运单号
tempExistCoPackWayBillList:[],
tempCoPackInfo:{},
// 弹出展示层
id:null,
@ -574,6 +580,7 @@ export default {
getList() {
this.loading = true;
// this.queryParams.params = {};
this.emisTmsPackList = [];
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
@ -632,6 +639,7 @@ export default {
packName: this.coData.packName || '',
packDate: this.coData.createTime,
destCountry: this.coData.destCountry,
nextSiteCode: this.coData.nextSiteCode,
// destCountryName: this.coData.,
blUnpack: this.coData.blUnpack,
sendStiteCode: this.coData.sendStiteCode,
@ -642,34 +650,126 @@ export default {
// packStatus: this.coData.,
opMan: this.$store.getters.empCode
}
addEmisTmsPack(coPackItem).then(response => {
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '新增合包失败')
return;
}
})
for(let i = 0; i< this.emisCoPackDetail.length;i++){
let packDetail = {
packNo:this.coData.packNo,
billCode: this.emisCoPackDetail[i].billCode,
scanDate: this.emisCoPackDetail[i].scanDate,
scanStatus: this.emisCoPackDetail[i].scanStatus,
packStatus: null,
scanMan: this.emisCoPackDetail[i].scanMan,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
};
addEmisTmsPackDtl(packDetail).then(response => {
if(this.coPackType == "add"){// 新增
addEmisTmsPack(coPackItem).then(response => {
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '合包明细新增失败')
this.$modal.msgError(response && response.msg || '新增合包失败')
return;
}
})
for(let i = 0; i< this.emisCoPackDetail.length;i++){
let packDetail = {
packNo:this.coData.packNo,
billCode: this.emisCoPackDetail[i].billCode,
scanDate: this.emisCoPackDetail[i].scanDate,
scanStatus: this.emisCoPackDetail[i].scanStatus,
packStatus: null,
scanMan: this.emisCoPackDetail[i].scanMan,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
};
addEmisTmsPackDtl(packDetail).then(response => {
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '合包明细新增失败')
return;
}
})
}
}else if(this.coPackType == "edit"){// 修改
//第一步:处理合包信息的更新;
if(this.tempCoPackInfo.destCountry != this.coData.destCountry
|| this.tempCoPackInfo.sendStiteCode != this.coData.sendStiteCode
|| this.tempCoPackInfo.nextSiteCode != this.coData.nextSiteCode
|| this.tempCoPackInfo.blUnpack != this.blUnpack
|| this.tempCoPackInfo.totalWaybillQty != this.coData.totalWaybillQty
|| this.tempCoPackInfo.parcelQty != this.coData.parcelQty
|| this.tempCoPackInfo.totalWeight != this.coData.totalWeight
|| this.tempCoPackInfo.totalVolume != this.coData.totalVolume
){
this.tempCoPackInfo.destCountry = this.coData.destCountry;
this.tempCoPackInfo.sendStiteCode = this.coData.sendStiteCode;
this.tempCoPackInfo.nextSiteCode = this.coData.nextSiteCode;
this.tempCoPackInfo.blUnpack = this.blUnpack;
this.tempCoPackInfo.totalWaybillQty = this.coData.totalWaybillQty;
this.tempCoPackInfo.parcelQty = this.coData.parcelQty;
this.tempCoPackInfo.totalWeight = this.coData.totalWeight;
this.tempCoPackInfo.totalVolume = this.coData.totalVolume;
updateEmisTmsPack(this.tempCoPackInfo).then(res => {
if(!res || res.code != 200){
this.$modal.msgError(res && res.msg || '未知错误')
return;
}
});
}
//第二步:处理运单列表的数据
let tempDelList = [];
let tempAddList=[];
//2.1:计算要删除的运单
tempDelList = this.tempExistCoPackWayBillList.filter(item => {
let ls = this.emisCoPackDetail.filter(cd => {
return cd.billCode == item.billCode
})
if(ls.length > 0){
return false;
}else{
return true;
}
})
tempDelList.forEach(item =>{
delEmisTmsPackDtl(item.id).then(res => {
if(!res || res.code != 200){
this.$modal.msgError(res && res.msg || '未知错误')
return;
}
})
})
//2.2:计算要新增的运单
tempAddList = this.emisCoPackDetail.filter(item => {
let ls = this.tempExistCoPackWayBillList.filter(cd => {
return cd.billCode == item.billCode
})
if(ls.length > 0){
return false;
}else{
return true;
}
})
tempAddList.forEach(item =>{
let packDetail = {
packNo:this.coData.packNo,
billCode: item.billCode,
scanDate: item.scanDate,
scanStatus: item.scanStatus,
packStatus: null,
scanMan: item.scanMan,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
};
addEmisTmsPackDtl(packDetail).then(response => {
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '合包明细新增失败')
return;
}
})
})
}
this.openForm= false;
this.titleForm = "";
this.$modal.msgSuccess('操作成功!');
this.getList();
},
async handleDeleteCoPack(){
let that =this;
for(let i = 0; i< this.ids.length;i++){
let res = await delEmisTmsPack(this.ids[i]);
if(!res || res.code != 200){
that.$modal.msgError(res && res.msg || '合包删除失败')
that.getList();
return;
}
}
this.$modal.msgSuccess('操作成功');
this.getList();
},
handleCancelCo(){
this.titleForm='';
@ -733,6 +833,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.selection = selection;
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -768,7 +869,10 @@ export default {
},
/** 新增按钮操作 */
async handleAdd() {
this.coPackType="add";
this.coData = {};
this.tempExistCoPackWayBillList = [];//情况临时保存的已有运单号
this.tempCoPackInfo={};
let response = await getPackNo();
if(!response || response.code != 200){
this.$message.error(response && response.msg || "未知错误");
@ -796,12 +900,12 @@ export default {
},
/** 修改按钮操作 */
async handleUpdate(row) {
this.coPackType="edit";
let response = await getEmisTmsPack(row.id);
if(!response || response.code != 200){
this.$message.error(response && response.msg || "未知错误");
return;
}
debugger;
let resData = response.data;
this.coData.packNo = resData.packNo;
this.coData.createTime = resData.createTime;
@ -818,7 +922,8 @@ export default {
this.$message.error(resList && resList.msg || "未知错误");
return;
}
debugger;
this.tempExistCoPackWayBillList = resList.rows;//临时存储,用于运单号校验
this.tempCoPackInfo = resData;
for(let p = 0; p < resList.rows.length;p++){
let resd = await getWaybillDetail(resList.rows[p].billCode);
if(!resd || resd.code != 200){
@ -846,7 +951,7 @@ export default {
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
CoPack(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisTmsPack(ids);

View File

@ -62,6 +62,7 @@
<script>
import { addEmisWaybillAttachment } from "@/api/emis/emisWaybillAttachment";
import { getWaybillDetail } from "@/api/emis/emisWaybill";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisWaybillView from '@/views/emis/emisWaybill/emisWaybillView';
import emisWaybillForm from '@/views/emis/emisWaybill/emisWaybillForm';
@ -121,17 +122,23 @@ export default {
getList(){
},
handleInput(item, size){
async handleInput(item, size){
if(item.trim() == ""){
return;
}
let scList = item.trim().split(/[;\;\,\,\n]/)||[];
scList.forEach(item=>{
this.form.picUrl =[];
for(let s = 0; s<scList.length; s++){
let billCode = this.extractSubstring(item);
if(this.dataMap[billCode]) return;
let response = await getWaybillDetail(billCode)
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || "未知错误");
return;
}
let record = {};
record.billCode=billCode;
record.fileUrl=item;
record.fileUrl=scList[s];
record.createSiteCode=this.$store.getters.ownerSiteCode;
record.createSite=this.$store.getters.ownerSiteName;
record.createBy=this.$store.getters.empName;
@ -150,18 +157,8 @@ export default {
let indexBillCode=billCode;
this.dataMap[indexBillCode]=record;
this.emisTmsScanRecordList.push(record);
// getWaybillDetail(billCode).then(response => {
// debugger;
// if(!response || response.code != 200){
// this.$modal.msgError(response && response.msg || "未知错误");
// return;
// }
// })
});
// this.$refs.imageUpload.fileList = [];
this.form.picUrl =[];
};
// this.form.picUrl =[];
},
/** 上传按钮操作 */
handleScanUpload(){

View File

@ -62,6 +62,7 @@
<script>
import { addEmisWaybillAttachment } from "@/api/emis/emisWaybillAttachment";
import { getWaybillDetail } from "@/api/emis/emisWaybill";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisWaybillView from '@/views/emis/emisWaybill/emisWaybillView';
import emisWaybillForm from '@/views/emis/emisWaybill/emisWaybillForm';
@ -121,18 +122,24 @@ export default {
getList(){
},
handleInput(item, size){
async handleInput(item, size){
if(item.trim() == ""){
return;
}
let scList = item.trim().split(/[;\;\,\,\n]/)||[];
scList.forEach(item=>{
let billCode = this.extractSubstring(item);
this.form.picUrl =[];
for(let s = 0; s<scList.length; s++){
let billCode = this.extractSubstring(scList[s]);
if(this.dataMap[billCode]) return;
let response = await getWaybillDetail(billCode)
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || "未知错误");
this.form.picUrl =[];
return;
}
let record = {};
record.billCode=billCode;
record.fileUrl=item;
// record.createSiteCode=this.$store.getters.ownerSiteCode;
record.fileUrl=scList[s];
record.createSite=this.$store.getters.ownerSiteName;
record.createBy=this.$store.getters.empName;
record.signManCode=this.$store.getters.empCode;
@ -150,18 +157,7 @@ export default {
let indexBillCode=billCode;
this.dataMap[indexBillCode]=record;
this.emisTmsScanRecordList.push(record);
// getWaybillDetail(billCode).then(response => {
// debugger;
// if(!response || response.code != 200){
// this.$modal.msgError(response && response.msg || "未知错误");
// return;
// }
// })
});
// this.$refs.imageUpload.fileList = [];
this.form.picUrl =[];
};
},
/** 上传按钮操作 */
handleScanUpload(){