浏览代码

诊所维护

zhangjiansheng 3 月之前
父节点
当前提交
7609ecdb2b
共有 3 个文件被更改,包括 414 次插入45 次删除
  1. 21 0
      src/api/allApi.js
  2. 257 0
      src/views/settingsPage/clinicMaintenance/addClinic.vue
  3. 136 45
      src/views/settingsPage/clinicMaintenance/index.vue

+ 21 - 0
src/api/allApi.js

@@ -841,4 +841,25 @@ export function operationsAnalysisList(params) {
841 841
     params
842 842
   })
843 843
 }
844
+export function clinictList(params) {
845
+  return request({
846
+    url: `/sys/clinict/list`,
847
+    method: 'get',
848
+    params
849
+  })
850
+}
851
+export function addClinict(data) {
852
+  return request({
853
+    url: `/sys/clinict/add`,
854
+    method: 'post',
855
+    data
856
+  })
857
+}
858
+export function editClinict(data) {
859
+  return request({
860
+    url: `/sys/clinict/edit`,
861
+    method: 'put',
862
+    data
863
+  })
864
+}
844 865
 

+ 257 - 0
src/views/settingsPage/clinicMaintenance/addClinic.vue

@@ -0,0 +1,257 @@
1
+<template>
2
+  <div>
3
+    <el-dialog :visible="onOpen" v-if="onOpen" @close="onClose" :title="pageType===1?`新增`:`编辑`">
4
+      <el-row :gutter="15">
5
+        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
6
+          <el-col :span="11">
7
+            <el-form-item label="诊所名称" prop="clinicName">
8
+              <el-input v-model="formData.clinicName" placeholder="请输入诊所名称" clearable
9
+                        :style="{width: '100%'}"></el-input>
10
+            </el-form-item>
11
+          </el-col>
12
+          <el-col :span="11">
13
+            <el-form-item label="服务IP" prop="clinicIp">
14
+              <el-input v-model="formData.clinicIp" placeholder="请输入服务IP" clearable :style="{width: '100%'}">
15
+              </el-input>
16
+            </el-form-item>
17
+          </el-col>
18
+          <el-col :span="11">
19
+            <el-form-item label="服务用户" prop="serverUser">
20
+              <el-input v-model="formData.serverUser" placeholder="请输入服务用户" clearable
21
+                        :style="{width: '100%'}"></el-input>
22
+            </el-form-item>
23
+          </el-col>
24
+          <el-col :span="11">
25
+            <el-form-item label="服务密码" prop="serverPassword">
26
+              <el-input v-model="formData.serverPassword" placeholder="请输入服务密码" clearable
27
+                        :style="{width: '100%'}"></el-input>
28
+            </el-form-item>
29
+          </el-col>
30
+          <el-col :span="11">
31
+            <el-form-item label="诊所域名" prop="realmName">
32
+              <el-input v-model="formData.realmName" placeholder="请输入诊所域名" clearable :style="{width: '100%'}">
33
+              </el-input>
34
+            </el-form-item>
35
+          </el-col>
36
+          <el-col :span="11">
37
+            <el-form-item label="创建时间" prop="creatTime">
38
+              <el-date-picker v-model="formData.creatTime" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
39
+                              :style="{width: '100%'}" placeholder="请输入创建时间" clearable></el-date-picker>
40
+            </el-form-item>
41
+          </el-col>
42
+          <el-col :span="11">
43
+            <el-form-item label="到期时间" prop="expireTime">
44
+              <el-date-picker v-model="formData.expireTime" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
45
+                              :style="{width: '100%'}" placeholder="请选择时间选择" clearable></el-date-picker>
46
+            </el-form-item>
47
+          </el-col>
48
+          <el-col :span="11">
49
+            <el-form-item label="版本信息" prop="versionInfo">
50
+              <el-input v-model="formData.versionInfo" placeholder="请输入版本信息" clearable
51
+                        :style="{width: '100%'}"></el-input>
52
+            </el-form-item>
53
+          </el-col>
54
+          <el-col :span="11">
55
+            <el-form-item label="所在地区" prop="region">
56
+              <el-input v-model="formData.region" placeholder="请输入所在地区" clearable :style="{width: '100%'}">
57
+              </el-input>
58
+            </el-form-item>
59
+          </el-col>
60
+          <el-col :span="11">
61
+            <el-form-item label="绑定手机" prop="phone">
62
+              <el-input v-model="formData.phone" placeholder="请输入绑定手机" clearable :style="{width: '100%'}">
63
+              </el-input>
64
+            </el-form-item>
65
+          </el-col>
66
+          <el-col :span="11">
67
+            <el-form-item label="详细地址" prop="address">
68
+              <el-input v-model="formData.address" placeholder="请输入详细地址" clearable :style="{width: '100%'}">
69
+              </el-input>
70
+            </el-form-item>
71
+          </el-col>
72
+          <el-col :span="11">
73
+            <el-form-item label="版本描述" prop="versionRefer">
74
+              <el-select v-model="formData.versionRefer" placeholder="请选择版本描述" clearable
75
+                         :style="{width: '100%'}">
76
+                <el-option v-for="(item, index) in mobileOptions" :key="index" :label="item.label"
77
+                           :value="item.value" :disabled="item.disabled"></el-option>
78
+              </el-select>
79
+            </el-form-item>
80
+          </el-col>
81
+        </el-form>
82
+      </el-row>
83
+      <div slot="footer">
84
+        <el-button @click="onClose">取消</el-button>
85
+        <el-button type="primary" @click="handleConfirm">确定</el-button>
86
+      </div>
87
+    </el-dialog>
88
+  </div>
89
+</template>
90
+<script>
91
+import {addClinict, editClinict} from '@/api/allApi.js'
92
+
93
+export default {
94
+  components: {},
95
+  props: {
96
+    onOpen: {
97
+      type: Boolean,
98
+      default: false
99
+    },
100
+    pageType: {
101
+      type: Number,
102
+      default: 1
103
+    }
104
+  },
105
+  data() {
106
+    return {
107
+      formData: {
108
+        clinicName: ``,
109
+        clinicIp: ``,
110
+        serverUser: ``,
111
+        serverPassword: ``,
112
+        realmName: ``,
113
+        creatTime: null,
114
+        expireTime: null,
115
+        versionInfo: ``,
116
+        region: ``,
117
+        phone: ``,
118
+        address: ``,
119
+        versionRefer: ``,
120
+      },
121
+      mobileOptions: [{
122
+        "label": "免费版",
123
+        "value": "免费版"
124
+      },{
125
+        "label": "基础版",
126
+        "value": "基础版"
127
+      }, {
128
+        "label": "高级版",
129
+        "value": "高级版"
130
+      }, {
131
+        "label": "豪华版",
132
+        "value": "豪华版"
133
+      }, {
134
+        "label": "尊贵版",
135
+        "value": "尊贵版"
136
+      }],
137
+      rules: {
138
+        clinicName: [{
139
+          required: true,
140
+          message: '请输入诊所名称',
141
+          trigger: 'blur'
142
+        }],
143
+        clinicIp: [{
144
+          required: true,
145
+          message: '请输入服务IP',
146
+          trigger: 'blur'
147
+        }],
148
+        serverUser: [{
149
+          required: true,
150
+          message: '请输入服务用户',
151
+          trigger: 'blur'
152
+        }],
153
+        serverPassword: [{
154
+          required: true,
155
+          message: '请输入服务密码',
156
+          trigger: 'blur'
157
+        }],
158
+        realmName: [{
159
+          required: true,
160
+          message: '请输入诊所域名',
161
+          trigger: 'blur'
162
+        }],
163
+        creatTime: [{
164
+          required: true,
165
+          message: '请输入创建时间',
166
+          trigger: 'change'
167
+        }],
168
+        expireTime: [{
169
+          required: true,
170
+          message: '请选择时间选择',
171
+          trigger: 'change'
172
+        }],
173
+        versionInfo: [{
174
+          required: true,
175
+          message: '请输入版本信息',
176
+          trigger: 'blur'
177
+        }],
178
+        region: [{
179
+          required: true,
180
+          message: '请输入所在地区',
181
+          trigger: 'blur'
182
+        }],
183
+        phone: [{
184
+          required: true,
185
+          message: '请输入绑定手机',
186
+          trigger: 'blur'
187
+        }, {
188
+          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
189
+          message: '手机号格式错误',
190
+          trigger: 'blur'
191
+        }],
192
+        address: [{
193
+          required: true,
194
+          message: '请输入详细地址',
195
+          trigger: 'blur'
196
+        }],
197
+        versionRefer: [{
198
+          required: true,
199
+          message: '请输入版本描述',
200
+          trigger: 'blur'
201
+        }],
202
+      },
203
+    }
204
+  },
205
+  computed: {},
206
+  watch: {},
207
+  created() {
208
+  },
209
+  mounted() {
210
+
211
+  },
212
+  methods: {
213
+    onClose() {
214
+      this.$emit('closeDialog')
215
+      this.formData = {
216
+        creatTime: null,
217
+        expireTime: null
218
+      }
219
+    },
220
+    async handleConfirm() {
221
+      /**
222
+       * 新增
223
+       */
224
+      if (this.pageType === 1) {
225
+        const res = await addClinict(this.formData)
226
+        if (res.code === 200) {
227
+          this.$emit('closeDialog')
228
+          this.$emit('initList')
229
+          this.$message.success('保存成功')
230
+        } else {
231
+          this.$message.error(res.msg)
232
+        }
233
+      } else {
234
+        /**
235
+         * 编辑
236
+         */
237
+        console.log(this.formData)
238
+        const res = await editClinict(this.formData)
239
+        if (res.code === 200) {
240
+          this.$emit('initList')
241
+          this.$emit('closeDialog')
242
+          this.$message.success('保存成功')
243
+          this.formData = {
244
+            creatTime: null,
245
+            expireTime: null
246
+          }
247
+        } else {
248
+          this.$message.error(res.msg)
249
+        }
250
+      }
251
+    },
252
+  }
253
+}
254
+
255
+</script>
256
+<style>
257
+</style>

