Joe 3 年 前
コミット
3c2227f6b2

+ 26 - 0
src/api/system/user.js

@@ -138,3 +138,29 @@ export function importTemplate() {
     method: 'get'
   })
 }
+// agentChange 改变代理的集团
+export function agentChangeGroup(data) {
+  return request({
+    url: '/system/agent/addSysAgent',
+    method: 'post',
+    data: data
+  })
+}
+
+// 用户密码重置
+export function getLeftData(data) {
+  return request({
+    url: '/system/dept/selectSysAgentList',
+    method: 'get',
+    params: data
+  })
+}
+
+//
+export function getRightData(data) {
+  return request({
+    url: '/system/agent/sysAgentlist',
+    method: 'get',
+    params: data
+  })
+}

+ 0 - 2
src/components/SelectDept/index.vue

@@ -161,7 +161,6 @@ export default {
       this.refreshTagView();
     },
     selectGroup(group) {
-      console.log(group);
       this.currentGroup = group;
       this.currentStation = undefined;
       this.refreshTagView();
@@ -225,7 +224,6 @@ export default {
       }
     },
     refreshTagView() {
-      console.log('哈哈',this.$route.path);
       const proArr = []
       this.$store.state.tagsView.visitedViews.map((view) => {
         proArr.push(this.$store.dispatch("tagsView/delCachedView", view))

+ 5 - 5
src/views/customer/Customer_Info.vue

@@ -27,9 +27,9 @@
           size="small">
           <el-option
             v-for="dict in oilNameOptions"
-            :key="dict.oilPriceId"
-            :label="dict.oilName"
-            :value="dict.oilName"
+            :key="dict.dictLabel"
+            :label="dict.dictLabel"
+            :value="dict.dictLabel"
           ></el-option>
         </el-select>
       </el-form-item>
@@ -143,8 +143,8 @@ export default {
   },
   created() {
     this.getList();
-    listPrice().then((response) => {
-      this.oilNameOptions = response.rows;
+    this.getDicts("oil_name").then((response) => {
+      this.oilNameOptions = response.data;
     });
   },
   methods: {

+ 3 - 6
src/views/order/Order_Oil.vue

@@ -33,9 +33,9 @@
         >
           <el-option
             v-for="dict in oilNameOptions"
-            :key="dict.oilName"
-            :label="dict.oilName"
-            :value="dict.oilName"
+            :key="dict.dictLabel"
+            :label="dict.dictLabel"
+            :value="dict.dictLabel"
           />
         </el-select>
       </el-form-item>
@@ -223,9 +223,6 @@ export default {
     this.getDicts("oil_name").then((response) => {
       this.oilNameOptions = response.data;
     });
-    listPrice({}).then((response) => {
-      this.oilNameOptions = response.rows;
-    });
   },
   methods: {
     payTypeFotmat(row, column) {

+ 0 - 1
src/views/station/Station_Configuration/applet.vue

@@ -105,7 +105,6 @@ export default {
     },
     //上传成功
     handlepaymentSuccess(response, file, fileList) {
-      console.log("img",response);
       this.ruleForm.imgFileList = [
         ...this.ruleForm.imgFileList,
         {

+ 0 - 1
src/views/station/Station_Group.vue

@@ -108,7 +108,6 @@ export default {
     getGroupInfo() {
       getGroupInfo().then((response) => {
         this.form = response.data;
-        console.log(response);
       });
     },
     /** 提交按钮 */

+ 59 - 9
src/views/system/user/index.vue

@@ -252,6 +252,7 @@
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
+                v-if="scope.row.agentFlag == 1"
                 @click="handleAgent(scope.row)"
                 v-hasPermi="['system:user:edit']"
                 >代理</el-button
@@ -485,6 +486,9 @@ import {
   changeUserStatus,
   importTemplate,
   changeAgentFlag,
+  agentChangeGroup,
+  getLeftData,
+  getRightData
 } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/system/dept";
@@ -573,7 +577,8 @@ export default {
             deptName: "李哈哈",
           },
         ],
-        value: ["55"],
+        value: [55],
+        currentUserId:null
       },
       // 表单校验
       rules: {
@@ -629,7 +634,12 @@ export default {
   },
   methods: {
     handleAgent(row) {
+      this.getLeftAgent(row.userId).then((response) => {
+        this.getRightAgent(row.userId)
+      })
+      this.agent.currentUserId = row.userId
       this.agent.open = true;
+
     },
     // 代理状态修改
     handleAgentFlagChange(row) {
@@ -865,19 +875,55 @@ export default {
     submitFileForm() {
       this.$refs.upload.submit();
     },
-    agentChange(q,direction,e){
-      console.log(q,direction,e);
+    agentChange(q,direction,changeArr){
+      const data = {
+        "userId": this.agent.currentUserId,
+        "flag":"0",
+        "list":changeArr
+      }
       if(direction == 'right'){
+        data.flag = 1
         // 向右添加
       }else if(direction == 'left'){
         // 向左减少
+         data.flag = 0
       }
+      agentChangeGroup(data).then((res)=>{
+        if(res.code == 200){
+          this.getRightAgent()
+        }else{
+          throw new Error("");
+        }
+      }).catch(()=>{
+        this.msgError("操作失败,请关闭弹窗后重新操作~")
+      })
     }, 
-    getLeftAgent(){
-
+    async getLeftAgent(id){
+      try {
+        const leftDataPro = await getLeftData({userId:id})
+        if(leftDataPro.code != 200){
+          throw new Error("")
+        }
+        this.agent.data = leftDataPro.data
+        return Promise.resolve()
+      } catch (error) {
+        this.msgError("拉取可代理的集团失败,请关闭弹窗后重新操作")
+      }
     },
-    getRightAgent(){
+    async getRightAgent(id){
+      try {
+        this.agent.value = []
+        const rightDataPro = await getRightData({ userId:id})
+        if(rightDataPro.code != 200){
+          throw new Error("")
+        }
+        this.agent.value = rightDataPro.data
+        console.log(this.agent.value);
+        return Promise.resolve()
 
+      } catch (error) {
+        this.msgError("拉取已代理的集团失败,请关闭弹窗后重新操作")
+      }
     }
   },
 };
@@ -886,10 +932,14 @@ export default {
 .agentDialog {
   .el-transfer-panel {
     height: 500px !important;
+    .el-transfer-panel__body{
+      height: 500px !important; 
+      .el-transfer-panel__list.is-filterable {
+        height: 500px !important;
+      }
+    }
   }
 
-  .app-container-user .el-transfer-panel__list.is-filterable {
-    height: 400px !important;
-  }
+  
 }
 </style>