Bladeren bron

Merge branch 'master' of http://101.42.248.108:3000/wangyu/eitc-erm-pc

李帅 3 maanden geleden
bovenliggende
commit
749f9d3e66

+ 21 - 0
src/api/allApi.js

@@ -841,6 +841,27 @@ 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
 
845 866
 export function noticeManageList(params) {
846 867
   return request({

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

@@ -0,0 +1,261 @@
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%'}" :maxlength="64"></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
+          pattern: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
149
+          message: '服务IP格式错误',
150
+          trigger: 'blur'
151
+        }],
152
+        serverUser: [{
153
+          required: true,
154
+          message: '请输入服务用户',
155
+          trigger: 'blur'
156
+        }],
157
+        serverPassword: [{
158
+          required: true,
159
+          message: '请输入服务密码',
160
+          trigger: 'blur'
161
+        }],
162
+        realmName: [{
163
+          required: true,
164
+          message: '请输入诊所域名',
165
+          trigger: 'blur'
166
+        }],
167
+        creatTime: [{
168
+          required: true,
169
+          message: '请输入创建时间',
170
+          trigger: 'change'
171
+        }],
172
+        expireTime: [{
173
+          required: true,
174
+          message: '请选择时间选择',
175
+          trigger: 'change'
176
+        }],
177
+        versionInfo: [{
178
+          required: true,
179
+          message: '请输入版本信息',
180
+          trigger: 'blur'
181
+        }],
182
+        region: [{
183
+          required: true,
184
+          message: '请输入所在地区',
185
+          trigger: 'blur'
186
+        }],
187
+        phone: [{
188
+          required: true,
189
+          message: '请输入绑定手机',
190
+          trigger: 'blur'
191
+        }, {
192
+          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
193
+          message: '手机号格式错误',
194
+          trigger: 'blur'
195
+        }],
196
+        address: [{
197
+          required: true,
198
+          message: '请输入详细地址',
199
+          trigger: 'blur'
200
+        }],
201
+        versionRefer: [{
202
+          required: true,
203
+          message: '请输入版本描述',
204
+          trigger: 'blur'
205
+        }],
206
+      },
207
+    }
208
+  },
209
+  computed: {},
210
+  watch: {},
211
+  created() {
212
+  },
213
+  mounted() {
214
+
215
+  },
216
+  methods: {
217
+    onClose() {
218
+      this.$emit('closeDialog')
219
+      this.formData = {
220
+        creatTime: null,
221
+        expireTime: null
222
+      }
223
+    },
224
+    async handleConfirm() {
225
+      /**
226
+       * 新增
227
+       */
228
+      if (this.pageType === 1) {
229
+        const res = await addClinict(this.formData)
230
+        if (res.code === 200) {
231
+          this.$emit('closeDialog')
232
+          this.$emit('initList')
233
+          this.$message.success('保存成功')
234
+        } else {
235
+          this.$message.error(res.msg)
236
+        }
237
+      } else {
238
+        /**
239
+         * 编辑
240
+         */
241
+        console.log(this.formData)
242
+        const res = await editClinict(this.formData)
243
+        if (res.code === 200) {
244
+          this.$emit('initList')
245
+          this.$emit('closeDialog')
246
+          this.$message.success('保存成功')
247
+          this.formData = {
248
+            creatTime: null,
249
+            expireTime: null
250
+          }
251
+        } else {
252
+          this.$message.error(res.msg)
253
+        }
254
+      }
255
+    },
256
+  }
257
+}
258
+
259
+</script>
260
+<style>
261
+</style>

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

@@ -1,94 +1,204 @@
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 > 30 "  style="color: green"> 剩余天数({{scope.row.isExpire}}) </p>
50
+          <p v-else-if="scope.row.isExpire > 1 && scope.row.isExpire < 31"  style="color: orange"> 剩余天数({{scope.row.isExpire}}) </p>
51
+          <span v-else style="color: red">已到期</span>
52
+        </template>
28 53
       </el-table-column>
29 54
       <el-table-column prop="address" label="地址" align="center">
30 55
       </el-table-column>
31 56
       <el-table-column fixed="right" label="操作" align="center">
32 57
         <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
-          >
58
+          <el-button type="text" size="small" @click="upgrade(scope.row)">升级</el-button>
59
+          <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
60
+          <el-button type="text" size="small" style="color: red" @click="deleteData(scope.row.id)">删除
61
+          </el-button>
37 62
         </template>
