Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
5edc1e10fb
3 changed files with 45 additions and 16 deletions
  1. +34
    -10
      src/components/Template/operation/TableOpertaion.vue
  2. +8
    -3
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  3. +3
    -3
      src/views/business/comps/template/dialog/SubPackageDialog.vue

+ 34
- 10
src/components/Template/operation/TableOpertaion.vue View File

@ -41,39 +41,63 @@ export default {
},
mounted() {
EventBus.$on("subPackageSubmit", (data) => {
EventBus.$on("dialogSubPackageSubmit", (data) => {
this.onSubPackageSubmit(data)
})
},
watch: {
row: {
handler(newVal, oldVal) {
this.innerRow = newVal;
},
deep: true,
}
},
data(){
return{
innerRow: this.row,
}
},
methods: {
//
onStartConfig() {
this.$emit("startConfig", this.row)
this.$emit("startConfig", this.innerRow)
},
//
onConfigComplete() {
this.$emit("configComplete", this.row)
this.$emit("configComplete", this.innerRow)
},
//
onPrintLabel() {
this.$emit("printLabel", this.row)
this.$emit("printLabel", this.innerRow)
},
//
onSubPackage() {
const {columns,row} = this;
const {columns,innerRow} = this;
const {headerSelectFields,columnsData} = columns;
const col = columnsData.find((item)=>item.myCodeFields);
const {myCodeFields,maxVolumeField,maxVolumeFieldUnit} = col;
console.log(row,col,"ooooo")
const fields = [];
myCodeFields.forEach((key)=>{
fields.push(row[key])
})
EventBus.$emit("showSubPackageDialog",{mybh:fields.join(""),maxVolume:row[maxVolumeField],maxVolumeUnit:headerSelectFields[maxVolumeFieldUnit],rowIndex:this.rowIndex})
fields.push(innerRow[key])
});
let defaultData = {mybh:fields.join(""),maxVolume:innerRow[maxVolumeField],maxVolumeUnit:headerSelectFields[maxVolumeFieldUnit],rowIndex:this.rowIndex}
if(innerRow.fzsj){
defaultData = innerRow.fzsj
}
EventBus.$emit("showSubPackageDialog",defaultData)
},
onSubPackageSubmit(data){
if(data.rowIndex === this.rowIndex){
this.$emit("subPackageSubmit", data)
this.innerRow.fzsj = data;
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params);
this.$emit("subPackageSubmit", {fzsj:data,rowData:this.innerRow});
}
},
//

+ 8
- 3
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -20,8 +20,8 @@
:showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="deleteRow"></TableOpertaion>
<TableOpertaion @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
:rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion>
</template>
</CustomTable>
</div>
@ -414,6 +414,11 @@ export default {
mounted() {
},
methods: {
//
subPackageSubmit(data) {
const { fzsj, rowData } = data;
console.log(data, "子项提交事件")
},
//
async handleUpdateCode() {
const { stepTableFormData = [] } = this.formData;
@ -427,7 +432,7 @@ export default {
}
const snList = await this.getLatestSn(stepTableFormData.length);
stepTableFormData.forEach((item, index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode:snList[index] });
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] });
})
this.$nextTick(() => {
//

+ 3
- 3
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -109,9 +109,10 @@ export default {
},
show(data) {
if (data.fzList) {
this.fzList = data.fzList;
this.fzList = JSON.parse(JSON.stringify(data.fzList));
//
this.fzListErrors = new Array(this.fzList.length).fill(false);
delete data.fzList;
}
this.formData = data;
//
@ -147,8 +148,7 @@ export default {
},
submitEmit(){
console.log({...this.formData, fzList: this.fzList})
EventBus.$emit('subPackageSubmit', {...this.formData, fzList: this.fzList});
EventBus.$emit('dialogSubPackageSubmit', {...this.formData, fzList: this.fzList});
this.close();
},

Loading…
Cancel
Save