Browse Source

fix:[试验管理]表单优化

lkf
15881625488@163.com 3 months ago
parent
commit
f6c4feb0cd
3 changed files with 29 additions and 12 deletions
  1. +13
    -5
      src/views/business/study/comp/jhbd/Bj.vue
  2. +6
    -1
      src/views/business/study/comp/sqbd/Bj.vue
  3. +10
    -6
      src/views/business/study/comp/tbbd/Bj.vue

+ 13
- 5
src/views/business/study/comp/jhbd/Bj.vue View File

@ -65,7 +65,7 @@
</el-form> </el-form>
</div> </div>
<div class="content" v-if="showIndex == 2"> <div class="content" v-if="showIndex == 2">
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="form" fillType="actFill" />
<TemplateTable ref="templateTable" :sn="form.templateSn" :templateData="templateData" fillType="actFill" />
</div> </div>
</div> </div>
</div> </div>
@ -78,7 +78,10 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('page.business.study.studyFormPlan.shryId')" prop="fshryId"> <el-form-item :label="$t('page.business.study.studyFormPlan.shryId')" prop="fshryId">
<SelectDeptUser v-model="form.fshryId" :name="form.fhryMc" key="shryId" @change="selectDeptUserChange" />
<SelectStudyUser v-model="form.fshryId" :query="{
studyId: form.studyId,
permit: 'business:studyFormPlan:fh'
}" key="fshryId" @change="selectDeptUserChange" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -128,12 +131,13 @@
import { studyFormPlan_bc, studyFormPlan_tj, studyFormPlan_info } from "@/api/business/study/studyFormPlan" import { studyFormPlan_bc, studyFormPlan_tj, studyFormPlan_info } from "@/api/business/study/studyFormPlan"
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import SelectTemplate from "@/views/business/comps/select/SelectTemplate"; import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectStudyUser from '@/views/business/comps/select/SelectStudyUser';
import TemplateTable from '@/views/business/comps/template/TemplateTable'; import TemplateTable from '@/views/business/comps/template/TemplateTable';
import { deepClone } from "@/utils/index";
export default { export default {
name: "Bj", name: "Bj",
components: { SelectTemplate, SelectDeptUser, TemplateTable },
components: { SelectTemplate, SelectStudyUser, TemplateTable },
data() { data() {
return { return {
open: false, open: false,
@ -169,7 +173,8 @@ export default {
trigger: 'blur' trigger: 'blur'
}], }],
}
},
templateData: {}
} }
}, },
computed: { computed: {
@ -195,6 +200,7 @@ export default {
this.form.bdmc = val.name this.form.bdmc = val.name
this.form.templateMc = val.name this.form.templateMc = val.name
this.form.templateSn = val.sn this.form.templateSn = val.sn
this.templateData = deepClone(this.form)
}, },
cancel() { cancel() {
this.$emit('close') this.$emit('close')
@ -227,12 +233,14 @@ export default {
this.$modal.loading() this.$modal.loading()
studyFormPlan_info({ id: row.id }).then(response => { studyFormPlan_info({ id: row.id }).then(response => {
this.form = response.data this.form = response.data
this.templateData = deepClone(this.form)
this.open = true this.open = true
this.$modal.closeLoading() this.$modal.closeLoading()
}) })
} else { } else {
this.showIndex = 1 this.showIndex = 1
this.form = _.merge({}, this.form, row) this.form = _.merge({}, this.form, row)
this.templateData = deepClone(this.form)
this.open = true this.open = true
} }
}, },

+ 6
- 1
src/views/business/study/comp/sqbd/Bj.vue View File

