Browse Source

feat:[模板管理][update]

luojie
luojie 3 weeks ago
parent
commit
76abd89883
5 changed files with 60 additions and 6 deletions
  1. +2
    -0
      src/components/Template/CustomTable.vue
  2. +5
    -2
      src/components/Template/StepComponents/pcr/hsypfz.vue
  3. +3
    -3
      src/components/Template/StepFormPackage.vue
  4. +49
    -0
      src/components/Template/mixins/stepMixins.js
  5. +1
    -1
      src/components/Template/operation/TableOpertaion.vue

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

@ -224,6 +224,7 @@
<template v-else-if="col.bodySubType === 'button'"> <template v-else-if="col.bodySubType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)" <HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)"
:value="row[col.bodySubKey]" :value="row[col.bodySubKey]"
:fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
@clickButton="(e,val, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" /> @clickButton="(e,val, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template> </template>
<div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')"> <div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')">
@ -240,6 +241,7 @@
<template v-if="col.bodyThirdType === 'button'"> <template v-if="col.bodyThirdType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyThirdButtonItem(col, rowIndex)" <HandleFormItem class="ml-10" type="button" :item="getBodyThirdButtonItem(col, rowIndex)"
:value="row[col.bodyThirdKey]" :value="row[col.bodyThirdKey]"
:fieldKey="prefixKey + '_' + col.bodyThirdKey + '_' + row.id"
@clickButton="(e,val, data) => handleClickButton(e, data, col.bodyThirdKey, rowIndex, colIndex)" /> @clickButton="(e,val, data) => handleClickButton(e, data, col.bodyThirdKey, rowIndex, colIndex)" />
</template> </template>
</div> </div>

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

@ -1,6 +1,6 @@
<!-- 核酸样品分装 --> <!-- 核酸样品分装 -->
<template> <template>
<StepFormPackage 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>
@ -89,9 +89,12 @@ export default {
type: "text", type: "text",
}, },
//todo : //todo :
button1:{
fzbutton:{
type:"button", type:"button",
fillType: "preFill",
fzType:"step",
buttonName:"分装", buttonName:"分装",
myCodeFields:["lbbh","lbbhCode"],
}, },
} }
}] }]

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

@ -32,7 +32,7 @@
<HandleFormItem <HandleFormItem
type="button" type="button"
:item="getButtonItem(sItem)" :item="getButtonItem(sItem)"
@clickButton="(e)=>handleClickButton(e,item)" />
@clickButton="(e)=>handleClickButton(e,item,key)" />
</template> </template>
<!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 --> <!-- 仪器instrumentsj(药剂) gsp(供试品) mix药剂/供试品/给药制剂 -->
<template v-else-if="isRegent(sItem)"> <template v-else-if="isRegent(sItem)">
@ -207,7 +207,7 @@ export default {
} }
}, },
// //
handleClickButton(e,item){
handleClickButton(e,item,key){
const {buttonName = ""} = e; const {buttonName = ""} = e;
const {config} = item; const {config} = item;
if(buttonName === '开始' && config.hasOwnProperty("startDate")){ if(buttonName === '开始' && config.hasOwnProperty("startDate")){
@ -215,7 +215,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)
this.$emit("clickButton",e,item,key)
}, },
// //
getButtonItem(sItem) { getButtonItem(sItem) {

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

@ -1,3 +1,5 @@
import { getuuid } from '@/utils/index.js';
import { EventBus } from "@/utils/eventBus";
export default { export default {
dicts:[ dicts:[
"business_tjdw","business_czhj","business_rqcz","business_zldw", "business_tjdw","business_czhj","business_rqcz","business_zldw",
@ -15,7 +17,54 @@ export default {
default: '' default: ''
} }
}, },
data() {
return {
uuid: getuuid(),
}
},
mounted() {
EventBus.$on("dialogSubPackageSubmit", (data) => {
this.onSubPackageSubmit(data)
})
EventBus.$on("subPackageDialogPrintTag", (data) => {
this.onPrintTag(data)
})
},
destroyed() {
EventBus.$off("dialogSubPackageSubmit")
EventBus.$off("subPackageDialogPrintTag")
},
methods: { methods: {
// 打印标签
onPrintTag(data) {
this.$emit("printTag")
},
onSubPackageSubmit(data) {
if (data.uuid === this.uuid) {
console.log(data,"ddd")
//通知后端保存数据
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params);
}
},
// 点击按钮
onHandleClickButton(e,item,key) {
const {buttonName = "",myCodeFields = []} = e;
const fields = [];
const stepFormData = this.getFilledFormData();
myCodeFields.forEach((key) => {
fields.push(stepFormData[key])
});
console.log(fields,item,"fields")
if(buttonName === '分装'){
EventBus.$emit("showSubPackageDialog", {mybh:fields.join(""),uuid:this.uuid,fzType:"step"})
}
},
async getFormData() { async getFormData() {
return await this.$refs.stepFormPackageRef.getFormData(); return await this.$refs.stepFormPackageRef.getFormData();
}, },

+ 1
- 1
src/components/Template/operation/TableOpertaion.vue View File

@ -167,7 +167,7 @@ export default {
if (innerRow.fzsj) { if (innerRow.fzsj) {
defaultData = {...innerRow.fzsj,...defaultData} defaultData = {...innerRow.fzsj,...defaultData}
} }
EventBus.$emit("showSubPackageDialog", {...defaultData,uuid:this.uuid,packageType:"ryList"})
EventBus.$emit("showSubPackageDialog", {...defaultData,uuid:this.uuid,fzType:"ryList"})
}, },
onSubPackageSubmit(data) { onSubPackageSubmit(data) {
if (data.uuid === this.uuid) { if (data.uuid === this.uuid) {

Loading…
Cancel
Save