| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:company:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="ä¼ä¸åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" 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="managerUserName"> |
| | | <el-input v-model="searchForm.managerUserName" placeholder="请è¾å
¥ç»å½è´¦å·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æææ" prop="oepnValidDate"> |
| | | <el-date-picker type="daterange" v-model="oepnValidDate" value-format="yyyy-MM-dd" start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" @change="selectOepnValidDate" /> |
| | | </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> |
| | | <ul class="toolbar" v-permissions="['business:company:create']"> |
| | | <li><el-button type="primary" @click="$refs.operaCompanyWindow.open('æ°å»ºç³»ç»-ä¼ä¸ä¿¡æ¯è¡¨')" |
| | | v-permissions="['business:company:create']">æ°å»º</el-button></li> |
| | | </ul> |
| | | <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="id" label="ä¼ä¸ç¼å·" fixed="left" min-width="80px" align="center"></el-table-column> |
| | | <el-table-column prop="name" label="ä¼ä¸åç§°" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="managerUserName" label="ç»å½è´¦å·" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="linkname" label="è系人" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="linkephone" label="è系人çµè¯" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="oepnValidDate" label="æææ" min-width="140px" align="center"></el-table-column> |
| | | <el-table-column prop="userNum" label="主æè´¦å·éå¶" min-width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.userNum || 'ä¸é' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="anchorUserNum" label="ä¸»ææ°" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="empUserNum" label="åå·¥æ°" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="goodsNum" label="ååæ°" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="salesmanRealName" 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:company: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-column v-if="containPermissions(['business:company:update', 'business:company:delete'])" label="æä½" |
| | | min-width="160" align="center" fixed="right"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCompanyWindow.open('ç¼è¾ä¼ä¸', row)" |
| | | v-permissions="['business:company:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaCompanyValidDateWindow.open('è°æ´æææ', row)" |
| | | v-permissions="['business:company:update']">è°æ´æææ</el-button> |
| | | <el-button type="text" @click="deleteById(row)" style="color: red;" v-permissions="['business:company:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCompanyWindow ref="operaCompanyWindow" @success="handlePageChange" /> |
| | | <OperaCompanyValidDateWindow ref="operaCompanyValidDateWindow" @success="handlePageChange" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCompanyWindow from '@/components/business/OperaCompanyWindow' |
| | | import OperaCompanyValidDateWindow from '@/components/business/OperaCompanyValidDateWindow' |
| | | import { updateById } from '@/api/business/company' |
| | | export default { |
| | | name: 'Company', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCompanyWindow, OperaCompanyValidDateWindow }, |
| | | data() { |
| | | return { |
| | | oepnValidDate: [], |
| | | // æç´¢ |
| | | searchForm: { |
| | | oepnValidDateStart: '', |
| | | oepnValidDateEnd: '', |
| | | managerUserName: '', |
| | | updateTime: '', |
| | | name: '', |
| | | shortName: '', |
| | | remark: '', |
| | | managerId: '', |
| | | linkname: '', |
| | | linkephone: '', |
| | | creditCode: '', |
| | | userNum: '', |
| | | oepnValidDate: '', |
| | | oepnType: '', |
| | | salesmanId: '', |
| | | status: '' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.config({ |
| | | module: 'ç³»ç»-ä¼ä¸ä¿¡æ¯è¡¨', |
| | | api: '/business/company', |
| | | '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> |