zhangjiansheng 3 mesi fa
parent
commit
26ae7dc6a7

+ 5 - 1
src/views/settingsPage/clinicMaintenance/addClinic.vue

@@ -6,7 +6,7 @@
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%'}"></el-input>
9
+                        :style="{width: '100%'}" :maxlength="64"></el-input>
10 10
             </el-form-item>
11 11
           </el-col>
12 12
           <el-col :span="11">
@@ -144,6 +144,10 @@ export default {
144 144
           required: true,
145 145
           message: '请输入服务IP',
146 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'
147 151
         }],
148 152
         serverUser: [{
149 153
           required: true,

+ 21 - 3
src/views/settingsPage/clinicMaintenance/index.vue

@@ -46,7 +46,8 @@
46 46
       </el-table-column>
47 47
       <el-table-column prop="isExpire" label="是否到期" align="center" width="170px">
48 48
         <template slot-scope="scope">
49
-          <p v-if="scope.row.isExpire > 1" > 剩余天数({{scope.row.isExpire}}) </p>
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>
50 51
           <span v-else style="color: red">已到期</span>
51 52
         </template>
52 53
       </el-table-column>
@@ -54,7 +55,7 @@
54 55
       </el-table-column>
55 56
       <el-table-column fixed="right" label="操作" align="center">
56 57
         <template slot-scope="scope">
57
-          <el-button type="text" size="small" @click="">升级</el-button>
58
+          <el-button type="text" size="small" @click="upgrade(scope.row)">升级</el-button>
58 59
           <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
59 60
           <el-button type="text" size="small" style="color: red" @click="deleteData(scope.row.id)">删除
60 61
           </el-button>
@@ -77,24 +78,32 @@
77 78
         ref="addClinicRef"
78 79
         @closeDialog="closeDialog"
79 80
     />
81
+    <upgrade
82
+        :upgradeOpen="upgradeOpen"
83
+        :title="title"
84
+        ref="upgradeOpenRef"
85
+        @closeDialog="closeDialog"
86
+    />
80 87
   </div>
81 88
 </template>
82 89
 
83 90
 <script>
84 91
 import {clinictList,delClinict} from '@/api/allApi.js'
85 92
 import addClinic from "./addClinic.vue";
86
-import edit from "@/views/settingsPage/clinicOverview/edit.vue";
93
+import upgrade from "./upgrade.vue";
87 94
 
88 95
 export default {
89 96
   name: 'EitcErmPcIndex',
90 97
   computed: {
91 98
   },
92 99
   components: {
100
+    upgrade,
93 101
     addClinic
94 102
   },
95 103
   data() {
96 104
     return {
97 105
       onOpen: false,
106
+      upgradeOpen: false,
98 107
       title: ``,
99 108
       dictType: ``,
100 109
       form: {
@@ -130,6 +139,14 @@ export default {
130 139
       this.onOpen = true;
131 140
       this.pageType = 1;
132 141
     },
142
+    /**
143
+     * 升级页面
144
+     */
145
+    upgrade(val){
146
+      this.upgradeOpen = true;
147
+      this.$refs.upgradeOpenRef.formData = val;
148
+      console.log(val)
149
+    },
133 150
     async initList() {
134 151
       let obj = {}
135 152
       if (this.clinicName.length>0){
@@ -154,6 +171,7 @@ export default {
154 171
      */
155 172
     closeDialog(){
156 173
       this.onOpen = false;
174
+      this.upgradeOpen = false;
157 175
     },
158 176
     /**
159 177
      * 删除

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

@@ -0,0 +1,110 @@
1
+<template>
2
+  <div>
3
+    <el-dialog :visible="upgradeOpen" @close="onClose" title="Dialog 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="versionInfo">
9
+              <el-input v-model="formData.versionInfo" 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="versionInfoNew">
15
+              <el-input v-model="formData.versionInfoNew" 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="请输入校验码" readonly :disabled='true' 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
+export default {
49
+  inheritAttrs: false,
50
+  components: {},
51
+  props: {
52
+    upgradeOpen: {
53
+      type: Boolean,
54
+      default: false
55
+    }
56
+  },
57
+  data() {
58
+    return {
59
+      formData: {
60
+      },
61
+      rules: {
62
+        versionInfoNew: [{
63
+          required: true,
64
+          message: '请输入升级版本',
65
+          trigger: 'blur'
66
+        }]
67
+      },
68
+      field102Action: 'https://jsonplaceholder.typicode.com/posts/',
69
+      field102fileList: [],
70
+    }
71
+  },
72
+  computed: {},
73
+  watch: {},
74
+  created() {
75
+
76
+  },
77
+  mounted() {
78
+
79
+
80
+  },
81
+  methods: {
82
+    onClose() {
83
+      this.$emit('closeDialog')
84
+    },
85
+    close() {
86
+      this.$emit('closeDialog')
87
+    },
88
+    handleConfirm() {
89
+      this.$refs['elForm'].validate(valid => {
90
+        if (!valid) return
91
+        this.close()
92
+      })
93
+    },
94
+    field102BeforeUpload(file) {
95
+      let isRightSize = file.size / 1024 / 1024 < 2
96
+      if (!isRightSize) {
97
+        this.$message.error('文件大小超过 2MB')
98
+      }
99
+      return isRightSize
100
+    },
101
+  }
102
+}
103
+
104
+</script>
105
+<style>
106
+.el-upload__tip {
107
+  line-height: 1.2;
108
+}
109
+
110
+</style>