Pārlūkot izejas kodu

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

李帅 3 mēneši atpakaļ
vecāks
revīzija
42070cfebd

+ 8 - 1
src/api/allApi.js

@@ -906,4 +906,11 @@ export function noticeManageDetails(params) {
906 906
     method: 'get',
907 907
     params
908 908
   })
909
-}
909
+}
910
+
911
+export function delClinict(id) {
912
+  return request({
913
+    url: `/sys/clinict/`+id,
914
+    method: 'delete'
915
+  })
916
+}

+ 121 - 80
src/views/settingsPage/clinicMaintenance/addClinic.vue

@@ -2,29 +2,32 @@
2 2
   <div>
3 3
     <el-dialog :visible="onOpen" v-if="onOpen" @close="onClose" :title="pageType===1?`新增`:`编辑`">
4 4
       <el-row :gutter="15">
5
-        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
5
+        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
6 6
           <el-col :span="11">
7 7
             <el-form-item label="诊所名称" prop="clinicName">
8 8
               <el-input v-model="formData.clinicName" placeholder="请输入诊所名称" clearable
9
-                        :style="{width: '100%'}" :maxlength="64"></el-input>
9
+                        :style="{width: '100%'}" :maxlength="64"
10
+              ></el-input>
10 11
             </el-form-item>
11 12
           </el-col>
12 13
           <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%'}">
14
+            <el-form-item label="IP地址" prop="clinicIp">
15
+              <el-input v-model="formData.clinicIp" placeholder="请输入IP地址" clearable :style="{width: '100%'}">
15 16
               </el-input>
16 17
             </el-form-item>
17 18
           </el-col>
18 19
           <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>
20
+            <el-form-item label="服务器登录名" prop="serverUser">
21
+              <el-input v-model="formData.serverUser" placeholder="请输入服务器登录名" clearable
22
+                        :style="{width: '100%'}"
23
+              ></el-input>
22 24
             </el-form-item>
23 25
           </el-col>
24 26
           <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>
27
+            <el-form-item label="服务器密码" prop="serverPassword">
28
+              <el-input v-model="formData.serverPassword" placeholder="请输入服务器密码" clearable
29
+                        :style="{width: '100%'}"
30
+              ></el-input>
28 31
             </el-form-item>
29 32
           </el-col>
30 33
           <el-col :span="11">
@@ -34,21 +37,26 @@
34 37
             </el-form-item>
35 38
           </el-col>
36 39
           <el-col :span="11">
37
-            <el-form-item label="创建时间" prop="creatTime">
40
+            <el-form-item label="购买时间" prop="creatTime">
38 41
               <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>
42
+                              :style="{width: '100%'}" placeholder="请选择购买时间" clearable
43
+                              :picker-options="pickerStartOptions"
44
+              ></el-date-picker>
40 45
             </el-form-item>
41 46
           </el-col>
42 47
           <el-col :span="11">
43 48
             <el-form-item label="到期时间" prop="expireTime">
44 49
               <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>
50
+                              :style="{width: '100%'}" placeholder="请选择到期时间" clearable
51
+                              :picker-options="pickerEndOptions"
52
+              ></el-date-picker>
46 53
             </el-form-item>
47 54
           </el-col>
48 55
           <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>
56
+            <el-form-item label="版本编号" prop="versionInfo">
57
+              <el-input v-model="formData.versionInfo" placeholder="请输入版本编号" clearable
58
+                        :style="{width: '100%'}"
59
+              ></el-input>
52 60
             </el-form-item>
53 61
           </el-col>
54 62
           <el-col :span="11">
@@ -58,8 +66,8 @@
58 66
             </el-form-item>
59 67
           </el-col>
60 68
           <el-col :span="11">
61
-            <el-form-item label="绑定手机" prop="phone">
62
-              <el-input v-model="formData.phone" placeholder="请输入绑定手机" clearable :style="{width: '100%'}">
69
+            <el-form-item label="手机" prop="phone">
70
+              <el-input v-model="formData.phone" placeholder="请输入手机" clearable :style="{width: '100%'}">
63 71
               </el-input>
64 72
             </el-form-item>
65 73
           </el-col>
@@ -70,11 +78,13 @@
70 78
             </el-form-item>
71 79
           </el-col>
72 80
           <el-col :span="11">
73
-            <el-form-item label="版本描述" prop="versionRefer">
74
-              <el-select v-model="formData.versionRefer" placeholder="请选择版本描述" clearable
75
-                         :style="{width: '100%'}">
81
+            <el-form-item label="购买版本" prop="versionRefer">
82
+              <el-select v-model="formData.versionRefer" placeholder="请选择购买版本" clearable
83
+                         :style="{width: '100%'}"
84
+              >
76 85
                 <el-option v-for="(item, index) in mobileOptions" :key="index" :label="item.label"
