2 Commits

9 changed files with 112 additions and 93 deletions
Unified View
  1. +4
    -1
      src/components/Template/Step.vue
  2. +2
    -0
      src/components/Template/StepFormPackage.vue
  3. +41
    -41
      src/components/Template/mixins/formPackageMixins.js
  4. +1
    -0
      src/lang/en/template/commonTemplate.js
  5. +1
    -0
      src/lang/zh/template/commonTemplate.js
  6. +2
    -2
      src/views/business/comps/template/comps/bl/BL002.vue
  7. +8
    -8
      src/views/business/comps/template/comps/sp/SP003.vue
  8. +52
    -41
      src/views/business/comps/template/dialog/SubPackageDialog.vue
  9. +1
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 4
- 1
src/components/Template/Step.vue View File

@ -10,7 +10,7 @@
<HandleFormItem type="select" placeholder="请选择" class="step-type-select" :item="stepSelectConfig" <HandleFormItem type="select" placeholder="请选择" class="step-type-select" :item="stepSelectConfig"
v-model="step.type" @change="onTypeChange(index)" /> v-model="step.type" @change="onTypeChange(index)" />
<!-- 根据步骤类型显示对应的表单 --> <!-- 根据步骤类型显示对应的表单 -->
<component class="flex1" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData" :formIndex="formIndex" :formType="formType"
<component class="flex1 w-0" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData" :formIndex="formIndex" :formType="formType"
:fieldItemLabel="stepNameConfig[step.type]" :fieldItemLabel="stepNameConfig[step.type]"
@update="onFormUpdate(index, $event)" :stepIndex = "prefixKey + index" :ref="'stepCompRef_' + index"> @update="onFormUpdate(index, $event)" :stepIndex = "prefixKey + index" :ref="'stepCompRef_' + index">
</component> </component>
@ -1196,4 +1196,7 @@ export default {
} }
} }
} }
.w-0{
width: 0;
}
</style> </style>

+ 2
- 0
src/components/Template/StepFormPackage.vue View File

