Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
bb364bc555
7 changed files with 133 additions and 55 deletions
  1. +16
    -3
      src/components/Template/operation/TableOpertaion.vue
  2. +1
    -1
      src/views/business/comps/template/TemplateTable.vue
  3. +14
    -8
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  4. +80
    -0
      src/views/business/comps/template/dialog/PrintTagDialog.vue
  5. +4
    -2
      src/views/business/comps/template/dialog/SubPackageDialog.vue
  6. +0
    -41
      src/views/business/comps/template/dialog/TagPrintDialog.vue
  7. +18
    -0
      src/views/business/comps/template/mixins/templateMixin.js

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

@ -11,7 +11,7 @@
<el-button type="text" size="small" @click="onSubPackage">分装</el-button>
<el-button type="text" size="small" @click="onStartConfig">开始配置</el-button>
<el-button type="text" size="small" @click="onConfigComplete">配置完成</el-button>
<el-button type="text" size="small" @click="onPrintLabel">打印标签</el-button>
<el-button type="text" size="small" @click="()=>onPrintTag()">打印标签</el-button>
</template>
</div>
</template>
@ -45,7 +45,14 @@ export default {
EventBus.$on("dialogSubPackageSubmit", (data) => {
this.onSubPackageSubmit(data)
})
EventBus.$on("subPackageDialogPrintTag", (data) => {
this.onPrintTag(data)
})
},
destroyed() {
EventBus.$off("dialogSubPackageSubmit")
EventBus.$off("subPackageDialogPrintTag")
},
watch: {
row: {
handler(newVal, oldVal) {
@ -69,8 +76,14 @@ export default {
this.$emit("configComplete", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
},
//
onPrintLabel() {
this.$emit("printLabel", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
onPrintTag(data) {
if(data) {
if(data.rowIndex === this.rowIndex){
this.$emit("printTag", { printCode: data.printCode,type:"subPackage" })
}
}else{
this.$emit("printTag", { row: this.innerRow,type:"row" })
}
},
//
onSubPackage() {

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

@ -31,7 +31,7 @@ import Demo from "./comps/sp/Demo.vue";
import SYWZPZJHB from "./comps/gsp/SYWZPZJHB.vue";
import MJYLQSQD from "./comps/gsp/MJYLQSQD.vue";
import SubPackageDialog from "./dialog/SubPackageDialog.vue";//
import TagPrintDialog from "./dialog/TagPrintDialog.vue";//
import TagPrintDialog from "./dialog/PrintTagDialog.vue";//
export default {
name: "TemplateTable",

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

@ -10,8 +10,8 @@
:formData="formData" />
<TableList label="试验试剂信息" :columns="sysjColumns" :dataSource="resource" />
<TableList label="仪器使用信息" :columns="yqsColumns" :dataSource="resource" />
<BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" />
<!-- <BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" /> -->
<LineLabel label="操作步骤" />
<div class="template-form-item">
<BaseInfoFormPcakge @clickable="handleClickable" ref="stepFormPackageRef"
@ -20,7 +20,7 @@
:showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
<TableOpertaion @printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
:rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion>
</template>
</CustomTable>
@ -47,6 +47,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus";
import moment from 'moment';
export default {
name: "SWYPBQGZYZBB",
@ -75,12 +76,12 @@ export default {
{
type: "conditionItem",
config: {
storageCondition1: {
storageCondition: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.getDictOptions('business_cctj'),
otherCode: "other1",
otherCode: "storageConditionOther",
},
}
@ -416,6 +417,11 @@ export default {
mounted() {
},
methods: {
//
printTag(data) {
const printConfig = this.getBasePrintConfig(data);
EventBus.$emit('showTagPrintDialog', {printConfig})
},
//
subPackageSubmit(data) {
const { fzsj, rowData } = data;
@ -448,7 +454,7 @@ export default {
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"])
},
handleClickable(item) {
if (this.fillType === "preFill") {
@ -492,11 +498,11 @@ export default {
this.$refs.stepTableRef.updateDataSource(newStepTableData);
},
async getFormData() {
return await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
return await this.validFormFields(["baseInfoRef", , "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
},
async onSave() {
// const formData = await this.getFormData();
const formData = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
const formData = await this.validFormFields(["baseInfoRef", , "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
console.log(formData, "formData")
}

+ 80
- 0
src/views/business/comps/template/dialog/PrintTagDialog.vue View File

@ -0,0 +1,80 @@
<template>
<el-dialog
title="标签打印"
:visible.sync="visible"
:width="col === 1 ? '550px' : '1000px'"
@close = "close"
>
<div class="print-config">
<div class="print-config-item" :class="{'full-row':col === 1}" v-for="(value, key) in printConfig">
<span class="print-config-label">{{ key }}</span>
<span class="print-config-value">
<el-input class="print-config-input" disabled :value="value" placeholder="请输入" />
</span>
</div>
</div>
<template slot="footer" class="dialog-footer">
<el-button @click="close">{{ $t('form.cancel') }}</el-button>
<el-button type="primary" @click="printTag">打印</el-button>
</template>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
printConfig: {},
col: 1,//
}
},
methods: {
show(data) {
const {printConfig,col} = data
this.printConfig = printConfig
this.col = col || 1;
this.visible = true
},
close() {
this.visible = false
},
printTag() {
//
console.log("打印标签", this.formData)
}
}
}
</script>
<style lang="scss" scoped>
.print-config {
margin-top: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
// align-items: center;
// justify-content: center;
}
.full-row{
grid-column: span 2;
}
.print-config-item {
margin-bottom: 15px;
display: flex;
align-items: center;
}
.print-config-label {
font-weight: bold;
width: 150px;
text-align: right;
}
.print-config-value {
margin-left: 10px;
}
.print-config-input{
width: 300px;
}
</style>

+ 4
- 2
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -33,7 +33,7 @@
<div class="list-label">{{ formData.mybh }}-set{{ item.subCode }}</div>
<HandleFormItem :isFieldsRecord="false" :item="inputNumberItem" :error="fzListErrors[index]"
@blur="onBlurFzNum(index)" v-model="item.num" />
<el-button type="primary" plain @click="onPrint">打印</el-button>
<el-button type="primary" plain @click="onPrint(item)">打印</el-button>
</div>
</div>
</div>
@ -255,7 +255,9 @@ export default {
//
this.formErrors.mfbzl = false;
},
onPrint() { },
onPrint(item) {
EventBus.$emit('subPackageDialogPrintTag', {...this.formData, printCode: `${this.formData.mybh}-set${item.subCode}`});
},
onCommonBlur(e, field) {
if (this.formData[field]) {
this.formErrors[field] = false;

+ 0
- 41
src/views/business/comps/template/dialog/TagPrintDialog.vue View File

@ -1,41 +0,0 @@
<template>
<el-dialog
title="标签打印"
:visible.sync="visible"
width="30%"
@close = "close"
>
<template slot="footer" class="dialog-footer">
<el-button type="primary" @click="close">{{ $t('form.cancel') }}</el-button>
<el-button type="primary" @click="printTag">打印标签</el-button>
</template>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
formData: {}
}
},
methods: {
show(data) {
this.formData = data
this.visible = true
},
close() {
this.visible = false
},
printTag() {
//
console.log("打印标签", this.formData)
}
}
}
</script>
<style lang="scss" scoped>
</style>

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

@ -129,6 +129,24 @@ export default {
this.setTemplateData({})
},
methods: {
//获取打印配置
getBasePrintConfig (data){
const { printCode,type,row } = data;
const {stepStorageCondition,startDate,expireDate} = this.formData;
const { nickName, name } = this.$store.getters;
const lang = this.$i18n.locale;
const printConfig = {
"品名":"暂时还不知道品名是哪个字段",
"存储条件":stepStorageCondition,
"配制日期":moment(startDate).format("YYYY-MM-DD"),
"有效期至":moment(expireDate).format("YYYY-MM-DD HH:mm"),
"配置者":lang === "zh_CN" ? nickName : name,
//type==="subPackage"从分装打印过来的,
//type==="row" 从列表上点过来的
"编号":type === "subPackage" ? printCode : (row.targetSolutionCode+row.subTargetSolutionCode),
}
return printConfig
},
async getLatestSn(count = 1) {
const res = await getLatestSn({ count })
if (res.code === 200) {

Loading…
Cancel
Save