38 63
       </el-table-column>
39 64
     </el-table>
40 65
 
41 66
     <pagination
42
-      v-show="total > 0"
43
-      :total="total"
44
-      :page.sync="form.pageNum"
45
-      :limit.sync="form.pageSize"
46
-      @pagination="initList"
67
+        v-show="total > 0"
68
+        :total="total"
69
+        :page.sync="form.pageNum"
70
+        :limit.sync="form.pageSize"
71
+        @pagination="initList"
72
+    />
73
+    <addClinic
74
+        :onOpen="onOpen"
75
+        :title="title"
76
+        :pageType="pageType"
77
+        :dictType="dictType"
78
+        ref="addClinicRef"
79
+        @closeDialog="closeDialog"
80
+    />
81
+    <upgrade
82
+        :upgradeOpen="upgradeOpen"
83
+        :title="title"
84
+        ref="upgradeOpenRef"
85
+        @closeDialog="closeDialog"
47 86
     />
48 87
   </div>
49 88
 </template>
50 89
 
51 90
 <script>
91
+import {clinictList,delClinict} from '@/api/allApi.js'
92
+import addClinic from "./addClinic.vue";
93
+import upgrade from "./upgrade.vue";
94
+
52 95
 export default {
53 96
   name: 'EitcErmPcIndex',
54
-
97
+  computed: {
98
+  },
99
+  components: {
100
+    upgrade,
101
+    addClinic
102
+  },
55 103
   data() {
56 104
     return {
105
+      onOpen: false,
106
+      upgradeOpen: false,
107
+      title: ``,
108
+      dictType: ``,
57 109
       form: {
58 110
         pageNum: 1,
59 111
         pageSize: 10
60 112
       },
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
113
+      clinicName: '',
114
+      data: {},
115
+      editData: {},
116
+      tableData: [],
117
+      total: 0,
118
+      pageType: 1,
84 119
     }
85 120
   },
86 121
 
87
-  mounted() {},
122
+  mounted() {
123
+    this.initList('')
124
+  },
88 125
 
89 126
   methods: {
90
-    initList() {},
91
-    reset() {}
127
+    /**
128
+     * 编辑
129
+     */
130
+    edit(val) {
131
+      this.onOpen = true;
132
+      this.pageType = 2;
133
+      this.$refs.addClinicRef.formData = val;
134
+    },
135
+    /**
136
+     * 新增
137
+     */
138
+    add(){
139
+      this.onOpen = true;
140
+      this.pageType = 1;
141
+    },
142
+    /**
143
+     * 升级页面
144
+     */
145
+    upgrade(val){
146
+      this.upgradeOpen = true;
147
+      val.versionInfoOld = val.versionInfo
148
+      this.$refs.upgradeOpenRef.formData = val;
149
+      console.log(val)
150
+    },
151
+    async initList() {
152
+      let obj = {}
153
+      if (this.clinicName.length>0){
154
+        obj = {clinicName: this.clinicName}
155
+      }
156
+      const res = await clinictList(obj)
157
+      this.tableData = res.rows;
158
+      this.tableData.forEach(x=>{
159
+        const today = new Date();
160
+        let endTime = new Date(Date.parse(x.expireTime.replace(/-/g, "/"))).getTime();
161
+        x.isExpire =Math.ceil(Math.abs((today - endTime)) / (1000 * 60 * 60 * 24));
162
+      })
163
+    },
164
+    /**
165
+     * 重置
166
+     */
167
+    reset() {
168
+      this.clinicName = ''
169
+    },
170
+    /**
171
+     * 关闭弹窗
172
+     */
173
+    closeDialog(){
174
+      this.onOpen = false;
175
+      this.upgradeOpen = false;
176
+    },
177
+    /**
178
+     * 删除
179
+     */
180
+    deleteData(id) {
181
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
182
+        confirmButtonText: '确定',
183
+        cancelButtonText: '取消',
184
+        type: 'warning'
185
+      }).then(() => {
186
+        delClinict(id).then(res => {
187
+          if (res.code !== 200) return this.$message.error(res.msg);
188
+          this.initList()
189
+          this.$message({
190
+            type: 'success',
191
+            message: '删除成功!'
192
+          });
193
+        })
194
+      }).catch(() => {
195
+        this.$message({
196
+          type: 'info',
197
+          message: '已取消删除'
198
+        });
199
+      });
200
+
201
+    }
92 202
   }
93 203
 }
94
-</script>
204
+</script>

