|
@@ -11,7 +11,7 @@
|
|
|
class="el-button--small-yh " @click.stop="openEdit">编辑
|
|
|
</el-button>
|
|
|
<el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 1"
|
|
|
- size="small">{{ form.id ? '修改数据' : '保存数据' }}
|
|
|
+ size="small">保存数据
|
|
|
</el-button>
|
|
|
<el-dropdown style="padding: 0 6px;line-height: 0">
|
|
|
<el-button type="primary" size="small" :loading="buttonLoading" :disabled="!form.id">
|
|
@@ -46,7 +46,7 @@
|
|
|
</trade-card>
|
|
|
<trade-card title="出库明细">
|
|
|
<avue-crud ref="crud" :data="itemsVOList" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn" :cell-style="cellStyle">
|
|
|
+ @resetColumn="resetColumn" :cell-style="cellStyle" @row-save="rowSave" @row-update="addUpdate">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" :disabled="detailData.status == 1"
|
|
|
@click.stop="addRow">录入明细
|
|
@@ -70,13 +70,21 @@
|
|
|
<el-button v-if="row.qrCode" type="text" slot="reference">查看</el-button>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
+ <template slot="storageInQuantityForm" slot-scope="{ row,disabled }">
|
|
|
+ <el-input-number size="small" v-model="row.storageInQuantity" @change="calculateChange(row)"
|
|
|
+ :controls="false" style="width:100%" placeholder="请输入"></el-input-number>
|
|
|
+ </template>
|
|
|
+ <template slot="priceForm" slot-scope="{ row,disabled }">
|
|
|
+ <el-input-number size="small" v-model="row.price" @change="calculateChange(row)" :controls="false"
|
|
|
+ style="width:100%" placeholder="请输入"></el-input-number>
|
|
|
+ </template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<div style="display:flex;justify-content: center;">
|
|
|
<el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
|
|
|
- :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
+ :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
|
|
|
<el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
:disabled="detailData.status == 1">删除</el-button>
|
|
|
- <!-- <el-button size="small" icon="el-icon-printer" type="text" @click="rowPrint(row, index)" :disabled="!row.id">
|
|
|
+ <!-- <el-button size="small" icon="el-icon-printer" type="text" @click="rowPrint(row, index)" :disabled="!row.id">
|
|
|
打印</el-button> -->
|
|
|
</div>
|
|
|
</template>
|
|
@@ -103,6 +111,7 @@ import feeInfo from "@/components/fee-info/main";
|
|
|
import checkSchedule from "../../../components/check/checkSchedule";
|
|
|
import uploadFile from "@/components/upload-file/main";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
+import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
data() {
|
|
@@ -215,7 +224,11 @@ export default {
|
|
|
subLoading: false,
|
|
|
pageLoading: false,
|
|
|
batchNo: '',
|
|
|
- storagetreeList: []
|
|
|
+ storagetreeList: [],
|
|
|
+ oldform: {},
|
|
|
+ olditemsVOList: [],
|
|
|
+ oldorderFeesList: [],
|
|
|
+ oldorderFilesList: [],
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -320,14 +333,13 @@ export default {
|
|
|
|
|
|
},
|
|
|
rowCell(row, index) {
|
|
|
- if (row.$cellEdit == true) {
|
|
|
- this.$set(row, "$cellEdit", false);
|
|
|
- } else {
|
|
|
- this.$set(row, "$cellEdit", true);
|
|
|
- }
|
|
|
+ this.$refs.crud.rowCell(row, index)
|
|
|
+ },
|
|
|
+ rowSave(form, done) {
|
|
|
+ done()
|
|
|
},
|
|
|
- rowSave(row) {
|
|
|
- this.$set(row, "$cellEdit", false);
|
|
|
+ addUpdate(form, index, done, loading) {
|
|
|
+ done()
|
|
|
},
|
|
|
rowDel(row) {
|
|
|
this.$confirm("确定删除数据?", {
|
|
@@ -350,6 +362,10 @@ export default {
|
|
|
this.itemsVOList = res.data.data.itemsVOList;
|
|
|
this.orderFeesList = res.data.data.orderFeesList;
|
|
|
this.orderFilesList = res.data.data.orderFilesList;
|
|
|
+ this.oldform = this.deepClone(res.data.data);
|
|
|
+ this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
|
|
|
+ this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
|
|
|
+ this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
|
|
|
this.getStorage()
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -369,16 +385,10 @@ export default {
|
|
|
res.data.data.itemsVOList.forEach(e => {
|
|
|
delete e.id
|
|
|
})
|
|
|
- // res.data.data.orderFeesList.forEach(e => {
|
|
|
- // delete e.id
|
|
|
- // })
|
|
|
- // res.data.data.orderFilesList.forEach(e => {
|
|
|
- // delete e.id
|
|
|
- // })
|
|
|
this.form = res.data.data;
|
|
|
- this.itemsVOList = res.data.data.itemsVOList;
|
|
|
- // this.orderFeesList = res.data.data.orderFeesList;
|
|
|
- // this.orderFilesList = res.data.data.orderFilesList;
|
|
|
+ this.itemsVOList = res.data.data.itemsVOList.filter(e => e.isIssue == 'N');
|
|
|
+ this.oldform = this.deepClone(res.data.data);
|
|
|
+ this.olditemsVOList = this.deepClone(res.data.data.itemsVOList.filter(e => e.isIssue == 'N'));
|
|
|
this.getStorage()
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -404,10 +414,17 @@ export default {
|
|
|
this.itemsVOList = res.data.data.itemsVOList;
|
|
|
this.orderFeesList = res.data.data.orderFeesList;
|
|
|
this.orderFilesList = res.data.data.orderFilesList;
|
|
|
+ this.oldform = this.deepClone(res.data.data);
|
|
|
+ this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
|
|
|
+ this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
|
|
|
+ this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "保存成功!"
|
|
|
});
|
|
|
+ if (status == "goBack") {
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.subLoading = false;
|
|
@@ -478,13 +495,36 @@ export default {
|
|
|
},
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
- this.$emit("goBack");
|
|
|
+ let orderFeesList = this.$refs.feeInfo.submitData();
|
|
|
+ if (
|
|
|
+ contrastObj(this.form, this.oldform) ||
|
|
|
+ contrastList(this.itemsVOList, this.olditemsVOList) ||
|
|
|
+ contrastList(orderFeesList, this.oldorderFeesList) ||
|
|
|
+ contrastList(this.orderFilesList, this.oldorderFilesList)
|
|
|
+ ) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.editCustomer("goBack");
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$emit("goBack");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
},
|
|
|
openEdit() {
|
|
|
this.detailData.status = 2;
|
|
|
this.option.disabled = false;
|
|
|
this.$refs.crud.refreshTable();
|
|
|
},
|
|
|
+ calculateChange(row) {
|
|
|
+ row.storageAmount = (row.storageInQuantity ? row.storageInQuantity : 0) * (row.price ? row.price : 0)
|
|
|
+ },
|
|
|
beforeFinance(feesData, callback) {
|
|
|
let params = {}
|
|
|
//暂时默认通过 之后优化
|
|
@@ -492,7 +532,7 @@ export default {
|
|
|
params.parentId = this.form.id
|
|
|
callback(params)
|
|
|
},
|
|
|
- openReport(){
|
|
|
+ openReport() {
|
|
|
this.$router.push(`/myiframe/urlPath?name=preview-木材库-出库单.ureport.xml&src=${this.website.reportUrl}/preview?_u=blade-木材库-出库单.ureport.xml&id=${this.form.id}`);
|
|
|
},
|
|
|
async saveColumn() {
|