jinhui.wang

提示语修正,数据初始化修正

......@@ -67,6 +67,7 @@ export default {
fltDate: undefined,
route: null,
overweight: false,
notInWhite: false,
},
cargoHeader: [
{ name: "口岸代码", value: "portName", width: "" },
......@@ -120,11 +121,14 @@ export default {
route: undefined,
flightId: undefined,
overweight: false,
notInWhite: false,
};
this.routeList = []
},
//确定配舱
submit() {
this.formData.overweight = false
this.formData.notInWhite = false
this.$refs.form.validate(val => {
if (val) {
this.loading = true;
......@@ -140,39 +144,18 @@ export default {
})
if (this.formData.fltNo && this.formData.fltDate) {
allocationFlight(this.formData).then((res) => {
this.loading = false;
//code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg
//code 200 配舱成功 202重量已满需要确认 203货物不在白名单需要确认 其余code直接输出msg 接口先判断重量后判断白名单 overweight/notInWhite初始默认false
if (res.code === 200) {
this.loading = false;
this.msgSuccess('货物配舱成功')
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 202) {
this.$confirm(res.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
allocationFlight(this.formData).then((res) => {
if (res.code === 200) {
this.msgSuccess('货物配舱成功')
} else {
this.msgWarning(res.msg)
}
});
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
})
.catch(() => {
//取消 取消当前配舱
this.msgSuccess('配舱已取消')
this.cleaerForm();
this.$emit("dialogBeforeClose", {
close: false,
reload: true,
});
});
//超重航班确实是否继续配舱
this.reallocationFlight(res.msg, 'overweight')
} else if (res.code === 203) {
//不存在白名单中确实是否继续配舱
this.reallocationFlight(res.msg, 'notInWhite')
} else {
this.loading = false;
this.msgWarning(res.msg)
......@@ -187,6 +170,40 @@ export default {
}
})
},
//手动配舱超重或白名单不存在提示
reallocationFlight(msg, status) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
if (status == 'overweight') {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
} else {
this.formData.notInWhite = true; //确定继续notInWhite变为true再次请求接口
}
allocationFlight(this.formData).then((res) => {
if (res.code === 200) {
this.loading = false
this.msgSuccess('货物配舱成功')
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 203) {
this.reallocationFlight(res.msg, 'notInWhite')
} else {
this.msgWarning(res.msg)
this.loading = false
}
});
}).catch(() => {
this.msgSuccess('配舱已取消')
this.cleaerForm();
this.$emit("dialogBeforeClose", {
close: false,
reload: true,
});
})
},
dialogBeforeClose() {
this.cleaerForm();
this.$refs['form'].clearValidate();
......
......@@ -201,20 +201,20 @@
<el-col :span="12">
<el-form-item label="高价百分比" prop="highPriceWeightPercent">
<el-input-number class="wid80" :disabled="ishighPriceWeightPercent" @change="LowHighAvailable"
placeholder="请输入高价百分比" v-model="form.highPriceWeightPercent"></el-input-number>
placeholder="开启高地价后可修改" v-model="form.highPriceWeightPercent"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="低价百分比" prop="lowPriceWeightPercent">
<el-input-number class="wid80" :disabled="true" placeholder="请输入低价百分比"
<el-input-number class="wid80" :disabled="true" placeholder="开启高地价后计算"
v-model="form.lowPriceWeightPercent"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高价可配重量" prop="highAvailableWeight">
<el-input-number class="wid80" :disabled="true" placeholder="请输入高价可配重量" v-model="form.highAvailableWeight"
<el-input-number class="wid80" :disabled="true" placeholder="开启高地价后计算" v-model="form.highAvailableWeight"
:precision="2"></el-input-number>
</el-form-item>
</el-col>
......@@ -222,7 +222,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="低价可配重量" prop="lowAvailableWeight">
<el-input-number class="wid80" :disabled="true" placeholder="请输入低价可配重量" v-model="form.lowAvailableWeight"
<el-input-number class="wid80" :disabled="true" placeholder="开启高地价后计算" v-model="form.lowAvailableWeight"
:precision="2"></el-input-number>
</el-form-item>
</el-col>
......@@ -248,12 +248,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="特殊规则预留总重量" prop="accountTotalWeight">
<el-input class="wid80" v-model="form.accountTotalWeight" disabled />
<el-input class="wid80" v-model="form.accountTotalWeight" disabled placeholder="配置特殊规则后计算" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特殊规则已配重量" prop="accountAllocatedWeight">
<el-input class="wid80" v-model="form.accountAllocatedWeight" disabled />
<el-input class="wid80" v-model="form.accountAllocatedWeight" disabled placeholder="配置特殊规则后计算" />
</el-form-item>
</el-col>
</el-row>
......@@ -498,6 +498,8 @@ export default {
//输入航班号后
blurfltNo() {
this.routeList = []
this.form.accountTotalWeight = 0
this.form.accountAllocatedWeight = 0
if (
this.form.fltNo != null &&
this.form.fltNo != undefined &&
......
......@@ -522,7 +522,6 @@ export default {
.catch(() => {
this.tableLoading = false;
});
this.$refs.newTables.clearTable();
this.cargoTotal();
},
//释放舱位
......
......@@ -67,6 +67,7 @@ export default {
fltDate: undefined,
route: null,
overweight: false,
notInWhite: false,
},
cargoHeader: [
{ name: "口岸代码", value: "portName", width: "" },
......@@ -120,11 +121,14 @@ export default {
route: undefined,
flightId: undefined,
overweight: false,
notInWhite: false,
};
this.routeList = []
},
//确定配舱
submit() {
this.formData.overweight = false
this.formData.notInWhite = false
this.$refs.form.validate(val => {
if (val) {
this.loading = true;
......@@ -140,66 +144,32 @@ export default {
})
if (this.formData.fltNo && this.formData.fltDate) {
batchMoveCargoToOtherFlight(this.formData).then((res) => {
this.loading = false;
//code 200 迁转成功 202 重量已满需要确认 其余code直接输出msg
//code 200 配舱成功 202重量已满需要确认 203货物不在白名单需要确认 其余code直接输出msg 接口先判断重量后判断白名单 overweight/notInWhite初始默认false
if (res.code === 200) {
this.loading = false;
this.msgSuccess(res.msg)
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 202) {
this.$confirm(res.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
} else if (res.code === 201) {
this.loading = false;
let arr = []
res.data.forEach(item => {
let obj = {
waybillNo: item.split(':')[0],
errorMessage: item.split(':')[1]
}
arr.push(obj)
})
.then(() => {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
batchMoveCargoToOtherFlight(this.formData).then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg)
} else {
this.msgWarning(res.msg)
if (res.data != null && res.data.length > 0) {
let arr = []
res.data.forEach(item => {
let obj = {
waybillNo: item.split(':')[0],
errorMessage: item.split(':')[1]
}
arr.push(obj)
})
this.$router.push({ name: 'UpDateResult', params: { data: arr, from: 'queryCargo' } })
this.dialogBeforeClose()
}
}
});
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
})
.catch(() => {
//取消 取消当前配舱
this.msgSuccess('迁转已取消')
this.cleaerForm();
this.$emit("dialogBeforeClose", {
close: false,
reload: true,
});
});
this.$router.push({ name: 'UpDateResult', params: { data: arr, from: 'queryCargo' } })
this.dialogBeforeClose()
} else if (res.code === 202) {
this.reBatchMoveCargoToOtherFlight(res.msg, 'overweight')
} else if (res.code === 203) {
this.reBatchMoveCargoToOtherFlight(res.msg, 'notInWhite')
} else {
this.loading = false;
this.dialogBeforeClose()
this.msgWarning(res.msg)
if (res.data != null && res.data.length > 0) {
let arr = []
res.data.forEach(item => {
let obj = {
waybillNo: item.split(':')[0],
errorMessage: item.split(':')[1]
}
arr.push(obj)
})
this.$router.push({ name: 'UpDateResult', params: { data: arr, from: 'queryCargo' } })
this.dialogBeforeClose()
}
}
}).catch(() => {
this.loading = false;
......@@ -211,6 +181,53 @@ export default {
}
})
},
//迁转白名单/超重确认
reBatchMoveCargoToOtherFlight(msg, status) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
if (status == 'overweight') {
this.formData.overweight = true; //确定继续overweight变为true再次请求接口
} else {
this.formData.notInWhite = true; //确定继续notInWhite变为true再次请求接口
}
batchMoveCargoToOtherFlight(this.formData).then((res) => {
if (res.code === 200) {
this.loading = false
this.msgSuccess('航班迁转成功')
this.cleaerForm();
this.$emit("dialogBeforeClose", { close: false, reload: true });
} else if (res.code === 201) {
let arr = []
res.data.forEach(item => {
let obj = {
waybillNo: item.split(':')[0],
errorMessage: item.split(':')[1]
}
arr.push(obj)
})
this.$router.push({ name: 'UpDateResult', params: { data: arr, from: 'queryCargo' } })
this.dialogBeforeClose()
} else if (res.code === 203) {
this.reBatchMoveCargoToOtherFlight(res.msg, 'notInWhite')
} else {
this.msgWarning(res.msg)
this.loading = false
}
})
}).ctach(() => {
//取消 取消当前配舱
this.loading = false
this.msgSuccess('迁转已取消')
this.cleaerForm();
this.$emit("dialogBeforeClose", {
close: false,
reload: true,
});
})
},
dialogBeforeClose() {
this.cleaerForm();
this.$refs['form'].clearValidate();
......