|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import Vue from "vue"; |
|
|
|
import Vuex from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { arrayReduce } from "@/utlis/proFunc"; |
|
|
|
// import { getapi, postapi, putapi, deletapi } from "@/api/api";
|
|
|
|
// import { arrayReduce } from "@/utlis/proFunc";
|
|
|
|
|
|
|
|
Vue.use(Vuex); |
|
|
|
|
|
|
|
@ -439,72 +439,72 @@ export default new Vuex.Store({ |
|
|
|
}, |
|
|
|
|
|
|
|
actions: { |
|
|
|
//获取体检人员所选组合项目
|
|
|
|
getPatientRegisterAbs(context, id) { |
|
|
|
//console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
|
|
|
|
if (id) { |
|
|
|
getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then( |
|
|
|
(res) => { |
|
|
|
console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res) |
|
|
|
if (res.code == 1) { |
|
|
|
let patientRegisterAbs = [] |
|
|
|
res.data.forEach(e => { |
|
|
|
e.standTotal = e.amount * e.standardPrice |
|
|
|
e.total = e.amount * e.chargePrice |
|
|
|
patientRegisterAbs.push(e) |
|
|
|
}); |
|
|
|
context.commit("setData", { |
|
|
|
key: "patientRegister.patientRegisterAbs", |
|
|
|
value: patientRegisterAbs, |
|
|
|
}); |
|
|
|
// //获取体检人员所选组合项目
|
|
|
|
// getPatientRegisterAbs(context, id) {
|
|
|
|
// //console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
|
|
|
|
// if (id) {
|
|
|
|
// getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
|
|
|
|
// (res) => {
|
|
|
|
// console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
|
|
|
|
// if (res.code == 1) {
|
|
|
|
// let patientRegisterAbs = []
|
|
|
|
// res.data.forEach(e => {
|
|
|
|
// e.standTotal = e.amount * e.standardPrice
|
|
|
|
// e.total = e.amount * e.chargePrice
|
|
|
|
// patientRegisterAbs.push(e)
|
|
|
|
// });
|
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "patientRegister.patientRegisterAbs",
|
|
|
|
// value: patientRegisterAbs,
|
|
|
|
// });
|
|
|
|
|
|
|
|
context.commit("setData", { |
|
|
|
key: "dict.asbItem", |
|
|
|
value: arrayReduce( |
|
|
|
[...context.state.dict.asbItem], [...context.state.patientRegister.patientRegisterAbs], |
|
|
|
"id=asbitemId" |
|
|
|
), |
|
|
|
}); |
|
|
|
context.commit("setData", { |
|
|
|
key: "dict.asbItemQuick", |
|
|
|
value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"), |
|
|
|
}); |
|
|
|
//console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
|
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
} else { |
|
|
|
context.commit("setData", { |
|
|
|
key: "patientRegister.patientRegisterAbs", |
|
|
|
value: [], |
|
|
|
}); |
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "dict.asbItem",
|
|
|
|
// value: arrayReduce(
|
|
|
|
// [...context.state.dict.asbItem], [...context.state.patientRegister.patientRegisterAbs],
|
|
|
|
// "id=asbitemId"
|
|
|
|
// ),
|
|
|
|
// });
|
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "dict.asbItemQuick",
|
|
|
|
// value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"),
|
|
|
|
// });
|
|
|
|
// //console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "patientRegister.patientRegisterAbs",
|
|
|
|
// value: [],
|
|
|
|
// });
|
|
|
|
|
|
|
|
context.commit("setData", { |
|
|
|
key: "dict.asbItem", |
|
|
|
value: [...context.state.dict.asbItemAll], |
|
|
|
}); |
|
|
|
context.commit("setData", { |
|
|
|
key: "dict.asbItemQuick", |
|
|
|
value: [...context.state.dict.asbItemAll], |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "dict.asbItem",
|
|
|
|
// value: [...context.state.dict.asbItemAll],
|
|
|
|
// });
|
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "dict.asbItemQuick",
|
|
|
|
// value: [...context.state.dict.asbItemAll],
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
|
|
|
|
//获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
|
|
|
|
getCustomerOrgGroup(context, customerOrgld) { |
|
|
|
console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`); |
|
|
|
getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`) |
|
|
|
.then((res) => { |
|
|
|
console.log("vuex getCustomerOrgGroup", res.data); |
|
|
|
if (res.code == 1) { |
|
|
|
//this.patientRegister.customerOrgGroup = res.data
|
|
|
|
context.commit("setData", { |
|
|
|
key: "patientRegister.customerOrgGroup", |
|
|
|
value: res.data, |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
|
|
|
|
// getCustomerOrgGroup(context, customerOrgld) {
|
|
|
|
// console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
|
|
|
|
// getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
|
|
|
|
// .then((res) => {
|
|
|
|
// console.log("vuex getCustomerOrgGroup", res.data);
|
|
|
|
// if (res.code == 1) {
|
|
|
|
// //this.patientRegister.customerOrgGroup = res.data
|
|
|
|
// context.commit("setData", {
|
|
|
|
// key: "patientRegister.customerOrgGroup",
|
|
|
|
// value: res.data,
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
}, |
|
|
|
modules: {}, |
|
|
|
}); |