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.

480 lines
21 KiB

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
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
  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. pageHeaderHeight: 50, //container-header 高度
  19. pageMarginWidth: 10, //container-左右边距和
  20. pageMarginHeight: 10, //container-上下边距和
  21. cardHeaderHeight: 45, //card-header 高度
  22. shift: false, //是否按下 shift键
  23. ctrl: false, //是否按下 ctrl键
  24. },
  25. elProgress: { //通用进度条相关参数
  26. display: false, //是否显示
  27. textInside: true,
  28. strokeWidth: 30,
  29. percentage: 0
  30. },
  31. customerOrg: {
  32. //体检单位设置
  33. oprStatus: '', //空,add,edit 三种状态
  34. customerOrgTree: [], //体检单位列表
  35. defaultExpandedKeys: [], //当前选中树的节点
  36. treeCurrentNodekey: '', //当前选中树的节点
  37. treeprops: {
  38. label: "displayName",
  39. value: "id",
  40. id: "id",
  41. children: "treeChildren",
  42. }, //树形组件的数据结构
  43. customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
  44. customerOrgRd: { id: "", isLock: "N", isActive: "Y", isLockBox: false, isActiveBox: true, }, //单个体检单位记录值
  45. customerOrgRegisterList: [{ id: 'uuid' }], //单位体检次数登记列表
  46. contactPersonList: [], //联系人列表
  47. contactMethodList: [], //联系方式列表
  48. orgEditStyle: '', //编辑表单样式
  49. orgDetailStyle: '', //体检次数样式
  50. orgDetailHeight: 300, //体检次数LIST表格高度
  51. personStyle: '', //联系人样式
  52. },
  53. //体检单位分组
  54. personnelUnit: {
  55. customerOrgGroupId: "",
  56. personnelgrouping: [], //人员分组
  57. id: "", //根据Id选择的数据
  58. form: { id: "" }, //列表每一项
  59. nogroupselected: [], //已选分组
  60. },
  61. //体检人员登记 add by pengjun
  62. patientRegister: {
  63. customerOrgTreeAll: [], //体检单位列表(含个人)
  64. patientRegisterId: "", //当前人员ID(可根据此值是否为空,判断是新增还是编辑)
  65. patientRegisterTimes: 0, //体检人员登记窗口显示次数(弃用)
  66. addTimes: 0, //用于触发新增时初始化赋值
  67. saveTimes: 0, //用于体检登记时,触发分组调整保存
  68. photo: "/pic/Photo.jpg", //单独抽出,拍照时会更新
  69. cameraVisble: false, //拍照控件显示
  70. lisRequestVisble: false, //检验条码补打
  71. mergeAsbitemVisble: false, //合并项目
  72. patientRegisterRd: { id: "" }, //体检人员记录
  73. patientRegisterRdInit: {
  74. id: "", //id
  75. patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
  76. patientNo: "", //档案号
  77. customerOrgId: null, //单位编号
  78. customerOrgGroupId: null, //分组
  79. medicalPackageId: null, //套餐
  80. patientName: "", //姓名
  81. birthDate: "", //字符串 如:2012-01-29
  82. sexId: "U", //性别 默认未知U
  83. age: null, //年龄
  84. jobCardNo: "", //工卡号
  85. medicalCardNo: "", //体检卡号
  86. maritalStatusId: "9", //婚姻状况 默认未知
  87. medicalTypeId: null, //体检类别
  88. personnelTypeId: null, //人员类别
  89. jobPost: "", //职务
  90. jobTitle: "", //职称
  91. photo: "/pic/Photo.jpg", //照片
  92. salesman: "", //介绍人
  93. sexHormoneTermId: null, //性激素期限
  94. isNameHide: "N", //隐藏姓名
  95. isPhoneFollow: "N", //电话随访
  96. isVip: "N", //vip客户
  97. remark: "", //
  98. isLock: "N", //是否锁住
  99. completeFlag: "1", //完成标志 0:预登记,1:未检,2:部份已检,3:已总检 【创建编辑时不操作】
  100. isMedicalStart: "N", //体检开始标志 【创建编辑时不操作】
  101. patientRegisterNo: "", //条码号 【创建编辑时不操作】
  102. medicalTimes: 1, //条码号 【创建编辑时不操作】
  103. organizationUnitId: null, //体检中心
  104. address: "", //地址
  105. email: "", //email
  106. idNo: "", //身份证号
  107. telephone: "", //电话
  108. mobileTelephone: "", //手机号
  109. nationId: null, //民族编号
  110. postalCode: "", //邮编
  111. creatorId: null,
  112. creationTime: "",
  113. lastModificationTime: "",
  114. lastModifierId: null,
  115. }, //体检人员记录(初始值)一般创建用
  116. customerOrgGroupAsb: [], //选中分组所包含的组合项目
  117. medicalPackageAsb: [], //选中套餐所包含的组合项目
  118. customerOrgGroupChange: 0, //控制体检列表记录切换时,0 无需触发更换分组操作
  119. medicalPackageChange: 0, //控制体检列表记录切换时,0 无需触发更换套餐操作
  120. query: {
  121. dateType: 'creationTime', //登记日期
  122. dateRange: null, //日期范围
  123. startDate: null,
  124. endDate: null,
  125. containRefuse: true, //包含弃检项目
  126. times: 0, //触发查询次数
  127. customerOrgId: "", //体检单位ID
  128. CustomerOrgParentId: "", //单位父级ID
  129. customerOrgFlag: true, //单位作为查询条件
  130. customerOrgRegister: { id: '' }, //单位体检次数
  131. checkAsbs: null,
  132. patientName: '', //姓名
  133. sex: '', //性别
  134. idCardNo: '', //身份证号
  135. }, //查询条件
  136. customerOrgGroup: [], //分组(针对单位)
  137. patientRegisterAbs: [], //人员已选组合项目
  138. prList: [], //体检登记记录
  139. },
  140. //体检医生诊台
  141. doctorCheck: {
  142. prBase: {
  143. id: '', //体检登记ID
  144. }, //人员体检登记显示基本信息
  145. RegisterCheckEdit: {
  146. id: '',
  147. checkDoctorId: null,
  148. checkDate: '',
  149. completeFlag: '0',
  150. LastModificationTime: '',
  151. LastModifierId: null,
  152. isLock: 'N',
  153. isAudit: 'N',
  154. auditorUserId: null,
  155. auditTime: '',
  156. }, //组合项目详情
  157. doctorCheckDialogVisible: false,
  158. RegisterCheckList: [], //人员体检 组合项目列表
  159. RegisterCheck: {}, //单组合项目记录
  160. RegisterCheckId: '', //
  161. checkItemList: [], //组合项目包含的明细项目
  162. checkItem: {}, //单项目记录
  163. checkSummaryList: [], //小结
  164. checkSuggestionList: [], //建议
  165. },
  166. //总检医生
  167. sumDoctorCheck: {
  168. sumDoctorCheckDialogVisible: false,
  169. sumDiagnosisVisible: false,
  170. sumPREdit: {}, //总检医生时间等相关信息(sumPREditInit)
  171. summaryList: [], //综述
  172. suggestionList: [], //建议
  173. diagnosisList: [], //诊断
  174. },
  175. report: {
  176. dialogCusOrgOCX: false, //通用单位查询控件显示
  177. dataCusOrgOCX: [], //通用单位查询的数据
  178. dialogAsbitemOCX: false,
  179. dataAsbitemOCX: [], //通用组合项目查询的数据
  180. },
  181. diagnosis: {
  182. dialogCusOrgOCX: false, //通用单位查询控件显示
  183. dataCusOrgOCX: [], //通用单位查询的数据
  184. dialogAsbitemOCX: false,
  185. dataAsbitemOCX: [], //通用诊断查询的数据
  186. },
  187. project: {
  188. dialogCusOrgOCX: false, //通用单位查询控件显示
  189. dataCusOrgOCX: [], //通用单位查询的数据
  190. dialogAsbitemOCX: false,
  191. dataAsbitemOCX: [], //通用项目查询的数据
  192. },
  193. //公共字典数据(量大的数据字典推荐用 indexedDB ) add by pengjun
  194. dict: {
  195. personOrgId: "00000000-0000-0000-0000-000000000000", //个人体检单位ID
  196. organization: [], //体检中心
  197. sex: [], //性别(人员档案用)
  198. forSex: [], //适用性别
  199. medicalType: [], //体检类别
  200. personnelType: [], //人员类别
  201. maritalStatus: [], //婚姻状况
  202. forMaritalStatus: [{ id: '0', displayName: '未婚' }, { id: '1', displayName: '已婚' }, { id: 'A', displayName: '全部' }], //适用婚姻
  203. sexHormoneTerm: [], //性激素期
  204. nation: [], //民族
  205. birthPlace: [], //籍惯 ,出生地
  206. completeFlag: [
  207. //体检完成标志
  208. { id: "0", displayName: "预登记" },
  209. { id: "1", displayName: "正式登记" },
  210. { id: "2", displayName: "部份已检" },
  211. { id: "3", displayName: "已总检" },
  212. ],
  213. checkCompleteFlag: [
  214. //体检完成标志
  215. { id: "0", displayName: "未检" },
  216. { id: "1", displayName: "已检" },
  217. { id: "2", displayName: "弃检" },
  218. ],
  219. sumAudit: [
  220. //总检审核
  221. { id: "Y", displayName: "已审核" },
  222. { id: "N", displayName: "未审核" }
  223. ],
  224. payType: [
  225. //支付方式,比如是0自费、2免费、1单位支付
  226. { id: "0", displayName: "个人支付" },
  227. { id: "1", displayName: "单位支付" },
  228. { id: "2", displayName: "赠送" },
  229. ],
  230. cardMode: [
  231. { id: "0", displayName: "充值卡" },
  232. { id: "1", displayName: "积分卡" },
  233. ],
  234. cardType: [], //会员卡类别
  235. billFlag: [
  236. { id: "0", displayName: "收费" },
  237. { id: "1", displayName: "退费" },
  238. { id: "2", displayName: "充值" },
  239. ],
  240. checkTypeFlag: [
  241. { id: "0", displayName: "检验" },
  242. { id: "1", displayName: "功能检查" },
  243. ],
  244. menuType: [
  245. { id: "0", displayName: "仅菜单节点" },
  246. { id: "1", displayName: "菜单及页面" },
  247. { id: "2", displayName: "仅页面节点" },
  248. { id: "3", displayName: "按钮或事件" },
  249. ],
  250. medicalPackage: [], //所有套餐
  251. customerOrgGroupAll: [], //所有分组,不限单位,不限次数
  252. customerOrg: [], //所有单位,非树结构
  253. payMode: [], //支付方式
  254. itemTypeTree: [], //体检类别 树结构
  255. asbItemAll: [], //所有组合项目
  256. asbItem: [], //显示的 未选组合项目
  257. asbItemQuick: [], //显示的 未选组合项目(供快速选择)
  258. diagnosisLevel: [], //诊断级别
  259. },
  260. // 项目特有的对象数据 project private
  261. projPriv: {
  262. idNos: {
  263. Code: "Success", //读取成功/失败
  264. Name: "刘滔",
  265. Sex: "男",
  266. Nation: "汉",
  267. Birthday: "1986-01-22",
  268. Address: "湖南省长沙县春华镇九木村新元组367号",
  269. DepartmentIC: "长沙县公安局",
  270. StartDateIC: "2019-11-25",
  271. EndDateIC: "2039-11-25",
  272. IDCode: "430121198601223693",
  273. Photo: "base64编码字符串"
  274. }, //读取身份证信息
  275. },
  276. // 多层数据传递时使用(统一归结在此,便于管理)
  277. dataTransOpts: {
  278. //强制刷新(如触发数据刷新的ID值没有变化时,但也想强制刷新数据: S--single 单记录刷新,M--more 多记录刷新)
  279. refresh: {
  280. adp_roles: { S: 0, M: 0 }, // 角色
  281. adp_users: { S: 0, M: 0 }, // 用户
  282. asbitem: { S: 0, M: 0 }, // 组合项目
  283. customer_org_group: { S: 0, M: 0 }, // 单位分组
  284. customer_org_group_detail: { S: 0, M: 0 }, // 单位分组包含的组合项目明细
  285. charge: { S: 0, M: 0 }, // 收费
  286. menu_info: { S: 0, M: 0 }, // 菜单与页面
  287. patient_register: { S: 0, M: 0 }, // 体检人员记录
  288. register_asbitem: { S: 0, M: 0 }, // 体检人员登记的项目(合并前)
  289. register_check: { S: 0, M: 0 }, // 体检人员登记的项目(合并后)
  290. register_check_item: { S: 0, M: 0 }, // 体检人员登记的明细项目
  291. role_menu_info: { S: 0, M: 0 }, // 角色对应的菜单
  292. },
  293. //表当前数据(单条记录 S--single)
  294. tableS: {
  295. adp_roles: { id: '' }, // 角色
  296. adp_users: { id: '' }, // 用户
  297. asbitem: { id: '' }, // 组合项目
  298. customer_org_group: { id: '' }, // 单位分组
  299. customer_org_group_detail: { id: '' }, // 单位分组包含的组合项目明细
  300. charge: { id: '' }, // 收费
  301. menu_info: { id: '' }, // 菜单与页面
  302. patient_register: { id: '' },
  303. register_asbitem: { id: '' },
  304. register_check: { id: '' },
  305. register_check_item: { id: '' },
  306. role_menu_info: { id: '' }, // 角色对应的菜单
  307. },
  308. //表当前数据(多条记录 M--more)
  309. tableM: {
  310. adp_roles: [], // 角色
  311. adp_users: [], // 用户
  312. asbitem: [], // 组合项目
  313. customer_org_group: [], // 单位分组
  314. customer_org_group_detail: [], // 单位分组包含的组合项目明细
  315. charge: [], // 收费
  316. menu_info: [], // 菜单与页面
  317. patient_register: [],
  318. register_asbitem: [],
  319. register_check: [],
  320. register_check_item: [],
  321. role_menu_info: [], // 角色对应的菜单
  322. },
  323. plus:{
  324. clearPatientRegisterQuery:0,
  325. }
  326. },
  327. // 弹窗控制
  328. dialogWin: {
  329. CustomerOrgGroupEdit:false, // 单位分组 新增/编辑
  330. PatientList: false, // 体检人员档案列表
  331. PatientRegisterEdit: false, // 体检人员登记 新增/编辑
  332. PatientRegisterForChoose: false, // 体检人员登记列表
  333. PatientRegisterEditItemBatch: false, //批量调整项目
  334. PatientRegisterEditGroupBatch: false, //批量调整分组
  335. MenuPageSet: false, // 设置角色菜单权限
  336. }
  337. },
  338. getters: {
  339. },
  340. mutations: {
  341. //同步更改状态
  342. //通用设置 state 值 option {key:,value:} add by pengjun
  343. setData(state, option) {
  344. let array = option.key.split(".");
  345. switch (array.length) {
  346. case 1:
  347. state[array[0]] = option.value;
  348. break;
  349. case 2:
  350. state[array[0]][array[1]] = option.value;
  351. break;
  352. case 3:
  353. state[array[0]][array[1]][array[2]] = option.value;
  354. break;
  355. case 4:
  356. state[array[0]][array[1]][array[2]][array[3]] = option.value;
  357. break;
  358. }
  359. },
  360. doctorCheckPrBaseInit(state) {
  361. state.doctorCheck.prBase = {
  362. id: '', //体检登记ID
  363. patientRegisterNo: '', //条码号
  364. patientNo: '', //档案号
  365. patientName: '', //姓名
  366. sexId: '', //性别
  367. medicalTimes: '', //体检次数
  368. maritalStatusId: '', //婚姻
  369. creationTime: '', //体检日期
  370. customerOrgParentName: '', //单位
  371. customerOrgName: '', //部门
  372. medicalTypeId: '', //体检类别
  373. personnelTypeId: '', //人员类别
  374. nationId: '', //民族
  375. mobileTelephone: '', //手机
  376. } //人员体检登记显示基本信息
  377. },
  378. sumPREditInit(state) {
  379. state.sumDoctorCheck.sumPREdit = {
  380. id: '', //体检登记ID
  381. completeFlag: '', //完成状态
  382. summaryDoctor: '', //总检医生
  383. summaryDate: '', //总检日期
  384. isAudit: '', //审核状态
  385. auditDoctor: '', //审核医生
  386. auditDate: '', //审核日期
  387. isLock: '', //锁定状态
  388. patientId: '', //人员档案ID
  389. } //人员体检登记显示基本信息
  390. },
  391. },
  392. actions: {
  393. //获取体检人员所选组合项目
  394. getPatientRegisterAbs(context, id) {
  395. //console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
  396. if (id) {
  397. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
  398. (res) => {
  399. console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
  400. if (res.code == 1) {
  401. let patientRegisterAbs = []
  402. res.data.forEach(e => {
  403. e.standTotal = e.amount * e.standardPrice
  404. e.total = e.amount * e.chargePrice
  405. patientRegisterAbs.push(e)
  406. });
  407. context.commit("setData", {
  408. key: "patientRegister.patientRegisterAbs",
  409. value: patientRegisterAbs,
  410. });
  411. context.commit("setData", {
  412. key: "dict.asbItem",
  413. value: arrayReduce(
  414. [...context.state.dict.asbItem], [...context.state.patientRegister.patientRegisterAbs],
  415. "id=asbitemId"
  416. ),
  417. });
  418. context.commit("setData", {
  419. key: "dict.asbItemQuick",
  420. value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"),
  421. });
  422. //console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
  423. }
  424. }
  425. );
  426. } else {
  427. context.commit("setData", {
  428. key: "patientRegister.patientRegisterAbs",
  429. value: [],
  430. });
  431. context.commit("setData", {
  432. key: "dict.asbItem",
  433. value: [...context.state.dict.asbItemAll],
  434. });
  435. context.commit("setData", {
  436. key: "dict.asbItemQuick",
  437. value: [...context.state.dict.asbItemAll],
  438. });
  439. }
  440. },
  441. //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
  442. getCustomerOrgGroup(context, customerOrgld) {
  443. console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
  444. getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
  445. .then((res) => {
  446. console.log("vuex getCustomerOrgGroup", res.data);
  447. if (res.code == 1) {
  448. //this.patientRegister.customerOrgGroup = res.data
  449. context.commit("setData", {
  450. key: "patientRegister.customerOrgGroup",
  451. value: res.data,
  452. });
  453. }
  454. });
  455. },
  456. },
  457. modules: {},
  458. });