+ 136 - 45
src/views/settingsPage/clinicMaintenance/index.vue

@@ -1,94 +1,185 @@
1 1
 <template>
2 2
   <div class="app-container">
3 3
     <el-form :inline="true">
4
-      <el-form-item label="姓名:">
4
+      <el-form-item label="诊所名称:">
5 5
         <el-input
6
-          v-model="form.doctorName"
7
-          placeholder="请输入姓名查找"
6
+            v-model="clinicName"
7
+            placeholder="请输入诊所名称查找"
8 8
         ></el-input>
9 9
       </el-form-item>
10 10
       <el-form-item>
11 11
         <el-button type="primary" @click="initList" icon="el-icon-search"
12
-          >搜索</el-button
12
+        >搜索
13
+        </el-button
13 14
         >
14 15
         <el-button @click="reset">重置</el-button>
15 16
       </el-form-item>
16 17
     </el-form>
17 18
 
18 19
     <el-row style="margin-bottom: 20px;">
19
-      <el-button type="primary" plain icon="el-icon-plus" size="mini"
20
-        >新增</el-button
20
+      <el-button type="primary" plain icon="el-icon-plus" size="mini"  @click="add()"
21
+      >新增
22
+      </el-button
21 23
       >
22 24
     </el-row>
23 25
 
