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() { mounted() {
EventBus.$on("subPackageSubmit", (data) => {
EventBus.$on("dialogSubPackageSubmit", (data) => {
this.onSubPackageSubmit(data) this.onSubPackageSubmit(data)
}) })
}, },
watch: {
row: {
handler(newVal, oldVal) {
this.innerRow = newVal;
},
deep: true,
}
},
data(){
return{
innerRow: this.row,
}
},
methods: { methods: {
// //
onStartConfig() { onStartConfig() {
this.$emit("startConfig", this.row)
this.$emit("startConfig", this.innerRow)
}, },
// //
onConfigComplete() { onConfigComplete() {
this.$emit("configComplete", this.row)
this.$emit("configComplete", this.innerRow)
}, },
// //
onPrintLabel() { onPrintLabel() {
this.$emit("printLabel", this.row)
this.$emit("printLabel", this.innerRow)
}, },
// //
onSubPackage() { onSubPackage() {
const {columns,row} = this;
const {columns,innerRow} = this;
const {headerSelectFields,columnsData} = columns; const {headerSelectFields,columnsData} = columns;
const col = columnsData.find((item)=>item.myCodeFields); const col = columnsData.find((item)=>item.myCodeFields);
const {myCodeFields,maxVolumeField,maxVolumeFieldUnit} = col; const {myCodeFields,maxVolumeField,maxVolumeFieldUnit} = col;
console.log(row,col,"ooooo")
const fields = []; const fields = [];
myCodeFields.forEach((key)=>{ 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){ onSubPackageSubmit(data){
if(data.rowIndex === this.rowIndex){ 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" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData"> :formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <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> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -414,6 +414,11 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
//
subPackageSubmit(data) {
const { fzsj, rowData } = data;
console.log(data, "子项提交事件")
},
// //
async handleUpdateCode() { async handleUpdateCode() {
const { stepTableFormData = [] } = this.formData; const { stepTableFormData = [] } = this.formData;
@ -427,7 +432,7 @@ export default {
} }
const snList = await this.getLatestSn(stepTableFormData.length); const snList = await this.getLatestSn(stepTableFormData.length);
stepTableFormData.forEach((item, index) => { stepTableFormData.forEach((item, index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode:snList[index] });
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] });
}) })
this.$nextTick(() => { this.$nextTick(() => {
// //

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

@ -109,9 +109,10 @@ export default {
}, },
show(data) { show(data) {
if (data.fzList) { if (data.fzList) {
this.fzList = data.fzList;
this.fzList = JSON.parse(JSON.stringify(data.fzList));
// //
this.fzListErrors = new Array(this.fzList.length).fill(false); this.fzListErrors = new Array(this.fzList.length).fill(false);
delete data.fzList;
} }
this.formData = data; this.formData = data;
// //
@ -147,8 +148,7 @@ export default {
}, },
submitEmit(){ 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(); this.close();
}, },

Loading…
Cancel
Save