@ -132,6 +132,7 @@ import { mapGetters } from 'vuex'
import SelectTemplate from "@/views/business/comps/select/SelectTemplate"; import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import TemplateTable from '@/views/business/comps/template/TemplateTable'; import TemplateTable from '@/views/business/comps/template/TemplateTable';
import { deepClone } from "@/utils/index";
export default { export default {
name: "Bj", name: "Bj",
@ -176,7 +177,8 @@ export default {
trigger: 'blur' trigger: 'blur'
}], }],
}
},
templateData: {}
} }
}, },
computed: { computed: {
@ -202,6 +204,7 @@ export default {
this.form.bdnr = val.content this.form.bdnr = val.content
this.form.templateMc = val.name this.form.templateMc = val.name
this.form.templateSn = val.sn this.form.templateSn = val.sn
this.templateData = deepClone(this.form)
}, },
cancel() { cancel() {
this.$emit('close') this.$emit('close')
@ -235,12 +238,14 @@ export default {
this.$modal.loading() this.$modal.loading()
studyFormApply_info({ id: row.id }).then(response => { studyFormApply_info({ id: row.id }).then(response => {
this.form = _.merge({}, this.form, response.data) this.form = _.merge({}, this.form, response.data)
this.templateData = deepClone(this.form)
this.open = true this.open = true
this.$modal.closeLoading() this.$modal.closeLoading()
}) })
} else { } else {
this.showIndex = 1 this.showIndex = 1
this.form = _.merge({}, this.form, row) this.form = _.merge({}, this.form, row)
this.templateData = deepClone(this.form)
this.open = true this.open = true
} }
}, },

+ 10
- 6
src/views/business/study/comp/tbbd/Bj.vue View File

@ -77,7 +77,7 @@
</div> </div>
<div class="content" v-if="showIndex == 2"> <div class="content" v-if="showIndex == 2">
<TemplateTable emitName="onFillCallback" @onFillCallback="onFillCallback" ref="templateTable" <TemplateTable emitName="onFillCallback" @onFillCallback="onFillCallback" ref="templateTable"
:sn="form.templateSn" :templateData="form" fillType="actFill" />
:sn="form.templateSn" :templateData="templateData" fillType="actFill" />
</div> </div>
</div> </div>
</div> </div>
@ -231,6 +231,7 @@ import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import TemplateTable from '@/views/business/comps/template/TemplateTable'; import TemplateTable from '@/views/business/comps/template/TemplateTable';
import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import { deepClone } from "@/utils/index";
export default { export default {
name: "Bj", name: "Bj",
@ -286,6 +287,7 @@ export default {
trigger: 'blur' trigger: 'blur'
}] }]
}, },
templateData: {}
} }
}, },
computed: { computed: {
@ -304,10 +306,10 @@ export default {
if (data.type == 'fieldChanged') { if (data.type == 'fieldChanged') {
studyFormFill_updateBdnr( studyFormFill_updateBdnr(
{ {
id:this.form.id,
bdnr:JSON.stringify(this.$refs.templateTable.getFilledFormData()),
zdxgjl:JSON.stringify(data.resourceList),
filedValue:JSON.stringify(data.newRecord)
id: this.form.id,
bdnr: JSON.stringify(this.$refs.templateTable.getFilledFormData()),
zdxgjl: JSON.stringify(data.resourceList),
filedValue: JSON.stringify(data.newRecord)
} }
).then(response => { ).then(response => {
}) })
@ -348,6 +350,7 @@ export default {
studyFormFill_info({ id: formId }).then(response => { studyFormFill_info({ id: formId }).then(response => {
this.form = response.data this.form = response.data
this.form.qmyy = this.$t('page.business.study.studyFormFill.zztjyzbd') this.form.qmyy = this.$t('page.business.study.studyFormFill.zztjyzbd')
this.templateData = deepClone(this.form)
this.$modal.closeLoading() this.$modal.closeLoading()
}) })
} else { } else {
@ -355,6 +358,7 @@ export default {
this.$modal.loading() this.$modal.loading()
study_info({ id: studyId }).then(response => { study_info({ id: studyId }).then(response => {
this.form = _.merge({}, this.form, { stydyId: studyId, resourceStudy: response.data.resource, sftb: 1 }) this.form = _.merge({}, this.form, { stydyId: studyId, resourceStudy: response.data.resource, sftb: 1 })
this.templateData = deepClone(this.form)
this.$modal.closeLoading() this.$modal.closeLoading()
}) })
} }
@ -432,7 +436,7 @@ export default {
this.showIndex = 2 this.showIndex = 2
this.$modal.loading() this.$modal.loading()
studyFormFill_bc(this.form).then(response => { studyFormFill_bc(this.form).then(response => {
this.form=response.data
this.form = response.data
this.showIndex = 2 this.showIndex = 2
}).finally(() => { }).finally(() => {
this.$modal.closeLoading() this.$modal.closeLoading()

Loading…
Cancel
Save