| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | <template> | 
 |  |  |   <TableLayout :permissions="['business:companyUser:query']"> | 
 |  |  |     <!-- æç´¢è¡¨å --> | 
 |  |  |     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
 |  |  |       <el-form-item label="ä¼ä¸åç§°" prop="companyName"> | 
 |  |  |         <el-input v-model="searchForm.companyName" placeholder="请è¾å
¥ä¼ä¸åç§°" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <!-- <el-form-item label="ä¼ä¸ç®ç§°" prop="shortName"> | 
 |  |  |         <el-input v-model="searchForm.shortName" placeholder="请è¾å
¥ä¼ä¸ç®ç§°" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> --> | 
 |  |  |       <el-form-item label="è´¦å·ä¿¡æ¯" prop="keyWords"> | 
 |  |  |         <el-input v-model="searchForm.keyWords" placeholder="请è¾å
¥ç»å½è´¦å·/å§å" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="ç¶æ" prop="status"> | 
 |  |  |         <el-select v-model="searchForm.status" clearable placeholder="è¯·éæ©" @change="search"> | 
 |  |  |           <el-option label="å¯ç¨" :value="0"></el-option> | 
 |  |  |           <el-option label="ç¦ç¨" :value="1"></el-option> | 
 |  |  |         </el-select> | 
 |  |  |       </el-form-item> | 
 |  |  |       <section> | 
 |  |  |         <el-button type="primary" @click="search">æç´¢</el-button> | 
 |  |  |         <el-button @click="reset">éç½®</el-button> | 
 |  |  |       </section> | 
 |  |  |     </el-form> | 
 |  |  |     <!-- è¡¨æ ¼åå页 --> | 
 |  |  |     <template v-slot:table-wrap> | 
 |  |  |       <el-table v-loading="isWorking.search" :data="tableData.list" border stripe | 
 |  |  |         @selection-change="handleSelectionChange"> | 
 |  |  |         <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> --> | 
 |  |  |         <el-table-column prop="companyName" label="ä¼ä¸åç§°" min-width="100px" align="center"></el-table-column> | 
 |  |  |         <el-table-column prop="username" label="ç»å½è´¦å·" min-width="100px" align="center"></el-table-column> | 
 |  |  |         <el-table-column prop="realname" label="å§å" min-width="100px" align="center"></el-table-column> | 
 |  |  |         <el-table-column prop="mobile" label="ææºå·" min-width="100px" align="center"></el-table-column> | 
 |  |  |         <el-table-column prop="status" label="ç¶æ" min-width="100px" align="center"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <!-- 0å¯ç¨ 1ç¦ç¨ --> | 
 |  |  |             <el-switch :disabled="!containPermissions(['business:companyUser:update'])" v-model="row.status" | 
 |  |  |               :inactive-value="1" :active-value="0" @change="changeStatus(row)"> | 
 |  |  |             </el-switch> | 
 |  |  |           </template> | 
 |  |  |  | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column prop="createTime" label="å建æ¶é´" min-width="140px" align="center"></el-table-column> | 
 |  |  |       </el-table> | 
 |  |  |       <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> | 
 |  |  |       </pagination> | 
 |  |  |     </template> | 
 |  |  |  | 
 |  |  |   </TableLayout> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  | import BaseTable from '@/components/base/BaseTable' | 
 |  |  | import TableLayout from '@/layouts/TableLayout' | 
 |  |  | import Pagination from '@/components/common/Pagination' | 
 |  |  | import { updateById } from '@/api/system/user' | 
 |  |  | export default { | 
 |  |  |   name: 'Company', | 
 |  |  |   extends: BaseTable, | 
 |  |  |   components: { TableLayout, Pagination }, | 
 |  |  |   data() { | 
 |  |  |     return { | 
 |  |  |       oepnValidDate: [], | 
 |  |  |       // æç´¢ | 
 |  |  |       searchForm: { | 
 |  |  |         companyName: '', | 
 |  |  |         keyWords: '', | 
 |  |  |         status: '', | 
 |  |  |         type: 2 | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   created() { | 
 |  |  |     this.config({ | 
 |  |  |       module: 'ç³»ç»-ä¼ä¸ä¿¡æ¯è¡¨', | 
 |  |  |       api: '/business/companyUser', | 
 |  |  |       'field.id': 'id', | 
 |  |  |       'field.main': 'id' | 
 |  |  |     }) | 
 |  |  |     this.search() | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     selectOepnValidDate(v) { | 
 |  |  |       [this.searchForm.oepnValidDateStart, this.searchForm.oepnValidDateEnd] = v | 
 |  |  |     }, | 
 |  |  |     reset() { | 
 |  |  |       // this.reset() | 
 |  |  |       this.$refs.searchForm.resetFields() | 
 |  |  |       this.searchForm.oepnValidDateStart = '' | 
 |  |  |       this.searchForm.oepnValidDateEnd = '' | 
 |  |  |       this.oepnValidDate = [] | 
 |  |  |       this.search() | 
 |  |  |     }, | 
 |  |  |     changeStatus(row) { | 
 |  |  |       updateById(row) | 
 |  |  |         .then(() => { | 
 |  |  |           this.$tip.apiSuccess('æ´æ°æå') | 
 |  |  |         }) | 
 |  |  |         .catch(err => { | 
 |  |  |           this.$tip.apiFailed(err) | 
 |  |  |         }) | 
 |  |  |         .finally(() => { | 
 |  |  |           this.handlePageChange() | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  | } | 
 |  |  | </script> |