+ 124 - 0
src/views/settingsPage/clinicMaintenance/upgrade.vue

@@ -0,0 +1,124 @@
1
+<template>
2
+  <div>
3
+    <el-dialog :visible="upgradeOpen" @close="onClose" title="升级">
4
+      <el-row :gutter="15">
5
+        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
6
+
7
+          <el-col :span="12">
8
+            <el-form-item label="现在版本" prop="versionInfoOld">
9
+              <el-input v-model="formData.versionInfoOld" placeholder="请输入现在版本" readonly :disabled='true' clearable
10
+                        :style="{width: '100%'}"></el-input>
11
+            </el-form-item>
12
+          </el-col>
13
+          <el-col :span="12">
14
+            <el-form-item label="升级版本" prop="versionInfo">
15
+              <el-input v-model="formData.versionInfo" placeholder="请输入升级版本" :maxlength="64" clearable
16
+                        :style="{width: '100%'}"></el-input>
17
+            </el-form-item>
18
+          </el-col>
19
+<!--          <el-col :span="24">-->
20
+<!--            <el-form-item label="上传升级包" prop="field102" required>-->
21
+<!--              <el-upload ref="field102" :file-list="field102fileList" :action="field102Action"-->
22
+<!--                         :before-upload="field102BeforeUpload">-->
23
+<!--                <el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>-->
24
+<!--              </el-upload>-->
25
+<!--            </el-form-item>-->
26
+<!--          </el-col>-->
27
+          <el-col :span="12">
28
+            <el-form-item label="校验码" prop="vcode">
29
+              <el-input v-model="formData.vcode" placeholder="请输入校验码" clearable
30
+                        :style="{width: '100%'}"></el-input>
31
+            </el-form-item>
32
+<!--          </el-col>-->
33
+<!--          <el-col :span="4">-->
34
+<!--            <el-form-item label-width="16px" label="" prop="field105">-->
35
+<!--              <el-button type="primary" size="medium"> 获取校验码 </el-button>-->
36
+<!--            </el-form-item>-->
37
+          </el-col>
38
+        </el-form>
39
+      </el-row>
40
+      <div slot="footer">
41
+        <el-button @click="close">取消</el-button>
42
+        <el-button type="primary" @click="handleConfirm">确定</el-button>
43
+      </div>
44
+    </el-dialog>
45
+  </div>
46
+</template>
47
+<script>
48
+import {editClinict} from '@/api/allApi.js'
49
+
50
+export default {
51
+  inheritAttrs: false,
52
+  components: {},
53
+  props: {
54
+    upgradeOpen: {
55
+      type: Boolean,
56
+      default: false
57
+    }
58
+  },
59
+  data() {
60
+    return {
61
+      formData: {
62
+      },
63
+      rules: {
64
+        versionInfo: [{
65
+          required: true,
66
+          message: '请输入升级版本',
67
+          trigger: 'blur'
68
+        }],
69
+        vcode: [{
70
+          required: true,
71
+          message: '请输入升级版本',
72
+          trigger: 'blur'
73
+        }]
74
+      },
75
+      field102Action: 'https://jsonplaceholder.typicode.com/posts/',
76
+      field102fileList: [],
77
+    }
78
+  },
79
+  computed: {},
80
+  watch: {},
81
+  created() {
82
+
83
+  },
84
+  mounted() {
85
+
86
+
87
+  },
88
+  methods: {
89
+    onClose() {
90
+      this.$emit('closeDialog')
91
+    },
92
+    close() {
93
+      this.$emit('closeDialog')
94
+    },
95
+    async handleConfirm() {
96
+      console.log(this.formData)
97
+      const res = await editClinict(this.formData)
98
+      if (res.code === 200) {
99
+        this.$emit('initList')
100
+        this.$emit('closeDialog')
101
+        this.$message.success('保存成功')
102
+        this.formData = {}
103
+      } else {
104
+        this.$message.error(res.msg)
105
+        this.$emit('closeDialog')
106
+      }
107
+    },
108
+    field102BeforeUpload(file) {
109
+      let isRightSize = file.size / 1024 / 1024 < 2
110
+      if (!isRightSize) {
111
+        this.$message.error('文件大小超过 2MB')
112
+      }
113
+      return isRightSize
114
+    },
115
+  }
116
+}
117
+
118
+</script>
119
+<style>
120
+.el-upload__tip {
121
+  line-height: 1.2;
122
+}
123
+
124
+</style>