WXL (wul)
2 天以前 d3c60e18b95b50751f8088fa2d23cd8ff7f173bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// src/store/modules/sms.js
const state = {
  // 短信对话框是否可见
  smsDialogVisible: false,
  // 患者数据
  patientData: {
    sendname: '',
    age: '',
    telcode: '',
    deptname: '',
    leavehospitaldistrictname: '',
  },
  // 短信模板
  smsTemplate: '',
};
 
const mutations = {
  // 打开短信对话框
  OPEN_SMS_DIALOG(state, patientData) {
    console.log(11);
 
    state.smsDialogVisible = true;
    if (patientData) {
      state.patientData = {
        sendname: patientData.name || '',
        age: patientData.age || '',
        telcode: patientData.phone || '',
        deptname: patientData.deptName || '',
        leavehospitaldistrictname: patientData.wardName || '',
      };
      state.smsTemplate = patientData.smsTemplate || '';
    }
  },
  // 关闭短信对话框
  CLOSE_SMS_DIALOG(state) {
    state.smsDialogVisible = false;
    state.smsTemplate = '';
  },
  // 更新短信内容
  UPDATE_SMS_CONTENT(state, content) {
    state.smsTemplate = content;
  },
};
 
const actions = {
  // 打开短信对话框
  openSmsDialog({ commit }, patientData) {
    commit('OPEN_SMS_DIALOG', patientData);
  },
  // 关闭短信对话框
  closeSmsDialog({ commit }) {
    commit('CLOSE_SMS_DIALOG');
  },
};
 
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};