|
|
@@ -32,9 +32,14 @@
|
|
|
@click="handleExport">导 出
|
|
|
</el-button> -->
|
|
|
</template>
|
|
|
+
|
|
|
<template #details-form>
|
|
|
<avue-crud :option="optionSub" ref="detailCrud"
|
|
|
:data="form.details">
|
|
|
+ <template #qrCode-form="{row}">
|
|
|
+ <el-input v-model="row.qrCode"
|
|
|
+ :disabled="row.id"></el-input>
|
|
|
+ </template>
|
|
|
<!-- <template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button v-if="row.$cellEdit"
|
|
|
text
|
|
|
@@ -107,6 +112,34 @@
|
|
|
return ids.join(",");
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // 'form.factoryId'(newValue, oldValue) {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.form.clientId='';
|
|
|
+ // this.form.productModelId='';
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ let that = this;
|
|
|
+ this.option.column.productModelId.change= function (column) {
|
|
|
+ // 函数体
|
|
|
+ if(column.value){
|
|
|
+ console.log(column.item.inStockNum)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ var details = [];
|
|
|
+ for(let i=0;i<column.item.inStockNum;i++){
|
|
|
+ details.push({"$cellEdit":true})
|
|
|
+ }
|
|
|
+ that.form.details = details
|
|
|
+ });
|
|
|
+ // if(!this.form.details){
|
|
|
+ // this.form.details = [{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true},{"$cellEdit":true}]
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
methods: {
|
|
|
rowSave(row, done, loading) {
|
|
|
this.$refs.detailCrud.$refs.cellForm.validate((valid) => {
|
|
|
@@ -208,6 +241,14 @@
|
|
|
if (["edit", "view"].includes(type)) {
|
|
|
getDetail(this.form.id).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
+ if(type == "edit"){
|
|
|
+ this.option.column.productModelId.disabled=true;
|
|
|
+ this.option.column.clientId.disabled=true;
|
|
|
+ this.option.column.factoryId.disabled=true;
|
|
|
+ this.form.details.forEach(item =>{
|
|
|
+ item["$cellEdit"] = true
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
if (["add"].includes(type)) {
|
|
|
@@ -251,7 +292,8 @@
|
|
|
productName,
|
|
|
clientId,
|
|
|
factoryId,
|
|
|
- productModelId
|
|
|
+ productModelId,
|
|
|
+ qrCode
|
|
|
} = this.query;
|
|
|
|
|
|
let values = {
|
|
|
@@ -260,6 +302,7 @@
|
|
|
productModelId: productModelId,
|
|
|
clientId: clientId,
|
|
|
factoryId: factoryId,
|
|
|
+ qrCode:qrCode,
|
|
|
};
|
|
|
|
|
|
getList(page.currentPage, page.pageSize, values).then(res => {
|