|  |  | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column prop="status" label="状态" min-width="100px"> | 
 |  |  |  | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <span :class="{ red: row.status == 1 }">{{ row.status == '0' ? '正常' : '禁用' }}</span> | 
 |  |  |             <el-switch v-model="row.status" @change="e => changeStatus(row)" :active-value="0" | 
 |  |  |               :inactive-value="1"> | 
 |  |  |             </el-switch> | 
 |  |  |             <!-- <span :class="{ red: row.status == 1 }">{{ row.status == '0' ? '正常' : '禁用' }}</span> --> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column v-if="containPermissions(['business:ywcustomer:update', 'business:ywcustomer:delete'])" | 
 |  |  | 
 |  |  | import Pagination from '@/components/common/Pagination' | 
 |  |  | import OperaYwCustomerWindow from './components/staffEdit.vue' | 
 |  |  | import { fetchList } from '@/api/client/ywCustomer' | 
 |  |  | import { updateStatusById } from '@/api/business/member' | 
 |  |  | import { ywExportExcel } from '@/api/client/staff' | 
 |  |  | import { Message } from 'element-ui' | 
 |  |  | export default { | 
 |  |  |   name: 'YwCustomer', | 
 |  |  |   extends: BaseTable, | 
 |  |  | 
 |  |  |     this.initData() | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     changeStatus(e) { | 
 |  |  |       updateStatusById(e).then(res => { | 
 |  |  |         this.search() | 
 |  |  |         Message.success('状态修改成功') | 
 |  |  |       }, () => { | 
 |  |  |         this.search() | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     initData() { | 
 |  |  |       fetchList({ | 
 |  |  |         capacity: 9000, | 
 |  |  | 
 |  |  |         this.clientList = res.records || [] | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     exportExcel () { | 
 |  |  |       this.$dialog.exportConfirm('确认导出吗?') | 
 |  |  |         .then(() => { | 
 |  |  |           this.isWorking.export = true | 
 |  |  |           ywExportExcel({ | 
 |  |  |             page: this.tableData.pagination.pageIndex, | 
 |  |  |             capacity: 1000000, | 
 |  |  |             model: this.searchForm, | 
 |  |  |             sorts: this.tableData.sorts | 
 |  |  |           }) | 
 |  |  |             .then(response => { | 
 |  |  |               this.download(response) | 
 |  |  |             }) | 
 |  |  |             .catch(e => { | 
 |  |  |               this.$tip.apiFailed(e) | 
 |  |  |             }) | 
 |  |  |             .finally(() => { | 
 |  |  |               this.isWorking.export = false | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |         .catch(() => {}) | 
 |  |  |     }, | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | </script> |