소스 검색

Merge remote-tracking branch 'origin/master'

yuhongqi 2 일 전
부모
커밋
5acc8f822f
2개의 변경된 파일114개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 0
      src/api/qw/externalContact.js
  2. 106 1
      src/views/qw/externalContact/index.vue

+ 8 - 0
src/api/qw/externalContact.js

@@ -297,3 +297,11 @@ export function delLossStatisticsExport(query) {
     params: query
   })
 }
+
+export function extChangeLevel(data) {
+  return request({
+    url: '/qw/externalContact/changeLevel',
+    method: 'post',
+    data: data
+  })
+}

+ 106 - 1
src/views/qw/externalContact/index.vue

@@ -252,6 +252,28 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateLevel"
+          v-hasPermi="['qw:externalContact:changeLevel']"
+        >批量修改客户等级
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateLevelFilter"
+          v-hasPermi="['qw:externalContact:changeLevel']"
+        >批量修改客户等级(筛选条件)
+        </el-button>
+      </el-col>
 <!--      <el-col :span="1.5">-->
 <!--        <el-button-->
 <!--          type="warning"-->
@@ -470,11 +492,37 @@
       <externalContactInfo  ref="Details" />
     </el-dialog>
 
+    <el-dialog :title="ratingOpen.title" :visible.sync="ratingOpen.open" width="600px" append-to-body>
+      <div style="padding: 20px 0;">
+        <el-select v-model="ratingOpen.level" placeholder="客户等级" clearable size="small">
+          <el-option
+            v-for="dict in ratingType"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="ratingSubmitForm()">确 定</el-button>
+        <el-button @click="ratingCancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listExternalContact, getExternalContact, delExternalContact, addExternalContact, updateExternalContact, exportExternalContact, exportUnionId } from "@/api/qw/externalContact";
+import {
+  listExternalContact,
+  getExternalContact,
+  delExternalContact,
+  addExternalContact,
+  updateExternalContact,
+  exportExternalContact,
+  exportUnionId,
+  extChangeLevel
+} from '@/api/qw/externalContact'
 import {getCompanyList} from "@/api/company/company";
 import {getAllUserlist} from "@/api/company/companyUser";
 import {getQwUserInfo} from "@/api/qw/qwUser";
@@ -489,6 +537,13 @@ export default {
   components: { PaginationMore,externalContactInfo },
   data() {
     return {
+      ratingOpen:{
+        open:false,
+        title:'',
+        level:null,
+        userIds:null,
+        filter:false,
+      },
       daterange: [],
       // 遮罩层
       loading: false,
@@ -667,6 +722,56 @@ export default {
     });
   },
   methods: {
+
+    handleBatchUpdateLevel(){
+
+      if (this.ids == null || this.ids == "") {
+        return this.$message('请选择需要添加备注的客户');
+      }
+
+      this.ratingOpen.open=true;
+      this.ratingOpen.title='批量修改客户等级'
+      this.ratingOpen.filter=false;
+    },
+
+    handleBatchUpdateLevelFilter(){
+      this.ratingOpen.open=true;
+      this.ratingOpen.title='批量修改客户等级'
+      this.ratingOpen.filter=true;
+    },
+
+    ratingSubmitForm(){
+
+      if (!this.ratingOpen.level){
+        return this.$message.error('请选择要修改的等级');
+      }
+
+      this.ratingOpen.userIds = this.ids;
+
+      let obj = JSON.parse(JSON.stringify(this.queryParams))
+      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
+        obj.tagIds = obj.tagIds.split(",");
+      }
+      this.ratingOpen.param = obj;
+
+      extChangeLevel(this.ratingOpen).then(response => {
+        this.msgSuccess("修改完成");
+        this.getList();
+      }).finally(() => {
+        this.ratingCancel();
+      });
+
+    },
+
+
+    ratingCancel(){
+      this.ratingOpen={
+        open: false,
+        title: '',
+        level: null,
+        userIds: null
+      }
+    },
     handledetails(row){
       this.info.open=true;
       setTimeout(() => {