|
@@ -119,7 +119,13 @@
|
|
|
@resetColumn="resetColumn"
|
|
|
>
|
|
|
<template slot="headerSerial" slot-scope="{column}">
|
|
|
- <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini" @click="$refs.crud.rowCellAdd()"></el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ circle
|
|
|
+ size="mini"
|
|
|
+ :disabled="disabled || !form.storageId || confirmDisabled"
|
|
|
+ @click="$refs.crud.rowCellAdd()"></el-button>
|
|
|
</template>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
@@ -484,7 +490,8 @@ import {getDetail} from "@/api/basicData/inventoryAccount";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
import { getCurrentDate } from "@/util/date";
|
|
|
import viewHistory from '../componet/history';
|
|
|
-import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
|
|
|
+import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees";
|
|
|
+import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
@@ -735,6 +742,9 @@ export default {
|
|
|
uploadParam: {},
|
|
|
historyVisible: false,
|
|
|
historyParams: {},
|
|
|
+ oldForm: {},
|
|
|
+ oldDataList: [],
|
|
|
+ oldUploadData: [],
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -829,6 +839,9 @@ export default {
|
|
|
this.uploadData = this.form.orderFilesList? this.form.orderFilesList: [];
|
|
|
delete this.form.orderItemsList;
|
|
|
delete this.form.orderFilesList;
|
|
|
+ this.oldForm = {...this.form};
|
|
|
+ this.oldDataList = [...this.dataList];
|
|
|
+ this.oldUploadData = [...this.uploadData];
|
|
|
this.dataList.forEach(async item => {
|
|
|
if (item.batch == 1) {
|
|
|
item.arr = await this.getLotNo({
|
|
@@ -1483,26 +1496,28 @@ export default {
|
|
|
},
|
|
|
// 确认或者取消订单
|
|
|
dealerSubmit() {
|
|
|
- let dealer;
|
|
|
- if (this.form.status == 0) {
|
|
|
- dealer = 1;
|
|
|
- } else if (this.form.status == 3) {
|
|
|
- dealer = 2;
|
|
|
- }
|
|
|
- this.btnLoading = true;
|
|
|
- dealerSubmit({
|
|
|
- id: this.form.id,
|
|
|
- dealer
|
|
|
- }).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.queryData(this.form.id)
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.msg)
|
|
|
+ if (this.verification()) {
|
|
|
+ let dealer;
|
|
|
+ if (this.form.status == 0) {
|
|
|
+ dealer = 1;
|
|
|
+ } else if (this.form.status == 3) {
|
|
|
+ dealer = 2;
|
|
|
}
|
|
|
- }).finally(() => {
|
|
|
- this.btnLoading = false;
|
|
|
- })
|
|
|
+ this.btnLoading = true;
|
|
|
+ dealerSubmit({
|
|
|
+ id: this.form.id,
|
|
|
+ dealer
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 下载模板
|
|
|
downloadHandle() {
|
|
@@ -1589,6 +1604,24 @@ export default {
|
|
|
this.salesPriceOtion = res.data.data
|
|
|
})
|
|
|
},
|
|
|
+ // 验证新旧值对比
|
|
|
+ verification() {
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.dataList, this.oldDataList) ||
|
|
|
+ contrastList(this.uploadData, this.oldUploadData)) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer();
|
|
|
+ }).catch(() => {
|
|
|
+ return false; //取消改动数据
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|