From 519d9280073607361a76cbb3650baf4cce3c3db4 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Mon, 5 Feb 2024 15:07:54 +0800 Subject: [PATCH] color --- src/components/doctorCheck/CheckItemList.vue | 42 ++++++++++++------- .../doctorCheck/RegisterCheckEdit.vue | 19 ++++++--- .../doctorCheck/RegisterCheckList.vue | 8 +++- src/store/index.js | 35 +++++++++------- src/views/doctorCheck/doctorCheck.vue | 6 +-- 5 files changed, 69 insertions(+), 41 deletions(-) diff --git a/src/components/doctorCheck/CheckItemList.vue b/src/components/doctorCheck/CheckItemList.vue index 3c3966f..abaccfa 100644 --- a/src/components/doctorCheck/CheckItemList.vue +++ b/src/components/doctorCheck/CheckItemList.vue @@ -50,10 +50,11 @@ // 0-无参考范围,1-数字型,2-字符型,3-性激素 import { mapState } from "vuex"; import { getapi, postapi, putapi, deletapi } from "@/api/api"; +import { deepCopy } from '../../utlis/proFunc' export default { components: {}, - props:["isCheckPicture"], + props:["isCheckPicture","registerCheckId"], data() { return { resultStatus:[], //结果状态提示数据 @@ -88,7 +89,7 @@ export default { }, computed: { - ...mapState(["window", "dict", "doctorCheck"]), + ...mapState(["window","dataTransOpts", "dict", "doctorCheck"]), }, methods: { @@ -223,7 +224,7 @@ export default { //检查组合项目下所包含的明细项目 checkItemList(RegisterCheckId) { - this.doctorCheck.checkItem = null + // this.doctorCheck.checkItem = null if(!RegisterCheckId){ this.doctorCheck.checkItemList = [] return @@ -235,10 +236,12 @@ export default { `/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}` ) .then((res) => { - console.log("checkItemList", res.data); + // console.log("checkItemList", res.data); if (res.code == 1) { this.doctorCheck.checkItemList = res.data; - + this.doctorCheck.checkItemList.forEach((e,i) => { + this.madeTooltips(i) + }); this.enterToTab(); } }) @@ -248,7 +251,7 @@ export default { }, querySearch(queryString, cb) { - var restaurants = [...this.restaurants]; //[{ value: '阴性' },{ value: '阳性' }] + var restaurants = deepCopy(this.restaurants); //[{ value: '阴性' },{ value: '阳性' }] restaurants.forEach((item) => { return (item.value = item.result); }); @@ -317,17 +320,26 @@ export default { //监听事件 watch: { //检查项目切换 - "doctorCheck.RegisterCheckId":{ + // "doctorCheck.RegisterCheckId":{ + // immediate:true, + // handler(newVal, oldVal) { + // console.log( + // "watch doctorCheck.RegisterCheckId newVal:", + // newVal, + // " oldVal:", + // oldVal + // ); + // this.checkItemList(newVal); + // } + // }, + + //检查项目未切换换时 也可以强制刷新数据 + "dataTransOpts.refresh.register_check_item":{ immediate:true, handler(newVal, oldVal) { - console.log( - "watch doctorCheck.RegisterCheckId newVal:", - newVal, - " oldVal:", - oldVal - ); - this.checkItemList(newVal); - } + console.log(`watch dataTransOpts.refresh.register_check_item newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`); + this.checkItemList(this.registerCheckId); + } }, }, }; diff --git a/src/components/doctorCheck/RegisterCheckEdit.vue b/src/components/doctorCheck/RegisterCheckEdit.vue index b1fe8a4..0f941d4 100644 --- a/src/components/doctorCheck/RegisterCheckEdit.vue +++ b/src/components/doctorCheck/RegisterCheckEdit.vue @@ -33,6 +33,7 @@ import { getapi, postapi, putapi, deletapi } from "@/api/api"; export default { components: {}, + props:["registerCheckId"], data() { return { dialogVisible: false, @@ -45,7 +46,7 @@ export default { mounted() {}, computed: { - ...mapState(["dict", "doctorCheck","patientRegister", "customerOrg"]), + ...mapState(["window","dataTransOpts","dict", "doctorCheck","patientRegister", "customerOrg"]), lmoment(date, forMat) { return moment(new Date(date)).format(forMat); }, @@ -73,13 +74,21 @@ export default { }, watch:{ - "doctorCheck.RegisterCheckId":{ + // "doctorCheck.RegisterCheckId":{ + // immediate:true, + // handler(newVal,oldVal){ + // this.getRegisterCheck(newVal) + // } + // }, + + //检查项目未切换换时 也可以强制刷新数据 + "dataTransOpts.refresh.register_check_item":{ immediate:true, - handler(newVal,oldVal){ - this.getRegisterCheck(newVal) + handler(newVal, oldVal) { + console.log(`watch dataTransOpts.refresh.register_check_item newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.registerCheckId}`); + this.getRegisterCheck(this.registerCheckId); } }, - }, }; diff --git a/src/components/doctorCheck/RegisterCheckList.vue b/src/components/doctorCheck/RegisterCheckList.vue index d99da32..7e84be4 100644 --- a/src/components/doctorCheck/RegisterCheckList.vue +++ b/src/components/doctorCheck/RegisterCheckList.vue @@ -59,8 +59,12 @@ export default { //选择组合项目 rowClick(row){ - //registerCheckId 具体动作写在相应组件监听事件中 + console.log('rowClick') this.doctorCheck.RegisterCheckId = row.id + this.dataTransOpts.table.register_check.id = row.id + setTimeout(() => { // 不管值是否改变,点击就强制刷新 + this.dataTransOpts.refresh.register_check_item++ + }, 100); // this.doctorCheck.RegisterCheckEdit = row }, @@ -100,7 +104,7 @@ export default { //监听事件 watch: { - //体检人员未切换时 强制刷新数据 + //体检人员未切换时 也可以强制刷新数据 "dataTransOpts.refresh.register_check":{ immediate:true, handler(newVal, oldVal) { diff --git a/src/store/index.js b/src/store/index.js index ca2a099..7e37856 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -127,11 +127,11 @@ export default new Vuex.Store({ customerOrgId: "", //体检单位ID CustomerOrgParentId: "", //单位父级ID customerOrgFlag: true, //单位作为查询条件 - customerOrgRegister: {id:''}, //单位体检次数 + customerOrgRegister: { id: '' }, //单位体检次数 checkAsbs: null, - patientName:'', //姓名 - sex:'', //性别 - idCardNo:'', //身份证号 + patientName: '', //姓名 + sex: '', //性别 + idCardNo: '', //身份证号 }, //查询条件 customerOrgGroup: [], //分组(针对单位) patientRegisterAbs: [], //人员已选组合项目 @@ -192,7 +192,7 @@ export default new Vuex.Store({ medicalType: [], //体检类别 personnelType: [], //人员类别 maritalStatus: [], //婚姻状况 - forMaritalStatus: [{ id: '0', displayName: '未婚' },{ id: '1', displayName: '已婚' },{ id: 'A', displayName: '全部' }], //适用婚姻 + forMaritalStatus: [{ id: '0', displayName: '未婚' }, { id: '1', displayName: '已婚' }, { id: 'A', displayName: '全部' }], //适用婚姻 sexHormoneTerm: [], //性激素期 nation: [], //民族 birthPlace: [], //籍惯 ,出生地 @@ -242,7 +242,7 @@ export default new Vuex.Store({ asbItemAll: [], //所有组合项目 asbItem: [], //显示的 未选组合项目 asbItemQuick: [], //显示的 未选组合项目(供快速选择) - diagnosisLevel:[], //诊断级别 + diagnosisLevel: [], //诊断级别 }, //项目特有的对象数据 @@ -263,21 +263,24 @@ export default new Vuex.Store({ }, //多层数据传递时使用 - dataTransOpts:{ + dataTransOpts: { //强制刷新(ID值没有变化,但也想强制刷新数据) - refresh:{ - patient_register:0, - register_check:0, + refresh: { + patient_register: 0, + register_check: 0, + register_check_item: 0, }, //表当前数据(单条记录) - table:{ - patient_register:{id:''}, - register_check:{id:''} + table: { + patient_register: { id: '' }, + register_check: { id: '' }, + register_check_item: { id: '' } }, //表当前数据(多条记录) - tableList:{ - patient_register:[], - register_check:[] + tableList: { + patient_register: [], + register_check: [], + register_check_item: [] } } }, diff --git a/src/views/doctorCheck/doctorCheck.vue b/src/views/doctorCheck/doctorCheck.vue index 85e3fa9..76ce807 100644 --- a/src/views/doctorCheck/doctorCheck.vue +++ b/src/views/doctorCheck/doctorCheck.vue @@ -46,7 +46,7 @@