Browse Source

打标签

Joe 4 years ago
parent
commit
ffd29bbb5d

+ 26 - 0
src/api/label/label.js

@@ -111,4 +111,30 @@ export function addAndDelCustomerLabel(data) {
     method: 'post',
     data: data
   })
+}
+
+// 批量标签 查询用户
+export function getLabelUser(query) {
+  return request({
+    url: '/label/label/selectCustomerLabelInfoList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询标签
+export function getLabelList() {
+  return request({
+    url: '/label/rule/labelList',
+    method: 'get',
+  })
+}
+
+// 清理为无标签状态
+export function delUserLabel(data) {
+  return request({
+    url: '/label/label/delCustomerLabel',
+    method: 'post',
+    data:data
+  })
 }

+ 0 - 464
src/views/label/Label_AddUser copy.vue

@@ -1,464 +0,0 @@
-<template>
-  <div v-if="pageStatus == 0">配置加载中...</div>
-  <div v-else-if="pageStatus == 1">此页面只对站点用户开发</div>
-  <div v-else-if="pageStatus == 4">
-    <div  class="Label_AddUser" v-if="labelList.labelFlag == 1">
-      <div v-if="(labelList.labelArr||[]).length == 0">
-        你未添加标签,请先添加标签后再来设置规则
-      </div>
-      
-      <el-collapse
-        v-model="activeNames"
-        @change="openLabel"
-        class=""
-        accordion
-      >
-        <el-collapse-item
-          :name="ele.id"
-          v-for="(ele, index) in labelList.labelArr"
-          :key="ele.id"
-        >
-          <template slot="title">
-            标签{{ index + 1 }} <i class="header-icon el-icon-info"></i>
-            <b>{{ ele.labelName }}</b>
-          </template>
-            <el-col :span="11">
-              <div>
-                <el-input
-                  v-model="leftQuery.customerName"
-                  placeholder="输入姓名"
-                  style="width: 150px"
-                  size="mini"
-                  clearable
-                />
-                <el-input
-                  v-model="leftQuery.phone"
-                  placeholder="输入手机号"
-                  style="width: 150px; margin-left: 3px"
-                  size="mini"
-                  clearable
-                />
-                <el-button
-                  type="primary"
-                  size="mini"
-                  icon="el-icon-search"
-                  style="margin-left: 6px"
-                  @click="getLeftData"
-                  >查询</el-button
-                >
-                <el-button
-                  type="danger"
-                  size="mini"
-                  icon="el-icon-delete"
-                  style="margin-left: 6px"
-                  @click="clearLeftQuery()"
-                  >清空</el-button
-                >
-              </div>
-              <el-table
-                :data="leftData"
-                border
-                size="mini"
-                :resizable="false"
-                highlight-current-row
-                height="500"
-                @selection-change="handleLeftChange"
-                disabled
-                ref="leftTable"
-              >
-                >
-                <el-table-column label="可选">
-                  <el-table-column
-                    prop="phone"
-                    label="姓名"
-                    type="selection"
-                  ></el-table-column>
-                  <el-table-column
-                    prop="customerName"
-                    label="姓名"
-                  ></el-table-column>
-                  <el-table-column
-                    prop="phone"
-                    label="手机号"
-                  ></el-table-column>
-                  <el-table-column label="添加" width="60px">
-                    <template slot-scope="scope">
-                      <el-button
-                        type="text"
-                        icon="el-icon-circle-plus-outline"
-                        class="underline btn24"
-                        size="mini"
-                        @click="handleMoveLabel('right', 1, scope.row)"
-                      >添加</el-button>
-                    </template>
-                  </el-table-column>
-                </el-table-column>
-              </el-table>
-  
-              <pagination
-                v-show="leftTotal > 0"
-                :total="leftTotal"
-                :page.sync="leftQuery.pageNum"
-                :limit.sync="leftQuery.pageSize"
-                @pagination="getLeftData"
-                style="margin-bottom:30px"
-                :pagerCount="5"
-                layout="total, prev, pager, next"
-              />
-              
-            </el-col>
-            <el-col :span="2" style="text-align: center;">
-               <el-button type="primary" size="mini" @click="toggleLabel" style="margin-top:200px" :disabled="toggleable">切换</el-button>
-            </el-col>
-            <el-col :span="11">
-              <div>
-                <el-input
-                  v-model="rightQuery.customerName"
-                  placeholder="输入姓名"
-                  style="width: 150px"
-                  size="mini"
-                  clearable
-                />
-                <el-input
-                  v-model="rightQuery.phone"
-                  placeholder="输入手机号"
-                  style="width: 150px; margin-left: 3px"
-                  size="mini"
-                  clearable
-                />
-                <el-button
-                  type="primary"
-                  size="mini"
-                  icon="el-icon-search"
-                  style="margin-left: 6px"
-                  @click="getRightData"
-                  >查询</el-button
-                >
-                <el-button
-                  type="danger"
-                  size="mini"
-                  icon="el-icon-delete"
-                  style="margin-left: 6px"
-                  @click="clearRightQuery()"
-                  >清空</el-button
-                >
-              </div>
-              <el-table
-                :data="rightData"
-                border
-                size="mini"
-                highlight-current-row
-                :resizable="false"
-                height="500"
-                @selection-change="handleRightChange"
-                :loading="true"
-                ref="rightTable"
-              >
-                <el-table-column label="已选" :resizable="false">
-                  <el-table-column
-                    prop="phone"
-                    type="selection"
-                  ></el-table-column>
-                  <el-table-column
-                    prop="customerName"
-                    label="姓名"
-                  ></el-table-column>
-                  <el-table-column
-                    prop="phone"
-                    label="手机号"
-                  ></el-table-column>
-                  <el-table-column label="移除" width="60px">
-                    <template slot-scope="scope">
-                      <el-button
-                        type="text"
-                        icon="el-icon-remove-outline"
-                        class="underline btn24"
-                        size="mini"
-                        @click="handleMoveLabel('left', 1, scope.row)"
-                        >移除</el-button
-                      >
-                    </template>
-                  </el-table-column>
-                </el-table-column>
-              </el-table>
-              <pagination
-                v-show="rightTotal > 0"
-                :total="rightTotal"
-                :page.sync="rightQuery.pageNum"
-                :limit.sync="rightQuery.pageSize"
-                @pagination="getRightData"
-                style="margin-bottom:30px"
-                :pagerCount="5"
-                layout="total, prev, pager, next"
-              />
-            </el-col>
-          
-        </el-collapse-item>
-      </el-collapse>
-    </div>
-    <div v-else>你未启用标签功能</div>
-  </div>
-</template>
-
-<script>
-import {
-  sysDeptDemoList,
-  selectCustomerLabelInfo,
-  addAndDelCustomerLabel,
-  selectPhoneList,
-  selectNotCustomerLabelInfo,
-} from "@/api/label/label";
-export default {
-  name: "Label_SetLabel",
-  data() {
-    return {
-      activeNames: undefined,
-      labelList: {},
-      notCustomerLabelList: [],
-      customerLabelList: [],
-      loading: false,
-      error: false,
-      currentLabelId: undefined,
-      pageStatus: 0,
-      timer: null,
-      leftData: [],
-      rightData: [],
-      leftTotal:100,
-      rightTotal:100,
-      leftQuery: {
-        pageNum: 1,
-        pageSize: 10,
-        labelId:null,
-        customerName: null,
-        phone:null
-      },
-      rightQuery: {
-        pageNum: 1,
-        pageSize: 10,
-        labelId:null,
-        customerName: null,
-        phone:null
-      },
-      moveRightData:[],
-      moveLeftData:[]
-    };
-  },
-  created() {
-    this.init();
-  },
-  computed:{
-    toggleable(){
-      if(this.moveRightData.length === 0 && this.moveLeftData.length === 0){
-        return true;
-      }
-      return false;
-    }
-  },
-  methods: {
-    getLeftData(){
-      // this.leftData = [];
-      selectNotCustomerLabelInfo(this.leftQuery)
-        .then((res) => {
-          if (res.code == 200) {
-            this.leftData = res.rows;
-            this.leftTotal = res.total
-          } else {
-            throw new Error("");
-          }
-        })
-        .catch((err) => {
-          this.leftData = [];
-          this.leftTotal = 0;
-          this.msgError("拉取左边标签用户失败,请刷新~");
-        });
-      
-    },
-    getRightData(){
-      // this.rightData = [];
-      selectPhoneList(this.rightQuery)
-        .then((res) => {
-          if (res.code == 200) {
-            this.rightData = res.rows;
-            this.rightTotal = res.total;
-          } else {
-            throw new Error("");
-          }
-        })
-        .catch(() => {
-          this.rightData = [];
-          this.rightTotal = 0;
-          this.msgError("拉取右边标签用户失败,请刷新~");
-        });
-
-    },
-    handleMoveLabel(direction = 'right', type = 1, row, labelIdArr){  // type 1 传row  type 2 idArr    direction right 向右转移 left 向左转移
-       let changeArr = []
-       if(type == 1){
-          changeArr.push(row.phone)
-       }else if(type == 2){
-         changeArr = labelIdArr
-       }
-      const query = {
-        labelId: direction == 'right' ? this.leftQuery.labelId : this.rightQuery.labelId,
-        flag: "1",
-        phoneList: changeArr,
-      };
-      if (direction == "right") {
-        query.flag = "0";
-      } else if (direction == "left") {
-        query.flag = "1";
-      }
-      addAndDelCustomerLabel(query).then((res) => {
-        if (res.code == 200) {
-          this.getLeftData();
-          this.getRightData();
-        } else {
-          throw new Error("");
-        }
-      }).catch((err)=>{
-        
-      });
-
-    },
-    clearLeftQuery(labelId = this.leftQuery.labelId){
-      this.leftQuery =  {
-        pageNum: 1,
-        pageSize: 10,
-        labelId,
-        customerName: null,
-        phone:null
-      }
-    },
-    clearRightQuery(labelId = this.rightQuery.labelId){
-      console.log(this.rightQuery);
-      this.rightQuery =  {
-        pageNum: 1,
-        pageSize: 10,
-        labelId,
-        customerName: null,
-        phone:null
-      }
-    },
-    handleLeftChange(val) {
-      let changeArr = [];
-      val.map((ele) => {
-        changeArr.push(ele.phone);
-      });
-      this.moveLeftData = []
-      this.moveRightData = changeArr
-      this.$refs.rightTable.map((ele)=>{
-        ele.clearSelection();
-      });
-    },
-    handleRightChange(val) {
-      let changeArr = [];
-      val.map((ele) => {
-        changeArr.push(ele.phone);
-      });
-      this.moveLeftData = changeArr
-      this.moveRightData = []
-      this.$refs.leftTable.map((ele)=>{
-        ele.clearSelection()
-      });
-    },
-    init() {
-      this.setPageStatus();
-      this.getLabelList();
-    },
-    setPageStatus() {
-      this.queryPageStatus([2]).then((res) => {
-        this.pageStatus = res;
-      });
-    },
-    openLabel(id) {
-      this.clearLeftQuery(id);
-      this.clearRightQuery(id);
-      this.getLeftData();
-      this.getRightData();
-    },
-    // getLabelUser(id) {
-    //   this.loading = true;
-    //   selectCustomerLabelInfo({
-    //     labelId: id,
-    //   })
-    //     .then((res) => {
-    //       if (res.code == 200) {
-    //         this.notCustomerLabelList = res.data.notCustomerLabelList;
-    //         this.customerLabelList = res.data.phoneList;
-    //       } else {
-    //         throw new Error("");
-    //       }
-    //     })
-    //     .catch(() => {
-    //       this.loading = false;
-    //       this.error = true;
-    //       this.msgError("拉取标签下用户信息失败");
-    //     });
-    // },
-    toggleLabel(){
-      console.log(this.moveLeftData);
-      console.log(this.moveRightData);
-      if(this.moveLeftData.length !== 0){
-        this.handleMoveLabel('left',2,null,this.moveLeftData)
-        return;
-      }
-      if(this.moveRightData.length !== 0){
-        this.handleMoveLabel('right',2,null,this.moveRightData)
-        return;
-      }
-      return;
-    },
-
-    getLabelList() {
-      return sysDeptDemoList().then((res) => {
-        if (res.code == 200) {
-          this.labelList = res.data;
-        } else {
-          this.msgError("初始化数据失败");
-        }
-      });
-    },
-
-    // transfer(originlArr, direction, changeArr) {
-    //   const query = {
-    //     labelId: this.activeNames,
-    //     flag: "1",
-    //     phoneList: changeArr,
-    //   };
-    //   if (direction == "right") {
-    //     query.flag = "0";
-    //   } else if (direction == "left") {
-    //     query.flag = "1";
-    //   }
-    //   addAndDelCustomerLabel(query).then((res) => {
-    //     if (res.code == 200) {
-    //       this.getRightUser();
-    //     } else {
-    //     }
-    //   });
-    // },
-  },
-};
-</script>
-
-<style lang="scss">
-.Label_AddUser {
-  .collapse {
-    width: 1200px;
-    margin: 0 auto;
-
-    //.el-collapse-item__wrap {
-    // border-bottom: 1px solid;
-    //}
-
-    .el-transfer-panel {
-      width: 300px;
-      height: 600px;
-    }
-
-    .el-transfer-panel__list.is-filterable {
-      height: 465px;
-    }
-  }
-}
-</style>

+ 243 - 56
src/views/label/Label_Batch.vue

@@ -12,6 +12,7 @@
               class="custom-select"
               id="inputGroupSelect01"
               style="width: 80px"
+              v-model="queryParams.oilName"
             >
               <option selected>Choose...</option>
               <option value="1">One</option>
@@ -24,9 +25,7 @@
           <div class="input-group input-group-sm flex-nowrap">
             <div class="input-group-prepend" style="width: 80px"></div>
             <div class="input-group-prepend">
-              <span class="input-group-text" id="addon-wrapping"
-                >日期:</span
-              >
+              <span class="input-group-text" id="addon-wrapping">日期:</span>
               <el-date-picker
                 v-model="dateRangeCreatedDate"
                 type="datetimerange"
@@ -61,9 +60,9 @@
               <span class="input-group-text" id="addon-wrapping">次</span>
             </div>
             <div class="input-group-prepend">
-              <span class="input-group-text" id="addon-wrapping"
-                > &lt; 加油次数 &lt; </span
-              >
+              <span class="input-group-text" id="addon-wrapping">
+                &lt; 加油次数 &lt;
+              </span>
             </div>
             <input
               type="text"
@@ -148,9 +147,9 @@
               <span class="input-group-text" id="addon-wrapping">升</span>
             </div>
             <div class="input-group-prepend">
-              <span class="input-group-text" id="addon-wrapping"
-                > &lt; 加油升数 &lt; </span
-              >
+              <span class="input-group-text" id="addon-wrapping">
+                &lt; 加油升数 &lt;
+              </span>
             </div>
             <input
               type="text"
@@ -165,16 +164,14 @@
         </div>
       </div>
     </div>
-   <hr/>
+    <hr />
     <div class="container">
       <div class="row">
         <div class="col-sm col-md-8">
           <div class="input-group input-group-sm flex-nowrap">
             <div class="input-group-prepend" style="width: 80px"></div>
             <div class="input-group-prepend">
-              <span class="input-group-text" id="addon-wrapping"
-                >时间:</span
-              >
+              <span class="input-group-text" id="addon-wrapping">时间:</span>
               <el-date-picker
                 v-model="dateRangeCreatedDate"
                 type="datetimerange"
@@ -313,17 +310,30 @@
         </div>
       </div>
     </div>
- 
+
     <hr />
-    <el-table :data="labelList" >
+    <el-table :data="userList" @selection-change="selectionChange">
       <af-table-column align="center" prop="id" type="selection" />
-      <af-table-column label="姓名" align="center" prop="id" />
-      <af-table-column label="当前归属的标签" align="center" prop="id" />
-      <af-table-column label="手机号" align="center" prop="stationName" />
+      <af-table-column label="姓名" align="center" prop="customerName" />
+      <af-table-column label="当前归属的标签" align="center" prop="labelName">
+        <template slot-scope="scope">
+          <span
+            class="badge"
+            :class="[
+              scope.row.labelId === null ? 'badge-danger' : 'badge-success',
+            ]"
+          >
+            {{
+              scope.row.labelId === null ? "未标记" : scope.row.labelName
+            }}</span
+          >
+        </template>
+      </af-table-column>
+      <af-table-column label="手机号" align="center" prop="phone" />
       <af-table-column
         label="最后一笔消费时间"
         align="center"
-        prop="stationName"
+        prop="createDate"
       />
       <af-table-column
         label="近期详细消费"
@@ -342,38 +352,122 @@
           >
         </template>
       </af-table-column>
-      <af-table-column label="操作" align="center" width="160px">
+      <af-table-column label="操作" align="center" width="160px" fixed="right">
         <template slot-scope="scope">
-          <el-button
-            type="text"
-            icon="el-icon-circle-plus-outline"
-            class="underline btn24"
-            size="mini"
-            @click="handleMoveLabel('right', 1, scope.row)"
-            >打标签</el-button
-          >
-          <el-button
-            type="text"
-            icon="el-icon-circle-plus-outline"
-            class="underline btn24"
-            size="mini"
-            @click="handleMoveLabel('right', 1, scope.row)"
-            >删除当前标签</el-button
+          <el-dropdown @command="toLabeled">
+            <span class="el-dropdown-link" style="font-size: 12px">
+              打标签<i class="el-icon-arrow-down el-icon--right"></i>
+            </span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                :command="ele.id"
+                v-for="ele in labelList"
+                :key="ele.id"
+                >{{ ele.labelName }}</el-dropdown-item
+              >
+            </el-dropdown-menu>
+          </el-dropdown>
+          <el-popconfirm
+            title="此操作会将选中用户强制列为无标签状态,是否继续?"
+            confirm-button-text="删除"
+            @onConfirm="toUnLableed"
           >
+            <el-button
+              type="text"
+              icon="el-icon-circle-plus-outline"
+              class="underline btn24"
+              size="mini"
+              slot="reference"
+              >删标签</el-button
+            >
+          </el-popconfirm>
         </template>
       </af-table-column>
     </el-table>
     <pagination
-      v-show="total > 0"
+      v-show="total > 10"
       :total="total"
+      :pageSizes="[10, 50, 100, 200]"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+    <el-dialog
+      title="打标签"
+      :visible.sync="toLabeledDialog"
+      width="750px"
+      append-to-body
+    >
+      <div v-if="filterSelectedUser.length != 0">
+        <div class="ml-5">
+          以下成员已经存在标签,如果<b>直接点击确认按钮</b>,以下成员<b>不会拉入此标签</b><span class="badge badge-success ml-1">{{translationLabel(currentLabelId)}}</span>。
+        </div>
+        <div class="ml-5">
+          想要<b>强制拉入标签</b><span class="badge badge-success ml-1">{{translationLabel(currentLabelId)}}</span>,请<b>先删除这些成员的现有的标签</b>,然后点击确认按钮,即可操作完成。
+        </div>
+
+        <div class="app-container">
+          <el-table
+            :data="filterSelectedUser"
+            @selection-change="selectionChange"
+          >
+            <af-table-column align="center" prop="id" type="selection" />
+            <af-table-column label="姓名" align="center" prop="customerName" />
+            <af-table-column
+              label="当前归属的标签"
+              align="center"
+              prop="labelName"
+            >
+              <template slot-scope="scope">
+                <span
+                  class="badge"
+                  :class="[
+                    scope.row.labelId === null
+                      ? 'badge-danger'
+                      : 'badge-success',
+                  ]"
+                >
+                  {{
+                    scope.row.labelId === null ? "未标记" : scope.row.labelName
+                  }}</span
+                >
+              </template>
+            </af-table-column>
+
+            <af-table-column label="手机号" align="center" prop="phone" />
+
+            <af-table-column label="操作" align="center" width="160px">
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  icon="el-icon-circle-plus-outline"
+                  class="underline btn24"
+                  size="mini"
+                  @click="handleMoveLabel('right', 1, scope.row)"
+                  >删标签</el-button
+                >
+              </template>
+            </af-table-column>
+          </el-table>
+          <pagination
+            v-show="totalInfo > 0"
+            :total="totalInfo"
+            :page.sync="query.pageNum"
+            :limit.sync="query.pageSize"
+            @pagination="getList"
+          />
+        </div>
+      </div>
+      <div v-else>点击确认按钮,立刻将选中用户拉入标签<span class="badge badge-success ml-1">{{translationLabel(currentLabelId)}}</span>~</div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handleSubmitLable" size="small">确 定</el-button>
+        <el-button @click="cancelSubmitLabel" size="small">取 消</el-button>
+      </div>
+    </el-dialog>
 
     <el-dialog
       title="1235555"
-      :visible.sync="orderOpen"
+      visible.sync="false"
       width="750px"
       append-to-body
     >
@@ -398,14 +492,6 @@
             prop="oilPersonnel"
           />
           <af-table-column label="加油枪号" align="center" prop="oilGun" />
-          <!--
-          <af-table-column
-            label="支付类型"
-            align="center"
-            prop="payType"
-            :formatter="payTypeFotmat"
-          />
-          -->
           <af-table-column
             label="油站名称"
             width="120"
@@ -463,7 +549,7 @@
 </template>
 
 <script>
-import { listRecord } from "@/api/customer/record";
+import { getLabelUser, getLabelList, delUserLabel,addAndDelCustomerLabel } from "@/api/label/label";
 
 export default {
   name: "Dzk_Bill",
@@ -472,17 +558,17 @@ export default {
       // 总条数
       total: 0,
       // 客户电子会员卡充值消费记录表格数据
-      labelList: [],
+      userList: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        orderNo: null,
-        customerNo: null,
-        customerName: null,
-        usageType: null,
-        payType: null,
-        cardOilsType: null,
+        // orderNo: null,
+        // customerNo: null,
+        // customerName: null,
+        // usageType: null,
+        // payType: null,
+        // cardOilsType: null,
       },
       orderList: [{}],
       orderOpen: false,
@@ -499,14 +585,100 @@ export default {
         levelId: this.levelId,
       },
       dateRangeCreatedDate: [],
+      selectedUser: [],
+      checkedUser: [],
+      toLabeledDialog: false,
+      labelList: [],
+      currentLabelId:undefined,
     };
   },
