Просмотр исходного кода

衍生字段禁用启用标志+翻译

zishan-an 11 месяцев назад
Родитель
Сommit
68cbd87a7d

+ 10 - 5
src/api/index.js

@@ -407,6 +407,13 @@ export function fieldEdit(fieldData) {
     });
 }
 
+export function fieldDeriveStatus(fieldStatus) {
+    return request.post('/field-status', {
+        id : fieldStatus.fieldId,
+        status : fieldStatus.status,
+    });
+}
+
 export function fieldTemplateEdit(templateData) {
     return request.post('/fieldtemplate/update', {
         id : templateData.templateId,
@@ -421,12 +428,10 @@ export function fieldTemplateEdit(templateData) {
 
     });
 }
-export function fieldTemplateStatus(templateData) {
+export function fieldTemplateStatus(templateStatus) {
     return request.post('/fieldtemplate/status', {
-        id : templateData.templateId,
-        status : templateData.status,
-
-
+        id : templateStatus.templateId,
+        status : templateStatus.status,
     });
 }
 

+ 38 - 3
src/views/system/fieldDerive.vue

@@ -74,7 +74,18 @@
 
               <el-table-column align="center" label="字段状态" >
                 <template v-slot="{row}">
-                  {{ row.status==1 ? '已启用' : '已禁用' }}
+
+                  <el-switch
+                      v-model="row.status"
+                      class="isShow"
+                      :active-value="'1'"
+                      :inactive-value="'0'"
+                      active-text="启用"
+                      inactive-text="禁用"
+                      active-color="#13ce66"
+                      inactive-color="#ff4949"
+                      @change="changeSwitch(row)">
+                  </el-switch>
                 </template>
               </el-table-column>
 <!-- 
@@ -123,7 +134,7 @@
 
 import {
   getList,
-  userInfo, partnerList, roleDel, fieldListDerive,fieldDel,selectFieldListDerive
+  userInfo, partnerList, roleDel, fieldListDerive, fieldDel, selectFieldListDerive, fieldDeriveStatus
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -162,7 +173,12 @@ export default {
       selected5: true,
       selected6: false,
       input:'',
-      i:0
+      i:0,
+      fieldStatus:
+          {
+            fieldId:"",
+            status:"",
+          },
     }
   },
   watch: {},
@@ -353,6 +369,25 @@ export default {
         }
       })
     },
+    changeSwitch (row) {
+      this.fieldStatus.fieldId = row.id;
+      this.fieldStatus.status = row.status;
+
+      fieldDeriveStatus(this.fieldStatus).then(
+          res=>
+          {
+            this.$message({
+              message: '修改成功',
+              type: 'success'
+            });
+            this.$router.push({
+              path: '/fieldTemplate',
+              query: {
+              }
+            })
+          },
+      )
+    },
     edit (row){
       this.$router.push({
         path: '/fieldEdit',

+ 2 - 15
src/views/system/fieldTemplate.vue

@@ -62,7 +62,7 @@
                     :active-value="'1'"
                     :inactive-value="'0'"
                     active-text="启用"
-                    inactive-text="用"
+                    inactive-text="用"
                     active-color="#13ce66"
                     inactive-color="#ff4949"
                     @change="changeSwitch(row)">
@@ -165,11 +165,6 @@ export default {
           {
             templateId:"",
             status:"",
-
-
-            // status:this.$route.query.status,
-            // createBy:'',
-            // createTime:'',
           },
     }
   },
@@ -294,15 +289,7 @@ export default {
               }
             })
           },
-      ),
-      axios.post(this.$api.customerQaUpdate,data).then(res=>{
-        if(res.code=='200'){
-          this.successMessage('操作成功');
-        }else{
-          this.errorMessage(res.message);
-        }
-      }).catch(err=>{})
-      console.log(data)
+      )
     },
 
     fieldTemplateEdit(row) {

+ 3 - 3
src/views/system/fieldTemplateAdd.vue

@@ -82,7 +82,7 @@
 
                       <el-table-column prop="state" label="状态" width="100">
                         <template slot-scope="scope">
-                          {{ scope.row.state ? '已启用' : '已禁用' }}
+                          {{ scope.row.status==1 ? '已启用' : '已禁用' }}
                         </template>
                       </el-table-column>
 
@@ -151,9 +151,9 @@
                         </template>
                       </el-table-column>
 
-                      <el-table-column align="center" label="字段状态" width="100">
+                      <el-table-column align="center" label="状态" width="100">
                         <template v-slot="{row}">
-                          <span>{{ row.status}}</span>
+                          <span>{{ row.status==1 ? '已启用' : '已禁用'}}</span>
                         </template>
                       </el-table-column>
 

+ 3 - 3
src/views/system/fieldTemplateEdit.vue

@@ -91,7 +91,7 @@
 
                 <el-table-column prop="state" label="状态" width="100">
                   <template slot-scope="scope">
-                    {{ scope.row.state ? '已启用' : '已禁用' }}
+                    {{ scope.row.status==1 ? '已启用' : '已禁用' }}
                   </template>
                 </el-table-column>
 
@@ -160,9 +160,9 @@
                   </template>
                 </el-table-column>
 
-                <el-table-column align="center" label="字段状态" width="100">
+                <el-table-column align="center" label="状态" width="100">
                   <template v-slot="{row}">
-                    <span>{{ row.status}}</span>
+                    <span>{{ row.status==1 ? '已启用' : '已禁用'}}</span>
                   </template>
                 </el-table-column>