Przeglądaj źródła

渠道经销商页面修改

guanglong 3 lat temu
rodzic
commit
8ee2061af8

+ 45 - 26
src/views/business/channel/childs.vue

@@ -19,17 +19,27 @@
       <!--用户数据-->
       <el-col :span="24" :xs="24">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-          <el-form-item label="渠道名称" prop="name">
-            <el-input
-              v-model="queryParams.name"
-              placeholder="请输入渠道名称"
-              clearable
-              size="small"
-              style="width: 240px"
-              @keyup.enter.native="handleQuery"
-            />
+          <el-form-item label="上级渠道" prop="parentName">
+           <el-input
+             v-model="queryParams.parentName"
+             placeholder="请输入上级渠道名称"
+             clearable
+             size="small"
+             style="width: 240px"
+             @keyup.enter.native="handleQuery"
+           />
           </el-form-item>
-          <el-form-item label="渠道级别" prop="level">
+          <el-form-item label="子渠道名" prop="name">
+           <el-input
+             v-model="queryParams.name"
+             placeholder="请输入子渠道名称"
+             clearable
+             size="small"
+             style="width: 240px"
+             @keyup.enter.native="handleQuery"
+           />
+          </el-form-item>
+          <!-- <el-form-item label="渠道级别" prop="level">
             <el-select
               v-model="queryParams.level"
               placeholder="选择渠道级别"
@@ -45,7 +55,7 @@
               <el-option label="5级渠道" value="5" />
               <el-option label="6级渠道" value="6" />
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="手机号码" prop="mobile">
             <el-input
               v-model="queryParams.mobile"
@@ -56,7 +66,7 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-         <el-form-item label="地区">
+         <!-- <el-form-item label="地区">
            <el-select
              v-model="queryParams.provinceId"
              placeholder="选择省份"
@@ -93,7 +103,7 @@
                :value="item.areaId"
              />
            </el-select>
-         </el-form-item>
+         </el-form-item> -->
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -109,7 +119,7 @@
               @click="handleAdd"
               v-hasPermi="['business:channel:add']"
             >添加一级渠道</el-button> -->
-            上级渠道 : <span style="font-weight: bold;"> {{title}}</span>
+
           </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
@@ -132,8 +142,7 @@
           <el-table-column label="用户数" prop="userCnt"  />
           <el-table-column label="状态" key="statusV">
            <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>
+               <el-tag :type="JSON.parse(row.status).value == '1' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
            </template>
           </el-table-column>
           <el-table-column
@@ -155,14 +164,23 @@
                 @click="handleUpdate(scope.row)"
                 v-hasPermi="['business:channel:edit']"
               >编辑</el-button>
-             <el-switch
+             <!-- <el-switch
                style="margin-left: 9px;"
                v-model="scope.row.statusV"
                active-value="1"
                inactive-value="2"
                v-hasPermi="['business:channel:edit']"
                @change="handleStatusChange(scope.row)"
-             ></el-switch>
+             ></el-switch> -->
+             <el-button
+                 size="mini"
+                 type="text"
+                 @click="handleStatusChange(scope.row)"
+                 v-hasPermi="['admin:channel:edit']"
+               >
+                 <span v-if="getValue(scope.row.status) == 1" > 停用</span>
+                 <span v-if="getValue(scope.row.status) == 2" > 启用</span>
+               </el-button>
 
              <!-- <el-button
                 size="mini"
@@ -270,13 +288,15 @@ export default {
     // 根据渠道名称筛选渠道树
   },
   mounted() {
-     this.getProvinceList()
+    // this.getProvinceList()
   },
   created() {
     let parentId = this.$route.query.parentId
     let title= this.$route.query.title
     this.title = title
     this.parentId = parentId
+    this.queryParams.parentId = parentId
+    this.queryParams.parentName = title
     console.log("parentId == "+parentId+  "title == "+title)
    // this.$route.meta.title = title + " - 子渠道管理"
     if(parentId){
@@ -287,7 +307,6 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      this.queryParams.parentId = this.parentId
       listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&', this.queryParams).then(response => {
           this.channelList = response.rows;
           this.channelList.forEach(item => {
@@ -300,7 +319,7 @@ export default {
     },
 
     // 省
-    getProvinceList(){
+   /* getProvinceList(){
       this.cityList = []
       this.areaList = []
       this.queryParams.cityId = ""
@@ -309,9 +328,9 @@ export default {
         // console.log("getProvinceList"+JSON.stringify(response))
          this.provinceList = response || [];
       });
-    },
+    }, */
 
-    getCityList(){
+    /* getCityList(){
       this.cityList = []
       this.areaList = []
       this.queryParams.cityId = ""
@@ -321,15 +340,15 @@ export default {
         // console.log("getCityList"+JSON.stringify(response))
          this.cityList = response || [];
       });
-    },
+    }, */
 
-    getAreaList(){
+   /* getAreaList(){
       var cityId = this.queryParams.cityId
       listAreaByPid(cityId).then(response => {
         // console.log("getAreaList"+JSON.stringify(response))
          this.areaList = response || [];
       });
-    },
+    }, */
 
     // 状态修改
     handleStatusChange(row) {

+ 10 - 5
src/views/business/channel/index.vue

@@ -117,7 +117,13 @@
           <el-table-column label="渠道编号" prop="channelId" width="100px" />
           <el-table-column label="渠道名称" prop="name" show-overflow-tooltip  width="180px">
             <template slot-scope="scope">
-              <el-link type="info" @click="handleView(scope.row)">{{scope.row.name}}</el-link>
+              <el-button
+                  size="mini"
+                  type="text"
+                  @click="handleView(scope.row)"
+                >
+                  {{scope.row.name}}
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column label="手机号码" prop="mobile" show-overflow-tooltip  width="120px"/>
@@ -135,8 +141,7 @@
           <el-table-column label="用户数" prop="userCnt"  />
           <el-table-column label="状态" key="statusV">
            <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>
+             <el-tag :type="JSON.parse(row.status).value == '1' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
            </template>
           </el-table-column>
           <el-table-column
@@ -164,8 +169,8 @@
                   @click="handleStatusChange(scope.row)"
                   v-hasPermi="['admin:channel:edit']"
                 >
-                  <span v-if="getValue(scope.row.status) == 1" style="color: red;"> 停用</span>
-                  <span v-if="getValue(scope.row.status) == 2" style="color: blue;"> 启用</span>
+                  <span v-if="getValue(scope.row.status) == 1" > 停用</span>
+                  <span v-if="getValue(scope.row.status) == 2" > 启用</span>
                 </el-button>
              <!-- <el-switch
                style="margin-left: 9px;"

+ 3 - 4
src/views/business/salesite/index.vue

@@ -121,8 +121,7 @@
       </el-table-column>
       <el-table-column label="状态" key="statusV">
         <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>
+            <el-tag :type="JSON.parse(row.status).value == '1' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
         </template>
         <!-- <template slot-scope="scope">
           <el-switch
@@ -155,8 +154,8 @@
             @click="handleStatusChange(scope.row)"
             v-hasPermi="['admin:salesite:edit']"
           >
-            <span v-if="getValue(scope.row.status) == 1" style="color: red;"> 停用</span>
-            <span v-if="getValue(scope.row.status) == 2" style="color: blue;"> 启用</span>
+            <span v-if="getValue(scope.row.status) == 1"> 停用</span>
+            <span v-if="getValue(scope.row.status) == 2"> 启用</span>
           </el-button>
          <!-- <el-switch
             style="margin-left: 9px;"