24 26
     <el-table :data="tableData" style="width: 100%">
25
-      <el-table-column prop="date" label="日期" align="center">
27
+      <el-table-column prop="clinicCode" label="诊所编号" align="center">
26 28
       </el-table-column>
27
-      <el-table-column prop="name" label="姓名" align="center">
29
+      <el-table-column prop="clinicName" label="诊所名称" align="center">
30
+      </el-table-column>
31
+      <el-table-column prop="clinicIp" label="IP地址" align="center">
32
+      </el-table-column>
33
+      <el-table-column prop="phone" label="手机号" align="center">
34
+      </el-table-column>
35
+      <el-table-column prop="serverUser" label="服务器登录名" align="center">
36
+      </el-table-column>
37
+      <el-table-column prop="serverPassword" label="服务器密码" align="center">
38
+      </el-table-column>
39
+      <el-table-column prop="versionInfo" label="服务器版本编号" align="center">
40
+      </el-table-column>
41
+      <el-table-column prop="versionRefer" label="购买版本" align="center">
42
+      </el-table-column>
43
+      <el-table-column prop="creatTime" label="购买时间" align="center" width="170px">
44
+      </el-table-column>
45
+      <el-table-column prop="expireTime" label="到期时间" align="center" width="170px">
46
+      </el-table-column>
47
+      <el-table-column prop="isExpire" label="是否到期" align="center" width="170px">
48
+        <template slot-scope="scope">
49
+          <p v-if="scope.row.isExpire > 1" > 剩余天数({{scope.row.isExpire}}) </p>
50
+          <span v-else style="color: red">已到期</span>
51
+        </template>
28 52
       </el-table-column>
29 53
       <el-table-column prop="address" label="地址" align="center">
30 54
       </el-table-column>
31 55
       <el-table-column fixed="right" label="操作" align="center">
32 56
         <template slot-scope="scope">
33
-          <el-button type="text" size="small">编辑</el-button>
34
-          <el-button type="text" size="small" style="color: red"
35
-            >删除</el-button
36
-          >
57
+          <el-button type="text" size="small" @click="">升级</el-button>
58
+          <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
59
+          <el-button type="text" size="small" style="color: red" @click="deleteData(scope.row.id)">删除
60
+          </el-button>
37 61
         </template>
