31 Commits

Author SHA1 Message Date
  memorylkf e6ba110250 feat: [模板管理] 供试品部试剂配制记录表(平行配制):实际表单与需求不一致,去掉方法编号、版本号、容器材质三项 1 week ago
  luojie 7ad955fed1 feat:[模板管理][update] 1 week ago
  luojie 8213e748e8 feat:[模板管理][update] 1 week ago
  luojie ae9993e240 Merge branch 'master' of http://182.151.8.209:9010/eln_TD/eln_web 1 week ago
  luojie a5e41ce6f8 feat:[模板管理][update] 1 week ago
  memorylkf 08d4a42013 feat: [步骤管理] 增加定容步骤 1 week ago
  memorylkf 13a3e9076d feat: [选择器] 选择其他也返回1个bh 1 week ago
  luojie c262ec8893 feat:[模板管理][update] 1 week ago
  luojie ad02cfb647 Merge branch 'master' of http://182.151.8.209:9010/eln_TD/eln_web 1 week ago
  luojie 14e7b8abdb feat:[模板管理][update] 1 week ago
  memorylkf 73feb0eb69 feat: [模板管理] LBA008获取天平值 1 week ago
  memorylkf 76a6a5fe6f feat: [模板管理] pcr3个增加获取天平值 1 week ago
  luojie f3641cd242 feat:[模板管理][update] 1 week ago
  memorylkf 1537bb9c9f feat: [资源管理] [给药制剂] [麻精药] 发放获取天平值 1 week ago
  memorylkf 727b16f040 feat: [仪器选择] 增加其他输入 1 week ago
  ZHANGTENG\张腾 67d79800a2 Merge branch 'master' of http://182.151.8.209:9010/eln_TD/eln_web 1 week ago
  memorylkf f438fc32c7 feat: [模板管理] 试剂/供试品/给药制剂加上其他 1 week ago
  memorylkf 2d2d84160c fix: [数据对接] 对接参数修改 1 week ago
  memorylkf a80b1ecc6b feat: [仪器对接] 天平 1 week ago
  luojie 457a2e179b feat:[模板管理][update] 1 week ago
  memorylkf cbf51b68a5 feat: [系统管理] [角色管理] 增加角色权限导出 2 weeks ago
  luojie dd3ce637ae feat:[模板管理][update] 2 weeks ago
  luojie b7afb548ae Merge branch 'master' of http://182.151.8.209:9010/eln_TD/eln_web 2 weeks ago
  luojie 37029c44fc feat:[模板管理][update] 2 weeks ago
  memorylkf b2c2ae3c4c feat: [数据对接] 天平数据 2 weeks ago
  luojie 2cd22c8127 Merge branch 'master' of http://182.151.8.209:9010/eln_TD/eln_web 2 weeks ago
  luojie e3e4f17e5b feat:[模板管理][update] 2 weeks ago
  memorylkf c6476fcf68 feat: [数据对接] 天平+PH测试返回 2 weeks ago
  memorylkf 5916d9e001 feat: [仪器对接] 测试天平 2 weeks ago
  15881625488@163.com 0ed001a318 fix:[模板管理]优化 2 weeks ago
  15881625488@163.com aa725bcdca fix:[模板管理]优化 2 weeks ago
56 changed files with 1164 additions and 425 deletions
Unified View
  1. +3
    -3
      src/components/Template/CustomTable.vue
  2. +28
    -23
      src/components/Template/DecimalInput.vue
  3. +30
    -12
      src/components/Template/HandleFormItem.vue
  4. +3
    -0
      src/components/Template/Step.vue
  5. +150
    -84
      src/components/Template/StepComponents/ZLSubPackage.vue
  6. +2
    -2
      src/components/Template/StepComponents/jcb/fyxks.vue
  7. +2
    -2
      src/components/Template/StepComponents/jcb/ycfyks.vue
  8. +2
    -2
      src/components/Template/StepComponents/pcr/lx.vue
  9. +2
    -2
      src/components/Template/StepComponents/pcr/lxdy.vue
  10. +2
    -2
      src/components/Template/StepComponents/pcr/sy_pcr.vue
  11. +2
    -2
      src/components/Template/StepComponents/qxwdx/qxlx.vue
  12. +13
    -2
      src/components/Template/StepComponents/ry/bdzl.vue
  13. +2
    -2
      src/components/Template/StepComponents/ry/dc.vue
  14. +91
    -0
      src/components/Template/StepComponents/ry/dr.vue
  15. +1
    -1
      src/components/Template/StepComponents/ry/fr.vue
  16. +1
    -1
      src/components/Template/StepComponents/ry/fy.vue
  17. +2
    -2
      src/components/Template/StepComponents/ry/hwhy.vue
  18. +2
    -2
      src/components/Template/StepComponents/ry/jrjb.vue
  19. +2
    -2
      src/components/Template/StepComponents/ry/lx.vue
  20. +2
    -2
      src/components/Template/StepComponents/ry/sy.vue
  21. +10
    -1
      src/components/Template/StepComponents/ry/tjphcz.vue
  22. +28
    -4
      src/components/Template/StepComponents/ry/tpjydd.vue
  23. +53
    -5
      src/components/Template/StepComponents/ry/tpjysd.vue
  24. +2
    -2
      src/components/Template/StepComponents/xbjzpz/fr_xbjzpz.vue
  25. +14
    -9
      src/components/Template/StepFormPackage.vue
  26. +57
    -30
      src/components/Template/mixins/formPackageMixins.js
  27. +54
    -1
      src/components/Template/mixins/stepMixins.js
  28. +1
    -0
      src/lang/en/system/role.js
  29. +1
    -0
      src/lang/zh/system/role.js
  30. +10
    -10
      src/lang/zh/template/pcr.js
  31. +24
    -0
      src/utils/conConverter.js
  32. +42
    -0
      src/utils/massTool.js
  33. +82
    -41
      src/utils/tpph.js
  34. +130
    -50
      src/views/business/comps/common/JcgjList.vue
  35. +19
    -4
      src/views/business/comps/select/SelectBalanceValue.vue
  36. +1
    -1
      src/views/business/comps/template/comps/dl/DL011.vue
  37. +1
    -1
      src/views/business/comps/template/comps/dl/DL012.vue
  38. +1
    -15
      src/views/business/comps/template/comps/gsp/GSP002.vue
  39. +29
    -3
      src/views/business/comps/template/comps/lba/LBA008.vue
  40. +28
    -3
      src/views/business/comps/template/comps/pcr/PCR007.vue
  41. +31
    -3
      src/views/business/comps/template/comps/pcr/PCR008.vue
  42. +29
    -3
      src/views/business/comps/template/comps/pcr/PCR010.vue
  43. +2
    -10
      src/views/business/comps/template/comps/sp/SP00456.vue
  44. +10
    -11
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  45. +46
    -4
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  46. +17
    -3
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue
  47. +9
    -3
      src/views/business/comps/template/dialog/SubPackageDialog.vue
  48. +14
    -14
      src/views/business/comps/template/formConfig/PCRTableConfig.js
  49. +6
    -5
      src/views/business/comps/template/formConfig/lba/lba008.js
  50. +2
    -2
      src/views/business/comps/template/formConfig/xb/xb001.js
  51. +2
    -3
      src/views/business/comps/template/mixins/templateMixin.js
  52. +27
    -24
      src/views/business/study/comp/tbbd/Fh.vue
  53. +2
    -2
      src/views/login.vue
  54. +4
    -4
      src/views/system/dept/index.vue
  55. +26
    -4
      src/views/system/role/index.vue
  56. +8
    -2
      src/views/system/user/index.vue

+ 3
- 3
src/components/Template/CustomTable.vue View File

@ -31,7 +31,7 @@
:value="headerFields[`${colIndex}_${headerIndex}`]" :value="headerFields[`${colIndex}_${headerIndex}`]"
:error="hasHeaderError(colIndex, headerIndex, headerCol.key)" :error="hasHeaderError(colIndex, headerIndex, headerCol.key)"
@update:error="onHeaderColumnErrorUpdate(colIndex, headerIndex, headerCol.key, $event)" @update:error="onHeaderColumnErrorUpdate(colIndex, headerIndex, headerCol.key, $event)"
:orange-bg="regentIsExpired(headerCol.key,rowIndex)"
:orange-bg="regentIsExpired(headerCol.key,colIndex)"
@onRegentSubmit="(data, inputValue) => onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex)" /> @onRegentSubmit="(data, inputValue) => onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex)" />
</template> </template>
<template <template
@ -548,7 +548,7 @@ export default {
}, },
// //
regentIsExpired(key,rowIndex) { regentIsExpired(key,rowIndex) {
const item = this.localDataSource[rowIndex];
const item = this.localDataSource[rowIndex] || {};
const { yxq, sxrq } = item[`selectInfo_${key}`] || {}; const { yxq, sxrq } = item[`selectInfo_${key}`] || {};
const rq = sxrq || yxq; const rq = sxrq || yxq;
if (rq) { if (rq) {
@ -1208,7 +1208,7 @@ export default {
} }
} }
this.$emit("blur", { rowIndex, colKey, value, item: this.localDataSource[rowIndex] });
this.$emit("blur", { rowIndex, colKey, value, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields, item: this.localDataSource[rowIndex] });
} }
} }
}; };

+ 28
- 23
src/components/Template/DecimalInput.vue View File

