Browse Source

feat: [模板管理] GSP009+GSP011 生成编号

lkf
memorylkf 2 months ago
parent
commit
b7834cdfe9
2 changed files with 72 additions and 21 deletions
  1. +69
    -18
      src/views/business/comps/template/comps/gsp/GSP009.vue
  2. +3
    -3
      src/views/business/comps/template/comps/lba/LBA006.vue

+ 69
- 18
src/views/business/comps/template/comps/gsp/GSP009.vue View File

@ -29,6 +29,9 @@
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{ $t('template.lba.lba004.sc')}}</el-button> <el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{ $t('template.lba.lba004.sc')}}</el-button>
</div> </div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" <BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" :ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')" /> :fieldItemLabel="$t('template.lba.lba004.xszj')" />
@ -163,7 +166,7 @@ export default {
}, },
xz: { xz: {
label: 'template.gsp.gsp009.xz', label: 'template.gsp.gsp009.xz',
type: "sj",
type: "mix",
fillType: "actFill", fillType: "actFill",
subType:"text", subType:"text",
subText:this.sn=='GSP009'?'template.gsp.gsp009.zw':'template.gsp.gsp011.zw' subText:this.sn=='GSP009'?'template.gsp.gsp009.zw':'template.gsp.gsp011.zw'
@ -180,8 +183,30 @@ export default {
}, },
mounted() { mounted() {
this.handleAddParalle(true); this.handleAddParalle(true);
const formData = this.getFormDataByTemplateData();
if(this.fillType === "actFill"){
this.getCode(formData);
}
}, },
methods: { methods: {
//
async getCode(content){
if (content.paralleConfigs && content.paralleConfigs.length > 0 && !content.paralleConfigs[0].ypBh) {
const codes = content.paralleConfigs.map((item) => ({ pre: item.yp, type: 1 }));
const snList = await this.getLatestSnArr(codes);
content.paralleConfigs.forEach((row, idx) => {
this.$refs[`paralleStepFormPackageRef_${idx}`][0].updateFormData('ypBh',snList[idx])
});
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
},
// //
getFilledFormData() { getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData(); const baseData = this.$refs.baseInfoRef.getFilledFormData();
@ -230,8 +255,45 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
if (content.paralleConfigs && content.paralleConfigs.length > 0) {
for (let i = 0; i < content.paralleConfigs.length; i++) {
let paralleConfigs = content.paralleConfigs[i]
//使
tmpResource.push({
mc: null,
bh: paralleConfigs.xz,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: null,
syldw: null,
yxzq: null,
yxzqdw: null,
})
}
}
}
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
}
tmpResource.forEach((row, idx) => {
row.syldw = null
row.syl = null
});
debugger
//使 //使
this.resourceTmp = []
this.resourceTmp = tmpResource
this.yqResourceTmp = [] this.yqResourceTmp = []
return this.resourceTmp; return this.resourceTmp;
}, },
@ -242,7 +304,6 @@ export default {
}, },
// //
handleAddParalle(init) { handleAddParalle(init) {
debugger
let isAdd = !init let isAdd = !init
if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){ if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){
isAdd = true isAdd = true
@ -258,7 +319,6 @@ export default {
}); });
} }
//todo: //todo:
debugger
}, },
// //
deleteParalleConfig(index) { deleteParalleConfig(index) {
@ -268,21 +328,12 @@ export default {
} }
this.formData.paralleConfigs.splice(index, 1); this.formData.paralleConfigs.splice(index, 1);
}, },
//
deleteRow(rowIndex, type, configIndex = 0) {
//
if (type === 'ladder') {
const tableRef = this.$refs[`ladderStepTableRef_${configIndex}`];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
} else if (type === 'paralle') {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
}
}
onTableBeforeReagentSubmit(val1,va2,va3){
debugger
}, },
onTableRegentSubmit(val1,va2,va3){
debugger
}
} }
}; };
</script> </script>

+ 3
- 3
src/views/business/comps/template/comps/lba/LBA006.vue View File

@ -183,7 +183,9 @@ export default {
}; };
}, },
mounted() { mounted() {
this.handleAddParalle(true);
setTimeout(()=>{
this.handleAddParalle(true);
},300)
}, },
methods: { methods: {
// //
@ -246,7 +248,6 @@ export default {
}, },
// //
handleAddParalle(init) { handleAddParalle(init) {
debugger
let isAdd = !init let isAdd = !init
if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){ if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){
isAdd = true isAdd = true
@ -261,7 +262,6 @@ export default {
showParalleConfig: true showParalleConfig: true
}); });
} }
debugger
}, },
// //
deleteParalleConfig(index) { deleteParalleConfig(index) {

Loading…
Cancel
Save