Browse Source

feat:[模板管理][update]

lkf
luojie 3 months ago
parent
commit
d68fab8acc
4 changed files with 34 additions and 5 deletions
  1. +24
    -0
      src/components/Template/CustomTable.vue
  2. +1
    -1
      src/components/Template/HandleFormItem.vue
  3. +8
    -3
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue
  4. +1
    -1
      src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js

+ 24
- 0
src/components/Template/CustomTable.vue View File

@ -59,6 +59,14 @@
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</template>
<div class="flex flex1" v-else-if="col.bodyType === 'clickable'">
<HandleFormItem :fieldKey="prefixKey+'_'+col.prop+'_'+rowIndex" :fieldItemLabel="fieldItemLabel" type="clickable" class="body-clickable"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
:error="hasError(rowIndex, colIndex, col.prop)"
@clickable="handleClickable(col,rowIndex,colIndex)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div>
<template v-else>
{{ row[col.prop] }}
</template>
@ -80,6 +88,7 @@
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
</template>
<template v-else>
{{ row[col.bodySubKey] }}
</template>
@ -181,6 +190,14 @@ export default {
// this.initHeaderSelectValues();
},
methods: {
//
handleClickable(col, rowIndex, colIndex) {
console.log("clickable",rowIndex,colIndex, col)
if (this.templateFillType !== 'actFill') {
return
}
this.$emit("clickable", col,rowIndex)
},
isShowAddRos() {
if(!this.showAddRow) {
return false;
@ -369,6 +386,7 @@ export default {
precision: currentItem[col.bodyPrecisionKey] || col.precision || 0,
copyFrom: col.copyFrom || "",
compareTo: col.bodyCompareTo, // compareTo
type: col.bodyType || "input",
};
if (col.bodyDisabled) {
item.disabled = col.bodyDisabled;
@ -631,4 +649,10 @@ export default {
padding: 20px 0;
margin-top: 20px;
}
.flex1 {
flex: 1;
}
.flex{
display: flex;
}
</style>

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

@ -839,7 +839,7 @@ export default {
cursor: pointer;
width: auto;
// margin-left: 10px;
min-width: 100px;
min-width: 178px;
height: 28px;
border-radius: 4px;
border: 1px solid #4ea2ff;

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

@ -23,8 +23,9 @@
@blur="onHandleTableBlur"
:ref="`tableRef`"
:columns="tableStepColumns"
:formData="formData.tableData"
:formData="formData"
:prefixKey = "`table`"
@clickable="handleClickable"
fieldItemLabel = "这个是什么"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
@ -249,6 +250,10 @@ export default {
}
},
methods: {
//
handleClickable(col, rowIndex, colIndex) {
console.log("clickable",rowIndex,colIndex, col)
},
//
async getCode(){
const result = await getLatestSn({
@ -260,10 +265,10 @@ export default {
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "tableRef","stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef","tableRef" ,"stepRef", "remarkRef"]);
//resource
let tmpResource = []
debugger

+ 1
- 1
src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js View File

@ -21,7 +21,7 @@ export const getSWYPFXFFXYPZBBTableConfig = ($this) => {
{
label: '实际溶液',
prop: 'sjry',
bodyType: 'input',
bodyType: 'clickable',
bodyFillType: 'actFill',
width: 280
},

Loading…
Cancel
Save