|
@@ -56,8 +56,19 @@
|
|
|
<el-table-column align="center" label="字段表状态">
|
|
|
<template v-slot="{row}">
|
|
|
|
|
|
- <span>{{ row.state ? '已启用' : '已停用' }}</span>
|
|
|
+ <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>
|
|
|
|
|
|
<el-table-column align="center" label="创建者" >
|
|
@@ -107,7 +118,7 @@
|
|
|
|
|
|
import {
|
|
|
getList,
|
|
|
- userInfo, partnerList, templateDel,selectTemplate
|
|
|
+ userInfo, partnerList, templateDel, selectTemplate, fieldTemplateEdit,fieldTemplateStatus
|
|
|
} from '@/api/index.js'
|
|
|
import store from "@/store";
|
|
|
import request from '@/utils/request.js'
|
|
@@ -150,7 +161,16 @@ export default {
|
|
|
isRouterAlive:true,
|
|
|
totalSize:'',
|
|
|
showSize:'',
|
|
|
+ templateStatus:
|
|
|
+ {
|
|
|
+ templateId:"",
|
|
|
+ status:"",
|
|
|
|
|
|
+
|
|
|
+ // status:this.$route.query.status,
|
|
|
+ // createBy:'',
|
|
|
+ // createTime:'',
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
watch: {},
|
|
@@ -165,13 +185,15 @@ export default {
|
|
|
fieldTemplateList(this.currentPage1,this.pagesize1).then(
|
|
|
res=>
|
|
|
{
|
|
|
- console.log(this.currentPage1)
|
|
|
|
|
|
this.templateData=res.data.field_template_list.list;
|
|
|
this.templateDataShow = this.templateData
|
|
|
var j = parseInt(res.data.field_template_list.total)
|
|
|
this.totalSize = j
|
|
|
this.showSize = this.totalSize
|
|
|
+ console.log("啊各位")
|
|
|
+
|
|
|
+ console.log(this.templateDataShow)
|
|
|
|
|
|
}
|
|
|
)
|
|
@@ -255,6 +277,33 @@ export default {
|
|
|
this.selected5 = true;
|
|
|
this.selected6 = true;
|
|
|
},
|
|
|
+ changeSwitch (row) {
|
|
|
+ this.templateStatus.templateId = row.id;
|
|
|
+ this.templateStatus.status = row.status;
|
|
|
+
|
|
|
+ fieldTemplateStatus(this.templateStatus).then(
|
|
|
+ res=>
|
|
|
+ {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ path: '/fieldTemplate',
|
|
|
+ query: {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ 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) {
|
|
|
this.$router.push({
|
|
@@ -467,5 +516,29 @@ export default {
|
|
|
height: 47em;
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
+.isShow .el-switch__label {
|
|
|
+ position: absolute;
|
|
|
+ display: none;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+/*打开时文字位置设置*/
|
|
|
+.isShow .el-switch__label--right {
|
|
|
+ z-index: 1;
|
|
|
+ right: 8px;
|
|
|
+}
|
|
|
+/*关闭时文字位置设置*/
|
|
|
+.isShow .el-switch__label--left {
|
|
|
+ z-index: 1;
|
|
|
+ left: 8px;
|
|
|
+}
|
|
|
+/*显示文字*/
|
|
|
+.isShow .el-switch__label.is-active {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.isShow.el-switch .el-switch__core,
|
|
|
+.el-switch .el-switch__label {
|
|
|
+ width: 50px !important;
|
|
|
+}
|
|
|
+
|
|
|
.container { }
|
|
|
</style>
|