|
|
@@ -2208,51 +2208,106 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
if (name == "生成订单") {
|
|
|
- if (!this.form.preContainersList.length) {
|
|
|
- return this.$message.error("集装箱明细不能为空");
|
|
|
- }
|
|
|
- if (this.form.status != 3) {
|
|
|
- for (let item of this.form.preContainersList) {
|
|
|
- if (!item.id) {
|
|
|
- return this.$message.error("请保存数据");
|
|
|
- }
|
|
|
- // if (!item.srcCostId) {
|
|
|
- // return this.$message.error("价格编号不能为空,请提取价格维护价格编号");
|
|
|
- // }
|
|
|
- if (Number(item.oceanFreight) < Number(item.salesPrice)) {
|
|
|
- return this.$message.error("集装箱的海运费低于销售价,请点击运费申请");
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ console.log(valid, this.form);
|
|
|
+ if (valid) {
|
|
|
+ if (!this.form.preContainersList.length) {
|
|
|
+ return this.$message.error("集装箱明细不能为空");
|
|
|
}
|
|
|
- if (!item.cntrTypeCode || !item.quantity) {
|
|
|
- this.$refs.crud.rowCell(item, item.$index);
|
|
|
- return this.$message.error("请完善明细信息");
|
|
|
+ if (this.form.status != 3) {
|
|
|
+ for (let item of this.form.preContainersList) {
|
|
|
+ if (!item.id) {
|
|
|
+ return this.$message.error("请保存数据");
|
|
|
+ }
|
|
|
+ if (Number(item.oceanFreight) < Number(item.salesPrice)) {
|
|
|
+ return this.$message.error("集装箱的海运费低于销售价,请点击运费申请");
|
|
|
+ }
|
|
|
+ if (!item.cntrTypeCode || !item.quantity) {
|
|
|
+ this.$refs.crud.rowCell(item, item.$index);
|
|
|
+ return this.$message.error("请完善明细信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- this.$confirm("是否生成订单?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.form.businessType = "KHTS";
|
|
|
- this.form.billNoFormat = "KHTS";
|
|
|
- this.form.businessTypeCode = "KHTS";
|
|
|
- verificationPrompt(this.form).then(res => {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: "加载中",
|
|
|
- spinner: "el-icon-loading",
|
|
|
- background: "rgba(255,255,255,0.7)"
|
|
|
- });
|
|
|
- submitBookingCabin(this.form)
|
|
|
- .then(res => {
|
|
|
- this.$message.success("操作成功");
|
|
|
- this.getDetails(this.form.id);
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- loading.close();
|
|
|
+ this.$confirm("是否生成订单?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.form.businessType = "KHTS";
|
|
|
+ this.form.billNoFormat = "KHTS";
|
|
|
+ this.form.businessTypeCode = "KHTS";
|
|
|
+ verificationPrompt(this.form).then(res => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
+ });
|
|
|
+ submitBookingCabin(this.form)
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetails(this.form.id);
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
});
|
|
|
+ // this.$refs["form"].validate(valid => {
|
|
|
+ // if (valid) {
|
|
|
+ // if (!this.form.preContainersList.length) {
|
|
|
+ // return this.$message.error("集装箱明细不能为空");
|
|
|
+ // }
|
|
|
+ // if (this.form.status != 3) {
|
|
|
+ // for (let item of this.form.preContainersList) {
|
|
|
+ // if (!item.id) {
|
|
|
+ // return this.$message.error("请保存数据");
|
|
|
+ // }
|
|
|
+ // // if (!item.srcCostId) {
|
|
|
+ // // return this.$message.error("价格编号不能为空,请提取价格维护价格编号");
|
|
|
+ // // }
|
|
|
+ // if (Number(item.oceanFreight) < Number(item.salesPrice)) {
|
|
|
+ // return this.$message.error("集装箱的海运费低于销售价,请点击运费申请");
|
|
|
+ // }
|
|
|
+ // if (!item.cntrTypeCode || !item.quantity) {
|
|
|
+ // this.$refs.crud.rowCell(item, item.$index);
|
|
|
+ // return this.$message.error("请完善明细信息");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.$confirm("是否生成订单?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning"
|
|
|
+ // }).then(() => {
|
|
|
+ // this.form.businessType = "KHTS";
|
|
|
+ // this.form.billNoFormat = "KHTS";
|
|
|
+ // this.form.businessTypeCode = "KHTS";
|
|
|
+ // verificationPrompt(this.form).then(res => {
|
|
|
+ // const loading = this.$loading({
|
|
|
+ // lock: true,
|
|
|
+ // text: "加载中",
|
|
|
+ // spinner: "el-icon-loading",
|
|
|
+ // background: "rgba(255,255,255,0.7)"
|
|
|
+ // });
|
|
|
+ // submitBookingCabin(this.form)
|
|
|
+ // .then(res => {
|
|
|
+ // this.$message.success("操作成功");
|
|
|
+ // this.getDetails(this.form.id);
|
|
|
+ // })
|
|
|
+ // .finally(() => {
|
|
|
+ // loading.close();
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
if (name == "一键保存") {
|
|
|
if (!this.form.preContainersList.length) {
|
|
|
@@ -2565,8 +2620,8 @@ export default {
|
|
|
submit(this.form)
|
|
|
.then(res => {
|
|
|
this.$message.success("保存成功");
|
|
|
- if(type=='goBack'){
|
|
|
- this.$emit("goBack");
|
|
|
+ if (type == "goBack") {
|
|
|
+ this.$emit("goBack");
|
|
|
}
|
|
|
this.getDetails(res.data.data.id);
|
|
|
})
|
|
|
@@ -2751,7 +2806,7 @@ export default {
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.submit("goBack")
|
|
|
+ this.submit("goBack");
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$emit("goBack");
|