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.

200 lines
7.3 KiB

3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 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
3 years ago
2 years ago
3 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
3 years ago
3 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
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. set: "qqqq",
  9. customerOrg: {
  10. //体检单位设置
  11. customerOrgTree: [], //体检单位列表
  12. treeprops: {
  13. label: "displayName",
  14. value: "id",
  15. children: "treeChildren",
  16. }, //树形组件的数据结构
  17. customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
  18. customerOrgRd: { id: "", displayName: "单位名称" }, //单个体检单位记录值
  19. customerOrgRegisterList: [], //单位体检次数登记列表
  20. contactPersonList: [], //联系人列表
  21. contactMethodList: [], //联系方式列表
  22. },
  23. //体检单位分组
  24. personnelUnit: {
  25. customerOrgGroupId: "",
  26. personnelgrouping: [], //人员分组
  27. id: "", //根据Id选择的数据
  28. form: { id: "" }, //列表每一项
  29. nogroupselected: [], //已选分组
  30. },
  31. //体检人员登记 add by pengjun
  32. patientRegister: {
  33. customerOrgTreeAll: [], //体检单位列表(含个人)
  34. patientRegisterId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
  35. patientRegisterRd: { id: "" }, //体检人员记录
  36. patientRegisterTimes: 0, //体检人员登记窗口显示次数(弃用)
  37. addTimes: 0, //用于触发新增时初始化赋值
  38. saveTimes:0, //用于体检登记时,触发分组调整保存
  39. photo:
  40. "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg", //单独抽出,拍照时会更新
  41. cameraVisble: false, //拍照控件显示
  42. patientRegisterRdInit: {
  43. id: "", //id
  44. patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
  45. patientNo: "", //档案号
  46. customerOrgId: null, //单位编号
  47. customerOrgGroupId: null, //分组
  48. medicalPackageId: null, //套餐
  49. patientName: "", //姓名
  50. birthDate: "", //字符串 如:2012-01-29
  51. sexId: "U", //性别 默认未知U
  52. age: null, //年龄
  53. jobCardNo: "", //工卡号
  54. medicalCardNo: "", //体检卡号
  55. maritalStatusId: "U", //婚姻状况 默认未知
  56. medicalTypeId: null, //体检类别
  57. personnelTypeId: null, //人员类别
  58. jobPost: "", //职务
  59. jobTitle: "", //职称
  60. photo: "", //照片
  61. salesman: "", //介绍人
  62. sexHormoneTermId: null, //性激素期限
  63. isNameHide: "N", //隐藏姓名
  64. isPhoneFollow: "N", //电话随访
  65. isVip: "N", //vip客户
  66. remark: "", //
  67. isLock: "N", //是否锁住
  68. completeFlag: "1", //完成标志 0:预登记,1:未检,2:部份已检,3:已总检 【创建编辑时不操作】
  69. isMedicalStart: "N", //体检开始标志 【创建编辑时不操作】
  70. patientRegisterNo: "", //条码号 【创建编辑时不操作】
  71. medicalTimes: 1, //条码号 【创建编辑时不操作】
  72. organizationUnitId: null, //体检中心
  73. address: "", //地址
  74. email: "", //email
  75. idNo: "", //身份证号
  76. telephone: "", //电话
  77. mobileTelephone: "", //手机号
  78. nationId: null, //民族编号
  79. postalCode: "", //邮编
  80. creatorId: null,
  81. creationTime: "",
  82. lastModificationTime: "",
  83. lastModifierId: null,
  84. }, //体检人员记录(初始值)一般创建用
  85. customerOrgGroupAsb: [], //选中分组所包含的组合项目
  86. medicalPackageAsb: [], //选中套餐所包含的组合项目
  87. query: {
  88. times: 0, //触发查询次数
  89. customerOrgId: "", //体检单位ID
  90. CustomerOrgParentld: "", //单位父级ID
  91. }, //查询条件
  92. customerOrgGroup: [], //分组(针对单位)
  93. patientRegisterAbs: [], //人员已选组合项目
  94. },
  95. //公共字典数据 add by pengjun
  96. dict: {
  97. personOrgId: "00000000-0000-0000-0000-000000000000", //个人体检单位ID
  98. organization: [], //体检中心
  99. sex: [], //性别
  100. medicalType: [], //体检类别
  101. personnelType: [], //人员类别
  102. maritalStatus: [], //婚姻状况
  103. sexHormoneTerm: [], //性激素期
  104. nation: [], //民族
  105. birthPlace: [], //籍惯 ,出生地
  106. completeFlag: [
  107. //体检完成标志
  108. { id: "0", displayName: "预登记" },
  109. { id: "1", displayName: "正式登记" },
  110. { id: "2", displayName: "部份已检" },
  111. { id: "3", displayName: "已总检" },
  112. ],
  113. payType: [
  114. //支付方式,比如是0自费、2免费、1单位支付
  115. { id: "0", displayName: "个人支付" },
  116. { id: "1", displayName: "单位支付" },
  117. { id: "2", displayName: "赠送" },
  118. ],
  119. medicalPackage: [], //所有套餐
  120. customerOrgGroupAll: [], //所有分组,不限单位,不限次数
  121. customerOrg: [], //所有单位,非树结构
  122. payMode: [], //支付方式
  123. itemTypeTree: [], //体检类别 树结构
  124. asbItemAll: [], //所有组合项目
  125. asbItem: [], //显示的 未选组合项目
  126. },
  127. },
  128. getters: {},
  129. mutations: {
  130. //同步更改状态
  131. //通用设置 state 值 option {key:,value:} add by pengjun
  132. setData(state, option) {
  133. let array = option.key.split(".");
  134. switch (array.length) {
  135. case 1:
  136. state[array[0]] = option.value;
  137. break;
  138. case 2:
  139. state[array[0]][array[1]] = option.value;
  140. break;
  141. case 3:
  142. state[array[0]][array[1]][array[2]] = option.value;
  143. break;
  144. case 4:
  145. state[array[0]][array[1]][array[2]][array[3]] = option.value;
  146. break;
  147. }
  148. },
  149. },
  150. actions: {
  151. //获取体检人员所选组合项目
  152. getPatientRegisterAbs(context, id) {
  153. //console.log('vuex getPatientRegisterAbs', context.state.dict.asbItemAll)
  154. getapi(`/api/app/register-asbitem/in-patient-register-id/${id}`).then(
  155. (res) => {
  156. if (res.code == 1) {
  157. context.commit("setData", {
  158. key: "patientRegister.patientRegisterAbs",
  159. value: res.data,
  160. });
  161. context.commit("setData", {
  162. key: "dict.asbItem",
  163. value: arrayReduce(
  164. [...context.state.dict.asbItemAll],
  165. [...context.state.patientRegister.patientRegisterAbs],
  166. "id=asbitemId"
  167. ),
  168. });
  169. }
  170. }
  171. );
  172. },
  173. //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
  174. getCustomerOrgGroup(context, customerOrgld) {
  175. console.log(
  176. `vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`
  177. );
  178. getapi(
  179. `/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`
  180. ).then((res) => {
  181. console.log("vuex getCustomerOrgGroup", res.data);
  182. if (res.code == 1) {
  183. //this.patientRegister.customerOrgGroup = res.data
  184. context.commit("setData", {
  185. key: "patientRegister.customerOrgGroup",
  186. value: res.data,
  187. });
  188. }
  189. });
  190. },
  191. },
  192. modules: {},
  193. });