77
-                           :value="item.value" :disabled="item.disabled"></el-option>
86
+                           :value="item.value" :disabled="item.disabled"
87
+                ></el-option>
78 88
               </el-select>
79 89
             </el-form-item>
80 90
           </el-col>
@@ -88,7 +98,7 @@
88 98
   </div>
89 99
 </template>
90 100
 <script>
91
-import {addClinict, editClinict} from '@/api/allApi.js'
101
+import { addClinict, editClinict } from '@/api/allApi.js'
92 102
 
93 103
 export default {
94 104
   components: {},
@@ -116,23 +126,38 @@ export default {
116 126
         region: ``,
117 127
         phone: ``,
118 128
         address: ``,
119
-        versionRefer: ``,
129
+        versionRefer: ``
130
+      },
131
+      pickerStartOptions: {
132
+        disabledDate: (time) => {
133
+
134
+          if (this.formData.expireTime !== null) {
135
+            return time.getTime() > new Date(this.formData.expireTime).getTime()
136
+          }
137
+        }
138
+      },
139
+      pickerEndOptions: {
140
+        disabledDate: (time) => {
141
+          if (this.formData.creatTime !== null){
142
+            return time.getTime() < new Date(this.formData.creatTime).getTime()
143
+          }
144
+        }
120 145
       },
121 146
       mobileOptions: [{
122
-        "label": "免费版",
123
-        "value": "免费版"
124
-      },{
125
-        "label": "基础版",
126
-        "value": "基础版"
147
+        'label': '免费版',
148
+        'value': '免费版'
127 149
       }, {
128
-        "label": "高级版",
129
-        "value": "高级版"
150
+        'label': '基础版',
151
+        'value': '基础版'
130 152
       }, {
131
-        "label": "豪华版",
132
-        "value": "豪华版"
153
+        'label': '高级版',
154
+        'value': '高级版'
133 155
       }, {
134
-        "label": "尊贵版",
135
-        "value": "尊贵版"
156
+        'label': '豪华版',
157
+        'value': '豪华版'
158
+      }, {
159
+        'label': '尊贵版',
160
+        'value': '尊贵版'
136 161
       }],
137 162
       rules: {
138 163
         clinicName: [{
@@ -142,21 +167,21 @@ export default {
142 167
         }],
143 168
         clinicIp: [{
144 169
           required: true,
145
-          message: '请输入服务IP',
170
+          message: '请输入IP地址',
146 171
           trigger: 'blur'
147 172
         }, {
148 173
           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格式错误',
174
+          message: 'IP地址格式错误',
150 175
           trigger: 'blur'
151 176
         }],
152 177
         serverUser: [{
153 178
           required: true,
154
-          message: '请输入服务用户',
179
+          message: '请输入服务器登录名',
155 180
           trigger: 'blur'
156 181
         }],
157 182
         serverPassword: [{
158 183
           required: true,
159
-          message: '请输入服务密码',
184
+          message: '请输入服务密码',
160 185
           trigger: 'blur'
161 186
         }],
162 187
         realmName: [{
@@ -166,17 +191,17 @@ export default {
166 191
         }],
167 192
         creatTime: [{
168 193
           required: true,
169
-          message: '请输入创建时间',
194
+          message: '请选择购买时间',
170 195
           trigger: 'change'
171 196
         }],
172 197
         expireTime: [{
173 198
           required: true,
174
-          message: '请选择时间选择',
199
+          message: '请选择到期时间',
175 200
           trigger: 'change'
176 201
         }],
177 202
         versionInfo: [{
178 203
           required: true,
179
-          message: '请输入版本信息',
204
+          message: '请输入版本编号',
180 205
           trigger: 'blur'
181 206
         }],
182 207
         region: [{
@@ -186,7 +211,7 @@ export default {
186 211
         }],
187 212
         phone: [{
188 213
           required: true,
189
-          message: '请输入绑定手机',
214
+          message: '请输入手机',
190 215
           trigger: 'blur'
191 216
         }, {
192 217
           pattern: /^1(3|4|5|7|8|9)\d{9}$/,
@@ -200,19 +225,24 @@ export default {
200 225
         }],
201 226
         versionRefer: [{
202 227
           required: true,
203
-          message: '请输入版本描述',
228
+          message: '请选择购买版本',
204 229
           trigger: 'blur'
205
-        }],
206
-      },
230
+        }]
231
+      }
207 232
     }
208 233
   },
