diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue index 8931129..32f2cff 100644 --- a/src/components/Template/Step.vue +++ b/src/components/Template/Step.vue @@ -10,7 +10,7 @@ - @@ -1196,4 +1196,7 @@ export default { } } } +.w-0{ + width: 0; +} \ No newline at end of file diff --git a/src/components/Template/StepFormPackage.vue b/src/components/Template/StepFormPackage.vue index bdb487b..321006d 100644 --- a/src/components/Template/StepFormPackage.vue +++ b/src/components/Template/StepFormPackage.vue @@ -250,6 +250,7 @@ export default { o.syldw = formFields[item.dwCode];//单位 } sjResource.push(o); + } }else if(item.type === "yq"){ if(formFields[key]){ @@ -261,6 +262,7 @@ export default { } } } + console.log(sjResource,yqResource,allFieldsConfig,formFields,"sjResource") return { sjResource, yqResource, diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 51706d0..a366af5 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -1,5 +1,5 @@ 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 moment from 'moment' @@ -63,8 +63,8 @@ export default { 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 this.orangeBgFields[key] @@ -82,8 +82,8 @@ export default { }, //试剂/仪器等弹窗提交 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") { this.formFields[`yqInfo_${key}`] = JSON.parse(JSON.stringify(data.row)); @@ -391,45 +391,46 @@ export default { 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) => { if (validateResult.valid && subComponentValidateResult.valid) { - console.log(this.formFields, 'this.formFields') resolve(this.formFields) } else if (!validateResult.valid) { // this.$message.error("表单内容未填完,请填写后再提交"); diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index 79c9eef..bb848f9 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -9,6 +9,7 @@ export default { instrumentInfo: 'Instrument Usage', storageCondition: 'Storage Conditions', operationSteps: 'Operation Workflow', + bzgzypz: '标曲工作液配制', remark: 'Comments', step: 'Step', bqdy: 'Label Print', diff --git a/src/lang/zh/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index e810a6f..48f7dc5 100644 --- a/src/lang/zh/template/commonTemplate.js +++ b/src/lang/zh/template/commonTemplate.js @@ -15,6 +15,7 @@ export default { instrumentInfo: '仪器使用信息', storageCondition: '存储条件', operationSteps: '操作步骤', + bzgzypz: '标曲工作液配制', step: '步骤', remark: '备注', bqdy: '标签打印', diff --git a/src/utils/calUnitTools.js b/src/utils/calUnitTools.js index 4ad979f..7d9c429 100644 --- a/src/utils/calUnitTools.js +++ b/src/utils/calUnitTools.js @@ -8,7 +8,6 @@ export function addTj(valueArr, unitArr) { let thisIndex = unit.indexOf(unitArr[i]) mixIndex = thisIndex < mixIndex ? thisIndex : mixIndex } - let total = 0 for (let i = 0; i < unitArr.length; i++) { let thisIndex = unit.indexOf(unitArr[i]) diff --git a/src/views/business/comps/template/comps/bl/BL002.vue b/src/views/business/comps/template/comps/bl/BL002.vue index 118a9a4..319c380 100644 --- a/src/views/business/comps/template/comps/bl/BL002.vue +++ b/src/views/business/comps/template/comps/bl/BL002.vue @@ -221,10 +221,10 @@ export default { if( stepTableFormData && stepTableFormData.length >0 ){ stepTableFormData.map((item,index)=>{ 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){ - this.$refs.yqsyTableRef.updateDataSourceByRowIndex(index, {...item,ztblxjqrxx:false}) + this.$refs.dwybTableRef.updateDataSourceByRowIndex(index, {...item,ztblxjqrxx:false}) } }) } diff --git a/src/views/business/comps/template/comps/sp/SP003.vue b/src/views/business/comps/template/comps/sp/SP003.vue index 46b7f6e..402304a 100644 --- a/src/views/business/comps/template/comps/sp/SP003.vue +++ b/src/views/business/comps/template/comps/sp/SP003.vue @@ -12,9 +12,9 @@ - +
- @@ -287,7 +287,7 @@ export default { { label: "template.sp.sp003.qsrybh", prop: "startSolutionCode", - width: 180, + width: 200, bodyType: "input", bodyFillType: "actFill", bodyMaxlength: 10, @@ -296,7 +296,7 @@ export default { { label: "template.sp.sp003.ysqsrytj", prop: "targetStartSolutionVolume", - width: 180, + width: 200, showWidth: 90, headerSelectKey: "targetStartSolutionVolumeUnit", fillType: "preFill", @@ -317,7 +317,7 @@ export default { { label: "template.sp.sp003.sjqsrytj", prop: "actStartSolutionVolume", - width: 180, + width: 200, showWidth: 90, headerSelectKey: "actStartSolutionVolumeUnit", fillType: "preFill", @@ -331,7 +331,7 @@ export default { { label: "template.sp.sp003.ysxsytj", prop: "targetDiluentVolume", - width: 180, + width: 200, showWidth: 90, headerSelectKey: "targetDiluentVolumeUnit", fillType: "preFill", @@ -352,7 +352,7 @@ export default { { label: "template.sp.sp003.sjxsytj", prop: "actDiluentVolume", - width: 180, + width: 200, showWidth: 90, headerSelectKey: "actDiluentVolumeUnit", fillType: "preFill", diff --git a/src/views/business/comps/template/dialog/SubPackageDialog.vue b/src/views/business/comps/template/dialog/SubPackageDialog.vue index 9b2ee4f..8360dfc 100644 --- a/src/views/business/comps/template/dialog/SubPackageDialog.vue +++ b/src/views/business/comps/template/dialog/SubPackageDialog.vue @@ -5,18 +5,18 @@
包装编号
- +
分装数量
- - 确定 + + 确定
@@ -25,13 +25,13 @@ 分装编号 单位:
-
每份包装量:
-
@@ -164,12 +164,12 @@ export default { this.fzListErrors = new Array(this.fzList.length).fill(false); delete cloneData.fzList; } - const { mybhOptions=[] } = cloneData; - if(mybhOptions.length){ + const { mybhOptions = [] } = cloneData; + if (mybhOptions.length) { this.mybhOptions = mybhOptions this.inputItem.options = mybhOptions; this.inputItem.disabled = false; - }else{ + } else { this.inputItem.disabled = true; } this.id = data.id; @@ -376,39 +376,48 @@ export default { // 分装数量失去焦点时,根据数量生成分装列表 async onBlurFzsl(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) } - + }, onAverage() { const { mfbzl } = this.formData; @@ -483,10 +492,12 @@ export default { border-radius: 4px; padding: 20px; } -.item-center{ + +.item-center { display: flex; align-items: center; } + .header-title { margin-bottom: 10px; } diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index 604560b..650905a 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -169,6 +169,7 @@ export default { id } } + console.log(this.formData,"templateData") const { effectivePeriod, effectivePeriodUnit, expireDate } = this.formData //实际填报的时候,如果有了开始时间,并且有有效周期,但是没有失效日,就计算失效日为开始时间+有效周期