You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

346 lines
13 KiB

3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
  1. import Vue from "vue";
  2. import Vuex from "vuex";
  3. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  4. import { arrayReduce } from "@/utlis/proFunc";
  5. Vue.use(Vuex);
  6. export default new Vuex.Store({
  7. state: {
  8. changepassword: '',//用户密码
  9. set: "qqqq",
  10. importexcel: {
  11. },
  12. router: {
  13. path: '',
  14. },
  15. window: {
  16. pageHeight: 960, //页面高度
  17. pageWidth: 1920, //页面宽度
  18. },
  19. customerOrg: {
  20. //体检单位设置
  21. customerOrgTree: [], //体检单位列表
  22. treeprops: {
  23. label: "displayName",
  24. value: "id",
  25. children: "treeChildren",
  26. }, //树形组件的数据结构
  27. customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
  28. customerOrgRd: { id: "", isLock: "N", isActive: "Y", isLockBox: false, isActiveBox: true, }, //单个体检单位记录值
  29. customerOrgRegisterList: [{id:'uuid'}], //单位体检次数登记列表
  30. contactPersonList: [], //联系人列表
  31. contactMethodList: [], //联系方式列表
  32. orgEditStyle: '', //编辑表单样式
  33. orgDetailStyle: '', //体检次数样式
  34. orgDetailHeight: 300, //体检次数LIST表格高度
  35. personStyle: '', //联系人样式
  36. },
  37. //体检单位分组
  38. personnelUnit: {
  39. customerOrgGroupId: "",
  40. personnelgrouping: [], //人员分组
  41. id: "", //根据Id选择的数据
  42. form: { id: "" }, //列表每一项
  43. nogroupselected: [], //已选分组
  44. },
  45. //体检人员登记 add by pengjun
  46. patientRegister: {
  47. customerOrgTreeAll: [], //体检单位列表(含个人)
  48. patientRegisterId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
  49. patientRegisterRd: { id: "" }, //体检人员记录
  50. patientRegisterTimes: 0, //体检人员登记窗口显示次数(弃用)
  51. addTimes: 0, //用于触发新增时初始化赋值
  52. saveTimes: 0, //用于体检登记时,触发分组调整保存
  53. photo: "", //单独抽出,拍照时会更新
  54. cameraVisble: false, //拍照控件显示
  55. lisRequestVisble:false, //检验条码补打
  56. mergeAsbitemVisble:false, //合并项目
  57. patientRegisterRdInit: {
  58. id: "", //id
  59. patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
  60. patientNo: "", //档案号
  61. customerOrgId: null, //单位编号
  62. customerOrgGroupId: null, //分组
  63. medicalPackageId: null, //套餐
  64. patientName: "", //姓名
  65. birthDate: "", //字符串 如:2012-01-29
  66. sexId: "U", //性别 默认未知U
  67. age: null, //年龄
  68. jobCardNo: "", //工卡号
  69. medicalCardNo: "", //体检卡号
  70. maritalStatusId: "9", //婚姻状况 默认未知
  71. medicalTypeId: null, //体检类别
  72. personnelTypeId: null, //人员类别
  73. jobPost: "", //职务
  74. jobTitle: "", //职称
  75. photo: "", //照片
  76. salesman: "", //介绍人
  77. sexHormoneTermId: null, //性激素期限
  78. isNameHide: "N", //隐藏姓名
  79. isPhoneFollow: "N", //电话随访
  80. isVip: "N", //vip客户
  81. remark: "", //
  82. isLock: "N", //是否锁住
  83. completeFlag: "1", //完成标志 0:预登记,1:未检,2:部份已检,3:已总检 【创建编辑时不操作】
  84. isMedicalStart: "N", //体检开始标志 【创建编辑时不操作】
  85. patientRegisterNo: "", //条码号 【创建编辑时不操作】
  86. medicalTimes: 1, //条码号 【创建编辑时不操作】
  87. organizationUnitId: null, //体检中心
  88. address: "", //地址
  89. email: "", //email
  90. idNo: "", //身份证号
  91. telephone: "", //电话
  92. mobileTelephone: "", //手机号
  93. nationId: null, //民族编号
  94. postalCode: "", //邮编
  95. creatorId: null,
  96. creationTime: "",
  97. lastModificationTime: "",
  98. lastModifierId: null,
  99. }, //体检人员记录(初始值)一般创建用
  100. customerOrgGroupAsb: [], //选中分组所包含的组合项目
  101. medicalPackageAsb: [], //选中套餐所包含的组合项目
  102. customerOrgGroupChange: 0, //控制体检列表记录切换时,0 无需触发更换分组操作
  103. medicalPackageChange: 0, //控制体检列表记录切换时,0 无需触发更换套餐操作
  104. query: {
  105. dateType:'creationTime', //登记日期
  106. dateRange:null, //日期范围
  107. times: 0, //触发查询次数
  108. customerOrgId: "", //体检单位ID
  109. CustomerOrgParentId: "", //单位父级ID
  110. customerOrgFlag: true, //单位作为查询条件
  111. customerOrgRegister:{}, //单位体检次数
  112. checkAsbs:null,
  113. }, //查询条件
  114. customerOrgGroup: [], //分组(针对单位)
  115. patientRegisterAbs: [], //人员已选组合项目
  116. prList: [], //体检登记记录
  117. },
  118. //体检医生诊台
  119. doctorCheck: {
  120. prBase: {
  121. id: '', //体检登记ID
  122. }, //人员体检登记显示基本信息
  123. RegisterCheckEdit: {
  124. id: '',
  125. checkDoctorId: null,
  126. checkDate: '',
  127. completeFlag: '0',
  128. LastModificationTime: '',
  129. LastModifierId: null,
  130. isLock: 'N',
  131. isAudit: 'N',
  132. auditorUserId: null,
  133. auditTime: '',
  134. }, //组合项目详情
  135. doctorCheckDialogVisible: false,
  136. RegisterCheckList: [], //人员体检 组合项目列表
  137. RegisterCheck: {}, //单组合项目记录
  138. RegisterCheckId: '', //
  139. checkItemList: [], //组合项目包含的明细项目
  140. checkItem: {}, //单项目记录
  141. checkSummaryList: [], //小结
  142. checkSuggestionList: [], //建议
  143. },
  144. //总检医生
  145. sumDoctorCheck: {
  146. sumDoctorCheckDialogVisible: false,
  147. sumPREdit: {}, //总检医生时间等相关信息(sumPREditInit)
  148. summaryList: [], //综述
  149. suggestionList: [], //建议
  150. },
  151. //公共字典数据 add by pengjun
  152. dict: {
  153. personOrgId: "00000000-0000-0000-0000-000000000000", //个人体检单位ID
  154. organization: [], //体检中心
  155. sex: [], //性别(人员档案用)
  156. forSex: [], //适用性别
  157. medicalType: [], //体检类别
  158. personnelType: [], //人员类别
  159. maritalStatus: [], //婚姻状况
  160. sexHormoneTerm: [], //性激素期
  161. nation: [], //民族
  162. birthPlace: [], //籍惯 ,出生地
  163. completeFlag: [
  164. //体检完成标志
  165. { id: "0", displayName: "预登记" },
  166. { id: "1", displayName: "正式登记" },
  167. { id: "2", displayName: "部份已检" },
  168. { id: "3", displayName: "已总检" },
  169. ],
  170. checkCompleteFlag: [
  171. //体检完成标志
  172. { id: "0", displayName: "未检" },
  173. { id: "1", displayName: "已检" },
  174. { id: "2", displayName: "弃检" },
  175. ],
  176. sumAudit: [
  177. //总检审核
  178. { id: "Y", displayName: "已审核" },
  179. { id: "N", displayName: "未审核" }
  180. ],
  181. payType: [
  182. //支付方式,比如是0自费、2免费、1单位支付
  183. { id: "0", displayName: "个人支付" },
  184. { id: "1", displayName: "单位支付" },
  185. { id: "2", displayName: "赠送" },
  186. ],
  187. cardMode:[
  188. { id: "0", displayName: "充值卡" },
  189. { id: "1", displayName: "积分卡" },
  190. ],
  191. cardType:[], //会员卡类别
  192. billFlag:[
  193. { id: "0", displayName: "收费" },
  194. { id: "1", displayName: "退费" },
  195. { id: "2", displayName: "充值" },
  196. ],
  197. checkTypeFlag: [
  198. { id: "0", displayName: "检验" },
  199. { id: "1", displayName: "功能检查" },
  200. ],
  201. medicalPackage: [], //所有套餐
  202. customerOrgGroupAll: [], //所有分组,不限单位,不限次数
  203. customerOrg: [], //所有单位,非树结构
  204. payMode: [], //支付方式
  205. itemTypeTree: [], //体检类别 树结构
  206. asbItemAll: [], //所有组合项目
  207. asbItem: [], //显示的 未选组合项目
  208. asbItemQuick: [], //显示的 未选组合项目(供快速选择)
  209. },
  210. },
  211. getters: {},
  212. mutations: {
  213. //同步更改状态
  214. //通用设置 state 值 option {key:,value:} add by pengjun
  215. setData(state, option) {
  216. let array = option.key.split(".");
  217. switch (array.length) {
  218. case 1:
  219. state[array[0]] = option.value;
  220. break;
  221. case 2:
  222. state[array[0]][array[1]] = option.value;
  223. break;
  224. case 3:
  225. state[array[0]][array[1]][array[2]] = option.value;
  226. break;
  227. case 4:
  228. state[array[0]][array[1]][array[2]][array[3]] = option.value;
  229. break;
  230. }
  231. },
  232. doctorCheckPrBaseInit(state) {
  233. state.doctorCheck.prBase = {
  234. id: '', //体检登记ID
  235. patientRegisterNo: '', //条码号
  236. patientNo: '', //档案号
  237. patientName: '', //姓名
  238. sexId: '', //性别
  239. medicalTimes: '', //体检次数
  240. maritalStatusId: '', //婚姻
  241. creationTime: '', //体检日期
  242. customerOrgParentName: '', //单位
  243. customerOrgName: '', //部门
  244. medicalTypeId: '', //体检类别
  245. personnelTypeId: '', //人员类别
  246. nationId: '', //民族
  247. mobileTelephone: '', //手机
  248. } //人员体检登记显示基本信息
  249. },
  250. sumPREditInit(state) {
  251. state.sumDoctorCheck.sumPREdit = {
  252. id: '', //体检登记ID
  253. completeFlag: '', //完成状态
  254. summaryDoctor: '', //总检医生
  255. summaryDate: '', //总检日期
  256. isAudit: '', //审核状态
  257. auditDoctor: '', //审核医生
  258. auditDate: '', //审核日期
  259. isLock: '', //锁定状态
  260. patientId: '', //人员档案ID
  261. } //人员体检登记显示基本信息
  262. },
  263. },
  264. actions: {
  265. //获取体检人员所选组合项目
  266. getPatientRegisterAbs(context, id) {
  267. //console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
  268. if (id) {
  269. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
  270. (res) => {
  271. console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
  272. if (res.code == 1) {
  273. let patientRegisterAbs = []
  274. res.data.forEach(e => {
  275. e.standTotal = e.amount * e.standardPrice
  276. e.total = e.amount * e.chargePrice
  277. patientRegisterAbs.push(e)
  278. });
  279. context.commit("setData", {
  280. key: "patientRegister.patientRegisterAbs",
  281. value: patientRegisterAbs,
  282. });
  283. context.commit("setData", {
  284. key: "dict.asbItem",
  285. value: arrayReduce(
  286. [...context.state.dict.asbItem],
  287. [...context.state.patientRegister.patientRegisterAbs],
  288. "id=asbitemId"
  289. ),
  290. });
  291. context.commit("setData", {
  292. key: "dict.asbItemQuick",
  293. value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"),
  294. });
  295. //console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
  296. }
  297. }
  298. );
  299. } else {
  300. context.commit("setData", {
  301. key: "patientRegister.patientRegisterAbs",
  302. value: [],
  303. });
  304. context.commit("setData", {
  305. key: "dict.asbItem",
  306. value: [...context.state.dict.asbItemAll],
  307. });
  308. context.commit("setData", {
  309. key: "dict.asbItemQuick",
  310. value: [...context.state.dict.asbItemAll],
  311. });
  312. }
  313. },
  314. //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
  315. getCustomerOrgGroup(context, customerOrgld) {
  316. console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
  317. getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
  318. .then((res) => {
  319. console.log("vuex getCustomerOrgGroup", res.data);
  320. if (res.code == 1) {
  321. //this.patientRegister.customerOrgGroup = res.data
  322. context.commit("setData", {
  323. key: "patientRegister.customerOrgGroup",
  324. value: res.data,
  325. });
  326. }
  327. });
  328. },
  329. },
  330. modules: {},
  331. });