Browse Source

feat:[模板管理][update]

luojie
luojie 3 weeks ago
parent
commit
f838632c14
3 changed files with 75 additions and 28 deletions
  1. +1
    -1
      src/components/Template/HandleFormItem.vue
  2. +48
    -27
      src/components/Template/StepComponents/pcr/hsypfz.vue
  3. +26
    -0
      src/components/Template/mixins/stepMixins.js

+ 1
- 1
src/components/Template/HandleFormItem.vue View File

@ -1202,7 +1202,7 @@ console.log("fillll")
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") { if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") {
console.log("需要电子签名") console.log("需要电子签名")
// EventBus // EventBus
// EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {// } else {//
this.handleUpdateRecord() this.handleUpdateRecord()
} }

+ 48
- 27
src/components/Template/StepComponents/pcr/hsypfz.vue View File

@ -1,6 +1,7 @@
<!-- 核酸样品分装 --> <!-- 核酸样品分装 -->
<template> <template>
<StepFormPackage @clickButton="onHandleClickButton" ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'pcr_hsypfz'" @resetRecord = "resetRecord" :form-config="formConfig" :formData="formData" />
<StepFormPackage @clickButton="onHandleClickButton" ref="stepFormPackageRef" :prefixKey="stepIndex + '_' + 'pcr_hsypfz'"
@resetRecord="resetRecord" :form-config="formConfig" :formData="formData" />
</template> </template>
<script> <script>
@ -10,14 +11,33 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default { export default {
mixins: [stepMixins], mixins: [stepMixins],
props: { props: {
sn: {
type: String,
default: 'hsypfz',
},
},
sn: {
type: String,
default: 'hsypfz',
},
},
components: { components: {
StepFormPackage StepFormPackage
}, },
mounted() {
this.getCode();
},
methods: {
async getCode() {
const { lbbhCode } = this.formData;
if (this.templateFillType === 'actFill') {
const stepFormData = this.getFilledFormData();
const { lbbh } = stepFormData;
const result = await this.getLatestSn({
count: 1,
type: 1,
pre: lbbh,
})
this.$refs.stepFormPackageRef.updateFormData("lbbhCode",result[0])
console.log(result,"reee")
}
}
},
computed: { computed: {
formConfig() { formConfig() {
return [{ return [{
@ -42,61 +62,62 @@ export default {
label: "吸取到离心管中,其体积预计为", label: "吸取到离心管中,其体积预计为",
type: "text", type: "text",
}, },
yjtj:{
yjtj: {
fillType: "preFill", fillType: "preFill",
type: "inputNumber", type: "inputNumber",
}, },
yjtjdw:{
yjtjdw: {
fillType: "preFill", fillType: "preFill",
type: "select", type: "select",
selectTo: "sjtjdw", selectTo: "sjtjdw",
options:this.getDictOptions('business_tjdw'),
options: this.getDictOptions('business_tjdw'),
}, },
text4:{
text4: {
label: "实际体积为", label: "实际体积为",
type: "text", type: "text",
}, },
sjtj:{
sjtj: {
fillType: "actFill", fillType: "actFill",
type: "inputNumber", type: "inputNumber",
compareTo:"yjtj",
copyFrom:"yjtj"
compareTo: "yjtj",
copyFrom: "yjtj"
}, },
sjtjdw:{
sjtjdw: {
fillType: "preFill", fillType: "preFill",
type: "select", type: "select",
options:this.getDictOptions('business_tjdw'),
options: this.getDictOptions('business_tjdw'),
}, },
text5:{
text5: {
label: "其编号为", label: "其编号为",
type: "text", type: "text",
}, },
lbbh:{
lbbh: {
fillType: "preFill", fillType: "preFill",
type: "input", type: "input",
}, },
text6:{
text6: {
label: "-", label: "-",
type: "text", type: "text",
}, },
//todo : //todo :
lbbhCode:{
lbbhCode: {
fillType: "actFill", fillType: "actFill",
type: "input", type: "input",
disabled: true,
}, },
text7:{
text7: {
label: ",进行分装", label: ",进行分装",
type: "text", type: "text",
}, },
//todo : //todo :
fzbutton:{
type:"button",
fzbutton: {
type: "button",
fillType: "actFill", fillType: "actFill",
fzType:"step",
buttonName:"分装",
maxVolumeField:"sjtj",
maxVolumeUnitField:"sjtjdw",
myCodeFields:["lbbh","lbbhCode"],
fzType: "step",
buttonName: "分装",
maxVolumeField: "sjtj",
maxVolumeUnitField: "sjtjdw",
myCodeFields: ["lbbh", "lbbhCode"],
}, },
} }
}] }]

+ 26
- 0
src/components/Template/mixins/stepMixins.js View File

@ -1,6 +1,8 @@
import { getuuid } from '@/utils/index.js'; import { getuuid } from '@/utils/index.js';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { getLatestSn, getLatestSnArr } from '@/api/template';
export default { export default {
inject: ['templateFillType'],
dicts: [ dicts: [
"business_tjdw", "business_czhj", "business_rqcz", "business_zldw", "business_tjdw", "business_czhj", "business_rqcz", "business_zldw",
"business_yqscdw", "business_zsdw", "business_wddw", "business_ccwz", "business_ggdw", "business_yqscdw", "business_zsdw", "business_wddw", "business_ccwz", "business_ggdw",
@ -20,6 +22,7 @@ export default {
data() { data() {
return { return {
uuid: getuuid(), uuid: getuuid(),
fzInfo:null,
} }
}, },
mounted() { mounted() {
@ -34,7 +37,29 @@ export default {
EventBus.$off("dialogSubPackageSubmit") EventBus.$off("dialogSubPackageSubmit")
EventBus.$off("subPackageDialogPrintTag") EventBus.$off("subPackageDialogPrintTag")
}, },
methods: { methods: {
//获取最新的多个编号
async getLatestSnArr(params) {
const res = await getLatestSnArr(params)
if (res.code === 200) {
return res.data
}
return []
},
async getLatestSn(params) {
const defaultParams = {
count: 1,
type:1,
pre: '',
}
const finalParams = {...defaultParams, ...params}
const res = await getLatestSn(finalParams)
if (res.code === 200) {
return res.data
}
return []
},
// 打印标签 // 打印标签
onPrintTag(data) { onPrintTag(data) {
this.$emit("printTag") this.$emit("printTag")
@ -42,6 +67,7 @@ export default {
onSubPackageSubmit(data) { onSubPackageSubmit(data) {
if (data.uuid === this.uuid) { if (data.uuid === this.uuid) {
console.log(data, "ddd") console.log(data, "ddd")
this.fzInfo = data;
//通知后端保存数据 //通知后端保存数据
const params = { const params = {
type: "fieldChanged", type: "fieldChanged",

Loading…
Cancel
Save