209
-  computed: {},
210
-  watch: {},
234
+  computed:
235
+      {}
236
+  ,
237
+  watch: {}
238
+  ,
211 239
   created() {
212
-  },
240
+  }
241
+  ,
213 242
   mounted() {
214 243
 
215
-  },
244
+  }
245
+  ,
216 246
   methods: {
217 247
     onClose() {
218 248
       this.$emit('closeDialog')
@@ -220,39 +250,50 @@ export default {
220 250
         creatTime: null,
221 251
         expireTime: null
222 252
       }
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
253
+    }
254
+    ,
255
+    handleConfirm() {
256
+
257
+      this.$refs.elForm.validate(async(valid) => {
258
+        if (valid) {
259
+          /**
260
+           * 新增
261
+           */
262
+          if (this.pageType === 1) {
263
+            const res = await addClinict(this.formData)
264
+            if (res.code === 200) {
265
+              this.$emit('closeDialog')
266
+              this.$emit('initList')
267
+              this.$message.success('保存成功')
268
+            } else {
269
+              this.$message.error(res.msg)
270
+            }
271
+          } else {
272
+            /**
273
+             * 编辑
274
+             */
275
+            console.log(this.formData)
276
+            const res = await editClinict(this.formData)
277
+            if (res.code === 200) {
278
+              this.$emit('initList')
279
+              this.$emit('closeDialog')
280
+              this.$message.success('保存成功')
281
+              this.formData = {
282
+                creatTime: null,
283
+                expireTime: null
284
+              }
285
+            } else {
286
+              this.$message.error(res.msg)
287
+            }
250 288
           }
251 289
         } else {
252
-          this.$message.error(res.msg)
290
+          console.log('error submit!!')
291
+          return false
253 292
         }
254
-      }
255
-    },
293
+      })
294
+
295
+    }
296
+
256 297
   }
257 298
 }
258 299
 

+ 29 - 22
src/views/settingsPage/clinicMaintenance/index.vue

@@ -24,36 +24,36 @@
24 24
     </el-row>
25 25
 
26 26
     <el-table :data="tableData" style="width: 100%">
27
-      <el-table-column prop="clinicCode" label="诊所编号" align="center">
27
+      <el-table-column prop="clinicCode" label="诊所编号" align="center" show-overflow-tooltip>
28 28
       </el-table-column>
29
-      <el-table-column prop="clinicName" label="诊所名称" align="center">
29
+      <el-table-column prop="clinicName" label="诊所名称" align="center" show-overflow-tooltip>
30 30
       </el-table-column>
31
-      <el-table-column prop="clinicIp" label="IP地址" align="center">
31
+      <el-table-column prop="clinicIp" label="IP地址" align="center" show-overflow-tooltip>
32 32
       </el-table-column>
33
-      <el-table-column prop="phone" label="手机号" align="center">
33
+      <el-table-column prop="phone" label="手机号" align="center" show-overflow-tooltip>
34 34
       </el-table-column>
35
-      <el-table-column prop="serverUser" label="服务器登录名" align="center">
35
+      <el-table-column prop="serverUser" label="服务器登录名" align="center" show-overflow-tooltip>
36 36
       </el-table-column>
37
-      <el-table-column prop="serverPassword" label="服务器密码" align="center">
37
+      <el-table-column prop="serverPassword" label="服务器密码" align="center" show-overflow-tooltip>
38 38
       </el-table-column>
39
-      <el-table-column prop="versionInfo" label="服务器版本编号" align="center">
39
+      <el-table-column prop="versionInfo" label="版本编号" align="center" show-overflow-tooltip>
40 40
       </el-table-column>
41
-      <el-table-column prop="versionRefer" label="购买版本" align="center">
41
+      <el-table-column prop="versionRefer" label="购买版本" align="center" show-overflow-tooltip>
42 42
       </el-table-column>
43
-      <el-table-column prop="creatTime" label="购买时间" align="center" width="170px">
43
+      <el-table-column prop="creatTime" label="购买时间" align="center" width="150px" show-overflow-tooltip>
44 44
       </el-table-column>
45
-      <el-table-column prop="expireTime" label="到期时间" align="center" width="170px">
45
+      <el-table-column prop="expireTime" label="到期时间" align="center" width="150px" show-overflow-tooltip>
46 46
       </el-table-column>
47
-      <el-table-column prop="isExpire" label="是否到期" align="center" width="170px">
47
+      <el-table-column prop="isExpire" label="是否到期" align="center" width="150px" show-overflow-tooltip>
48 48
         <template slot-scope="scope">
