瀏覽代碼

渠道经销商缺陷解决

Liugl 3 年之前
父節點
當前提交
c1d182b8c1
共有 2 個文件被更改,包括 41 次插入78 次删除
  1. 15 20
      src/views/business/channel/index.vue
  2. 26 58
      src/views/business/salesite/index.vue

+ 15 - 20
src/views/business/channel/index.vue

@@ -105,7 +105,7 @@
         </el-row>
 
         <el-table v-loading="loading" :data="channelList">
-          <el-table-column label="渠道ID" prop="channelId" width="100px" />
+          <el-table-column label="渠道编号" prop="channelId" width="100px" />
           <el-table-column label="渠道名称" prop="name" show-overflow-tooltip  width="180px"/>
           <el-table-column label="手机号码" prop="mobile" show-overflow-tooltip  width="120px"/>
           <el-table-column label="佣金比例" prop="commRate">
@@ -120,11 +120,19 @@
           </el-table-column>
           <el-table-column label="经销商数" prop="siteCnt"  />
           <el-table-column label="用户数" prop="userCnt"  />
-          <el-table-column label="状态" key="status">
-           <template slot-scope="{ row, column }">
+          <el-table-column label="状态" key="statusV">
+            <template slot-scope="scope">
+              <el-switch
+                v-model="scope.row.statusV"
+                active-value="1"
+                inactive-value="2"
+                @change="handleStatusChange(scope.row)"
+              ></el-switch>
+            </template>
+           <!-- <template slot-scope="{ row, column }">
                <span v-if="getValue(row.status) == 1" style="color: blue;"> {{getDesc(row.status)}}</span>
                <span v-if="getValue(row.status) == 2" style="color: red;"> {{getDesc(row.status)}}</span>
-           </template>
+           </template> -->
           </el-table-column>
           <el-table-column
             label="操作"
@@ -275,6 +283,9 @@ export default {
       this.loading = true;
       listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&', this.queryParams).then(response => {
           this.channelList = response.rows;
+          this.channelList.forEach(item => {
+              item.statusV = JSON.parse(item.status).value+""
+          })
           this.total = response.total;
           this.loading = false;
         }
@@ -299,7 +310,6 @@ export default {
            return resolve(response.data);
         });
       }
-
     },
 
     refreshChannelTree(){
@@ -417,21 +427,6 @@ export default {
       const dataObj = JSON.parse(val);
       return (dataObj && dataObj.value) || "";
     },
-
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const channelId = row.channelId;
-      // this.$confirm('是否确认删除编号为"' + channelId + '"的数据项?', "警告", {
-      //     confirmButtonText: "确定",
-      //     cancelButtonText: "取消",
-      //     type: "warning"
-      //   }).then(function() {
-      //     return delUser(userIds);
-      //   }).then(() => {
-      //     this.getList();
-      //     this.msgSuccess("删除成功");
-      //   }).catch(() => {});
-    }
   }
 };
 </script>

+ 26 - 58
src/views/business/salesite/index.vue

@@ -98,9 +98,9 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="siteList" @selection-change="handleSelectionChange">
      <!-- <el-table-column type="selection" width="55" align="center" /> -->
-      <el-table-column label="经销商ID" prop="channelId" width="100px"/>
+      <el-table-column label="经销商编号" prop="channelId" width="100px"/>
       <el-table-column label="经销商名称" show-overflow-tooltip align="center" prop="name" max-width="100px" />
       <el-table-column label="手机号码" align="center" prop="mobile" />
       <el-table-column label="佣金比例" align="center" prop="commRate" />
@@ -112,12 +112,22 @@
              <span v-if="getValue(row.certifyStatus) == 'n'" style="color: red;"> {{getDesc(row.certifyStatus)}}</span>
          </template>
       </el-table-column>
-      <el-table-column label="状态" align="center" prop="status"  >
+      <el-table-column label="状态" align="center" key="statusV">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.statusV"
+            active-value="1"
+            inactive-value="2"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
+ <!--     <el-table-column label="状态" align="center" prop="status"  >
          <template slot-scope="{ row, column }">
              <span v-if="getValue(row.status) == 1" style="color: blue;"> {{getDesc(row.status)}}</span>
              <span v-if="getValue(row.status) == 2" style="color: red;"> {{getDesc(row.status)}}</span>
          </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -133,7 +143,7 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['admin:salesite:edit']"
           >编辑</el-button> -->
-          <el-button
+        <!--  <el-button
             size="mini"
             type="text"
             @click="handleStatusChange(scope.row)"
@@ -141,7 +151,7 @@
           >
             <span v-if="getValue(scope.row.status) == 1"> 停用</span>
             <span v-if="getValue(scope.row.status) == 2"> 启用</span>
-          </el-button>
+          </el-button> -->
         </template>
       </el-table-column>
     </el-table>
@@ -213,8 +223,8 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
-      // 岗位表格数据
-      postList: [],
+      // 经销商表格数据
+      siteList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -236,18 +246,7 @@ export default {
       },
       // 表单参数
       form: {},
-      // 表单校验
-      rules: {
-        postName: [
-          { required: true, message: "岗位名称不能为空", trigger: "blur" }
-        ],
-        postCode: [
-          { required: true, message: "岗位编码不能为空", trigger: "blur" }
-        ],
-        postSort: [
-          { required: true, message: "岗位顺序不能为空", trigger: "blur" }
-        ]
-      }
+
     };
   },
   mounted() {
@@ -261,11 +260,14 @@ export default {
     });
   },
   methods: {
-    /** 查询岗位列表 */
+    /** 查询经销商列表 */
     getList() {
       this.loading = true;
       listSaleSite('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&',this.queryParams).then(response => {
-        this.postList = response.rows;
+        this.siteList = response.rows;
+        this.siteList.forEach(item => {
+            item.statusV = JSON.parse(item.status).value+""
+        })
         this.total = response.total;
         this.loading = false;
       });
@@ -351,25 +353,7 @@ export default {
       this.createShow = false
       this.detailShow = false
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        postId: undefined,
-        postCode: undefined,
-        postName: undefined,
-        postSort: 0,
-        status: "0",
-        remark: undefined
-      };
-      this.cityList = []
-      this.areaList = []
-      this.resetForm("form");
-    },
+
     /** 搜索按钮操作 */
     handleQuery() {
       this.channelList = this.channelCopyList;
@@ -421,22 +405,6 @@ export default {
       this.detailShow = false
     },
 
-    /** 删除按钮操作 */
-    // handleDelete(row) {
-    //   const postIds = row.postId || this.ids;
-    //   this.$confirm('是否确认删除名称为"' + row.name + '"的经销商?', "警告", {
-    //       confirmButtonText: "确定",
-    //       cancelButtonText: "取消",
-    //       type: "warning"
-    //     }).then(function() {
-    //       return delPost(postIds);
-    //     }).then(() => {
-    //       this.getList();
-    //       this.msgSuccess("删除成功");
-    //     }).catch(() => {});
-    // },
-
-
     // 状态修改
     handleStatusChange(row) {
       var newStatus = this.getValue(row.status) == 2?1:2
@@ -455,7 +423,7 @@ export default {
           this.msgSuccess(text + "成功");
           this.getList();
         }).catch(function() {
-          // row.status = row.status === "0" ? "1" : "0";
+           row.statusV = row.statusV === "1" ? "2" : "1";
         });
     }
   }