Browse Source

fix:[麻精药表单]领取申请单

lkf
15881625488@163.com 2 months ago
parent
commit
43b14a91a8
1 changed files with 92 additions and 34 deletions
  1. +92
    -34
      src/views/business/comps/template/comps/gsp/MJYLQSQD.vue

+ 92
- 34
src/views/business/comps/template/comps/gsp/MJYLQSQD.vue View File

@ -8,15 +8,17 @@
<div class="content">
<LineLabel label="template.gsp.MJYLQSQD.jbxx" />
<div class="template-form-item">
<BaseInfoFormPcakge @clickable="onClickSybh" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<BaseInfoFormPcakge @select="onSelectBlur" @clickable="onClickSybh" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" />
</div>
<BaseInfoFormPcakge label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
<BaseInfoFormPcakge label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" />
</div>
</div>
</div>
<SelectReagentDialog type="MJYLQSQD" selectedCode="sn" title="template.gsp.MJYLQSQD.qxzsyhbm" :searchForm="searchForm"
:columns="columns" @submit="onDialogSubmit" :listApi="public_studyList" ref="selectReagentDialogRef">
<SelectReagentDialog type="MJYLQSQD" selectedCode="sn" title="template.gsp.MJYLQSQD.qxzsyhbm"
:searchForm="searchForm" :columns="columns" @submit="onDialogSubmit" :listApi="public_studyList"
ref="selectReagentDialogRef">
</SelectReagentDialog>
</div>
</template>
@ -29,6 +31,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import SelectReagentDialog from "../../dialog/SelectReagentDialog.vue";
import { public_studyList } from '@/api/business/public/public';
import { listData } from "@/api/system/dict/data"
export default {
name: "MJYLQSQD",
@ -60,7 +63,6 @@ export default {
},
},
computed: {
//
remarkConig() {
return [
@ -94,28 +96,28 @@ export default {
SD: {
label: "template.gsp.MJYLQSQD.sd",
type: "input",
disabled:true,
fillType: "actFill",
},
sywzmc: {
label: "template.gsp.MJYLQSQD.sywzmc",
type: "select",
fillType: "actFill",
otherCode: "sywzmcOther",
options: this.getDictOptions('business_sywzmc'),
},
gyjl: {
label: "template.gsp.MJYLQSQD.gyjl",
type: "select",
fillType: "actFill",
otherCode: "gyjlOther",
options: this.getDictOptions('business_gyjl'),
fillType: "actFill",
options: this.gyjlOptions,
},
xynd: {
label: "template.gsp.MJYLQSQD.xynd",
type: "select",
fillType: "actFill",
otherCode: "xyndOther",
options: this.getDictOptions('business_gynd'),
fillType: "actFill",
options: this.gyndOptions,
},
xyl: {
label: "template.gsp.MJYLQSQD.xyl",
@ -162,13 +164,10 @@ export default {
}
},
]
},
}
},
data() {
return {
syId: null,
bmId: null,
sdId: null,
public_studyList: public_studyList,
searchForm: {
name: {
@ -202,12 +201,76 @@ export default {
prop: 'createTime',
label: 'page.business.study.study.createDate',
}
]
],
gyjlOptionsOld: [],
gyndOptionsOld: [],
gyjlOptions: [],
gyndOptions: []
};
},
created() {
this.getGyjl()
this.getGynd()
},
mounted() {
},
methods: {
onSelectBlur(val) {
if (val.key == 'sywzmc') {
let tmp = []
_.forEach(_.filter(this.gyjlOptionsOld, function (o) {
return o.remark.indexOf(val.value) > -1;
}), function (item) {
tmp.push({ label: item.dictLabel, value: item.dictValue })
})
this.gyjlOptions = tmp
this.gyndOptions = []
this.$refs.baseInfoRef.batchUpdateFormData({
gyjl: '',
xynd: '',
});
}
if (val.key == 'gyjl') {
let tmp = []
_.forEach(_.filter(this.gyndOptionsOld, function (o) {
return o.remark.indexOf(val.value) > -1;
}), function (item) {
tmp.push({ label: item.dictLabel, value: item.dictValue })
})
this.gyndOptions = tmp
this.$refs.baseInfoRef.batchUpdateFormData({
xynd: '',
});
}
},
//
getGyjl() {
listData({
pageNum: 1,
pageSize: 999999,
dictType: 'business_gyjl',
status: 0
}).then(response => {
this.gyjlOptionsOld = response.rows
if (this.formData.sywzmc && this.formData.sywzmc !== '') {
this.onSelectBlur({ key: 'sywzmc', value: this.formData.sywzmc })
}
})
},
//
getGynd() {
listData({
pageNum: 1,
pageSize: 999999,
dictType: 'business_gynd',
status: 0
}).then(response => {
this.gyndOptionsOld = response.rows
if (this.formData.gyjl && this.formData.gyjl !== '') {
this.onSelectBlur({ key: 'gyjl', value: this.formData.gyjl })
}
})
},
onDialogSubmit(selectedId, currentRow) {
console.log(JSON.stringify(currentRow))
//
@ -216,9 +279,9 @@ export default {
syNo: currentRow.sn,
SD: currentRow.leaderName,
});
this.syId = currentRow.id
this.bmId = currentRow.deptId
this.sdId = currentRow.leader
this.formData.syId = currentRow.id
this.formData.bmId = currentRow.deptId
this.formData.sdId = currentRow.leader
}
//
if (currentRow.type == 2) {
@ -226,9 +289,9 @@ export default {
syNo: currentRow.deptName,
SD: currentRow.nickName,
});
this.syId = ''
this.bmId = currentRow.deptId
this.sdId = currentRow.userId
this.formData.syId = ''
this.formData.bmId = currentRow.deptId
this.formData.sdId = currentRow.userId
}
this.$refs.selectReagentDialogRef.onCancel()
},
@ -240,23 +303,18 @@ export default {
//
getFilledFormData() {
let content = this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"])
content.syId = this.syId
content.bmId = this.bmId
content.sdId = this.sdId
content.syId = this.formData.syId
content.bmId = this.formData.bmId
content.sdId = this.formData.sdId
return content;
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "remarkRef"]);
content.syId = this.syId
content.bmId = this.bmId
content.sdId = this.sdId
content.syId = this.formData.syId
content.bmId = this.formData.bmId
content.sdId = this.formData.sdId
return content;
},
async onSave() {
const formData = await this.getFormData();
// const formData = await this.$refs.stepTableRef.getFormData();
console.log(formData, "formData")
},
}
}
};
</script>

Loading…
Cancel
Save