@ -250,6 +250,7 @@ export default {
o.syldw = formFields[item.dwCode];// o.syldw = formFields[item.dwCode];//
} }
sjResource.push(o); sjResource.push(o);
} }
}else if(item.type === "yq"){ }else if(item.type === "yq"){
if(formFields[key]){ if(formFields[key]){
@ -261,6 +262,7 @@ export default {
} }
} }
} }
console.log(sjResource,yqResource,allFieldsConfig,formFields,"sjResource")
return { return {
sjResource, sjResource,
yqResource, yqResource,

+ 41
- 41
src/components/Template/mixins/formPackageMixins.js View File

@ -1,5 +1,5 @@
import _ from 'lodash' import _ from 'lodash'
import { getuuid, isEqual, isValueEmpty,isRegent } from '@/utils/index.js'
import { getuuid, isEqual, isValueEmpty, isRegent } from '@/utils/index.js'
import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js' import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js'
import moment from 'moment' import moment from 'moment'
@ -63,8 +63,8 @@ export default {
this.$set(this.errors, key, false) this.$set(this.errors, key, false)
} }
}, },
getOrangeBg(key,sItem) {
if(sItem.compareText){
getOrangeBg(key, sItem) {
if (sItem.compareText) {
return sItem.compareText == this.formFields[key] return sItem.compareText == this.formFields[key]
} }
return this.orangeBgFields[key] return this.orangeBgFields[key]
@ -82,8 +82,8 @@ export default {
}, },
//试剂/仪器等弹窗提交 //试剂/仪器等弹窗提交
onRegentSubmit(data, inputValue, key, item) { onRegentSubmit(data, inputValue, key, item) {
if(data.selectInfo){
this.formFields[`selectInfo_${key}`] = JSON.parse(JSON.stringify(data.selectInfo));
if (data.selectInfo) {
this.formFields[`selectInfo_${key}`] = JSON.parse(JSON.stringify(data.selectInfo));
} }
if (data.type === "yq") { if (data.type === "yq") {
this.formFields[`yqInfo_${key}`] = JSON.parse(JSON.stringify(data.row)); this.formFields[`yqInfo_${key}`] = JSON.parse(JSON.stringify(data.row));
@ -391,45 +391,46 @@ export default {
currentConfig.otherCode currentConfig.otherCode
) )
} }
})
// 处理可能存在的直接otherCode字段
if (item.config?.otherCode) {
config[item.config?.otherCode] = item.config?.otherCode
}
if (item.config?.thirdOtherCode) {
config[item.config?.thirdOtherCode] = item.config?.thirdOtherCode
}
if (isRegent(item.config) || isRegent(item.config,"subType")) {
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
// 优先使用this.formFields中以selectInfo_开头的字段
let selectInfoKeys = [], yqInfoKeys = [];
if (this.formFields) {
selectInfoKeys = Object.keys(this.formFields).filter((key) =>
key.startsWith('selectInfo_')
)
yqInfoKeys = Object.keys(this.formFields).filter((key) =>
key.startsWith('yqInfo_')
)
// 处理可能存在的直接otherCode字段
if (currentConfig.otherCode) {
config[currentConfig.otherCode] = currentConfig.otherCode
} }
// 如果this.formFields中没有,则使用formData中的
if (selectInfoKeys.length === 0 && formData) {
selectInfoKeys = Object.keys(formData).filter((key) =>
key.startsWith('selectInfo_')
)
if (currentConfig.thirdOtherCode) {
config[currentConfig.thirdOtherCode] = currentConfig.thirdOtherCode
} }
if (yqInfoKeys.length === 0 && formData) {
yqInfoKeys = Object.keys(formData).filter((key) =>
key.startsWith('yqInfo_')
)
if (isRegent(currentConfig) || isRegent(currentConfig, "subType")) {
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
// 优先使用this.formFields中以selectInfo_开头的字段
let selectInfoKeys = [], yqInfoKeys = [];
if (this.formFields) {
selectInfoKeys = Object.keys(this.formFields).filter((key) =>
key.startsWith('selectInfo_')
)
yqInfoKeys = Object.keys(this.formFields).filter((key) =>
key.startsWith('yqInfo_')
)
}
// 如果this.formFields中没有,则使用formData中的
if (selectInfoKeys.length === 0 && formData) {
selectInfoKeys = Object.keys(formData).filter((key) =>
key.startsWith('selectInfo_')
)
}
if (yqInfoKeys.length === 0 && formData) {
yqInfoKeys = Object.keys(formData).filter((key) =>
key.startsWith('yqInfo_')
)
}
selectInfoKeys.forEach((key) => {
result[key] = this.formFields[key] || formData[key] || ''
})
yqInfoKeys.forEach((key) => {
result[key] = this.formFields[key] || formData[key] || ''
})
} }
selectInfoKeys.forEach((key) => {
result[key] = this.formFields[key] || formData[key] || ''
})
yqInfoKeys.forEach((key) => {
result[key] = this.formFields[key] || formData[key] || ''
})
}
})
} }
}) })
@ -649,7 +650,6 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (validateResult.valid && subComponentValidateResult.valid) { if (validateResult.valid && subComponentValidateResult.valid) {
console.log(this.formFields, 'this.formFields')
resolve(this.formFields) resolve(this.formFields)
} else if (!validateResult.valid) { } else if (!validateResult.valid) {
// this.$message.error("表单内容未填完,请填写后再提交"); // this.$message.error("表单内容未填完,请填写后再提交");

+ 1
- 0
src/lang/en/template/commonTemplate.js View File

@ -9,6 +9,7 @@ export default {
instrumentInfo: 'Instrument Usage', instrumentInfo: 'Instrument Usage',
storageCondition: 'Storage Conditions', storageCondition: 'Storage Conditions',
operationSteps: 'Operation Workflow', operationSteps: 'Operation Workflow',
bzgzypz: '标曲工作液配制',
remark: 'Comments', remark: 'Comments',
step: 'Step', step: 'Step',
bqdy: 'Label Print', bqdy: 'Label Print',

+ 1
- 0
src/lang/zh/template/commonTemplate.js View File

@ -15,6 +15,7 @@ export default {
instrumentInfo: '仪器使用信息', instrumentInfo: '仪器使用信息',
storageCondition: '存储条件', storageCondition: '存储条件',
operationSteps: '操作步骤', operationSteps: '操作步骤',
bzgzypz: '标曲工作液配制',
step: '步骤', step: '步骤',
remark: '备注', remark: '备注',
bqdy: '标签打印', bqdy: '标签打印',

+ 2
- 2
src/views/business/comps/template/comps/bl/BL002.vue View File

@ -221,10 +221,10 @@ export default {
if( stepTableFormData && stepTableFormData.length >0 ){ if( stepTableFormData && stepTableFormData.length >0 ){
stepTableFormData.map((item,index)=>{ stepTableFormData.map((item,index)=>{
if(!item.smryqrxx && item.smryqrxx !== false){ if(!item.smryqrxx && item.smryqrxx !== false){
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(index, {...item,smryqrxx:false})
this.$refs.dwybTableRef.updateDataSourceByRowIndex(index, {...item,smryqrxx:false})
} }
if(!item.ztblxjqrxx && item.ztblxjqrxx !== false){ if(!item.ztblxjqrxx && item.ztblxjqrxx !== false){
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(index, {...item,ztblxjqrxx:false})
this.$refs.dwybTableRef.updateDataSourceByRowIndex(index, {...item,ztblxjqrxx:false})
} }
}) })
} }

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

@ -12,9 +12,9 @@
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<!-- <BaseInfoFormPackage label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig" <!-- <BaseInfoFormPackage label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" /> --> :formData="formData" /> -->
<LineLabel label="template.common.operationSteps" />
<LineLabel label="template.common.bzgzypz" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage ref="stepFormPackageRef" fieldItemLabel="template.common.operationSteps"
<BaseInfoFormPackage ref="stepFormPackageRef" fieldItemLabel="template.common.bzgzypz"
@onRegentSubmit="onRegentSubmit" @onRegentSubmit="onRegentSubmit"
@beforeReagentSubmit="onBeforeReagentSubmit" @beforeReagentSubmit="onBeforeReagentSubmit"
@select = "onFormSelect" @select = "onFormSelect"
@ -22,7 +22,7 @@
:formData="formData" /> :formData="formData" />
<CustomTable <CustomTable
@headerSelectChange="onHeaderSelectChange" @headerSelectChange="onHeaderSelectChange"
fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
fieldItemLabel="template.common.bzgzypz" @blur="onHandleTableBlur"
@beforeSaveRecord = "beforeSaveRecord" @beforeSaveRecord = "beforeSaveRecord"
:showAddRow="false" :showOperation="fillType === 'actFill'" :showAddRow="false" :showOperation="fillType === 'actFill'"
ref="stepTableRef" :columns="stepColumns" :formData="formData"> ref="stepTableRef" :columns="stepColumns" :formData="formData">
@ -287,7 +287,7 @@ export default {
{ {
label: "template.sp.sp003.qsrybh", label: "template.sp.sp003.qsrybh",
prop: "startSolutionCode", prop: "startSolutionCode",
width: 180,
width: 200,
bodyType: "input", bodyType: "input",
bodyFillType: "actFill", bodyFillType: "actFill",
bodyMaxlength: 10, bodyMaxlength: 10,
@ -296,7 +296,7 @@ export default {
{ {
label: "template.sp.sp003.ysqsrytj", label: "template.sp.sp003.ysqsrytj",
prop: "targetStartSolutionVolume", prop: "targetStartSolutionVolume",
width: 180,
width: 200,
showWidth: 90, showWidth: 90,
headerSelectKey: "targetStartSolutionVolumeUnit", headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
@ -317,7 +317,7 @@ export default {
{ {
label: "template.sp.sp003.sjqsrytj", label: "template.sp.sp003.sjqsrytj",
prop: "actStartSolutionVolume", prop: "actStartSolutionVolume",
width: 180,
width: 200,
showWidth: 90, showWidth: 90,
headerSelectKey: "actStartSolutionVolumeUnit", headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
@ -331,7 +331,7 @@ export default {
{ {
label: "template.sp.sp003.ysxsytj", label: "template.sp.sp003.ysxsytj",
prop: "targetDiluentVolume", prop: "targetDiluentVolume",
width: 180,
width: 200,
showWidth: 90, showWidth: 90,
headerSelectKey: "targetDiluentVolumeUnit", headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill", fillType: "preFill",
@ -352,7 +352,7 @@ export default {
{ {
label: "template.sp.sp003.sjxsytj", label: "template.sp.sp003.sjxsytj",
prop: "actDiluentVolume", prop: "actDiluentVolume",
width: 180,
width: 200,
showWidth: 90, showWidth: 90,
headerSelectKey: "actDiluentVolumeUnit", headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill", fillType: "preFill",

+ 52
- 41
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -5,18 +5,18 @@
<div class="header-container"> <div class="header-container">
<div class="header-item"> <div class="header-item">
<div class="header-title">包装编号</div> <div class="header-title">包装编号</div>
<HandleFormItem :fieldKey="formData.mybh +id+ '_mybh'" :isFieldsRecord="false" :item="inputItem"
:type = "mybhOptions.length ? 'select' : 'input'"
@change="onChangeMybh"
:error="formErrors.mybh" v-model="formData.mybh" />
<HandleFormItem :fieldKey="formData.mybh + id + '_mybh'" :isFieldsRecord="false" :item="inputItem"
:type="mybhOptions.length ? 'select' : 'input'" @change="onChangeMybh" :error="formErrors.mybh"
v-model="formData.mybh" />
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">分装数量</div> <div class="header-title">分装数量</div>
<div class="item-center"> <div class="item-center">
<HandleFormItem :isFieldsRecord="false" :fieldKey="formData.mybh +id+ '_fzsl'"
:item="integerInputNumberItem" type="inputNumber" :error="formErrors.fzsl"
v-model="formData.fzsl" />
<el-button class="ml-5" type="primary" :disabled="!formData.fzsl" plain @click="onBlurFzsl(formData.fzsl)">确定</el-button>
<HandleFormItem :isFieldsRecord="false" :fieldKey="formData.mybh + id + '_fzsl'"
:item="integerInputNumberItem" type="inputNumber" :error="formErrors.fzsl"
v-model="formData.fzsl" />
<el-button class="ml-5" type="primary" :disabled="!formData.fzsl" plain
@click="onBlurFzsl(formData.fzsl)">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -25,13 +25,13 @@
<span>分装编号</span> <span>分装编号</span>
<span class="ml-20">单位</span> <span class="ml-20">单位</span>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey="formData.mybh +id+ '_dw'" :isFieldsRecord="false" :item="unitItem"
<HandleFormItem :fieldKey="formData.mybh + id + '_dw'" :isFieldsRecord="false" :item="unitItem"
type="select" :error="formErrors.dw" @blur="(e) => onCommonBlur(e, 'dw')" type="select" :error="formErrors.dw" @blur="(e) => onCommonBlur(e, 'dw')"
v-model="formData.dw" /> v-model="formData.dw" />
</div> </div>
<span class="ml-20">每份包装量</span> <span class="ml-20">每份包装量</span>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey="formData.mybh +id+ '_mfbzl'" type="inputNumber"
<HandleFormItem :fieldKey="formData.mybh + id + '_mfbzl'" type="inputNumber"
:error="formErrors.mfbzl" :isFieldsRecord="false" :item="inputNumberItem" :error="formErrors.mfbzl" :isFieldsRecord="false" :item="inputNumberItem"
v-model="formData.mfbzl" /> v-model="formData.mfbzl" />
</div> </div>
@ -164,12 +164,12 @@ export default {
this.fzListErrors = new Array(this.fzList.length).fill(false); this.fzListErrors = new Array(this.fzList.length).fill(false);
delete cloneData.fzList; delete cloneData.fzList;
} }
const { mybhOptions=[] } = cloneData;
if(mybhOptions.length){
const { mybhOptions = [] } = cloneData;
if (mybhOptions.length) {
this.mybhOptions = mybhOptions this.mybhOptions = mybhOptions
this.inputItem.options = mybhOptions; this.inputItem.options = mybhOptions;
this.inputItem.disabled = false; this.inputItem.disabled = false;
}else{
} else {
this.inputItem.disabled = true; this.inputItem.disabled = true;
} }
this.id = data.id; this.id = data.id;
@ -376,39 +376,48 @@ export default {
// //
async onBlurFzsl(e) { async onBlurFzsl(e) {
console.log(e, "失去焦点时的数量") console.log(e, "失去焦点时的数量")
//
if (e) {
this.formErrors.fzsl = false;
}
//
this.fzList = [];
this.fzListErrors = [];
const result = await getLatestSn({
pre: this.formData.mybh,
count: e,
type: 2,
})
if (result.code === 200) {
const codes = result.data;
//
for (let i = 0; i < e; i++) {
this.fzList.push({
num: "",
subCode: codes[i],
preCode: `${this.formData.mybh}-set${codes[i]}`
});
//
this.fzListErrors.push(false);
this.$modal.confirm("分装数量确认后会永久占用分装流水号,且事后无法修改", '提示', {
confirmButtonText: this.$t('form.saveConfirm'),
cancelButtonText: this.$t('form.cancel'),
type: 'warning'
}).then(async () => {
//
if (e) {
this.formErrors.fzsl = false;
} }
}
//
this.fzList = [];
this.fzListErrors = [];
const result = await getLatestSn({
pre: this.formData.mybh,
count: e,
type: 2,
})
if (result.code === 200) {
const codes = result.data;
//
for (let i = 0; i < e; i++) {
this.fzList.push({
num: "",
subCode: codes[i],
preCode: `${this.formData.mybh}-set${codes[i]}`
});
//
this.fzListErrors.push(false);
}
}
}).catch(() => {
//
});
}, },
// //
onChangeMybh(e,type) {
if(type === "change" && this.formData.fzsl){
onChangeMybh(e, type) {
if (type === "change" && this.formData.fzsl) {
this.onBlurFzsl(this.formData.fzsl) this.onBlurFzsl(this.formData.fzsl)
} }
}, },
onAverage() { onAverage() {
const { mfbzl } = this.formData; const { mfbzl } = this.formData;
@ -483,10 +492,12 @@ export default {
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px;
} }
.item-center{
.item-center {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.header-title { .header-title {
margin-bottom: 10px; margin-bottom: 10px;
} }

+ 1
- 0
src/views/business/comps/template/mixins/templateMixin.js View File

@ -169,6 +169,7 @@ export default {
id id
} }
} }
console.log(this.formData,"templateData")
const { effectivePeriod, effectivePeriodUnit, expireDate } = const { effectivePeriod, effectivePeriodUnit, expireDate } =
this.formData this.formData
//实际填报的时候,如果有了开始时间,并且有有效周期,但是没有失效日,就计算失效日为开始时间+有效周期 //实际填报的时候,如果有了开始时间,并且有有效周期,但是没有失效日,就计算失效日为开始时间+有效周期

Loading…
Cancel
Save