Browse Source

fix:[模板管理]优化

lkf
15881625488@163.com 2 months ago
parent
commit
3fcc5d98d9
4 changed files with 34 additions and 29 deletions
  1. +18
    -12
      src/views/business/comps/template/comps/sp/SP001.vue
  2. +13
    -9
      src/views/business/comps/template/comps/sp/SP003.vue
  3. +1
    -3
      src/views/business/comps/template/comps/sp/SP00456.vue
  4. +2
    -5
      src/views/business/study/comp/tbbd/Bj.vue

+ 18
- 12
src/views/business/comps/template/comps/sp/SP001.vue View File

@ -2,21 +2,23 @@
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" v-if="resourceWz.length>0"/>
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz"
v-if="resourceWz.length > 0" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" <BaseInfoFormPackage fieldItemLabel="template.common.storageCondition"
label="template.common.storageCondition" ref="storageConditionRef" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" /> :formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary"
@click="printTag">{{ $t('template.common.bqdy') }}</el-button>
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" @click="printTag">{{
$t('template.common.bqdy') }}</el-button>
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
</div> </div>
@ -249,7 +251,7 @@ export default {
}, },
mounted() { mounted() {
const formData = this.getFormDataByTemplateData(); const formData = this.getFormDataByTemplateData();
if(!formData.targetCodeSn&& this.fillType === "actFill"){
if (!formData.targetCodeSn && this.fillType === "actFill") {
this.getCode(formData); this.getCode(formData);
} }
@ -268,8 +270,8 @@ export default {
getCode: debounce(async function (v) { getCode: debounce(async function (v) {
const result = await getLatestSn({ const result = await getLatestSn({
count: 1, count: 1,
pre:v.targetCode,
type:1
pre: v.targetCode,
type: 1
}) })
if (result.code == 200) { if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0]) this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
@ -282,6 +284,10 @@ export default {
// //
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource //resource
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
@ -307,15 +313,15 @@ export default {
} }
//使 //使
const stepResource = this.$refs.stepRef.getStepResource() const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return content;
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
}, },
// //
async onSave() { async onSave() {
let content =await this.$refs.stepRef.getFormData();
let content = await this.$refs.stepRef.getFormData();
console.log(content); console.log(content);
}, },
} }
}; };

+ 13
- 9
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -2,7 +2,8 @@
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
@ -14,8 +15,7 @@
:formData="formData" /> --> :formData="formData" /> -->
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage ref="stepFormPackageRef"
fieldItemLabel="template.common.operationSteps"
<BaseInfoFormPackage ref="stepFormPackageRef" fieldItemLabel="template.common.operationSteps"
@onRegentSubmit="onRegentSubmit" :formConfig="stepFormConfig" @blur="onHandleBlur" @onRegentSubmit="onRegentSubmit" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" /> :formData="formData" />
<CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" <CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
@ -60,7 +60,7 @@ export default {
default: 'preFill', default: 'preFill',
}, },
}, },
computed: { computed: {
// //
storageFormConfig() { storageFormConfig() {
@ -428,8 +428,8 @@ export default {
methods: { methods: {
// //
onRegentSubmit(data) { onRegentSubmit(data) {
const { selectInfo,key} = data;
const {row} = selectInfo;
const { selectInfo, key } = data;
const { row } = selectInfo;
if (key === "subStartSolution") {//table if (key === "subStartSolution") {//table
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd); this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row); this.updateStepTableData(row);
@ -470,7 +470,7 @@ export default {
if (fzList && fzList.length > 0) { if (fzList && fzList.length > 0) {
const list = fzList.map((item) => { const list = fzList.map((item) => {
return { return {
bh: mybh + item.subCode,
bh: mybh + item.preCode + item.subCode,
kc: item.num, kc: item.num,
kcdw: dw, kcdw: dw,
} }
@ -537,7 +537,7 @@ export default {
} else { } else {
// targetSolutionCode // targetSolutionCode
// targetSolutionCode // targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode+newStepTableData[i - 1].subTargetSolutionCode;
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
initNd = newStepTableData[i - 1].actSolutionConcentration; initNd = newStepTableData[i - 1].actSolutionConcentration;
} }
const volResult = this.updateSjmbrynd(item, initNd); const volResult = this.updateSjmbrynd(item, initNd);
@ -553,6 +553,10 @@ export default {
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
@ -653,7 +657,7 @@ export default {
const stepResource = this.$refs.stepRef.getStepResource() const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
return content;
return this.resourceTmp;
}, },
async onSave() { async onSave() {
// const formData = await this.getFormData(); // const formData = await this.getFormData();

+ 1
- 3
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -199,12 +199,11 @@ export default {
if (fzList && fzList.length > 0) { if (fzList && fzList.length > 0) {
const list = fzList.map((item) => { const list = fzList.map((item) => {
return { return {
bh: mybh + item.subCode,
bh: mybh +item.preCode + item.subCode,
kc: item.num, kc: item.num,
kcdw: dw, kcdw: dw,
} }
}) })
debugger
let postData = { let postData = {
studyId: this.formData.studyId, studyId: this.formData.studyId,
studyFormId: this.formData.id, studyFormId: this.formData.id,
@ -762,7 +761,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource this.resourceTmp = tmpResource
return this.resourceTmp; return this.resourceTmp;
}, },

+ 2
- 5
src/views/business/study/comp/tbbd/Bj.vue View File

@ -655,12 +655,9 @@ export default {
that.addCcYj() that.addCcYj()
that.$refs.templateTable.getFilledFormData() that.$refs.templateTable.getFilledFormData()
let resource = that.$refs.templateTable.getResource() let resource = that.$refs.templateTable.getResource()
let tmp = _.filter(resource, function (o) {
return o.type == null || o.type == 3 || o.type == 5 || o.type == 7
})
if (tmp.length > 0) {
if (resource.length > 0) {
that.$modal.loading() that.$modal.loading()
studyFormFill_yjccFilter({ id: this.form.id, resource: JSON.stringify(tmp) }).then(response => {
studyFormFill_yjccFilter({ id: this.form.id, resource: JSON.stringify(resource) }).then(response => {
let tmpResource = JSON.parse(response.msg) let tmpResource = JSON.parse(response.msg)
if (tmpResource.length > 0) { if (tmpResource.length > 0) {
that.resourceYj = tmpResource that.resourceYj = tmpResource

Loading…
Cancel
Save