49 49
           <p v-if="scope.row.isExpire > 30 "  style="color: green"> 剩余天数({{scope.row.isExpire}}) </p>
50 50
           <p v-else-if="scope.row.isExpire > 1 && scope.row.isExpire < 31"  style="color: orange"> 剩余天数({{scope.row.isExpire}}) </p>
51 51
           <span v-else style="color: red">已到期</span>
52 52
         </template>
53 53
       </el-table-column>
54
-      <el-table-column prop="address" label="地址" align="center">
54
+      <el-table-column prop="address" label="地址" align="center" show-overflow-tooltip>
55 55
       </el-table-column>
56
-      <el-table-column fixed="right" label="操作" align="center">
56
+      <el-table-column fixed="right" label="操作" align="center" width="150">
57 57
         <template slot-scope="scope">
58 58
           <el-button type="text" size="small" @click="upgrade(scope.row)">升级</el-button>
59 59
           <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
@@ -91,6 +91,8 @@
91 91
 import {clinictList,delClinict} from '@/api/allApi.js'
92 92
 import addClinic from "./addClinic.vue";
93 93
 import upgrade from "./upgrade.vue";
94
+// 分页组件
95
+import Pagination from "@/components/Pagination";
94 96
 
95 97
 export default {
96 98
   name: 'EitcErmPcIndex',
@@ -130,7 +132,7 @@ export default {
130 132
     edit(val) {
131 133
       this.onOpen = true;
132 134
       this.pageType = 2;
133
-      this.$refs.addClinicRef.formData = val;
135
+      this.$refs.addClinicRef.formData = { ...val };
134 136
     },
135 137
     /**
136 138
      * 新增
@@ -149,23 +151,28 @@ export default {
149 151
       console.log(val)
150 152
     },
151 153
     async initList() {
152
-      let obj = {}
154
+      let obj = {pageNum: this.form.pageNum,pageSize: this.form.pageSize}
153 155
       if (this.clinicName.length>0){
154 156
         obj = {clinicName: this.clinicName}
155 157
       }
156 158
       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
-      })
159
+      if (res.code === 200){
160
+        this.total = res.total;
161
+        this.tableData = res.rows;
162
+        this.tableData.forEach(x=>{
163
+          const today = new Date();
164
+          let endTime = new Date(Date.parse(x.expireTime.replace(/-/g, "/"))).getTime();
165
+          x.isExpire =Math.ceil(Math.abs((today - endTime)) / (1000 * 60 * 60 * 24));
166
+        })
167
+        this.loading = false;
168
+      }
163 169
     },
164 170
     /**
165 171
      * 重置
166 172
      */
167 173
     reset() {
168 174
       this.clinicName = ''
175
+      this.initList('')
169 176
     },
170 177
     /**
171 178
      * 关闭弹窗
@@ -178,7 +185,7 @@ export default {
178 185
      * 删除
179 186
      */
180 187
     deleteData(id) {
181
-      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
188
+      this.$confirm('此操作将永久删除该, 是否继续?', '提示', {
182 189
         confirmButtonText: '确定',
183 190
         cancelButtonText: '取消',
184 191
         type: 'warning'

+ 17 - 12
src/views/settingsPage/clinicMaintenance/upgrade.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div>
3
-    <el-dialog :visible="upgradeOpen" @close="onClose" title="升级">
3
+    <el-dialog :visible="upgradeOpen" v-if="upgradeOpen"   @close="onClose" title="升级">
4 4
       <el-row :gutter="15">
5 5
         <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
6 6
 
@@ -68,7 +68,7 @@ export default {
68 68
         }],
69 69
         vcode: [{
70 70
           required: true,
71
-          message: '请输入升级版本',
71
+          message: '请输入校验码',
72 72
           trigger: 'blur'
73 73
         }]
74 74
       },
@@ -94,16 +94,21 @@ export default {
94 94
     },
95 95
     async handleConfirm() {
96 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
-      }
97
+      this.$refs.elForm.validate(async(valid) => {
98
+        if (valid) {
99
+          const res = await editClinict(this.formData)
100
+          if (res.code === 200) {
101
+            this.$emit('initList')
102
+            this.$emit('closeDialog')
103
+            this.$message.success('保存成功')
104
+            this.formData = {}
105
+          } else {
106
+            this.$message.error(res.msg)
107
+            this.$emit('closeDialog')
108
+          }
109
+        }
110
+      })
111
+
107 112
     },
108 113
     field102BeforeUpload(file) {
109 114
       let isRightSize = file.size / 1024 / 1024 < 2