|
|
@@ -514,6 +514,22 @@
|
|
|
<el-tag v-else type="info"> 未绑定</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="允许领红包" width="100px" align="center" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="!scope.row.fsUserId" style="color: #c0c4cc;">-</span>
|
|
|
+ <el-switch
|
|
|
+ v-else
|
|
|
+ v-model="scope.row.fsUserRedStatus"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#dcdfe6"
|
|
|
+ :disabled="!!scope.row._fsUserRedStatusSaving"
|
|
|
+ v-hasPermi="['user:fsUser:edit']"
|
|
|
+ @change="handleFsUserRedStatusChange(scope.row)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="200px" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
@@ -1028,6 +1044,7 @@ import selectUser from "@/views/qw/externalContact/selectUser.vue";
|
|
|
import collection from "@/views/qw/externalContact/collection.vue";
|
|
|
import info from "@/views/qw/externalContact/info.vue";
|
|
|
import { editTalk } from "@/api/qw/externalContactInfo";
|
|
|
+import { updateFsUserRedStatus } from '@/api/user/fsUser'
|
|
|
import PaginationMore from "../../../components/PaginationMore/index.vue";
|
|
|
import userDetails from '@/views/store/components/userDetails.vue';
|
|
|
import {courseList, videoList} from "@/api/course/courseRedPacketLog";
|
|
|
@@ -1509,12 +1526,33 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ handleFsUserRedStatusChange(row) {
|
|
|
+ if (!row.fsUserId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const newVal = row.fsUserRedStatus
|
|
|
+ const prev = newVal === 1 ? 0 : 1
|
|
|
+ this.$set(row, '_fsUserRedStatusSaving', true)
|
|
|
+ updateFsUserRedStatus({ userId: row.fsUserId, redStatus: newVal })
|
|
|
+ .then(() => {
|
|
|
+ this.msgSuccess('领红包设置已保存')
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$set(row, 'fsUserRedStatus', prev)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.$set(row, '_fsUserRedStatusSaving', false)
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 查询企业微信客户列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
const { qwUserName, ...queryParams } = this.queryParams;
|
|
|
listExternalContact(queryParams).then(response => {
|
|
|
- this.externalContactList = response.rows;
|
|
|
+ this.externalContactList = (response.rows || []).map(r => ({
|
|
|
+ ...r,
|
|
|
+ fsUserRedStatus: [1, '1'].includes(r.redStatus != null ? r.redStatus : r.red_status) ? 1 : 0
|
|
|
+ }));
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
});
|