|
|
@@ -20,17 +20,40 @@
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad">
|
|
|
<template #menu-left>
|
|
|
- <el-button type="danger"
|
|
|
+ <!-- <el-button type="danger"
|
|
|
icon="el-icon-delete"
|
|
|
plain
|
|
|
v-if="permission.productBatch_delete"
|
|
|
@click="handleDelete">删 除
|
|
|
- </el-button>
|
|
|
- <el-button type="warning"
|
|
|
+ </el-button> -->
|
|
|
+ <!-- <el-button type="warning"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
@click="handleExport">导 出
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
+ </template>
|
|
|
+ <template #details-form>
|
|
|
+ <avue-crud :option="optionSub" ref="detailCrud"
|
|
|
+ :data="form.details">
|
|
|
+ <!-- <template slot-scope="{row,index}" slot="menu">
|
|
|
+ <el-button v-if="row.$cellEdit"
|
|
|
+ text
|
|
|
+ icon="el-icon-cancel"
|
|
|
+ type="primary"
|
|
|
+ @click="rowDelSub(index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{row}" slot="tradeTotalPriceForm">
|
|
|
+ <span>{{(row.tradeUnitPrice * row.tradeNum)? (row.tradeUnitPrice * row.tradeNum).toFixed(2):0 }}</span>
|
|
|
+ </template> -->
|
|
|
+
|
|
|
+ <!-- <template slot-scope="{row,index}" slot="productIdForm">
|
|
|
+ <el-button v-if="row.$cellEdit"
|
|
|
+ text
|
|
|
+ icon="el-icon-cancel"
|
|
|
+ type="primary"
|
|
|
+ @click="rowDelSub(index)">删除</el-button>
|
|
|
+ </template> -->
|
|
|
+ </avue-crud>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
@@ -39,6 +62,7 @@
|
|
|
<script>
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/productBatch/productBatch";
|
|
|
import option from "@/option/productBatch/productBatch";
|
|
|
+ import optionSub from "@/option/productBatch/product.js";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import {exportBlob} from "@/api/common";
|
|
|
import {getToken} from '@/utils/auth';
|
|
|
@@ -61,7 +85,8 @@
|
|
|
},
|
|
|
selectionList: [],
|
|
|
option: option,
|
|
|
- data: []
|
|
|
+ data: [],
|
|
|
+ optionSub: optionSub
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -84,17 +109,24 @@
|
|
|
},
|
|
|
methods: {
|
|
|
rowSave(row, done, loading) {
|
|
|
- add(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- window.console.log(error);
|
|
|
- });
|
|
|
+ this.$refs.detailCrud.$refs.cellForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ add(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ window.console.log(error);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
update(row).then(() => {
|
|
|
@@ -178,6 +210,11 @@
|
|
|
this.form = res.data.data;
|
|
|
});
|
|
|
}
|
|
|
+ if (["add"].includes(type)) {
|
|
|
+ if(!this.form.details){
|
|
|
+ this.form.details = [{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true}]
|
|
|
+ }
|
|
|
+ }
|
|
|
done();
|
|
|
},
|
|
|
searchReset() {
|