Browse Source

feat:[模板管理]DJ001,DL006优化

ouqian
ZHANGTENG\张腾 1 month ago
parent
commit
bbf72424d8
3 changed files with 66 additions and 33 deletions
  1. +3
    -3
      src/components/Template/HandleFormItem.vue
  2. +48
    -22
      src/views/business/comps/template/comps/dj/DJ001.vue
  3. +15
    -8
      src/views/business/comps/template/comps/dl/DL006.vue

+ 3
- 3
src/components/Template/HandleFormItem.vue View File

@ -1164,8 +1164,8 @@ export default {
isSame = isEqual(current.oldValue, current.newValue);
isOldValueEmpty = isValueEmpty(current.oldValue);
} else if (this.type === "checkboxTree") {
const current = this.getCheckboxTreeInfo();
const { oldValue, newValue } = current;
const current = this.getCheckboxTreeInfo() || {};
const { oldValue = {}, newValue = {} } = current;
if (currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue.checked, newValue.checked);
isOldValueEmpty = oldValue.checked === undefined;
@ -1248,7 +1248,7 @@ export default {
const current = this.getCheckboxTreeInfo();
if (this.currentHandleType === "checkboxTreeCheckbox") {
const { oldValue, newValue } = current;
recordOldVlaue = `${oldValue.label || ''}:${oldValue.checked ? '勾选' : '未勾选'}`;
recordOldVlaue = `${oldValue?.label || ''}:${oldValue?.checked ? '勾选' : '未勾选'}`;
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined;
} else {

+ 48
- 22
src/views/business/comps/template/comps/dj/DJ001.vue View File

@ -13,7 +13,7 @@
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo"
ref="operateStepRef" :formConfig="operateConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.dj.dj001.fhfw"
<BaseInfoFormPackage v-if="fillType !== 'preFill'" fieldItemLabel="template.dj.dj001.fhfw"
ref="fhfwCheckBoxRef" :formConfig="fhfwCheckBoxConfig" :formData="formData" />
<div class="template-form-item" >
<span>{{ $t('template.dj.dj001.fhfw') }}</span>
@ -159,13 +159,14 @@ export default {
label: 'template.dj.dj001.fhfw',
type: "checkboxTree",
fillType: 'actFill',
options: this.fhfwCheckOptions
options: Array.isArray(this.fhfwCheckOptions) ? this.fhfwCheckOptions : []
},
fhlrCheck: {
label: 'template.dj.dj001.fhlr',
type: "checkboxTree",
fillType: 'actFill',
options: this.fhlrCheckOptions
options: Array.isArray(this.fhlrCheckOptions) ? this.fhlrCheckOptions : []
},
}
},
@ -199,16 +200,17 @@ export default {
},
data() {
return {
formData: {},
formData: {
fhfwCheck: { checkedValues: [], otherValues: {} },
fhlrCheck: { checkedValues: [], otherValues: {} },
},
fhfwCheckOptions:[],
fhlrCheckOptions:[],
isFirstTableDataRecorded: false,
};
},
mounted() {
setTimeout(()=>{
this.getTableData()
},200)
this.getTableData()
},
methods: {
//
@ -251,23 +253,47 @@ export default {
},
//
getTableData() {
const formData = this.getFilledFormData() || {};
const stepTableFormData = formData.stepTableFormData || [];
const stepTableFormData_1 = formData.stepTableFormData_1 || [];
// options+
const firstList = stepTableFormData
.filter(item => item.fhfw) //
.map(item => ({ label: item.fhfw, value: item.fhfw }))
.filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); //
try {
const formData = this.getFilledFormData() || {};
//
const stepTableFormData = formData.stepTableFormData || this.formData.stepTableFormData || [];
const stepTableFormData_1 = formData.stepTableFormData_1 || this.formData.stepTableFormData_1 || [];
// checkboxTreechildren
const firstList = stepTableFormData
.filter(item => item && item.fhfw && item.fhfw.trim()) //
.map(item => ({
label: item.fhfw,
value: item.fhfw,
children: [] // childrencheckboxTree
}))
//
.filter((item, index, arr) => {
return arr.findIndex(i => i.value === item.value) === index;
});
const secondList = stepTableFormData_1
.filter(item => item.fhlr) //
.map(item => ({ label: item.fhlr, value: item.fhlr }))
.filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); //
const secondList = stepTableFormData_1
.filter(item => item && item.fhlr && item.fhlr.trim()) //
.map(item => ({
label: item.fhlr,
value: item.fhlr,
children: [] // children
}))
.filter((item, index, arr) => {
return arr.findIndex(i => i.value === item.value) === index;
});
// computed
this.fhfwCheckOptions = firstList;
this.fhlrCheckOptions = secondList;
//
this.$nextTick(()=>{
this.fhfwCheckOptions = firstList;
this.fhlrCheckOptions = secondList;
})
} catch (error) {
//
this.fhfwCheckOptions = [];
this.fhlrCheckOptions = [];
}
},
}
};

+ 15
- 8
src/views/business/comps/template/comps/dl/DL006.vue View File

@ -659,9 +659,7 @@ export default {
// 2
const newDataSource = [];
let rowIndexNew = 0;
console.log(doseGroupCount, parallelDishCount,"doseGroupCount, parallelDishCount")
for (let doseIndex = 0; doseIndex < doseGroupCount; doseIndex++) {
for (let dishIndex = 0; dishIndex < parallelDishCount; dishIndex++) {
const rowData = {
jlzb: stepTableFormData[doseIndex]?.jlzmc || '',
@ -671,19 +669,28 @@ export default {
newDataSource.push(rowData);
rowIndexNew++;
}
newDataSource.map((item,index)=>{
for (let i = 0; i < doseGroupCount; i++) {
item[`czrxm_${i}Label`] = formatNumberByDigits((i*newDataSource.length)+index+1)
}
})
}
// newDataSource
console.log(this.getFilledFormData())
if (qsbh && /^\d+$/.test(qsbh)) {
let currentNum = parseInt(qsbh, 10);
const totalRows = newDataSource.length;
//
for (let colIndex = 0; colIndex < Number(jzs); colIndex++) {
//
for (let rowIndex = 0; rowIndex < totalRows; rowIndex++) {
const row = newDataSource[rowIndex];
// 3 001002
row[`czrxm_${colIndex}Label`] = currentNum.toString().padStart(3, '0');
currentNum++;
}
}
}
// 3
this.$refs.czxxTableRef.updateDataSource(newDataSource);
justUpdateFilledFormData()
});
},
}
}
</script>

Loading…
Cancel
Save