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.

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