@ -5,6 +5,9 @@
<template slot="prepend" v-if="prepend"> <template slot="prepend" v-if="prepend">
{{ prepend }} {{ prepend }}
</template> </template>
<template slot="append" v-if="append">
{{ append }}
</template>
</el-input> </el-input>
</template> </template>
@ -32,6 +35,10 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
append: {
type: String,
default: ''
},
}, },
data() { data() {
return { return {
@ -108,7 +115,7 @@ export default {
this.isNA = false; this.isNA = false;
} }
} }
// NAFRACTION // NAFRACTION
// NA // NA
if (/^NA$/i.test(upperVal)) { if (/^NA$/i.test(upperVal)) {
@ -123,7 +130,7 @@ export default {
// FRACTION // FRACTION
matchedRule = this.getMatchingRule(val); matchedRule = this.getMatchingRule(val);
} }
if (matchedRule) { if (matchedRule) {
if (matchedRule.name === 'FRACTION') { if (matchedRule.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, ''); cleaned = val.replace(/[^\d/]/g, '');
@ -141,10 +148,10 @@ export default {
} else { } else {
// //
// decimalDigits 0 // decimalDigits 0
const allowedPattern = this.decimalDigits === 0 ? /[^\d-]/g : /[^\d.-]/g;
//
const allowedPattern = this.decimalDigits === 0 ? /[^\d]/g : /[^\d.]/g;
cleaned = val cleaned = val
.replace(allowedPattern, '')
.replace(/^(-)\1+/, '$1');
.replace(allowedPattern, '');
// //
const firstDotIndex = cleaned.indexOf('.'); const firstDotIndex = cleaned.indexOf('.');
@ -166,28 +173,26 @@ export default {
// //
if (this.decimalDigits > 0) { if (this.decimalDigits > 0) {
if (cleaned === '.') cleaned = '0.'; if (cleaned === '.') cleaned = '0.';
else if (cleaned === '-.') cleaned = '-0.';
else if (cleaned.startsWith('.')) cleaned = '0' + cleaned; else if (cleaned.startsWith('.')) cleaned = '0' + cleaned;
else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2);
} }
// //
if (cleaned.includes('.')) { if (cleaned.includes('.')) {
const [int, dec] = cleaned.split('.'); const [int, dec] = cleaned.split('.');
let newInt = int; let newInt = int;
if (/^-?0+\d/.test(int)) {
newInt = int.replace(/^-?0+(\d)/, '$1');
} else if (int === '' || int === '-') {
newInt = int + '0';
} else if (int === '00' || /^-00+$/.test(int)) {
newInt = int.startsWith('-') ? '-0' : '0';
if (/^0+\d/.test(int)) {
newInt = int.replace(/^0+(\d)/, '$1');
} else if (int === '') {
newInt = '0';
} else if (int === '00' || /^00+$/.test(int)) {
newInt = '0';
} }
cleaned = newInt + '.' + dec; cleaned = newInt + '.' + dec;
} else { } else {
if (/^-?0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^-?0+(\d)/, '$1');
} else if (cleaned === '00' || /^-00+$/.test(cleaned)) {
cleaned = cleaned.startsWith('-') ? '-0' : '0';
if (/^0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^0+(\d)/, '$1');
} else if (cleaned === '00' || /^00+$/.test(cleaned)) {
cleaned = '0';
} }
} }
} }
@ -218,7 +223,7 @@ export default {
const actVal = val || this.internalValue; const actVal = val || this.internalValue;
let finalValue = actVal.trim(); let finalValue = actVal.trim();
if (finalValue === '' || finalValue === '-') {
if (finalValue === '') {
return ''; return '';
} }
@ -242,7 +247,7 @@ export default {
handleBlur() { handleBlur() {
const val = this.internalValue.trim(); const val = this.internalValue.trim();
if (val === '') { if (val === '') {
this.oldValue = null; this.oldValue = null;
this.oldPattern = null; this.oldPattern = null;
@ -253,7 +258,7 @@ export default {
} }
const upperVal = val.toUpperCase(); const upperVal = val.toUpperCase();
// //
for (const rule of this.patternRules) { for (const rule of this.patternRules) {
if (rule.pattern.test(upperVal)) { if (rule.pattern.test(upperVal)) {
@ -271,7 +276,7 @@ export default {
if (val.includes('/')) { if (val.includes('/')) {
const parts = val.split('/'); const parts = val.split('/');
const validParts = parts.filter(part => part !== ''); const validParts = parts.filter(part => part !== '');
if (validParts.length === 0) { if (validParts.length === 0) {
if (this.oldValue) { if (this.oldValue) {
this.internalValue = this.oldValue; this.internalValue = this.oldValue;
@ -284,7 +289,7 @@ export default {
} }
return; return;
} }
if (validParts.length === 1) { if (validParts.length === 1) {
const result = validParts[0]; const result = validParts[0];
this.oldValue = result; this.oldValue = result;
@ -294,7 +299,7 @@ export default {
this.$emit('blur', result); this.$emit('blur', result);
return; return;
} }
const formattedValue = validParts.join('/'); const formattedValue = validParts.join('/');
this.oldValue = formattedValue; this.oldValue = formattedValue;
this.oldPattern = this.patternRules.find(r => r.name === 'FRACTION'); this.oldPattern = this.patternRules.find(r => r.name === 'FRACTION');

+ 30
- 12
src/components/Template/HandleFormItem.vue View File

@ -13,7 +13,7 @@
@input="onInputChange" @change="onInputChange" /> @input="onInputChange" @change="onInputChange" />
<DecimalInput v-else-if="type === 'inputNumber'" @blur="onCommonHandleSaveRecord" <DecimalInput v-else-if="type === 'inputNumber'" @blur="onCommonHandleSaveRecord"
:maxlength="item.maxlength || 10" class="flex1" :disabled="getDisabled()" :maxlength="item.maxlength || 10" class="flex1" :disabled="getDisabled()"
:controls="item.controls || false" :min="item.min || 0" :prepend="item.prepend"
:controls="item.controls || false" :min="item.min || 0" :prepend="item.prepend" :append="item.append"
:decimalDigits="getDecimalDigits()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" :decimalDigits="getDecimalDigits()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"
:placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" /> :placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" />
<el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple" <el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple"
@ -343,6 +343,7 @@ export default {
}] }]
}, },
allowedTypes: ["zip","rar","doc","docx","pdf","jpg"], allowedTypes: ["zip","rar","doc","docx","pdf","jpg"],
signData: null,//
} }
}, },
watch: { watch: {
@ -699,6 +700,7 @@ export default {
} }
}, },
onEditSignSave(data) { onEditSignSave(data) {
this.signData = data;
// //
if (this.pendingUploadFile) { if (this.pendingUploadFile) {
// //
@ -1236,7 +1238,7 @@ export default {
}, },
// //
handleUpdateRecord(data, recordData) {
handleUpdateRecord(data, recordData, isUpdateInputValue = true) {
const baseInfo = this.getCommonRecordInfo(); const baseInfo = this.getCommonRecordInfo();
//recordData //recordData
if (!this.oldValue && !this.inputValue && !recordData) { if (!this.oldValue && !this.inputValue && !recordData) {
@ -1244,8 +1246,10 @@ export default {
} }
let finallyKey = this.fieldKey; let finallyKey = this.fieldKey;
if (recordData) { if (recordData) {
this.oldValue = recordData.oldValue;
this.inputValue = recordData.inputValue;
if(isUpdateInputValue){
this.oldValue = recordData.oldValue;
this.inputValue = recordData.inputValue;
}
} }
let recordOldVlaue = this.oldValue, recordValue = this.inputValue, isModify = !!this.oldValue,oldUrl = "",url=""; let recordOldVlaue = this.oldValue, recordValue = this.inputValue, isModify = !!this.oldValue,oldUrl = "",url="";
if (this.type === "checkboxTag") { if (this.type === "checkboxTag") {
@ -1286,10 +1290,15 @@ export default {
const oldAttList = JSON.parse(recordOldVlaue || "[]"); const oldAttList = JSON.parse(recordOldVlaue || "[]");
recordValue = attList.map(item => item.name).join(";"); recordValue = attList.map(item => item.name).join(";");
recordOldVlaue = oldAttList.map(item => item.name).join(";"); recordOldVlaue = oldAttList.map(item => item.name).join(";");
oldUrl = oldAttList.map(item => item.url).join(";");
url = attList.map(item => item.url).join(";");
oldUrl = oldAttList.map(item => item.url).join("|");
url = attList.map(item => item.url).join("|");
}
if (recordData) {
if(!isUpdateInputValue){//
recordOldVlaue = recordData.oldValue;
recordValue = recordData.inputValue;
}
} }
const record = { const record = {
...baseInfo, ...baseInfo,
oldValue: recordOldVlaue, oldValue: recordOldVlaue,
@ -1304,6 +1313,9 @@ export default {
if (data) { if (data) {
record.reason = data.remark record.reason = data.remark
} }
if(this.type === "attachment" && this.signData){
record.reason = this.signData.remark;
}
const params = { const params = {
type: "fieldChanged", type: "fieldChanged",
@ -1350,12 +1362,14 @@ export default {
this.updateZdxgjl(record); this.updateZdxgjl(record);
this.updateSubmittedCodes(finallyKey); this.updateSubmittedCodes(finallyKey);
} }
if (isRegent(this.item)) {
this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue);
}
this.$nextTick(() => { this.$nextTick(() => {
EventBus.$emit('onModifyRecord', params,)
console.log(params, "onModifyRecord")
if (isRegent(this.item)) {
this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue);
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 100);
}) })
}, },
@ -1612,6 +1626,7 @@ export default {
.orange-border { .orange-border {
.el-input-group__prepend, .el-input-group__prepend,
.el-input-group__append,
input, input,
textarea { textarea {
border-color: #f9c588; border-color: #f9c588;
@ -1691,6 +1706,7 @@ export default {
.green-border { .green-border {
.el-input-group__prepend, .el-input-group__prepend,
.el-input-group__append,
input, input,
textarea { textarea {
border-color: green; border-color: green;
@ -1713,6 +1729,7 @@ export default {
.blue-border { .blue-border {
.el-input-group__prepend, .el-input-group__prepend,
.el-input-group__append,
input, input,
.el-checkbox__inner, .el-checkbox__inner,
textarea { textarea {
@ -1736,6 +1753,7 @@ export default {
.error-border { .error-border {
.el-input-group__prepend, .el-input-group__prepend,
.el-input-group__append,
.el-input__inner, .el-input__inner,
textarea, textarea,
.el-select, .el-select,

+ 3
- 0
src/components/Template/Step.vue View File

@ -75,6 +75,7 @@ import Mj from "./StepComponents/ry/mj.vue";//溶液-灭菌
import Fs from "./StepComponents/ry/fs.vue";//- import Fs from "./StepComponents/ry/fs.vue";//-
import Fb from "./StepComponents/ry/fb.vue";//- import Fb from "./StepComponents/ry/fb.vue";//-
import Zlfz from "./StepComponents/ry/zlfz.vue";//- import Zlfz from "./StepComponents/ry/zlfz.vue";//-
import dr from "./StepComponents/ry/dr.vue";//-
// //
import kbyq from "./StepComponents/ry/kbyq.vue";//- import kbyq from "./StepComponents/ry/kbyq.vue";//-
@ -444,6 +445,7 @@ export default {
Fs, Fs,
Fb, Fb,
Zlfz, Zlfz,
dr,
// //
kbyq, kbyq,
kbsjgsp, kbsjgsp,
@ -644,6 +646,7 @@ export default {
'fs': 'Fs', 'fs': 'Fs',
'fb': 'Fb', 'fb': 'Fb',
'zlfz': 'Zlfz', 'zlfz': 'Zlfz',
'dr': 'dr',
// //
'kbyq': 'kbyq', 'kbyq': 'kbyq',

+ 150
- 84
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -5,30 +5,41 @@
<div class="zl-header-container"> <div class="zl-header-container">
<div class="header-item" v-for="item in subConfig" :key="item.key"> <div class="header-item" v-for="item in subConfig" :key="item.key">
<div class="header-title">{{ item.label }}</div> <div class="header-title">{{ item.label }}</div>
<HandleFormItem fieldItemLabel = "质量分装" :fieldKey = 'prefixKey+stepIndex + item.fieldKey'
:item="item" :error="formErrors[item.key]"
:type="item.type"
@blur = "(e)=>onCommonBlur(e,item.key)"
<HandleFormItem fieldItemLabel="质量分装" :fieldKey='prefixKey + stepIndex + item.fieldKey' :item="item"
:error="formErrors[item.key]" :type="item.type" @blur="(e) => onCommonBlur(e, item.key)"
v-model="formData[item.key]" /> v-model="formData[item.key]" />
<span class="ml-5">{{ item.unit }}</span> <span class="ml-5">{{ item.unit }}</span>
<el-button class="ml-5" type="primary" v-if="item.key == 'fzsl' && templateFillType == 'preFill'"
:disabled="!formData[item.key]" plain @click="onConfirm(item.key)">确定</el-button>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">分装单位</div> <div class="header-title">分装单位</div>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey = "prefixKey+stepIndex + 'dw'" :item="unitItem" type="select" :error="formErrors.dw"
@blur="(e) => onCommonBlur(e, 'dw')" v-model="formData.dw" />
<HandleFormItem :fieldKey="prefixKey + stepIndex + 'dw'" :item="unitItem" type="select"
:error="formErrors.dw" @blur="(e) => onCommonBlur(e, 'dw')" v-model="formData.dw" />
</div> </div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">预设每份容量</div> <div class="header-title">预设每份容量</div>
<div class="unit-select">
<HandleFormItem :fieldKey="prefixKey+stepIndex + formData.mybh + '_mfbzl'" type="inputNumber"
<div class="unit-select">
<HandleFormItem :fieldKey="prefixKey + stepIndex + '_mfbzl'" type="inputNumber"
:error="formErrors.mfbzl" :isFieldsRecord="false" :item="preInputNumberItem" :error="formErrors.mfbzl" :isFieldsRecord="false" :item="preInputNumberItem"
v-model="formData.mfbzl" /> v-model="formData.mfbzl" />
</div> </div>
<el-button v-if = "templateFillType == 'preFill'" class="ml-10" type="primary" plain @click="onAverage">平均分配</el-button>
<el-button v-if = "templateFillType == 'preFill'" type="primary" plain @click="onReset">重置</el-button>
<el-button v-if="templateFillType == 'preFill'" class="ml-10" type="primary" plain
@click="onAverage">平均分配</el-button>
<el-button v-if="templateFillType == 'preFill'" type="primary" plain @click="onReset">重置</el-button>
</div>
<div class="header-item">
<div class="header-title">电子天平</div>
<div class="unit-select">
<HandleFormItem :fieldKey="prefixKey + stepIndex + '_dztp'" type="yq"
@onRegentSubmit="(data) => onRegentSubmit(data, 'dztp')" :error="formErrors.dztp"
:item="yqItem" v-model="formData.dztp" />
</div>
</div>
<div class="header-item">
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">分装编号</div> <div class="header-title">分装编号</div>
@ -38,20 +49,29 @@
<div class="zl-header-container"> <div class="zl-header-container">
<div v-for="(item, index) in fzList" class="list-item" :key="index"> <div v-for="(item, index) in fzList" class="list-item" :key="index">
<div class="list-label" v-if="item.subCode">{{ formData.mybh }}-set{{ item.subCode }}</div> <div class="list-label" v-if="item.subCode">{{ formData.mybh }}-set{{ item.subCode }}</div>
<HandleFormItem fieldItemLabel = "质量分装" :fieldKey = "prefixKey+stepIndex + 'clfz_set'+index+'_prenum'" :item="preInputNumberItem"
:error="hasError(index, 'prenum')"
:disabled="true"
type="inputNumber" @blur="onBlurFzNum(index,'prenum')" v-model="item.prenum" />
<HandleFormItem fieldItemLabel = "质量分装" :fieldKey = "prefixKey+stepIndex + 'clfz_set'+index+'_actnum'" class="ml-5" :item="inputNumberItem"
:error="hasError(index, 'actnum')"
type="inputNumber" @blur="onBlurFzNum(index,'actnum')" v-model="item.actnum" />
<el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain @click="onGetValue(item)">获取值</el-button>
<el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain @click="onPrint(item)">打印</el-button>
<HandleFormItem fieldItemLabel="质量分装"
:fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_prenum'"
:item="preInputNumberItem" :error="hasError(index, 'prenum')" :disabled="true"
type="inputNumber" @blur="onBlurFzNum(index, 'prenum')" v-model="item.prenum" />
<HandleFormItem fieldItemLabel="质量分装"
:fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_actnum'" class="ml-5"
:item="inputNumberItem" :error="hasError(index, 'actnum')" type="inputNumber"
:ref = "prefixKey + stepIndex + '_actnum'+index"
@blur="onBlurFzNum(index, 'actnum')" v-model="item.actnum" />
<HandleFormItem
:fieldKey="prefixKey + stepIndex + 'clfz_set' + index + '_hqz'" class="ml-5"
:item="getButtonItem()" @clickButton="(e,v,d) => onGetValue(d, item,index)" type="button" v-model="item.hqz" />
<!-- <el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain
@click="onGetValue(item)">获取值</el-button> -->
<el-button class="ml-5" v-if="templateFillType == 'actFill'" type="primary" plain
@click="onPrint(item)">打印</el-button>
</div> </div>
</div> </div>
<div class="sure-button-row"> <div class="sure-button-row">
<el-button v-if="templateFillType == 'actFill'" class="ml-5" type="primary" @click="onSure">确定</el-button>
<el-button v-if="templateFillType == 'actFill'" class="ml-5" type="primary"
@click="onSure">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -62,7 +82,8 @@
import HandleFormItem from '@/components/Template/HandleFormItem.vue'; import HandleFormItem from '@/components/Template/HandleFormItem.vue';
import { EventBus } from '@/utils/eventBus'; import { EventBus } from '@/utils/eventBus';
import { getLatestSn } from '@/api/template'; import { getLatestSn } from '@/api/template';
import { isValueEmpty,justUpdateFilledFormData } from '@/utils/index.js';
import { isValueEmpty, justUpdateFilledFormData } from '@/utils/index.js';
import { getBalance } from '@/utils/tpph.js';
export default { export default {
inject: ['templateFillType'], inject: ['templateFillType'],
dicts: [ dicts: [
@ -87,6 +108,10 @@ export default {
}, },
data() { data() {
return { return {
yqItem: {
type: "yq",
fillType: "actFill",
},
inputItem: { inputItem: {
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
@ -99,7 +124,8 @@ export default {
inputNumberItem: { inputNumberItem: {
type: "inputNumber", type: "inputNumber",
fillType: "actFill", fillType: "actFill",
label:"实际称量"
label: "实际称量",
disabled: true,
}, },
preInputNumberItem: { preInputNumberItem: {
type: "inputNumber", type: "inputNumber",
@ -109,24 +135,27 @@ export default {
mybh: "",// mybh: "",//
fzsl: "",// fzsl: "",//
dw: "",// dw: "",//
dztp: "",//
dztpInfo: {},//
}, },
fzList: [],// fzList: [],//
// //
formErrors: { formErrors: {
fzsl: false, fzsl: false,
dw: false, dw: false,
dztp: false,
}, },
fzListErrors: [], // fzListErrors: [], //
uuid:"",//id
uuid: "",//id
} }
}, },
watch: { watch: {
subData:{
subData: {
handler(newVal) { handler(newVal) {
if(newVal.formData){
if (newVal.formData) {
this.formData = newVal.formData; this.formData = newVal.formData;
} }
if(newVal.fzList){
if (newVal.fzList) {
this.fzList = newVal.fzList; this.fzList = newVal.fzList;
} }
}, },
@ -156,25 +185,25 @@ export default {
options: this.dict.type.business_zldw options: this.dict.type.business_zldw
} }
}, },
subConfig(){
return[
subConfig() {
return [
{ {
fieldKey:"clfz_mybh",
key:"mybh",
label:"包装编号",
type:"input",
fieldKey: "clfz_mybh",
key: "mybh",
label: "包装编号",
type: "input",
disabled: true, disabled: true,
fillType: "actFill", fillType: "actFill",
}, },
{ {
fieldKey:"clfz_fzsl",
key:"fzsl",
label:"分装数量",
type:"inputNumber",
fieldKey: "clfz_fzsl",
key: "fzsl",
label: "分装数量",
type: "inputNumber",
fillType: "preFill", fillType: "preFill",
precision: 0, precision: 0,
maxlength: 3, maxlength: 3,
unit:"份",
unit: "份",
}, },
// {// // {//
// fieldKey:"clfz_dw1", // fieldKey:"clfz_dw1",
@ -184,22 +213,22 @@ export default {
}, },
}, },
methods: { methods: {
onSure(){
onSure() {
this.$emit("onSubPackageSubmit"); this.$emit("onSubPackageSubmit");
}, },
onPrint(item){
console.log(item,"打印");
onPrint(item) {
console.log(item, "打印");
}, },
updateFormData(data){
this.formData = {...this.formData,...data};
if(data.mybh){
updateFormData(data) {
this.formData = { ...this.formData, ...data };
if (data.mybh) {
this.updateCode(data.mybh); this.updateCode(data.mybh);
} }
}, },
// //
async updateCode(mybh){
async updateCode(mybh) {
const { fzList } = this; const { fzList } = this;
if(isValueEmpty(mybh) || isValueEmpty(fzList)){
if (isValueEmpty(mybh) || isValueEmpty(fzList)) {
return; return;
} }
const result = await getLatestSn({ const result = await getLatestSn({
@ -207,7 +236,7 @@ export default {
count: fzList.length, count: fzList.length,
type: 2, type: 2,
}) })
if(result.code === 200){
if (result.code === 200) {
const codes = result.data; const codes = result.data;
// //
for (let i = 0; i < fzList.length; i++) { for (let i = 0; i < fzList.length; i++) {
@ -221,24 +250,24 @@ export default {
getButtonItem() { getButtonItem() {
return { return {
fillType: "actFill", fillType: "actFill",
buttonName:"获取值",
key:"hqz",
buttonName: "获取值",
key: "hqz",
} }
}, },
// //
getPrintButtonItem() { getPrintButtonItem() {
return { return {
fillType: "actFill", fillType: "actFill",
buttonName:"打印",
key:"print",
buttonName: "打印",
key: "print",
} }
}, },
// //
getSureButtonItem() { getSureButtonItem() {
return { return {
fillType: "actFill", fillType: "actFill",
buttonName:"确定",
key:"sure",
buttonName: "确定",
key: "sure",
} }
}, },
close() { close() {
@ -276,12 +305,25 @@ export default {
let isValid = true; let isValid = true;
// //
const baseFieldConfigs = this.subConfig;
const baseFieldConfigs = JSON.parse(JSON.stringify(this.subConfig));
baseFieldConfigs.push(
{
key: "dztp",
label: "电子天平",
type: "yq",
fillType: "actFill",
},
{
key: "dw",
label: "分装单位",
fillType: "preFill",
}
)
// //
baseFieldConfigs.forEach(config => { baseFieldConfigs.forEach(config => {
if (config.fillType === this.templateFillType) { if (config.fillType === this.templateFillType) {
if (isValueEmpty(this.formData[config.key]) && !config.disabled) {
if (isValueEmpty(this.formData[config.key])) {
this.formErrors[config.key] = true; this.formErrors[config.key] = true;
isValid = false; isValid = false;
} }
@ -319,7 +361,7 @@ export default {
} }
} }
} }
return {valid: isValid,error:"质量分装数据没填完"};
return { valid: isValid, error: "质量分装数据没填完" };
}, },
resetErrors() { resetErrors() {
// //
@ -339,29 +381,48 @@ export default {
// //
this.fzList = []; this.fzList = [];
this.fzListErrors = []; this.fzListErrors = [];
for (let i = 0; i < e; i++) {
this.fzList.push({
prenum: "",
actnum: "",
subCode: "",
});
}
for (let i = 0; i < e; i++) {
this.fzList.push({
prenum: "",
actnum: "",
subCode: "",
});
}
justUpdateFilledFormData() justUpdateFilledFormData()
},
onRegentSubmit(data, field) {
const { selectedId } = data;
this.formData[field] = selectedId;
this.formData.dztpInfo = data.row;
},
async onGetValue(signData, item, index) {
const { dztp,dztpInfo,dw } = this.formData;
if (isValueEmpty(dztp)) {
this.$message.error("请选择电子天平");
return;
}
const oldItem = JSON.parse(JSON.stringify(item));
const result = await getBalance({yq:dztpInfo,dw});
if(result.success){
item.actnum = result.value;
this.fzList = [...this.fzList];
this.$refs[this.prefixKey + this.stepIndex + '_actnum'+index][0].handleUpdateRecord(signData,{
oldValue: oldItem.actnum,
inputValue: result.value
})
}else{
this.$message.error(result.message || "获取值失败");
}
}, },
onGetValue(item) {
item.actnum = 123;
console.log(item,"获取值")
this.fzList = [...this.fzList]
},
onCommonBlur(e,field) {
onCommonBlur(e, field) {
if (this.formData[field]) { if (this.formData[field]) {
this.formErrors[field] = false; this.formErrors[field] = false;
} }
if(field === 'fzsl'){
this.onBlurFzsl(e);
}
},
onConfirm(field) {
this.onBlurFzsl(this.formData[field]);
}, },
onBlurFzNum(index, field) { onBlurFzNum(index, field) {
if (this.fzList[index]) { if (this.fzList[index]) {
@ -397,9 +458,9 @@ export default {
!(item.rowIndex === index && item.field === field) !(item.rowIndex === index && item.field === field)
); );
}, },
hasError(index, field) { hasError(index, field) {
const o = this.fzListErrors.find((item)=>{
const o = this.fzListErrors.find((item) => {
// item // item
if (!item || typeof item !== 'object') { if (!item || typeof item !== 'object') {
return false; // nullundefined return false; // nullundefined
@ -422,18 +483,21 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.zl-container{
.zl-container {
// width: 1100px; // width: 1100px;
} }
.dialog-content { .dialog-content {
// padding: 20px; // padding: 20px;
} }
.ml-5{
.ml-5 {
margin-left: 5px; margin-left: 5px;
} }
.unit-select { .unit-select {
// width: 100px; // width: 100px;
flex:1;
flex: 1;
} }
.content-item { .content-item {
@ -443,7 +507,7 @@ export default {
.zl-header-container { .zl-header-container {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px; grid-gap: 20px;
margin-top: 10px; margin-top: 10px;
} }
@ -485,7 +549,8 @@ export default {
margin-right: 5px; margin-right: 5px;
// width: 200px; // width: 200px;
} }
.sure-button-row{
.sure-button-row {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -493,7 +558,8 @@ export default {
position: relative; position: relative;
padding: 20px; padding: 20px;
} }
.absolute{
.absolute {
position: absolute; position: absolute;
}
}
</style> </style>

+ 2
- 2
src/components/Template/StepComponents/jcb/fyxks.vue View File

@ -39,7 +39,7 @@ export default {
type: "text", type: "text",
}, },
temp: { temp: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -47,7 +47,7 @@ export default {
type: "text", type: "text",
}, },
actTemp: { actTemp: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo: "temp", compareTo: "temp",
copyFrom: "temp", copyFrom: "temp",

+ 2
- 2
src/components/Template/StepComponents/jcb/ycfyks.vue View File

@ -69,7 +69,7 @@ export default {
type: "text", type: "text",
}, },
rm: { rm: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text5: { text5: {
@ -77,7 +77,7 @@ export default {
type: "text", type: "text",
}, },
rxry: { rxry: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm" copyFrom:"rm"

+ 2
- 2
src/components/Template/StepComponents/pcr/lx.vue View File

@ -51,7 +51,7 @@ export default {
type: "text", type: "text",
}, },
rm: { rm: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -59,7 +59,7 @@ export default {
type: "text", type: "text",
}, },
rxry: { rxry: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm" copyFrom:"rm"

+ 2
- 2
src/components/Template/StepComponents/pcr/lxdy.vue View File

@ -35,7 +35,7 @@ export default {
type: "text", type: "text",
}, },
rm: { rm: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -43,7 +43,7 @@ export default {
type: "text", type: "text",
}, },
rxry: { rxry: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm" copyFrom:"rm"

+ 2
- 2
src/components/Template/StepComponents/pcr/sy_pcr.vue View File

@ -35,7 +35,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
temp:{ temp:{
type:"inputNumber",
type:"input",
fillType:"preFill", fillType:"preFill",
}, },
text3:{ text3:{
@ -43,7 +43,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
actTemp:{ actTemp:{
type:"inputNumber",
type:"input",
fillType:"actFill", fillType:"actFill",
compareTo:"temp", compareTo:"temp",
copyFrom:"temp", copyFrom:"temp",

+ 2
- 2
src/components/Template/StepComponents/qxwdx/qxlx.vue View File

@ -43,7 +43,7 @@ export default {
type: "text", type: "text",
}, },
rm: { rm: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -51,7 +51,7 @@ export default {
type: "text", type: "text",
}, },
rxry: { rxry: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm" copyFrom:"rm"

+ 13
- 2
src/components/Template/StepComponents/ry/bdzl.vue View File

@ -1,6 +1,6 @@
<!-- 标定(质量) --> <!-- 标定(质量) -->
<template> <template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_bdzl'" @resetRecord = "resetRecord" :form-config="formConfig" :formData = "formData" />
<StepFormPackage @clickButton="onHandleClickButton" @beforeSaveRecord="onBeforeSaveRecord" :fieldItemLabel = "fieldItemLabel" ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_bdzl'" @resetRecord = "resetRecord" :form-config="formConfig" :formData = "formData" />
</template> </template>
<script> <script>
@ -14,7 +14,6 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
}, },
computed: { computed: {
formConfig() { formConfig() {
console.log(this.stepIndex,"stepIndex")
return [{ return [{
config:{ config:{
text1:{ text1:{
@ -50,8 +49,20 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
compareTo:"rm", compareTo:"rm",
disabled:true, disabled:true,
}, },
sjbdtjdw:{
type:"inputNumber",
fillType:"actFill",
compareTo:"bdtjdw",
disabled:true,
},
button1:{ button1:{
type:"button", type:"button",
dataSource:"tp",//
yqCode:"yq",//
fillField:"sjbdtj",//
fillDwField:"sjbdtjdw",//
dwField:"bdtjdw",//
buttonName:"获取值", buttonName:"获取值",
}, },
text5:{ text5:{

+ 2
- 2
src/components/Template/StepComponents/ry/dc.vue View File

@ -35,7 +35,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
temp:{ temp:{
type:"inputNumber",
type:"input",
fillType:"preFill", fillType:"preFill",
}, },
text3:{ text3:{
@ -43,7 +43,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
actTemp:{ actTemp:{
type:"inputNumber",
type:"input",
fillType:"actFill", fillType:"actFill",
compareTo:"temp", compareTo:"temp",
copyFrom:"temp", copyFrom:"temp",

+ 91
- 0
src/components/Template/StepComponents/ry/dr.vue View File

@ -0,0 +1,91 @@
<!-- 定容 -->
<template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_dr'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
props: {
sn: {
type: String,
default: 'dr',
},
},
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config: {
text1: {
label: "使用",
type: "text",
},
yqmc: {
fillType: "preFill",
type: "input",
},
yyq: {
fillType: "actFill",
type: "yq",
},
text3: {
label: ",取",
type: "text",
},
mry: {
fillType: "preFill",
type: "input",
},
sjry:{
fillType: "actFill",
type: "sj",
ylCode: "sjtj",
dwCode: "sjtjdw",
},
text4:{
label: ",预计定容至",
type: "text",
},
yjtj:{
fillType: "preFill",
type: "inputNumber",
},
yjtjdw:{
fillType: "preFill",
type: "select",
selectTo: "sjtjdw",
options:this.getDictOptions('business_tjdw'),
},
text5:{
label: ",实际定容至",
type: "text",
},
sjtj:{
fillType: "actFill",
type: "inputNumber",
compareTo:"yjtj",
copyFrom:"yjtj"
},
sjtjdw:{
fillType: "preFill",
type: "select",
options: this.getDictOptions('business_tjdw'),
},
text6:{
label: "。",
type: "text",
},
}
}]
}
},
}
</script>
<style lang="scss" scoped></style>

+ 1
- 1
src/components/Template/StepComponents/ry/fr.vue View File

@ -49,7 +49,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
dwCode: "sjtjdw", dwCode: "sjtjdw",
}, },
text3:{ text3:{
label:"溶液,各预计加入休积为",
label:"溶液,预计加入体积为",
type:"text", type:"text",
}, },
yjtj:{ yjtj:{

+ 1
- 1
src/components/Template/StepComponents/ry/fy.vue View File

@ -55,7 +55,7 @@ export default {
copyFrom:"yjtj", copyFrom:"yjtj",
}, },
text4: { text4: {
label: ",进行孵育",
label: ",对上表进行孵育",
type: "text", type: "text",
}, },
fysr: { fysr: {

+ 2
- 2
src/components/Template/StepComponents/ry/hwhy.vue View File

@ -36,7 +36,7 @@ export default {
type: "text", type: "text",
}, },
yjzs: { yjzs: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -44,7 +44,7 @@ export default {
type: "text", type: "text",
}, },
sjwd: { sjwd: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo: "yjzs", compareTo: "yjzs",
copyFrom: "yjzs" copyFrom: "yjzs"

+ 2
- 2
src/components/Template/StepComponents/ry/jrjb.vue View File

@ -35,7 +35,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
yjwd:{ yjwd:{
type:"inputNumber",
type:"input",
fillType:"preFill", fillType:"preFill",
}, },
text3:{ text3:{
@ -43,7 +43,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
sjwd:{ sjwd:{
type:"inputNumber",
type:"input",
fillType:"actFill", fillType:"actFill",
compareTo:"yjwd", compareTo:"yjwd",
copyFrom:"yjwd" copyFrom:"yjwd"

+ 2
- 2
src/components/Template/StepComponents/ry/lx.vue View File

@ -35,7 +35,7 @@ export default {
type: "text", type: "text",
}, },
rm: { rm: {
type: "inputNumber",
type: "input",
fillType: "preFill", fillType: "preFill",
}, },
text3: { text3: {
@ -43,7 +43,7 @@ export default {
type: "text", type: "text",
}, },
rxry: { rxry: {
type: "inputNumber",
type: "input",
fillType: "actFill", fillType: "actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm" copyFrom:"rm"

+ 2
- 2
src/components/Template/StepComponents/ry/sy.vue View File

@ -35,7 +35,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
temp:{ temp:{
type:"inputNumber",
type:"input",
fillType:"preFill", fillType:"preFill",
}, },
text3:{ text3:{
@ -43,7 +43,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
actTemp:{ actTemp:{
type:"inputNumber",
type:"input",
fillType:"actFill", fillType:"actFill",
compareTo:"temp", compareTo:"temp",
copyFrom:"temp", copyFrom:"temp",

+ 10
- 1
src/components/Template/StepComponents/ry/tjphcz.vue View File

@ -1,6 +1,11 @@
<!-- 调节PH(传值) --> <!-- 调节PH(传值) -->
<template> <template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_tjphcz'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
<StepFormPackage
:fieldItemLabel = "fieldItemLabel"
ref="stepFormPackageRef"
@beforeSaveRecord="onBeforeSaveRecord"
@clickButton="onHandleClickButton"
:prefixKey="stepIndex+'_'+'ry_tjphcz'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
</template> </template>
<script> <script>
@ -97,9 +102,13 @@ export default {
type: "inputNumber", type: "inputNumber",
fillType: "actFill", fillType: "actFill",
compareTo: "rm", compareTo: "rm",
disabled: true,
}, },
button1: { button1: {
type: "button", type: "button",
dataSource:"ph",//
yqCode:"yq",//
fillField:"ph",//
buttonName: "获取值", buttonName: "获取值",
}, },
text8: { text8: {

+ 28
- 4
src/components/Template/StepComponents/ry/tpjydd.vue View File

@ -2,14 +2,16 @@
<template> <template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" <StepFormPackage :fieldItemLabel = "fieldItemLabel"
ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_tpjydd'" @resetRecord = "resetRecord" ref = "stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_tpjydd'" @resetRecord = "resetRecord"
@clickButton="handleClickButton"
@clickButton="onHandleClickButton"
@beforeSaveRecord="onBeforeSaveRecord"
@blur = "onBlur"
:form-config="formConfig" :formData = "formData" /> :form-config="formConfig" :formData = "formData" />
</template> </template>
<script> <script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue'; import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js'; import stepMixins from '@/components/Template/mixins/stepMixins.js';
import {convertMass} from "@/utils/massTool";
export default { export default {
mixins: [stepMixins], mixins: [stepMixins],
components: { components: {
@ -38,6 +40,9 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
}, },
button1:{ button1:{
type:"button", type:"button",
dataSource:"tp",//
yqCode:"ddsys",//
fillField:"pz",//
buttonName:"获取值", buttonName:"获取值",
}, },
text3:{ text3:{
@ -85,6 +90,9 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
}, },
button2:{ button2:{
type:"button", type:"button",
dataSource:"tp",//
yqCode:"ddsys",//
fillField:"fmz",//
buttonName:"获取值", buttonName:"获取值",
}, },
text7:{ text7:{
@ -108,6 +116,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"input", type:"input",
fillType:"actFill", fillType:"actFill",
disabled:true, disabled:true,
compareText:"不通过",
}, },
text9:{ text9:{
label:"。", label:"。",
@ -118,8 +127,23 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
} }
}, },
methods: { methods: {
handleClickButton(key){
console.log(key)
onBlur(values) {
const {fmz,sjsr2,sjsr3,sjsrdw2,sjsrdw3,sjsr4,sjsrdw4} = values;
if(!fmz || !sjsr2 || !sjsr3 || !sjsrdw2 || !sjsrdw3 || !sjsr4 || !sjsrdw4){
return;
}
const result = fmz.match(/(\d+)([a-zA-Z]+)/);
if(!result){
return;
}
const fmzValue = Number(result[1]);
const fmzUnit = result[2];
const sjsr2Value = convertMass(sjsr2+sjsrdw2, fmzUnit);
const sjsr3Value = convertMass(sjsr3+sjsrdw3, fmzUnit);
const sjsr4Value = convertMass(sjsr4+sjsrdw4, fmzUnit);
const deviationValue = fmzValue-(sjsr2Value + sjsr3Value );
const des = deviationValue<=sjsr4Value?"通过":"不通过";
this.$refs.stepFormPackageRef.updateFormData("jgpd", des);
} }
} }
} }

+ 53
- 5
src/components/Template/StepComponents/ry/tpjysd.vue View File

@ -1,13 +1,14 @@
<!-- 天平校验(双点) --> <!-- 天平校验(双点) -->
<template> <template>
<StepFormPackage :fieldItemLabel="fieldItemLabel" ref="stepFormPackageRef" :prefixKey="stepIndex + '_' + 'ry_tpjysd'"
@resetRecord="resetRecord" @clickButton="handleClickButton" :form-config="formConfig" :formData="formData" />
<StepFormPackage :fieldItemLabel="fieldItemLabel" ref="stepFormPackageRef"
:prefixKey="stepIndex + '_' + 'ry_tpjysd'" @resetRecord="resetRecord" @clickButton="onHandleClickButton"
@beforeSaveRecord="onBeforeSaveRecord" :form-config="formConfig" @blur="onBlur" :formData="formData" />
</template> </template>
<script> <script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue'; import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js'; import stepMixins from '@/components/Template/mixins/stepMixins.js';
import { convertMass } from "@/utils/massTool";
export default { export default {
mixins: [stepMixins], mixins: [stepMixins],
components: { components: {
@ -45,6 +46,9 @@ export default {
}, },
dfmbutton1: { dfmbutton1: {
type: "button", type: "button",
dataSource: "tp",//
yqCode: "ddsys",//
fillField: "dfmpz",//
buttonName: "获取值", buttonName: "获取值",
}, },
dfmtext3: { dfmtext3: {
@ -92,6 +96,9 @@ export default {
}, },
dfmbutton2: { dfmbutton2: {
type: "button", type: "button",
dataSource: "tp",//
yqCode: "ddsys",//
fillField: "dfmfmz",//
buttonName: "获取值", buttonName: "获取值",
}, },
dfmtext7: { dfmtext7: {
@ -115,6 +122,7 @@ export default {
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
disabled: true, disabled: true,
compareText: "不通过",
} }
} }
}, },
@ -136,6 +144,9 @@ export default {
}, },
button1: { button1: {
type: "button", type: "button",
dataSource: "tp",//
yqCode: "ddsys",//
fillField: "pz",//
buttonName: "获取值", buttonName: "获取值",
}, },
text3: { text3: {
@ -183,6 +194,9 @@ export default {
}, },
button2: { button2: {
type: "button", type: "button",
dataSource: "tp",//
yqCode: "ddsys",//
fillField: "fmz",//
buttonName: "获取值", buttonName: "获取值",
}, },
text7: { text7: {
@ -206,6 +220,7 @@ export default {
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
disabled: true, disabled: true,
compareText: "不通过",
}, },
text9: { text9: {
label: "。", label: "。",
@ -218,8 +233,41 @@ export default {
} }
}, },
methods: { methods: {
handleClickButton(key) {
console.log(key)
onBlur(values) {
console.log(values, "values");
const { dfmpz, dfmsjsr2, dfmsjsr3, dfmsjsrdw2, dfmsjsrdw3, dfmsjsr4, dfmsjsrdw4,fmz, sjsr2, sjsr3, sjsrdw2, sjsrdw3, sjsr4, sjsrdw4 } = values;
if (dfmpz && dfmsjsr2 && dfmsjsr3 && dfmsjsrdw2 && dfmsjsrdw3 && dfmsjsr4 && dfmsjsrdw4) {
const result = dfmpz.match(/(\d+)([a-zA-Z]+)/);
if (!result) {
return;
}
const dfmpzValue = Number(result[1]);
const dfmpzUnit = result[2];
const sjsr2Value = convertMass(dfmsjsr2 + dfmsjsrdw2, dfmpzUnit);
const sjsr3Value = convertMass(dfmsjsr3 + dfmsjsrdw3, dfmpzUnit);
const sjsr4Value = convertMass(dfmsjsr4 + dfmsjsrdw4, dfmpzUnit);
const deviationValue = dfmpzValue - (sjsr2Value + sjsr3Value);
const des = Math.abs(deviationValue) <= Math.abs(sjsr4Value) ? "通过" : "不通过";
this.$refs.stepFormPackageRef.updateFormData("dfmjgpd", des);
}
if (fmz && sjsr2 && sjsr3 && sjsrdw2 && sjsrdw3 && sjsr4 && sjsrdw4) {
if (!fmz || !sjsr2 || !sjsr3 || !sjsrdw2 || !sjsrdw3 || !sjsr4 || !sjsrdw4) {
return;
}
const result = fmz.match(/(\d+)([a-zA-Z]+)/);
if (!result) {
return;
}
const fmzValue = Number(result[1]);
const fmzUnit = result[2];
const sjsr2Value = convertMass(sjsr2 + sjsrdw2, fmzUnit);
const sjsr3Value = convertMass(sjsr3 + sjsrdw3, fmzUnit);
const sjsr4Value = convertMass(sjsr4 + sjsrdw4, fmzUnit);
const deviationValue = fmzValue - (sjsr2Value + sjsr3Value);
const des = Math.abs(deviationValue) <= Math.abs(sjsr4Value) ? "通过" : "不通过";
this.$refs.stepFormPackageRef.updateFormData("jgpd", des);
}
} }
} }
} }

+ 2
- 2
src/components/Template/StepComponents/xbjzpz/fr_xbjzpz.vue View File

@ -35,7 +35,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
temp:{ temp:{
type:"inputNumber",
type:"input",
fillType:"preFill", fillType:"preFill",
}, },
text3:{ text3:{
@ -43,7 +43,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
actTemp:{ actTemp:{
type:"inputNumber",
type:"input",
fillType:"actFill", fillType:"actFill",
compareTo:"temp", compareTo:"temp",
copyFrom:"temp", copyFrom:"temp",

+ 14
- 9
src/components/Template/StepFormPackage.vue View File

@ -5,35 +5,37 @@
<template v-if="sItem.type === 'input'"> <template v-if="sItem.type === 'input'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)"
:item="sItem" v-model="formFields[key]" :field-key="prefixKey+'_' + key" :item="sItem" v-model="formFields[key]" :field-key="prefixKey+'_' + key"
:ref="key"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
:orange-bg="getOrangeBg(key,sItem)" />
</template> </template>
<template v-else-if="sItem.type === 'inputNumber'"> <template v-else-if="sItem.type === 'inputNumber'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key"
type="inputNumber" @blur="onBlur(key, $event)" :item="sItem"
type="inputNumber" @blur="onBlur(key, $event)" :item="sItem" :ref="key"
@input="onInputNumberChange(key, $event)" v-model="formFields[key]" @copy="onCopy(sItem, key)" @input="onInputNumberChange(key, $event)" v-model="formFields[key]" @copy="onCopy(sItem, key)"
:error="errors[key]" @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
:error="errors[key]" @update:error="errors[key] = false" :orange-bg="getOrangeBg(key,sItem)" />
</template> </template>
<template v-else-if="sItem.type === 'select'"> <template v-else-if="sItem.type === 'select'">
<HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key" <HandleFormItem class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key"
type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]" type="select" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)"
@change="onSelectChange(key, $event, sItem.type)" :ref="key"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'checkbox' || sItem.type === 'radio'"> <template v-else-if="sItem.type === 'checkbox' || sItem.type === 'radio'">
<HandleFormItem :class="sItem.type === 'checkbox' ? 'step-row' : ''" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key" <HandleFormItem :class="sItem.type === 'checkbox' ? 'step-row' : ''" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_' + key"
:type="sItem.type" :item="sItem" v-model="formFields[key]" :type="sItem.type" :item="sItem" v-model="formFields[key]"
@change="onSelectChange(key, $event, sItem.type)"
@change="onSelectChange(key, $event, sItem.type)" :ref="key"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'button'"> <template v-else-if="sItem.type === 'button'">
<HandleFormItem <HandleFormItem
type="button" type="button"
@beforeSaveRecord="(data, callback)=>onBeforeSaveRecord(data, callback,sItem)"
:field-key="prefixKey+'_' + key" :field-key="prefixKey+'_' + key"
:item="getButtonItem(sItem)" :item="getButtonItem(sItem)"
@clickButton="(e)=>handleClickButton(e,item,key)" />
@clickButton="(e,v,data)=>handleClickButton(e,item,key,data)" />
</template> </template>
<!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 --> <!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 -->
<template v-else-if="isRegent(sItem)"> <template v-else-if="isRegent(sItem)">
@ -146,11 +148,14 @@ export default {
// /// // ///
onRegentSubmit(data,key,item){ onRegentSubmit(data,key,item){
this.updateFormData(key,data.selectedId); this.updateFormData(key,data.selectedId);
console.log(data.selectedId,key,"data.selectedId")
console.log(data.selectedId,key,item,"data.selectedId")
if(data.selectType){ if(data.selectType){
this.allFieldsConfig[key].sjSelectType = data.selectType; this.allFieldsConfig[key].sjSelectType = data.selectType;
} }
this.formFields[`selectInfo_${key}`] = data.selectInfo; this.formFields[`selectInfo_${key}`] = data.selectInfo;
if(data.type === "yq"){
this.formFields[`yqInfo_${key}`] = data.row;
}
this.$emit("onRegentSubmit", {selectInfo:data,key,config:item}); this.$emit("onRegentSubmit", {selectInfo:data,key,config:item});
}, },
getRegentItem(item,fieldCode="type"){ getRegentItem(item,fieldCode="type"){
@ -262,7 +267,7 @@ export default {
} }
}, },
// //
handleClickButton(e,item,key){
handleClickButton(e,item,key,data){
const {buttonName = ""} = e; const {buttonName = ""} = e;
const {config} = item; const {config} = item;
if(buttonName === '开始' && config.hasOwnProperty("startDate")){ if(buttonName === '开始' && config.hasOwnProperty("startDate")){
@ -270,7 +275,7 @@ export default {
}else if(buttonName === '结束' && config.hasOwnProperty("endDate")){ }else if(buttonName === '结束' && config.hasOwnProperty("endDate")){
this.updateFormData("endDate",moment().format('YYYY-MM-DD HH:mm')) this.updateFormData("endDate",moment().format('YYYY-MM-DD HH:mm'))
} }
this.$emit("clickButton",e,item,key)
this.$emit("clickButton",e,item,key,data)
}, },
// //
getButtonItem(sItem) { getButtonItem(sItem) {

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

@ -1,5 +1,5 @@
import _ from 'lodash' import _ from 'lodash'
import { getuuid, isEqual, isValueEmpty } 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'
@ -20,7 +20,6 @@ export default {
deep: true, // 深度监听,以便检测嵌套对象变化 deep: true, // 深度监听,以便检测嵌套对象变化
handler(v) { handler(v) {
if (v) { if (v) {
console.log(v, 'fieldItemLabel')
} }
} }
}, },
@ -53,8 +52,8 @@ export default {
if (currentConfig?.selectTo) { if (currentConfig?.selectTo) {
this.formFields[currentConfig?.selectTo] = val this.formFields[currentConfig?.selectTo] = val
if (this.errors[currentConfig?.selectTo]) { if (this.errors[currentConfig?.selectTo]) {
this.$set(this.errors, currentConfig?.selectTo, false)
}
this.$set(this.errors, currentConfig?.selectTo, false)
}
} }
this.onValueChangeCompareTo(key, val) this.onValueChangeCompareTo(key, val)
this.formFields[key] = val this.formFields[key] = val
@ -64,6 +63,12 @@ export default {
this.$set(this.errors, key, false) this.$set(this.errors, key, false)
} }
}, },
getOrangeBg(key,sItem) {
if(sItem.compareText){
return sItem.compareText == this.formFields[key]
}
return this.orangeBgFields[key]
},
//是否过期 //是否过期
regentIsExpired(key) { regentIsExpired(key) {
const { yxq, sxrq } = this.formFields[`selectInfo_${key}`] || {}; const { yxq, sxrq } = this.formFields[`selectInfo_${key}`] || {};
@ -77,17 +82,20 @@ export default {
}, },
//试剂/仪器等弹窗提交 //试剂/仪器等弹窗提交
onRegentSubmit(data, inputValue, key, item) { onRegentSubmit(data, inputValue, key, item) {
this.updateFormData(key, inputValue)
this.formFields[`selectInfo_${key}`] = 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));
}
this.$emit('onRegentSubmit', { this.$emit('onRegentSubmit', {
selectInfo: data, selectInfo: data,
inputValue, inputValue,
key, key,
config: item config: item
}) })
this.updateFormData(key, inputValue)
}, },
onBeforeReagentSubmit(data, callback, key) { onBeforeReagentSubmit(data, callback, key) {
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields })
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields })
}, },
getRegentItem(item, fieldCode = 'type') { getRegentItem(item, fieldCode = 'type') {
const type = item[fieldCode] const type = item[fieldCode]
@ -137,7 +145,7 @@ export default {
}, },
//更新表单数据 //更新表单数据
updateFormData(key, value, data) { updateFormData(key, value, data) {
const { isUpdateRecord, signData } = data || {}
const { isUpdateRecord, signData, record, isUpdateInputValue = true } = data || {}
// 深拷贝当前表单数据,避免直接修改原数据 // 深拷贝当前表单数据,避免直接修改原数据
const cloneFormFields = JSON.parse(JSON.stringify(this.formFields)) const cloneFormFields = JSON.parse(JSON.stringify(this.formFields))
@ -147,13 +155,13 @@ export default {
if (this.errors[key]) { if (this.errors[key]) {
this.$set(this.errors, key, false) this.$set(this.errors, key, false)
} }
const re = record || {
oldValue: this.oldFormFields[key],
inputValue: value
}
if (isUpdateRecord) { if (isUpdateRecord) {
setTimeout(() => { setTimeout(() => {
this.$refs[key][0].handleUpdateRecord(signData, {
oldValue: this.oldFormFields[key],
inputValue: value
})
this.$refs[key][0].handleUpdateRecord(signData, re, isUpdateInputValue)
}, 10) }, 10)
} }
}, },
@ -390,25 +398,40 @@ export default {
if (item.config?.thirdOtherCode) { if (item.config?.thirdOtherCode) {
config[item.config?.thirdOtherCode] = 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_')
)
}
// 如果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] || ''
})
}
} }
}) })
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
// 优先使用this.formFields中以selectInfo_开头的字段
let selectInfoKeys = []
if (this.formFields) {
selectInfoKeys = Object.keys(this.formFields).filter((key) =>
key.startsWith('selectInfo_')
)
}
// 如果this.formFields中没有,则使用formData中的
if (selectInfoKeys.length === 0 && formData) {
selectInfoKeys = Object.keys(formData).filter((key) =>
key.startsWith('selectInfo_')
)
}
selectInfoKeys.forEach((key) => {
result[key] = this.formFields[key] || formData[key] || ''
})
// 更新表单字段 // 更新表单字段
this.formFields = { ...result } this.formFields = { ...result }
this.allFieldsConfig = config this.allFieldsConfig = config
@ -615,6 +638,7 @@ export default {
errors: errors errors: errors
} }
}, },
// 校验表单数据
getFormData() { getFormData() {
// 同时执行数据校验和子组件校验 // 同时执行数据校验和子组件校验
const validateResult = this.validateFormData() const validateResult = this.validateFormData()
@ -647,6 +671,9 @@ export default {
getFormDataByKey(key) { getFormDataByKey(key) {
return this.formFields[key] return this.formFields[key]
}, },
onBeforeSaveRecord(data, callback, item) {
this.$emit('beforeSaveRecord', { data, callback, item })
},
onBlur(key, val) { onBlur(key, val) {
// compareTo 功能:当fillType==="actFill"时,判断当前值是否与compareTo字段的值一样,如果不一样则将当前input框的背景色标记成橙色 // compareTo 功能:当fillType==="actFill"时,判断当前值是否与compareTo字段的值一样,如果不一样则将当前input框的背景色标记成橙色
this.onValueChangeCompareTo(key, val) this.onValueChangeCompareTo(key, val)

+ 54
- 1
src/components/Template/mixins/stepMixins.js View File

@ -1,6 +1,7 @@
import { getuuid, justUpdateFilledFormData } from '@/utils/index.js' import { getuuid, justUpdateFilledFormData } from '@/utils/index.js'
import { EventBus } from '@/utils/eventBus' import { EventBus } from '@/utils/eventBus'
import { getLatestSn, getLatestSnArr } from '@/api/template' import { getLatestSn, getLatestSnArr } from '@/api/template'
import { getBalance, getPh } from '@/utils/tpph.js';
export default { export default {
inject: { inject: {
templateFillType: { default: 'preFill' }, templateFillType: { default: 'preFill' },
@ -150,8 +151,27 @@ export default {
this.justUpdateFilledFormData(); this.justUpdateFilledFormData();
} }
}, },
onBeforeSaveRecord(params) {
const { callback, item } = params
const { buttonName } = item;
if (buttonName === '获取值') {
const { dataSource, yqCode } = item;
const stepFormData = this.getFilledFormData()
if (dataSource === "tp" || dataSource === "ph") {//电子天平或PH测量仪
const yq = stepFormData[yqCode] || "";
const obj = {
tp:"请选择电子天平",
ph:"请选择PH测量仪"
}
if (!yq) {
callback.prevent(obj[dataSource])
}
}
}
},
// 点击按钮 // 点击按钮
onHandleClickButton(e, item, key) {
async onHandleClickButton(e, item, key,signData) {
const { const {
buttonName = '', buttonName = '',
myCodeFields = [], myCodeFields = [],
@ -201,6 +221,39 @@ export default {
maxVolumeUnit, maxVolumeUnit,
uuid: this.uuid, uuid: this.uuid,
}) })
} else if (buttonName === '获取值') {
const { dataSource, dwField = "", fillField,fillDwField = "", yqCode } = e;
const stepFormData = this.getFilledFormData()
const yqInfo = stepFormData[`yqInfo_${yqCode}`] || {};
if (dataSource === "tp") {//电子天平
const dw = stepFormData[dwField] || "";
const oldValue = stepFormData[fillDwField] || "";
const result = await getBalance({ yq: yqInfo, dw });
if (result.success) {
const value = dw?result.value:`${result.value}${result.unit}`
if(fillDwField){//需要回填的单位字段
this.$refs.stepFormPackageRef.updateFormData(fillField, value)
this.$refs.stepFormPackageRef.updateFormData(fillDwField, result.unit,{isUpdateRecord:true,signData,isUpdateInputValue:false,record:{
oldValue,
inputValue:result.value+result.unit
}})
}else{
this.$refs.stepFormPackageRef.updateFormData(fillField, value,{isUpdateRecord:true,signData})
}
} else {
this.$message.error(result.message || "获取值失败");
}
}else if(dataSource === "ph"){
const result = await getPh({ yq: yqInfo });
if (result.success) {
this.$refs.stepFormPackageRef.updateFormData(fillField, result.value,{isUpdateRecord:true,signData})
} else {
this.$message.error(result.message || "获取值失败");
}
}
} }
}, },

+ 1
- 0
src/lang/en/system/role.js View File

@ -4,6 +4,7 @@ export default {
status: 'Status', status: 'Status',
remark: 'Role Description', remark: 'Role Description',
permit: 'Permit', permit: 'Permit',
exporPermit: 'Export Permit',
statusEnable: 'Enabled', statusEnable: 'Enabled',
statusDisable: 'Disabled', statusDisable: 'Disabled',

+ 1
- 0
src/lang/zh/system/role.js View File

@ -4,6 +4,7 @@ export default {
status: '状态', status: '状态',
remark: '备注', remark: '备注',
permit: '权限', permit: '权限',
exporPermit: '导出权限',
statusEnable: '启用', statusEnable: '启用',
statusDisable: '禁用', statusDisable: '禁用',

+ 10
- 10
src/lang/zh/template/pcr.js View File

@ -45,7 +45,7 @@ export default {
ysxsyxytj: '预设稀释液吸样体积', ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积', sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度', ypznd: '样品终浓度',
fj: '附件',
fj: '附件'
}, },
pcr007: { pcr007: {
dztpbh: '电子天平编号', dztpbh: '电子天平编号',
@ -63,7 +63,7 @@ export default {
ysxsyxytj: '预设稀释液吸样体积', ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积', sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度', ypznd: '样品终浓度',
fj: 'Attachment',
fj: 'Attachment'
}, },
pcr008: { pcr008: {
czb: '称重表', czb: '称重表',
@ -77,10 +77,10 @@ export default {
lzzcz: '连组织称重', lzzcz: '连组织称重',
lzzgz: '连组织管重', lzzgz: '连组织管重',
zzzl: '组织重量', zzzl: '组织重量',
ysyjryjrl: '预设匀浆溶液加入量',
sjyjryjrl: '实际匀浆溶液加入量',
ysyjrybjrl: '预设匀浆溶液加入量',
sjyjrybjrl: '实际匀浆溶液加入量'
}, },
pcr009: {
pcr009: {
clsj: '处理时间', clsj: '处理时间',
yjry: '匀浆溶液', yjry: '匀浆溶液',
bs: '倍数', bs: '倍数',
@ -88,7 +88,7 @@ export default {
ypmc: '样品名称', ypmc: '样品名称',
zzz: '组织重', zzz: '组织重',
ysyjrybjrl: '预设匀浆溶液补加入量', ysyjrybjrl: '预设匀浆溶液补加入量',
sjyjrybjrl: '实际匀浆溶液补加入量',
sjyjrybjrl: '实际匀浆溶液补加入量'
}, },
pcr010: { pcr010: {
clsj: '处理时间', clsj: '处理时间',
@ -98,20 +98,20 @@ export default {
yjyjry: '已加匀浆溶液', yjyjry: '已加匀浆溶液',
ypmc: '样品名称', ypmc: '样品名称',
cqzl: '称取重量', cqzl: '称取重量',
ysyjrybjrl: '预设匀浆溶液加入量',
sjyjrybjrl: '实际匀浆溶液加入量',
ysyjryjrl: '预设匀浆溶液加入量',
sjyjryjrl: '实际匀浆溶液加入量'
}, },
pcr011: { pcr011: {
sj: '试剂', sj: '试剂',
ysjyztj: '预设加样总体积', ysjyztj: '预设加样总体积',
sjypjytj: '实际样品加样体积', sjypjytj: '实际样品加样体积',
yssjjrtj: '预设试剂加入体积', yssjjrtj: '预设试剂加入体积',
sjsjjrtj: '实际试剂加入体积',
sjsjjrtj: '实际试剂加入体积'
}, },
pcr012: { pcr012: {
sjwj: '数据文件', sjwj: '数据文件',
hsndcdwjm: '核酸浓度测定文件名', hsndcdwjm: '核酸浓度测定文件名',
hsndcdwjlj: '核酸浓度测定文件路径',
hsndcdwjlj: '核酸浓度测定文件路径'
}, },
// 生物样品分析方法学样品制备表-Recovery // 生物样品分析方法学样品制备表-Recovery
sp009: { sp009: {

+ 24
- 0
src/utils/conConverter.js View File

@ -1,8 +1,30 @@
/** /**
* 浓度单位转换 同一类别内转换 * 浓度单位转换 同一类别内转换
*/ */
import { Message } from 'element-ui';
class ConcentrationConverter { class ConcentrationConverter {
// 用于防抖的消息缓存
messageCache = {};
/**
* 防抖显示消息相同消息在指定时间内只显示一次
* @param {string} message - 消息内容
* @param {string} type - 消息类型
* @param {number} delay - 防抖时间毫秒默认2000ms
*/
showDebouncedMessage(message, type = 'warning', delay = 2000) {
const now = Date.now();
const cacheKey = `${message}_${type}`;
if (!this.messageCache[cacheKey] || now - this.messageCache[cacheKey] > delay) {
this.messageCache[cacheKey] = now;
Message({
message: message,
type: type
});
}
}
// 单位换算系数 // 单位换算系数
unitFactors = { unitFactors = {
// 质量单位(以g为基准) // 质量单位(以g为基准)
@ -128,11 +150,13 @@ class ConcentrationConverter {
// 3. 检查是否为%单位 // 3. 检查是否为%单位
if (inputUnit === '%' || normalizedTargetUnit === '%') { if (inputUnit === '%' || normalizedTargetUnit === '%') {
// %单位是单独的系列,不进行转换 // %单位是单独的系列,不进行转换
this.showDebouncedMessage(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit},请重新选择`);
throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`); throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`);
} }
// 4. 验证单位类别 // 4. 验证单位类别
if (!this.isSameCategory(inputUnit, normalizedTargetUnit)) { if (!this.isSameCategory(inputUnit, normalizedTargetUnit)) {
this.showDebouncedMessage(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit},请重新选择`);
throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`); throw new Error(`单位类别不匹配: ${inputUnit} 不能转换为 ${targetUnit}`);
} }

+ 42
- 0
src/utils/massTool.js View File

@ -33,4 +33,46 @@ export function compareMass(value1, unit1, value2, unit2) {
if (grams1 > grams2) return 1; if (grams1 > grams2) return 1;
if (Math.abs(grams1 - grams2) < 1e-12) return 0; if (Math.abs(grams1 - grams2) < 1e-12) return 0;
return -1; return -1;
}
/**
* 质量单位转换
* @param {string} massStr - 质量字符串 "3kg"
* @param {string} targetUnit - 目标单位 "g"
* @returns {number} 转换后的数值
* @example
* convertMass('3kg', 'g') // 返回 3000
* convertMass('500mg', 'g') // 返回 0.5
*/
export function convertMass(massStr, targetUnit) {
if (typeof massStr !== 'string' || massStr.length === 0) {
throw new Error('质量字符串不能为空');
}
if (typeof targetUnit !== 'string' || targetUnit.length === 0) {
throw new Error('目标单位不能为空');
}
// 解析质量字符串,提取数值和单位
const match = massStr.trim().match(/^([\d.]+)\s*([a-zA-Z]+)$/);
if (!match) {
throw new Error(`无效的质量字符串格式: ${massStr}`);
}
const value = parseFloat(match[1]);
const sourceUnit = match[2].toLowerCase();
const lowerTargetUnit = targetUnit.toLowerCase();
if (isNaN(value)) {
throw new Error('无法解析数值');
}
if (!isMassUnit(sourceUnit)) {
throw new Error(`无效的源单位: ${sourceUnit}`);
}
if (!isMassUnit(lowerTargetUnit)) {
throw new Error(`无效的目标单位: ${targetUnit}`);
}
// 先转换为克,再转换为目标单位
const grams = value * toGramFactor[sourceUnit];
return grams / toGramFactor[lowerTargetUnit];
} }

+ 82
- 41
src/utils/tpph.js View File

@ -4,17 +4,31 @@
import axios from 'axios' import axios from 'axios'
import { Message } from 'element-ui' import { Message } from 'element-ui'
export async function getBalance(
cmd,
format,
comPort,
baudRate,
byteSize,
parity
) {
let val = {}
let url = `http://localhost/tpphurl/api/v1/balance/value?cmd=12&format=hex&comPort=COM1&baudRate=9600&byteSize=8&parity=N`
// let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/balance/value?cmd=${cmd}&format=${format}&comPort=${comPort}&baudRate=${baudRate}&byteSize=${byteSize}&parity=${parity}`
export async function getBalance(obj) {
// alert('入参:' + JSON.stringify(obj))
return {
success: true,
originalValue: '1000',
originalUnit: 'g',
value: convertUnit('1000', 'g', obj.dw || 'g'),
unit: obj.dw || 'g',
message: ''
}
let yq = obj.yq
let dw = obj.dw
let val = {
success: false,
originalValue: '',
originalUnit: '',
value: '',
unit: '',
message: '未获取到天平数据'
}
// let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/balance/value?cmd=12&format=hex&comPort=COM1&baudRate=9600&byteSize=8&parity=N`
let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/balance/value?cmd=${yq.cmdHex}&format=hex&comPort=${yq.serialPort}&baudRate=${yq.baudRate}&byteSize=${yq.byteSize}&parity=${yq.parity}`
await axios await axios
.get( .get(
url, url,
@ -26,26 +40,37 @@ export async function getBalance(
} }
) )
.then((res) => { .then((res) => {
// alert('127.0.0.1返回:' + JSON.stringify(res))
if (res.status !== 200) { if (res.status !== 200) {
Message.error('获取天平失败') Message.error('获取天平失败')
return
}
let data = res.data
if (data.code !== 200) {
Message.error(data.msg || '获取天平数据失败')
return
val.message = '获取天平失败'
} else {
let data = res.data
if (data.code !== 200) {
Message.error(data.msg || '获取天平数据失败')
val.message = data.msg || '获取天平数据失败'
} else {
val = parseBalanceData(data.data, dw)
// alert('parseBalanceData返回:' + JSON.stringify(val))
debugger
}
} }
val = parseBalanceData(data.data)
debugger
}) })
debugger debugger
return await val return await val
} }
export async function getPh(cmd, format, comPort, baudRate, byteSize, parity) {
let val = {}
let url = `http://localhost/tpphurl/api/v1/ph/value?cmd=12&format=hex&comPort=COM1&baudRate=9600&byteSize=8&parity=N`
// let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/ph/value?cmd=${cmd}&format=${format}&comPort=${comPort}&baudRate=${baudRate}&byteSize=${byteSize}&parity=${parity}`
export async function getPh(obj) {
return {
success: true,
value: '900',
message: ''
}
let yq = obj.yq
let val = { success: false, value: '', message: '未获取到PH数据' }
// let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/ph/value?cmd=12&format=hex&comPort=COM1&baudRate=9600&byteSize=8&parity=N`
let url = `http://127.0.0.1:${localStorage.getItem('sb_port')}/api/v1/ph/value?cmd=${yq.cmdHex}&format=hex&comPort=${yq.serialPort}&baudRate=${yq.baudRate}&byteSize=${yq.byteSize}&parity=${yq.parity}`
await axios await axios
.get( .get(
url, url,
@ -60,28 +85,30 @@ export async function getPh(cmd, format, comPort, baudRate, byteSize, parity) {
debugger debugger
if (res.status !== 200) { if (res.status !== 200) {
Message.error('获取PH失败') Message.error('获取PH失败')
return
}
let data = res.data
if (data.code !== 200) {
Message.error(data.msg || '获取PH数据失败')
return
val.message = '获取PH失败'
} else {
let data = res.data
if (data.code !== 200) {
Message.error(data.msg || '获取PH数据失败')
val.message = data.msg || '获取PH数据失败'
} else {
val = extractPHValue(data.data)
debugger
}
} }
val = parseBalanceData(data.data)
debugger
}) })
debugger debugger
return await val return await val
} }
export function parseBalanceData(rawData, targetUnit = 'g', precision) {
export function parseBalanceData(rawData, unit, precision) {
// 初始化返回结果,固定字段结构 // 初始化返回结果,固定字段结构
const result = { const result = {
success: false, success: false,
value: '',
originalValue: '', originalValue: '',
originalUnit: '', originalUnit: '',
targetUnit: targetUnit.toLowerCase(),
value: '',
unit: '',
message: '' message: ''
} }
@ -145,6 +172,7 @@ export function parseBalanceData(rawData, targetUnit = 'g', precision) {
// 赋值到结果对象 // 赋值到结果对象
result.originalValue = originalValue result.originalValue = originalValue
result.originalUnit = originalUnit result.originalUnit = originalUnit
result.unit = unit || originalUnit
result.message = `【解析成功】匹配到${matchedFormat.desc},提取数值:${originalValue},单位:${originalUnit}` result.message = `【解析成功】匹配到${matchedFormat.desc},提取数值:${originalValue},单位:${originalUnit}`
// 7. 数值有效性校验 // 7. 数值有效性校验
@ -155,10 +183,8 @@ export function parseBalanceData(rawData, targetUnit = 'g', precision) {
} }
// 8. 单位换算核心逻辑 // 8. 单位换算核心逻辑
const unitToGram = { g: 1, kg: 1000 }
const originalCoeff = unitToGram[result.originalUnit] || 1
const targetCoeff = unitToGram[result.targetUnit] || 1
let convertedValue = (num * originalCoeff) / targetCoeff
let convertedValue =
result.unit === originalUnit ? num : convertUnit(num, originalUnit, unit)
// 9. 数值格式化:保留原始精度(仅当传入precision时,按指定位数截取,不四舍五入) // 9. 数值格式化:保留原始精度(仅当传入precision时,按指定位数截取,不四舍五入)
if (typeof precision === 'number' && precision >= 0) { if (typeof precision === 'number' && precision >= 0) {
@ -180,10 +206,10 @@ export function parseBalanceData(rawData, targetUnit = 'g', precision) {
// 11. 优化提示信息 // 11. 优化提示信息
const baseMsg = result.message.replace('【解析成功】', '【成功】') const baseMsg = result.message.replace('【解析成功】', '【成功】')
if (result.originalUnit === result.targetUnit) {
result.message = `${baseMsg} → 最终值:${result.value} ${result.targetUnit}`
if (result.originalUnit === result.unit) {
result.message = `${baseMsg} → 最终值:${result.value} ${result.unit}`
} else { } else {
result.message = `${baseMsg} → 换算至${result.targetUnit}${result.value} ${result.targetUnit}`
result.message = `${baseMsg} → 换算至${result.unit}${result.value} ${result.unit}`
} }
} catch (error) { } catch (error) {
result.message = `【系统错误】解析换算失败:${error.message}` result.message = `【系统错误】解析换算失败:${error.message}`
@ -193,6 +219,21 @@ export function parseBalanceData(rawData, targetUnit = 'g', precision) {
return result return result
} }
export function convertUnit(num, originalUnit, targetUnit) {
// 8. 单位换算核心逻辑
const unitToGram = {
pg: 1,
ug: 1000,
ng: 1000000,
mg: 1000000000,
g: 1000000000000,
kg: 1000000000000000
}
const originalCoeff = unitToGram[originalUnit] || 1
const targetCoeff = unitToGram[targetUnit] || originalCoeff
return (num * originalCoeff) / targetCoeff
}
export function extractPHValue(rawData) { export function extractPHValue(rawData) {
const result = { const result = {
success: false, success: false,

+ 130
- 50
src/views/business/comps/common/JcgjList.vue View File

@ -1,11 +1,12 @@
<template> <template>
<div class="jcgjList"> <div class="jcgjList">
<div class="jcgjList-keywords" v-if="!readonly"> <div class="jcgjList-keywords" v-if="!readonly">
<el-input v-model="queryParams.jcmc" clearable :placeholder="$t('form.placeholderInput')" @keyup.enter.native="handleQuery">
<el-input v-model="queryParams.jcmc" clearable :placeholder="$t('form.placeholderInput')"
@keyup.enter.native="handleQuery">
<el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button>
</el-input> </el-input>
</div> </div>
<div class="jcgjList-jcgjlx" v-if="!readonly">
<div class="jcgjList-jcgjlx" v-if="!readonly">
<el-radio-group v-model="queryParams.jcgjlx" @change="handleQuery"> <el-radio-group v-model="queryParams.jcgjlx" @change="handleQuery">
<el-radio-button :label="-1">{{ $t('page.business.study.study.qb') }}</el-radio-button> <el-radio-button :label="-1">{{ $t('page.business.study.study.qb') }}</el-radio-button>
<el-radio-button :label="1" v-if="showLc">{{ $t('page.business.study.study.lc') }}</el-radio-button> <el-radio-button :label="1" v-if="showLc">{{ $t('page.business.study.study.lc') }}</el-radio-button>
@ -18,35 +19,54 @@
</div> </div>
<div class="jcgjList-content "> <div class="jcgjList-content ">
<el-timeline style="margin-left: -30px;"> <el-timeline style="margin-left: -30px;">
<el-timeline-item placement="top" v-for="(item, index) in list" :key="index" :color="item.color">
<div class="jcgjList-title no-break">
<div class="jcgjList-jcmc" :style="'color:' + item.color">{{ $i18n.locale === 'zh_CN'?item.jcmc:item.jcmcEn }}</div>
<div>{{ item.createTime }}</div>
</div>
<div class="jcglList-jcnr no-break">
<template v-if="$i18n.locale === 'zh_CN'">
<div v-for="(pitem, pindex) in item.jcnrList" :key="pindex">
{{ pitem.name }}{{ pitem.value }}
<el-timeline-item placement="top" v-for="(item, index) in list" :key="index" :color="item.color">
<div class="jcgjList-title no-break">
<div class="jcgjList-jcmc" :style="'color:' + item.color">{{ $i18n.locale === 'zh_CN' ? item.jcmc : item.jcmcEn
}}</div>
<div>{{ item.createTime }}</div>
</div>
<div class="jcglList-jcnr no-break" >
<template v-if="$i18n.locale === 'zh_CN'">
<div v-for="(pitem, pindex) in item.jcnrList" :key="pindex">
<span v-if="pitem.name != 'url' && pitem.name != 'oldUrl'">
{{ pitem.name }}
<template v-if="pitem.value && pitem.value != ''">
<span v-for="(ppitem, ppindex) in pitem.value.split(';')" :key="ppindex"
>
<a v-if="openFile(ppindex, pitem, item)!=''" :href="openFile(ppindex, pitem, item)" target="_black" style="cursor: pointer;text-decoration: underline;color:#1890ff;margin-right: 5px;">{{ ppitem }}</a>
<span v-else >{{ ppitem }};</span>
</span>
</template>
</span>
</div>
</template>
<template v-else>
<div v-for="(pitem, pindex) in item.jcnrListEn" :key="pindex">
<span v-if="pitem.name != 'url' && pitem.name != 'oldUrl'">
{{ pitem.name }}
<template v-if="pitem.value && pitem.value != ''">
<span v-for="(ppitem, ppindex) in pitem.value.split(';')" :key="ppindex"
>
<a v-if="openFileEn(ppindex, pitem, item)!=''" :href="openFileEn(ppindex, pitem, item)" target="_black" style="cursor: pointer;text-decoration: underline;color:#1890ff;margin-right: 5px;">{{ ppitem }}</a>
<span v-else >{{ ppitem }};</span>
</span>
</template>
</span>
</div>
</template>
<div v-if="item.remark && item.remark !== ''">
{{ $t('form.remark') }}{{ item.remark }}
</div> </div>
</template>
<template v-else>
<div v-for="(pitem, pindex) in item.jcnrListEn" :key="pindex">
{{ pitem.name }}{{ pitem.value }}
<div v-if="item.qmrId && item.qmrId > 0">
{{ $t('form.qmyy') }}{{ $i18n.locale === 'zh_CN' ? item.jcmc : item.jcmcEn }}
</div>
<div v-if="item.qmrId && item.qmrId > 0">
<!-- {{$t('form.signer')}}{{ $i18n.locale === 'zh_CN'?item.qmrMc:item.qmrMcEn }} -->
{{ $t('form.signer') }}{{ item.qmrMc }}
</div> </div>
</template>
<div v-if="item.remark&&item.remark!==''">
{{$t('form.remark')}}{{ item.remark }}
</div>
<div v-if="item.qmrId&&item.qmrId>0">
{{$t('form.qmyy')}}{{ $i18n.locale === 'zh_CN'?item.jcmc:item.jcmcEn }}
</div>
<div v-if="item.qmrId&&item.qmrId>0">
<!-- {{$t('form.signer')}}{{ $i18n.locale === 'zh_CN'?item.qmrMc:item.qmrMcEn }} -->
{{$t('form.signer')}}{{ item.qmrMc }}
</div> </div>
</div>
</el-timeline-item>
</el-timeline>
</el-timeline-item>
</el-timeline>
</div> </div>
</div> </div>
</template> </template>
@ -55,35 +75,35 @@
export default { export default {
name: "JcgjList", name: "JcgjList",
components: {}, components: {},
props:{
showRy:{
type:Boolean,
default:false
props: {
showRy: {
type: Boolean,
default: false
}, },
showXg:{
type:Boolean,
default:false
showXg: {
type: Boolean,
default: false
}, },
showLc:{
type:Boolean,
default:true
showLc: {
type: Boolean,
default: true
}, },
showBj:{
type:Boolean,
default:true
showBj: {
type: Boolean,
default: true
}, },
showBcsm:{
type:Boolean,
default:false
showBcsm: {
type: Boolean,
default: false
}, },
// //
showLj: { showLj: {
type:Boolean,
default:false
type: Boolean,
default: false
}, },
readonly: { readonly: {
type:Boolean,
default:false
type: Boolean,
default: false
}, },
}, },
data() { data() {
@ -96,11 +116,71 @@ export default {
}; };
}, },
mounted() { mounted() {
this.list=[]
this.list = []
}, },
methods: { methods: {
openFileEn(ppindex, pitem, item) {
let result=''
if (pitem.name == 'Old Value') {
let _oldUrl = ""
for (var i = 0; i < item.jcnrList.length; i++) {
if (item.jcnrList[i].name == 'oldUrl') {
_oldUrl = item.jcnrList[i].value
break;
}
}
if (_oldUrl && _oldUrl != '') {
let oldUrl = _oldUrl.split(";")
result=process.env.VUE_APP_FILE_DOMAIN +oldUrl[ppindex]
}
}
if (pitem.name == 'New Value') {
let _url = ""
for (var i = 0; i < item.jcnrList.length; i++) {
if (item.jcnrList[i].name == 'url') {
_url = item.jcnrList[i].value
break;
}
}
if (_url && _url != '') {
let url = _url.split(";")
result=process.env.VUE_APP_FILE_DOMAIN +url[ppindex];
}
}
return result;
},
openFile(ppindex, pitem, item) {
let result=''
if (pitem.name == '原值') {
let _oldUrl = ""
for (var i = 0; i < item.jcnrList.length; i++) {
if (item.jcnrList[i].name == 'oldUrl') {
_oldUrl = item.jcnrList[i].value
break;
}
}
if (_oldUrl && _oldUrl != '') {
let oldUrl = _oldUrl.split(";")
result=process.env.VUE_APP_FILE_DOMAIN +oldUrl[ppindex]
}
}
if (pitem.name == '新值') {
let _url = ""
for (var i = 0; i < item.jcnrList.length; i++) {
if (item.jcnrList[i].name == 'url') {
_url = item.jcnrList[i].value
break;
}
}
if (_url && _url != '') {
let url = _url.split(";")
result=process.env.VUE_APP_FILE_DOMAIN +url[ppindex];
}
}
return result;
},
handleQuery() { handleQuery() {
this.$emit('handleQuery',this.queryParams)
this.$emit('handleQuery', this.queryParams)
}, },
init(val) { init(val) {
let that = this let that = this

+ 19
- 4
src/views/business/comps/select/SelectBalanceValue.vue View File

@ -21,6 +21,7 @@
<script> <script>
import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog'; import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog';
import { getBalance } from "@/utils/tpph";
export default { export default {
name: "SelectBalanceValue", name: "SelectBalanceValue",
components: {SelectInstrumentDialog}, components: {SelectInstrumentDialog},
@ -45,7 +46,9 @@ export default {
data() { data() {
return { return {
tpName: '', tpName: '',
tpz: ''
tpz: '',
yq:{}
}; };
}, },
mounted() { mounted() {
@ -55,10 +58,22 @@ export default {
this.$refs.selectInstrumentDialog.show() this.$refs.selectInstrumentDialog.show()
}, },
selectInstrumentChange(val,row){ selectInstrumentChange(val,row){
this.tpName=row.mc
this.tpName=row.mc
this.yq = row
}, },
getBalanceValue() {
alert('todo')
async getBalanceValue() {
if(!this.yq || !this.yq.bh){
this.$message.error('请选择仪器')
return
}
this.tpz = ''
let x = await getBalance({yq:this.yq,dw:this.dw})
if(x && x.success){
this.tpz = x.value
}else{
this.$message.error(x.message || '获取值失败')
}
this.tpzChange()
}, },
tpzChange() { tpzChange() {
this.$emit('change', this.tpz) this.$emit('change', this.tpz)

+ 1
- 1
src/views/business/comps/template/comps/dl/DL011.vue View File

@ -422,7 +422,7 @@ export default {
tmpResource, tmpResource,
stepResource.sjResource || [] stepResource.sjResource || []
) )
this.yqResourceTmp = uniqeYqOne(tmpYq, stepResource.yqResource || [])
this.yqResourceTmp = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp return this.resourceTmp
}, },
// //

+ 1
- 1
src/views/business/comps/template/comps/dl/DL012.vue View File

@ -454,7 +454,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 = uniqeYqOne(tmpYq, stepResource.yqResource || [])
this.yqResourceTmp = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp; return this.resourceTmp;
}, },
// //

+ 1
- 15
src/views/business/comps/template/comps/gsp/GSP002.vue View File

@ -126,7 +126,7 @@ export default {
}, },
// //
baseInfoFormConfig() { baseInfoFormConfig() {
return this.sn==='GG006'?[
return this.sn==='GSP002' || this.sn==='GG006' ?[
{ {
type: 'cardItem', type: 'cardItem',
config: { config: {
@ -166,20 +166,6 @@ export default {
} }
}, },
{ {
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
containerMaterial: {
label: 'template.sp.sp00456.rqcz',
type: 'select',
options: this.getDictOptions('business_rqcz'),
fillType: 'actFill',
multiple: true,
otherCode: 'containerMaterialOther'
}
}
},
{
type: 'cellItem', type: 'cellItem',
label: 'template.common.configurationTime', label: 'template.common.configurationTime',
config: { config: {

+ 29
- 3
src/views/business/comps/template/comps/lba/LBA008.vue View File

@ -26,7 +26,8 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps">
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps"
@clickButton="handleClickButton">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -60,8 +61,9 @@ import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLBA008Config } from "../../formConfig/lba/lba008.js"; import { getLBA008Config } from "../../formConfig/lba/lba008.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals,uniqeYqOne } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog' import ImportExcelDialog from '../../dialog/ImportExcelDialog'
import { getBalance } from '@/utils/tpph.js';
export default { export default {
name: "LBA008", name: "LBA008",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog },
@ -307,9 +309,12 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
let formData = this.formData;
//resource //resource
let tmpResource = [] let tmpResource = []
let tmpYq = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
@ -344,10 +349,14 @@ export default {
if (tmpResource.length > 0) { if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource) tmpResource = uniqeResourceOne(tmpResource)
} }
//使
tmpYq.push(content.selectInfo_dztpbh || formData.selectInfo_dztpbh)
//使 //使
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 = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp; return this.resourceTmp;
}, },
// //
@ -363,6 +372,23 @@ export default {
stepTableRef.deleteRow(rowIndex); stepTableRef.deleteRow(rowIndex);
} }
}, },
//
async handleClickButton(e, rowIndex,colIndex,ee,data) {
if(e==='cqzlBtn'){
const content = this.getFilledFormData()
let formData = this.formData;
let qy = content.yqInfo_dztpbh || formData.yqInfo_dztpbh
let dw = content.headerSelectFields.cqzlUnit
let x = await getBalance({yq:qy,dw:dw})
if(x && x.success){
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { cqzl: x.value },{signData:data,updateFields:['cqzl']});
}else{
this.$message.error(x.message || '称量失败')
}
}
},
} }
}; };

+ 28
- 3
src/views/business/comps/template/comps/pcr/PCR007.vue View File

@ -27,7 +27,7 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'" :showOperation="fillType === 'preFill'"
fieldItemLabel="template.common.operationSteps">
fieldItemLabel="template.common.operationSteps" @clickButton="handleClickButton">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -61,8 +61,9 @@ import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getPCR007Config } from "../../formConfig/PCRTableConfig.js"; import { getPCR007Config } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals,uniqeYqOne } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog' import ImportExcelDialog from '../../dialog/ImportExcelDialog'
import { getBalance } from '@/utils/tpph.js';
export default { export default {
name: "PCR005", name: "PCR005",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog },
@ -236,9 +237,12 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
let formData = this.formData;
//resource //resource
let tmpResource = [] let tmpResource = []
let tmpYq = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
@ -249,10 +253,14 @@ export default {
if (tmpResource.length > 0) { if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource) tmpResource = uniqeResourceOne(tmpResource)
} }
//使
tmpYq.push(content.selectInfo_solution || formData.selectInfo_solution)
//使 //使
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 = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp; return this.resourceTmp;
}, },
// //
@ -267,6 +275,23 @@ export default {
stepTableRef.deleteRow(rowIndex); stepTableRef.deleteRow(rowIndex);
} }
}, },
//
async handleClickButton(e, rowIndex,colIndex,ee,data) {
if(e==='targetDiluentVolumePrecision'){
const content = this.getFilledFormData()
let formData = this.formData;
let qy = content.yqInfo_solution || formData.yqInfo_solution
let dw = content.headerSelectFields.cjgzlUnit
let x = await getBalance({yq:qy,dw:dw})
if(x && x.success){
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { cjgzl: x.value },{signData:data,updateFields:['cjgzl']});
}else{
this.$message.error(x.message || '称量失败')
}
}
},
} }
}; };

+ 31
- 3
src/views/business/comps/template/comps/pcr/PCR008.vue View File

@ -25,7 +25,8 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showCheckAll="true" @selectionChange="handleSelectionChange" :showCheckAll="true" @selectionChange="handleSelectionChange"
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps">
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps"
@clickButton="handleClickButton">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -58,8 +59,9 @@ import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getPCR008Config } from "../../formConfig/PCRTableConfig.js"; import { getPCR008Config } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals,uniqeYqOne } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog' import ImportExcelDialog from '../../dialog/ImportExcelDialog'
import { getBalance } from '@/utils/tpph.js';
export default { export default {
name: "PCR008", name: "PCR008",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog },
@ -368,9 +370,13 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
let formData = this.formData;
//resource //resource
let tmpResource = [] let tmpResource = []
let tmpYq = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
//使 //使
tmpResource.push({ tmpResource.push({
@ -395,10 +401,14 @@ export default {
if (tmpResource.length > 0) { if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource) tmpResource = uniqeResourceOne(tmpResource)
} }
//使
tmpYq.push(content.selectInfo_dztpbh || formData.selectInfo_dztpbh)
//使 //使
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 = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp; return this.resourceTmp;
}, },
// //
@ -414,6 +424,24 @@ export default {
stepTableRef.deleteRow(rowIndex); stepTableRef.deleteRow(rowIndex);
} }
}, },
//
async handleClickButton(e, rowIndex,colIndex,ee,data) {
debugger
if(e==='lzzgzBtn'){
const content = this.getFilledFormData()
let formData = this.formData;
let qy = content.yqInfo_dztpbh || formData.yqInfo_dztpbh
let dw = content.headerSelectFields.lzzgzUnit
let x = await getBalance({yq:qy,dw:dw})
if(x && x.success){
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { lzzgz: x.value },{signData:data,updateFields:['lzzgz']});
}else{
this.$message.error(x.message || '称量失败')
}
}
},
} }
}; };

+ 29
- 3
src/views/business/comps/template/comps/pcr/PCR010.vue View File

@ -26,7 +26,8 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps">
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps"
@clickButton="handleClickButton">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> @deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@ -60,8 +61,9 @@ import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getPCR010Config } from "../../formConfig/PCRTableConfig.js"; import { getPCR010Config } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals,uniqeYqOne } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog' import ImportExcelDialog from '../../dialog/ImportExcelDialog'
import { getBalance } from '@/utils/tpph.js';
export default { export default {
name: "PCR005", name: "PCR005",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog },
@ -288,9 +290,12 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
let formData = this.formData;
//resource //resource
let tmpResource = [] let tmpResource = []
let tmpYq = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
@ -326,10 +331,14 @@ export default {
if (tmpResource.length > 0) { if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource) tmpResource = uniqeResourceOne(tmpResource)
} }
//使
tmpYq.push(content.selectInfo_dztpbh || formData.selectInfo_dztpbh)
//使 //使
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 = uniqeYqOne([...stepResource.yqResource || [],...tmpYq])
return this.resourceTmp; return this.resourceTmp;
}, },
// //
@ -345,6 +354,23 @@ export default {
stepTableRef.deleteRow(rowIndex); stepTableRef.deleteRow(rowIndex);
} }
}, },
//
async handleClickButton(e, rowIndex,colIndex,ee,data) {
if(e==='targetDiluentVolumePrecision'){
const content = this.getFilledFormData()
let formData = this.formData;
let qy = content.yqInfo_dztpbh || formData.yqInfo_dztpbh
let dw = content.headerSelectFields.cqzlUnit
let x = await getBalance({yq:qy,dw:dw})
if(x && x.success){
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { cqzl: x.value },{signData:data,updateFields:['cqzl']});
}else{
this.$message.error(x.message || '称量失败')
}
}
},
} }
}; };

+ 2
- 10
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -27,7 +27,7 @@
</CustomTable> </CustomTable>
</div> </div>
<LineLabel :label="getOperationStepsLabel()" /> <LineLabel :label="getOperationStepsLabel()" />
<div v-if="fillType === 'preFill' && !isPcr234 && !isGsp" class="mt-20">
<div v-if="fillType === 'preFill' && !isPcr234" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ <el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{
$t('template.common.xzpxpz') $t('template.common.xzpxpz')
}}</el-button> }}</el-button>
@ -35,11 +35,7 @@
$t('template.common.xzjtpz') $t('template.common.xzjtpz')
}}</el-button> }}</el-button>
</div> </div>
<div v-else-if="fillType === 'preFill' && isGsp" class="mt-20">
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{
$t('template.common.addBtn')
}}</el-button>
</div>
<!-- 阶梯配制区域 --> <!-- 阶梯配制区域 -->
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" <div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderConfig.id"> :key="'ladder_' + ladderConfig.id">
@ -63,7 +59,6 @@
:configType="'paralle'" :ref="`paralleRef_${paralleIndex}`" :configType="'paralle'" :ref="`paralleRef_${paralleIndex}`"
:fieldItemLabel="getTableLabel('paralle')" :fieldItemLabel="getTableLabel('paralle')"
:showHeader="!isPcr234" :showHeader="!isPcr234"
:showHeaderLabel="!isGsp"
@deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" /> @deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
</div> </div>
<template v-if="sn === 'LBA005'"> <template v-if="sn === 'LBA005'">
@ -261,9 +256,6 @@ export default {
"paralle": "template.common.pxpz",//线 "paralle": "template.common.pxpz",//线
"ladder": "template.common.jtpz",// "ladder": "template.common.jtpz",//
} }
if(this.isGsp){
return "";
}
return obj[type] || '';// return obj[type] || '';//
}, },
// //

+ 10
- 11
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -54,6 +54,7 @@ export default {
TableOpertaion, TableOpertaion,
BaseInfoFormPackage, BaseInfoFormPackage,
}, },
inject:["templateData"],
name: "LadderConfig", name: "LadderConfig",
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
@ -342,9 +343,9 @@ export default {
const { rowData } = val; const { rowData } = val;
let postData = { let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
studySubjectId: this.templateData.studySubjectId,
studyId: this.templateData.studyId,
studyFormId: this.templateData.id,
} }
this.startConfigRequest(postData); this.startConfigRequest(postData);
}, },
@ -358,9 +359,9 @@ export default {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,// nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
studySubjectId: this.templateData.studySubjectId,
studyId: this.templateData.studyId,
studyFormId: this.templateData.id,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
} }
@ -379,14 +380,12 @@ export default {
} }
}) })
let postData = { let postData = {
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
studyId: this.templateData.studyId,
studyFormId: this.templateData.id,
bh: mybh, bh: mybh,
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
studySubjectId: this.templateData.studySubjectId,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);

+ 46
- 4
src/views/business/comps/template/dialog/SelectInstrumentDialog.vue View File

@ -7,6 +7,12 @@
:listApi="listApi" :listApi="listApi"
:selectedCode="selectedCode" :selectedCode="selectedCode"
@radioSelect="handleSelect"/> @radioSelect="handleSelect"/>
<div class="other-reagent">
<el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox>
<el-input class="other-reagent-input" v-model="otherReagent"></el-input>
</div>
<template slot="footer" class="dialog-footer"> <template slot="footer" class="dialog-footer">
<el-button @click="onCancel">{{$t('form.cancel')}}</el-button> <el-button @click="onCancel">{{$t('form.cancel')}}</el-button>
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button> <el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button>
@ -86,10 +92,19 @@ export default {
currentRow: {}, currentRow: {},
studyFormId:'',//studyFormId studyFormId:'',//studyFormId
uuid:'',//eventBusid, uuid:'',//eventBusid,
otherChecked: false,
otherReagent: "",//
} }
}, },
computed: { computed: {
isDisabled() { isDisabled() {
if (this.otherChecked && this.otherReagent) {//
return false;
}else if(this.checkType === "checkbox"){
console.log(this.currentRow,"this.currentRow")
return !this.currentRow || this.currentRow.length === 0;
}
return !this.selectedId; return !this.selectedId;
} }
}, },
@ -106,28 +121,45 @@ export default {
} }
}, 10); }, 10);
this.studyFormId = studyFormId this.studyFormId = studyFormId
this.otherChecked = false;
this.otherReagent = "";
}, },
onCancel() { onCancel() {
this.visible = false this.visible = false
this.$emit('cancel'); this.$emit('cancel');
}, },
onSubmit() { onSubmit() {
let row = this.currentRow;
this.$emit('submit', this.selectedId,row);
const selectInfo = {
let row = this.otherChecked ? {bh: this.otherReagent}:this.currentRow;
const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId;
this.$emit('submit', selectedValue,row);
const selectInfo = this.otherChecked ?{
mc: "",
bh: row.bh,
xh: "",
jzrq: "",
}: {
mc: row.mc, mc: row.mc,
bh: row.bh, bh: row.bh,
xh: row.xh, xh: row.xh,
jzrq: row.jzrq, jzrq: row.jzrq,
} }
// eventBus // eventBus
EventBus.$emit("onInstrumentSubmit",{selectInfo,uuid:this.uuid,selectedId:this.selectedId,row});
EventBus.$emit("onInstrumentSubmit",{selectInfo,uuid:this.uuid,selectedId:selectedValue,row,type:"yq"});
this.visible = false; this.visible = false;
}, },
handleSelect(code,row) { handleSelect(code,row) {
this.selectedId = code; this.selectedId = code;
this.currentRow = row; this.currentRow = row;
}, },
handleOtherChange(val) {
this.otherChecked = val;
if (val) {//id
this.selectedId = "";
this.currentRow = null;
}
},
} }
} }
</script> </script>
@ -138,4 +170,14 @@ export default {
align-items: center; align-items: center;
padding: 20px 0; padding: 20px 0;
} }
.other-reagent {
display: flex;
align-items: center;
padding: 20px 0;
}
.other-reagent-input {
width: 200px;
margin-left: 5px;
}
</style> </style>

+ 17
- 3
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -13,7 +13,7 @@
<!-- 只有步骤才会又这个选项 --> <!-- 只有步骤才会又这个选项 -->
<!-- xb+xj也会 --> <!-- xb+xj也会 -->
<div v-if="sourceFrom === 'step' || selectType==='9' || selectType==='11'" class="other-reagent">
<div v-if="sourceFrom === 'step' || selectType==='1' || selectType==='3' || selectType==='7' || selectType==='9' || selectType==='11'" class="other-reagent">
<el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox> <el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox>
<el-input class="other-reagent-input" v-model="otherReagent"></el-input> <el-input class="other-reagent-input" v-model="otherReagent"></el-input>
</div> </div>
@ -179,9 +179,23 @@ export default {
this.$emit('cancel'); this.$emit('cancel');
}, },
onSubmit() { onSubmit() {
let row = this.currentRow;
let row = this.otherChecked ? {bh: this.otherReagent}:this.currentRow;
const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId; const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId;
const selectInfo = this.otherChecked ?{}:{
const selectInfo = this.otherChecked ?{
mc: "",
bh: row.bh,
nd: "",
ly: "",
nddw: "",
sxrq: "",
yxq: "",
ndz: "",
type: Number(this.selectType),
kc: "",
kcdw: "",
gg: "",
ggdw: "",
}:{
mc: row.mc, mc: row.mc,
bh: row.bh, bh: row.bh,
nd: row.nd, nd: row.nd,

+ 9
- 3
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="分装(分装后的编号可用于下一步关联选择)" append-to-body
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="分装" append-to-body
:visible.sync="visible" @close="close" width="1100px"> :visible.sync="visible" @close="close" width="1100px">
<div class="dialog-content"> <div class="dialog-content">
<div class="header-container"> <div class="header-container">
@ -12,9 +12,12 @@
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">分装数量</div> <div class="header-title">分装数量</div>
<HandleFormItem :isFieldsRecord="false" :fieldKey="formData.mybh +id+ '_fzsl'" @blur="onBlurFzsl"
<div class="item-center">
<HandleFormItem :isFieldsRecord="false" :fieldKey="formData.mybh +id+ '_fzsl'"
:item="integerInputNumberItem" type="inputNumber" :error="formErrors.fzsl" :item="integerInputNumberItem" type="inputNumber" :error="formErrors.fzsl"
v-model="formData.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 class="content-container"> <div class="content-container">
@ -480,7 +483,10 @@ export default {
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px;
} }
.item-center{
display: flex;
align-items: center;
}
.header-title { .header-title {
margin-bottom: 10px; margin-bottom: 10px;
} }

+ 14
- 14
src/views/business/comps/template/formConfig/PCRTableConfig.js View File

@ -743,7 +743,7 @@ export const getPCR007Config = ($this) => {
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'cjgzlUnit', headerSelectKey: 'cjgzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
headerOptions: $this.getDictOptions('business_zldw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType: 'button', bodySubType: 'button',
@ -779,7 +779,7 @@ export const getPCR008Config = ($this) => {
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'cjgzUnit', headerSelectKey: 'cjgzUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
headerOptions: $this.getDictOptions('business_zldw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10 bodyMaxlength: 10
@ -791,10 +791,11 @@ export const getPCR008Config = ($this) => {
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'lzzgzUnit', headerSelectKey: 'lzzgzUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
headerOptions: $this.getDictOptions('business_zldw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubKey: 'lzzgzBtn',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType: 'button', bodySubType: 'button',
bodySubButtonName: 'form.hqz', bodySubButtonName: 'form.hqz',
@ -808,7 +809,7 @@ export const getPCR008Config = ($this) => {
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'zzzlUnit', headerSelectKey: 'zzzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
headerOptions: $this.getDictOptions('business_zldw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
@ -939,7 +940,7 @@ export const getPCR010Config = ($this) => {
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'cqzlUnit', headerSelectKey: 'cqzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
headerOptions: $this.getDictOptions('business_zldw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType: 'button', bodySubType: 'button',
@ -954,7 +955,7 @@ export const getPCR010Config = ($this) => {
bodySubPlaceholder: 'template.common.xswsPlaceholder' bodySubPlaceholder: 'template.common.xswsPlaceholder'
}, },
{ {
label: 'template.pcr.pcr009.ysyjryjrl',
label: 'template.pcr.pcr010.ysyjryjrl',
prop: 'ysyjryjrl', prop: 'ysyjryjrl',
width: 280, width: 280,
showWidth: 180, showWidth: 180,
@ -975,7 +976,7 @@ export const getPCR010Config = ($this) => {
headerSelectTo: 'actStartSolutionVolumeUnit' headerSelectTo: 'actStartSolutionVolumeUnit'
}, },
{ {
label: 'template.pcr.pcr009.sjyjryjrl',
label: 'template.pcr.pcr010.sjyjryjrl',
prop: 'sjyjryjrl', prop: 'sjyjryjrl',
width: 280, width: 280,
showWidth: 180, showWidth: 180,
@ -1013,7 +1014,7 @@ export const getPCR011Config = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true,
bodyDisabled: true
}, },
{ {
label: 'template.pcr.pcr011.sjypjytj', label: 'template.pcr.pcr011.sjypjytj',
@ -1025,9 +1026,9 @@ export const getPCR011Config = ($this) => {
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10,
bodyMaxlength: 10
}, },
{
{
label: 'template.pcr.pcr011.yssjjrtj', label: 'template.pcr.pcr011.yssjjrtj',
prop: 'yssjjrtj', prop: 'yssjjrtj',
width: 280, width: 280,
@ -1037,7 +1038,7 @@ export const getPCR011Config = ($this) => {
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10,
bodyMaxlength: 10
}, },
{ {
label: 'template.pcr.pcr011.sjsjjrtj', label: 'template.pcr.pcr011.sjsjjrtj',
@ -1049,8 +1050,7 @@ export const getPCR011Config = ($this) => {
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10,
},
bodyMaxlength: 10
}
] ]
} }

+ 6
- 5
src/views/business/comps/template/formConfig/lba/lba008.js View File

@ -8,7 +8,7 @@ export const getLBA008Config = ($this) => {
bodyType: 'input', bodyType: 'input',
fillType: 'preFill', fillType: 'preFill',
otherCode: 'bhOther', otherCode: 'bhOther',
bodyFillType: 'preFill',
bodyFillType: 'preFill'
}, },
{ {
label: 'template.lba.lba008.zzlx', label: 'template.lba.lba008.zzlx',
@ -18,7 +18,7 @@ export const getLBA008Config = ($this) => {
fillType: 'preFill', fillType: 'preFill',
bodyType: 'input', bodyType: 'input',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10,
bodyMaxlength: 10
}, },
{ {
label: 'template.lba.lba008.cqzl', label: 'template.lba.lba008.cqzl',
@ -31,13 +31,14 @@ export const getLBA008Config = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType: 'button', bodySubType: 'button',
bodySubKey: 'cqzlBtn',
bodySubButtonName: 'form.hqz', bodySubButtonName: 'form.hqz',
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubFillType: 'actFill', bodySubFillType: 'actFill',
subPrecision: 0, subPrecision: 0,
showBodySub: $this.fillType === 'actFill', showBodySub: $this.fillType === 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodySubPlaceholder: 'template.common.xswsPlaceholder'
}, },
{ {
label: 'template.lba.lba008.ysyjrybjrl', label: 'template.lba.lba008.ysyjrybjrl',
@ -58,7 +59,7 @@ export const getLBA008Config = ($this) => {
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: $this.fillType === 'preFill', bodyDisabled: $this.fillType === 'preFill',
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
headerSelectTo:"actStartSolutionVolumeUnit",
headerSelectTo: 'actStartSolutionVolumeUnit'
}, },
{ {
label: 'template.lba.lba008.sjyjrybjrl', label: 'template.lba.lba008.sjyjrybjrl',
@ -71,7 +72,7 @@ export const getLBA008Config = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
copyFrom: 'ysyjrybjrl', //复制哪个字段 copyFrom: 'ysyjrybjrl', //复制哪个字段
bodyMaxlength: 10,
bodyMaxlength: 10
} }
] ]
} }

+ 2
- 2
src/views/business/comps/template/formConfig/xb/xb001.js View File

@ -292,7 +292,7 @@ export const getStepFivth = ($this) => {
type: 'text' type: 'text'
}, },
yjwd: { yjwd: {
type: 'inputNumber',
type: 'input',
fillType: 'preFill' fillType: 'preFill'
}, },
text4: { text4: {
@ -300,7 +300,7 @@ export const getStepFivth = ($this) => {
type: 'text' type: 'text'
}, },
sjwd: { sjwd: {
type: 'inputNumber',
type: 'input',
fillType: 'actFill', fillType: 'actFill',
compareTo: 'yjwd', compareTo: 'yjwd',
copyFrom: 'yjwd' copyFrom: 'yjwd'

+ 2
- 3
src/views/business/comps/template/mixins/templateMixin.js View File

@ -192,7 +192,6 @@ export default {
this.formData = { ...this.formData, expireDate: end } this.formData = { ...this.formData, expireDate: end }
} }
console.log(this.formData, 'formData from templateData')
this.setTemplateData(v) this.setTemplateData(v)
} }
} }
@ -294,7 +293,7 @@ export default {
//试剂弹窗确认前 //试剂弹窗确认前
onBeforeReagentSubmit(data) { onBeforeReagentSubmit(data) {
const { selectData, callback, key, formFields } = data const { selectData, callback, key, formFields } = data
const { subTargetStartSolution, targetStartSolution } = formFields
const { subTargetStartSolution = "", targetStartSolution = "" } = formFields
const { nd } = selectData.row const { nd } = selectData.row
const sjndArr = nd.split('/') const sjndArr = nd.split('/')
const ytndArr = targetStartSolution.split('/') const ytndArr = targetStartSolution.split('/')
@ -308,7 +307,7 @@ export default {
} else if (nd === 'NA') { } else if (nd === 'NA') {
callback.prevent('当前实际浓度为NA,请重新选择') callback.prevent('当前实际浓度为NA,请重新选择')
} else if (ytndArr.length !== sjndArr.length) { } else if (ytndArr.length !== sjndArr.length) {
callback.prevent('起始溶液浓度和目标溶液浓度格式不一致,请重新输入')
callback.prevent('起始溶液浓度和目标溶液浓度格式不一致,请重新选择')
} }
}, },
getFormDataByTemplateData() { getFormDataByTemplateData() {

+ 27
- 24
src/views/business/study/comp/tbbd/Fh.vue View File

@ -48,18 +48,17 @@
<div class="line"></div> <div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div> <div class="subtitle"> {{ $t('page.business.study.studyFormFill.jcgj') }}</div>
</div> </div>
<JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showXg="true"/>
<JcgjList ref="jcgjList" @handleQuery="getJjcgjList" :showXg="true" />
<pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal" <pagination v-show="jcgjTotal > 0" small layout="prev, pager, next" :total="jcgjTotal"
@pagination="getJjcgjList" :page.sync="queryParamsJcgj.pageNum"
:limit.sync="queryParamsJcgj.pageSize"/>
@pagination="getJjcgjList" :page.sync="queryParamsJcgj.pageNum" :limit.sync="queryParamsJcgj.pageSize" />
</div> </div>
</div> </div>
</div> </div>
<el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body <el-dialog :title="$t(openTitle)" :visible.sync="openApprove" width="500px" append-to-body
:close-on-click-modal="false"> :close-on-click-modal="false">
<el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px" v-if="openApprove"> <el-form ref="formApprove" :model="formApprove" :rules="rulesApprove" label-width="120px" v-if="openApprove">
<div class="sbzdtcma"> <input type="text"> <input type="password" > </div>
<div class="sbzdtcma"> <input type="text"> <input type="password"> </div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('form.qmyy')" prop="qmyy"> <el-form-item :label="$t('form.qmyy')" prop="qmyy">
@ -97,8 +96,8 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="$t('form.password')" prop="qmrmm"> <el-form-item :label="$t('form.password')" prop="qmrmm">
<el-input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent show-password v-model="formApprove.qmrmm" maxlength="20"
:placeholder="$t('form.placeholderInput')" />
<el-input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent
show-password v-model="formApprove.qmrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -191,8 +190,8 @@ export default {
}, },
getJjcgjList(val) { getJjcgjList(val) {
this.$modal.loading() this.$modal.loading()
if(val){
this.queryParamsJcgj=_.merge({}, this.queryParamsJcgj, val)
if (val) {
this.queryParamsJcgj = _.merge({}, this.queryParamsJcgj, val)
} }
studyFormFill_jcgj(this.queryParamsJcgj).then(response => { studyFormFill_jcgj(this.queryParamsJcgj).then(response => {
this.jcgjList = response.rows this.jcgjList = response.rows
@ -234,22 +233,26 @@ export default {
}) })
}, },
async showApprove(qmyy) { async showApprove(qmyy) {
let content = await this.$refs.templateTable.getFormData()
if (content) {
this.openApprove = true
this.resetApprove()
this.formApprove.id = this.form.id
this.formApprove.bdnr = JSON.stringify(content)
this.formApprove.qmyy = qmyy
if (qmyy == '复核通过') {
this.openTitle = 'page.business.study.studyFormFill.fhtg'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.fhtg')
} else if (qmyy == '复核拒绝') {
this.openTitle = 'page.business.study.studyFormFill.fhjj'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.fhjj')
} else if (qmyy == '通过') {
this.openTitle = 'page.business.study.studyFormFill.tongguo'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.mfhtg')
if ((qmyy == '通过'||qmyy == '复核通过')&&!this.$refs.templateTable.isReply()) {
this.$modal.msgError("还有疑问项未回复");
} else {
let content = await this.$refs.templateTable.getFormData()
if (content) {
this.openApprove = true
this.resetApprove()
this.formApprove.id = this.form.id
this.formApprove.bdnr = JSON.stringify(content)
this.formApprove.qmyy = qmyy
if (qmyy == '复核通过') {
this.openTitle = 'page.business.study.studyFormFill.fhtg'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.fhtg')
} else if (qmyy == '复核拒绝') {
this.openTitle = 'page.business.study.studyFormFill.fhjj'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.fhjj')
} else if (qmyy == '通过') {
this.openTitle = 'page.business.study.studyFormFill.tongguo'
this.formApprove.qmyyMc = this.$t('page.business.study.studyFormFill.mfhtg')
}
} }
} }
}, },

+ 2
- 2
src/views/login.vue View File

@ -150,9 +150,9 @@ export default {
}; };
}, },
async testGetTpph() { async testGetTpph() {
let x = await getBalance()
let x = await getBalance({yq:{},dw:'kg'})
debugger debugger
let y = await getPh()
let y = await getPh({yq:{}})
debugger debugger
}, },
handleLogin() { handleLogin() {

+ 4
- 4
src/views/system/dept/index.vue View File

@ -59,8 +59,8 @@
<el-table-column prop="deptName" :label="$t('page.system.dept.name')"></el-table-column> <el-table-column prop="deptName" :label="$t('page.system.dept.name')"></el-table-column>
<el-table-column prop="abbr" :label="$t('page.system.dept.abbr')"></el-table-column> <el-table-column prop="abbr" :label="$t('page.system.dept.abbr')"></el-table-column>
<el-table-column prop="jc" label="简称" width="150" v-if="id==1 || id==2"></el-table-column>
<el-table-column prop="showInSubject" label="是否在学科显示" width="200" v-if="id==1 || id==2">
<el-table-column prop="jc" label="简称" width="150" v-if="id==2"></el-table-column>
<el-table-column prop="showInSubject" label="是否在学科显示" width="200" v-if="id==2">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.showInSubject===1"></span> <span v-if="scope.row.showInSubject===1"></span>
<span v-if="scope.row.showInSubject===10"></span> <span v-if="scope.row.showInSubject===10"></span>
@ -145,12 +145,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-if="id==1 || id==2">
<el-col :span="24" v-if="id==2">
<el-form-item label="简称:" prop="jc"> <el-form-item label="简称:" prop="jc">
<el-input v-model="form.jc" :placeholder="$t('form.placeholderInput')" :readonly="readonly" /> <el-input v-model="form.jc" :placeholder="$t('form.placeholderInput')" :readonly="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-if="id==1 || id==2">
<el-col :span="24" v-if="id==2">
<el-form-item label="是否在学科显示" prop="showInSubject"> <el-form-item label="是否在学科显示" prop="showInSubject">
<el-radio-group v-model="form.showInSubject" :disabled="readonly"> <el-radio-group v-model="form.showInSubject" :disabled="readonly">
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>

+ 26
- 4
src/views/system/role/index.vue View File

@ -10,7 +10,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('page.system.role.key')+':'" prop="roleKey">
<el-form-item :label="$t('page.system.role.key')+':'" prop="roleKey" v-if="id==2">
<el-input <el-input
v-model="queryParams.roleKey" v-model="queryParams.roleKey"
:placeholder="$t('form.placeholderInput')" :placeholder="$t('form.placeholderInput')"
@ -68,6 +68,17 @@
v-hasPermi="['system:role:export']" v-hasPermi="['system:role:export']"
>{{$t('form.export')}}</el-button> >{{$t('form.export')}}</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
@click="handleExportPermit"
v-hasPermi="['system:role:export']"
>{{$t('page.system.role.exporPermit')}}</el-button>
</el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
@ -98,7 +109,7 @@
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column label="角色编号" prop="roleId" width="120" /> --> <!-- <el-table-column label="角色编号" prop="roleId" width="120" /> -->
<el-table-column :label="$t('page.system.role.name')" prop="roleName" :show-overflow-tooltip="true" width="250" /> <el-table-column :label="$t('page.system.role.name')" prop="roleName" :show-overflow-tooltip="true" width="250" />
<el-table-column :label="$t('page.system.role.key')" prop="roleKey" :show-overflow-tooltip="true" width="250" />
<el-table-column :label="$t('page.system.role.key')" prop="roleKey" :show-overflow-tooltip="true" width="250" v-if="id==2" />
<el-table-column :label="$t('page.system.role.remark')" prop="remark" :show-overflow-tooltip="true" /> <el-table-column :label="$t('page.system.role.remark')" prop="remark" :show-overflow-tooltip="true" />
<!-- <el-table-column label="显示顺序" prop="roleSort" width="100" /> --> <!-- <el-table-column label="显示顺序" prop="roleSort" width="100" /> -->
<el-table-column :label="$t('page.system.role.status')" prop="status" :show-overflow-tooltip="true" width="150"> <el-table-column :label="$t('page.system.role.status')" prop="status" :show-overflow-tooltip="true" width="150">
@ -204,7 +215,7 @@
<el-form-item :label="$t('page.system.role.name')+':'" prop="roleName"> <el-form-item :label="$t('page.system.role.name')+':'" prop="roleName">
<el-input v-model="form.roleName" :placeholder="$t('form.placeholderInput')" :readonly="readonly" /> <el-input v-model="form.roleName" :placeholder="$t('form.placeholderInput')" :readonly="readonly" />
</el-form-item> </el-form-item>
<el-form-item prop="roleKey">
<el-form-item prop="roleKey" v-if="id==2">
<span slot="label"> <span slot="label">
<!-- <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> <!-- <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
<i class="el-icon-question"></i> <i class="el-icon-question"></i>
@ -315,6 +326,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect,allocatedUserList,authUserSetAll } from "@/api/system/role" import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect,allocatedUserList,authUserSetAll } from "@/api/system/role"
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu" import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
import Sign from '@/views/business/study/comp/sign.vue' import Sign from '@/views/business/study/comp/sign.vue'
@ -323,6 +335,11 @@ export default {
name: "Role", name: "Role",
dicts: ['sys_normal_disable'], dicts: ['sys_normal_disable'],
components:{Sign}, components:{Sign},
computed: {
...mapGetters([
'id'
]),
},
data() { data() {
return { return {
// //
@ -735,7 +752,12 @@ export default {
...this.queryParams ...this.queryParams
}, `role_${new Date().getTime()}.xlsx`) }, `role_${new Date().getTime()}.xlsx`)
}, },
handleExportPermit() {
this.saveSimpleLog({name:'',nameEn:'',jcmc:'角色权限导出',jcmcEn:'Role Permit Export'})
this.download('system/role/exportMenu', {
...this.queryParams
}, `rolePermit_${new Date().getTime()}.xlsx`)
},
transfer(row){ transfer(row){
allocatedUserList({roleId:row.roleId}).then(response => { allocatedUserList({roleId:row.roleId}).then(response => {
let list = [] let list = []

+ 8
- 2
src/views/system/user/index.vue View File

@ -119,8 +119,8 @@
v-hasPermi="['system:user:roleChange']" v-hasPermi="['system:user:roleChange']"
>{{$t('page.system.user.history')}}</el-button> >{{$t('page.system.user.history')}}</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
<el-dropdown @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
<el-button v-if="id==2" type="text" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
<el-dropdown v-if="id==2" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
<el-button type="text" icon="el-icon-d-arrow-right">更多</el-button> <el-button type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item> <el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
@ -291,6 +291,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect,roleChangeList,checkExist } from "@/api/system/user" import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect,roleChangeList,checkExist } from "@/api/system/user"
import { getToken } from "@/utils/auth" import { getToken } from "@/utils/auth"
import Treeselect from "@riophae/vue-treeselect" import Treeselect from "@riophae/vue-treeselect"
@ -303,6 +304,11 @@ export default {
name: "User", name: "User",
dicts: ['sys_normal_disable', 'sys_user_sex'], dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect, Splitpanes, Pane,Sign }, components: { Treeselect, Splitpanes, Pane,Sign },
computed: {
...mapGetters([
'id'
]),
},
data() { data() {
return { return {
// //

Loading…
Cancel
Save