|
@@ -99,11 +99,11 @@
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="scope">
|
|
|
<el-button
|
|
|
- v-if="scope.row.$cellEdit"
|
|
|
size="small"
|
|
|
icon="el-icon-edit"
|
|
|
type="text"
|
|
|
@click="rowDel(scope.row, scope.index)"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
>删 除</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -252,7 +252,7 @@ import {
|
|
|
} from "@/api/basicData/customerInquiry";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
|
|
|
-import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
+import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
@@ -460,7 +460,8 @@ export default {
|
|
|
treeDeptId: null,
|
|
|
orderFeesList: [],
|
|
|
oldform: {},
|
|
|
- olddata:[]
|
|
|
+ olddata: [],
|
|
|
+ oldorderFeesList: []
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -524,6 +525,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
saveShipping() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
+ }
|
|
|
this.$confirm("是否生成船务询价单?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -537,6 +541,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
savePurchase() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
+ }
|
|
|
this.$confirm("是否生成采购询价单?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -646,15 +653,16 @@ export default {
|
|
|
getDetail(id) {
|
|
|
detail(id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.oldform = res.data.data;
|
|
|
this.data = res.data.data.orderItemsList;
|
|
|
- this.olddata= this.deepClone(res.data.data.orderFeesList);
|
|
|
this.orderFeesList = res.data.data.orderFeesList;
|
|
|
this.configuration.dicData = this.form.corpName;
|
|
|
+ this.oldform = res.data.data;
|
|
|
+ this.olddata = this.deepClone(res.data.data.orderItemsList);
|
|
|
+ this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
|
|
|
});
|
|
|
},
|
|
|
//修改提交触发
|
|
|
- editCustomer() {
|
|
|
+ editCustomer(status) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
@@ -678,10 +686,16 @@ export default {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message.success(this.form.id ? "修改成功" : "提交成功");
|
|
|
this.form = res.data.data;
|
|
|
- this.oldform = res.data.data;
|
|
|
this.data = res.data.data.orderItemsList;
|
|
|
this.orderFeesList = res.data.data.orderFeesList;
|
|
|
- this.olddata= this.deepClone(res.data.data.orderFeesList);
|
|
|
+ this.oldform = res.data.data;
|
|
|
+ this.olddata = this.deepClone(res.data.data.orderItemsList);
|
|
|
+ this.oldorderFeesList = this.deepClone(
|
|
|
+ res.data.data.orderFeesList
|
|
|
+ );
|
|
|
+ if(status=='goBack'){
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -691,9 +705,26 @@ export default {
|
|
|
},
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
- console.log(contrastObj(this.form,this.oldform))
|
|
|
- console.log(contrastList(this.orderFeesList,this.olddata))
|
|
|
- this.$emit("goBack");
|
|
|
+ let orderFeesList = this.$refs.feeInfo.submitData();
|
|
|
+ if (
|
|
|
+ contrastObj(this.form, this.oldform) ||
|
|
|
+ contrastList(this.data, this.olddata) ||
|
|
|
+ contrastList(orderFeesList, this.oldorderFeesList)
|
|
|
+ ) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.editCustomer('goBack');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$emit("goBack");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
},
|
|
|
openReport() {
|
|
|
this.switchDialog = !this.switchDialog;
|