38 62
       </el-table-column>
39 63
     </el-table>
40 64
 
41 65
     <pagination
42
-      v-show="total > 0"
43
-      :total="total"
44
-      :page.sync="form.pageNum"
45
-      :limit.sync="form.pageSize"
46
-      @pagination="initList"
66
+        v-show="total > 0"
67
+        :total="total"
68
+        :page.sync="form.pageNum"
69
+        :limit.sync="form.pageSize"
70
+        @pagination="initList"
71
+    />
72
+    <addClinic
73
+        :onOpen="onOpen"
74
+        :title="title"
75
+        :pageType="pageType"
76
+        :dictType="dictType"
77
+        ref="addClinicRef"
78
+        @closeDialog="closeDialog"
47 79
     />
48 80
   </div>
49 81
 </template>
50 82
 
51 83
 <script>
84
+import {clinictList,delClinict} from '@/api/allApi.js'
85
+import addClinic from "./addClinic.vue";
86
+import edit from "@/views/settingsPage/clinicOverview/edit.vue";
87
+
52 88
 export default {
53 89
   name: 'EitcErmPcIndex',
54
-
90
+  computed: {
91
+  },
92
+  components: {
93
+    addClinic
94
+  },
55 95
   data() {
56 96
     return {
97
+      onOpen: false,
98
+      title: ``,
99
+      dictType: ``,
57 100
       form: {
58 101
         pageNum: 1,
59 102
         pageSize: 10
60 103
       },
61
-      tableData: [
62
-        {
63
-          date: '2016-05-02',
64
-          name: '王小虎',
65
-          address: '上海市普陀区金沙江路 1518 弄'
66
-        },
67
-        {
68
-          date: '2016-05-04',
69
-          name: '王小虎',
70
-          address: '上海市普陀区金沙江路 1517 弄'
71
-        },
72
-        {
73
-          date: '2016-05-01',
74
-          name: '王小虎',
75
-          address: '上海市普陀区金沙江路 1519 弄'
76
-        },
77
-        {
78
-          date: '2016-05-03',
79
-          name: '王小虎',
80
-          address: '上海市普陀区金沙江路 1516 弄'
81
-        }
82
-      ],
83
-      total: 0
104
+      clinicName: '',
105
+      data: {},
106
+      editData: {},
107
+      tableData: [],
108
+      total: 0,
109
+      pageType: 1,
84 110
     }
85 111
   },
86 112
 
87
-  mounted() {},
113
+  mounted() {
114
+    this.initList('')
115
+  },
88 116
 
89 117
   methods: {
90
-    initList() {},
91
-    reset() {}
118
+    /**
119
+     * 编辑
120
+     */
121
+    edit(val) {
122
+      this.onOpen = true;
123
+      this.pageType = 2;
124
+      this.$refs.addClinicRef.formData = val;
125
+    },
126
+    /**
127
+     * 新增
128
+     */
129
+    add(){
130
+      this.onOpen = true;
131
+      this.pageType = 1;
132
+    },
133
+    async initList() {
134
+      let obj = {}
135
+      if (this.clinicName.length>0){
136
+        obj = {clinicName: this.clinicName}
137
+      }
138
+      const res = await clinictList(obj)
139
+      this.tableData = res.rows;
140
+      this.tableData.forEach(x=>{
141
+        const today = new Date();
142
+        let endTime = new Date(Date.parse(x.expireTime.replace(/-/g, "/"))).getTime();
143
+        x.isExpire =Math.ceil(Math.abs((today - endTime)) / (1000 * 60 * 60 * 24));
144
+      })
145
+    },
146
+    /**
147
+     * 重置
148
+     */
149
+    reset() {
150
+      this.clinicName = ''
151
+    },
152
+    /**
153
+     * 关闭弹窗
154
+     */
155
+    closeDialog(){
156
+      this.onOpen = false;
157
+    },
158
+    /**
159
+     * 删除
160
+     */
161
+    deleteData(id) {
162
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
163
+        confirmButtonText: '确定',
164
+        cancelButtonText: '取消',
165
+        type: 'warning'
166
+      }).then(() => {
167
+        delClinict(id).then(res => {
168
+          if (res.code !== 200) return this.$message.error(res.msg);
169
+          this.initList()
170
+          this.$message({
171
+            type: 'success',
172
+            message: '删除成功!'
173
+          });
174
+        })
175
+      }).catch(() => {
176
+        this.$message({
177
+          type: 'info',
178
+          message: '已取消删除'
179
+        });
180
+      });
181
+
182
+    }
92 183
   }
93 184
 }
94
-</script>
185
+</script>