+  computed: {
+    filterSelectedUser() {
+      return this.selectedUser.filter((ele) => {
+        return !!ele.labelId && ele.labelId != this.currentLabelId;
+      });
+    },
+  },
   created() {
     this.getList();
+    getLabelList()
+      .then((res) => {
+        console.log(res);
+        if (res.code == 200) {
+          this.labelList = res.rows;
+        } else {
+          throw new Error("");
+        }
+      })
+      .catch(() => {
+        this.msgError("拉取标签列表失败,请刷新网页~");
+      });
   },
   methods: {
-    selectionChange(selection){
+    handleSubmitLable(){
+      const addArr = []
+      this.selectedUser.map((ele)=>{
+      if(ele.labelId != this.currentLabelId && !ele.labelId )
+        addArr.push(ele.phone)
+      })
+      addAndDelCustomerLabel({
+        labelId: this.currentLabelId,
+        flag: "0",
+        phoneList : addArr
+      }).then((res)=>{
+        if(res.code == 200){
+          this.getList();
+          this.msgSuccess("批量拉入标签成功~")
+          this.toLabeledDialog = false;
+        }else{
+          throw new Error("");
+        }
+      }).catch(()=>{
+        this.msgError("批量拉入标签失败,请刷新网页后重试~")
+        this.toLabeledDialog= false;
+      })
+
+
+    },
+    cancelSubmitLabel(){
+      this.toLabeledDialog = false;
+    },
+    translationLabel(id){
+      console.log(this.labelList);
+      const label = this.labelList.find((ele)=>{
+        return id == ele.id
+      })
+      if(label == undefined){
+        return ''
+      }
+      return label.labelName;
+    },
+    toUnLableed() {
+      if(this.selectedUser.length == 0){
+        this.msgError("请先选择用户后再进行删除标签~");
+        return;
+      }
+      const delArr = [];
+      this.selectedUser.map((ele)=>{
+        if(!!ele.phone){
+          delArr.push(ele.phone)
+        }
+      })
+      delUserLabel({phoneList:delArr}).then((res)=>{
+        if(res.code == 200){
+          this.getList();
+          this.msgSuccess("删除用户标签成功~");
+        }else{
+          throw new Error("")
+        }
+      }).catch(()=>{
+        this.msgError("删除用户标签状态失败,请刷新后重试~")
+      })
+    },
+
+    selectionChange(selection) {
       console.log(selection);
+      this.selectedUser = selection;
     },
     usageTypeFotmat(row, column) {
       if (row.usageType === "+") {
@@ -530,8 +702,8 @@ export default {
     },
     /** 查询客户电子会员卡充值消费记录列表 */
     getList() {
-      listRecord(this.queryParams).then((response) => {
-        this.labelList = response.rows;
+      getLabelUser(this.queryParams).then((response) => {
+        this.userList = response.rows;
         this.total = response.total;
       });
     },
@@ -548,6 +720,14 @@ export default {
     orderOpenMethod() {
       this.orderOpen = true;
     },
+    toLabeled(id) {
+      if (this.selectedUser.length == 0) {
+        this.msgError("请先选择用户后再打标签");
+        return;
+      }
+      this.currentLabelId = id
+      this.toLabeledDialog = true;
+    },
   },
 };
 </script>
@@ -559,4 +739,11 @@ export default {
     }
   }
 }
+.el-dropdown-link {
+  cursor: pointer;
+  color: #409eff;
+}
+.el-icon-arrow-down {
+  font-size: 12px;
+}
 </style>

+ 23 - 7
src/views/lng/Lng_BalaceRecord.vue

@@ -1,20 +1,36 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true"  label-width="68px">
+      <el-form-item label="类型" prop="type">
+        <el-select
+          v-model="queryParams.type"
+          placeholder="请选择消费充值类型"
+          clearable
+          size="small"
+        >
+          <el-option label="充值" value="+" />
+          <el-option label="消费" value="-" />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
     </el-form>
     <el-table  :data="balanceAdjustList">
-      <el-table-column label="结算价" align="center" prop="recentConsumptionDate" width="180">
+      <el-table-column label="类型" align="center" prop="type">
         <template slot-scope="scope">
-          <span>{{ scope.row.settlementType == 1 ? '直降' : '折扣' }} {{ scope.row.settlementPrice }} {{ scope.row.settlementType == 1 ? '元' : '%' }}</span>
+          <span class="badge" :class="scope.row.type == '+' ? 'badge-primary':'badge-danger'">{{ scope.row.type == '+' ? '增加' : '减少' }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="司机价" align="center" prop="recentConsumptionDate" width="180">
+      <af-table-column label="变动金额" align="center" prop="amt" />
+      <af-table-column label="站点名称" align="center" prop="stationName" v-if="jiBie==1" />
+      <af-table-column label="调价时间" align="center" prop="createTime"  />
+      <el-table-column label="涉及订单" align="center" prop="type">
         <template slot-scope="scope">
-          <span>折扣 {{ scope.row.driverPrice }} % </span>
+          <span>{{ scope.row.orderNo == null ? '无' : scope.row.orderNo }}</span>
         </template>
       </el-table-column>
-      <af-table-column label="站点名称" align="center" prop="stationName" v-if="jiBie==1" />
-      <af-table-column label="调价时间" align="center" prop="createTime"  />
       <af-table-column label="操作人" align="center" prop="createName"  />
     </el-table>
     <pagination
@@ -65,7 +81,7 @@ export default {
   methods: {
     /** 查询结算价格,司机价格优惠调整列表 */
     getList() {
-      listAdjust(this.queryParams).then(response => {
+      listBanlaceAdjust(this.queryParams).then(response => {
         this.balanceAdjustList = response.rows;
         this.total = response.total;
       });