Browse Source

升级接口对接

zhangjiansheng 3 months ago
parent
commit
7242f2a253

+ 1 - 0
src/views/settingsPage/clinicMaintenance/index.vue

@@ -144,6 +144,7 @@ export default {
144
      */
144
      */
145
     upgrade(val){
145
     upgrade(val){
146
       this.upgradeOpen = true;
146
       this.upgradeOpen = true;
147
+      val.versionInfoOld = val.versionInfo
147
       this.$refs.upgradeOpenRef.formData = val;
148
       this.$refs.upgradeOpenRef.formData = val;
148
       console.log(val)
149
       console.log(val)
149
     },
150
     },

+ 39 - 25
src/views/settingsPage/clinicMaintenance/upgrade.vue

@@ -1,39 +1,39 @@
1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <el-dialog :visible="upgradeOpen" @close="onClose" title="Dialog Title">
3
+    <el-dialog :visible="upgradeOpen" @close="onClose" title="升级">
4
       <el-row :gutter="15">
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="100px">
6
 
6
 
7
           <el-col :span="12">
7
           <el-col :span="12">
8
-            <el-form-item label="现在版本" prop="versionInfo">
9
-              <el-input v-model="formData.versionInfo" placeholder="请输入现在版本" readonly :disabled='true' clearable
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>
10
                         :style="{width: '100%'}"></el-input>
11
             </el-form-item>
11
             </el-form-item>
12
           </el-col>
12
           </el-col>
13
           <el-col :span="12">
13
           <el-col :span="12">
14
-            <el-form-item label="升级版本" prop="versionInfoNew">
15
-              <el-input v-model="formData.versionInfoNew" placeholder="请输入升级版本" :maxlength="64" clearable
14
+            <el-form-item label="升级版本" prop="versionInfo">
15
+              <el-input v-model="formData.versionInfo" placeholder="请输入升级版本" :maxlength="64" clearable
16
                         :style="{width: '100%'}"></el-input>
16
                         :style="{width: '100%'}"></el-input>
17
             </el-form-item>
17
             </el-form-item>
18
           </el-col>
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>
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">
27
           <el-col :span="12">
28
             <el-form-item label="校验码" prop="vcode">
28
             <el-form-item label="校验码" prop="vcode">
29
-              <el-input v-model="formData.vcode" placeholder="请输入校验码" readonly :disabled='true' clearable
29
+              <el-input v-model="formData.vcode" placeholder="请输入校验码" clearable
30
                         :style="{width: '100%'}"></el-input>
30
                         :style="{width: '100%'}"></el-input>
31
             </el-form-item>
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>
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>
37
           </el-col>
38
         </el-form>
38
         </el-form>
39
       </el-row>
39
       </el-row>
@@ -45,6 +45,8 @@
45
   </div>
45
   </div>
46
 </template>
46
 </template>
47
 <script>
47
 <script>
48
+import {editClinict} from '@/api/allApi.js'
49
+
48
 export default {
50
 export default {
49
   inheritAttrs: false,
51
   inheritAttrs: false,
50
   components: {},
52
   components: {},
@@ -59,7 +61,12 @@ export default {
59
       formData: {
61
       formData: {
60
       },
62
       },
61
       rules: {
63
       rules: {
62
-        versionInfoNew: [{
64
+        versionInfo: [{
65
+          required: true,
66
+          message: '请输入升级版本',
67
+          trigger: 'blur'
68
+        }],
69
+        vcode: [{
63
           required: true,
70
           required: true,
64
           message: '请输入升级版本',
71
           message: '请输入升级版本',
65
           trigger: 'blur'
72
           trigger: 'blur'
@@ -85,11 +92,18 @@ export default {
85
     close() {
92
     close() {
86
       this.$emit('closeDialog')
93
       this.$emit('closeDialog')
87
     },
94
     },
88
-    handleConfirm() {
89
-      this.$refs['elForm'].validate(valid => {
90
-        if (!valid) return
91
-        this.close()
92
-      })
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
+      }
93
     },
107
     },
94
     field102BeforeUpload(file) {
108
     field102BeforeUpload(file) {
95
       let isRightSize = file.size / 1024 / 1024 < 2
109
       let isRightSize = file.size / 1024 / 1024 < 2