| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:jkcustomer:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="客æ·ç®ç " prop="code"> |
| | | <el-input v-model="searchForm.code" placeholder="请è¾å
¥å®¢æ·ç®ç " clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥å®¢æ·åç§°" clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å°å" prop="location"> |
| | | <el-input v-model="searchForm.location" placeholder="请è¾å
¥å°å" clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é
é卿" prop="lineWeeks"> |
| | | <el-select v-model="searchForm.lineWeeks" clearable filterable placeholder="è¯·éæ©é
é卿" @change="search"> |
| | | <el-option v-for="item in weeksList" :key="item" :label="item" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ä¸»çº¿è·¯" prop="categoryId"> |
| | | <el-select v-model="searchForm.categoryId" clearable filterable placeholder="è¯·éæ©æå±ä¸»çº¿è·¯" @change="loadLines();search()"> |
| | | <el-option v-for="item in categoryList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é货线路" prop="lineId"> |
| | | <el-select v-model="searchForm.lineId" clearable filterable placeholder="è¯·éæ©é货线路" @change="search"> |
| | | <el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="交éè§åç¶æ" prop="distanceStatus"> |
| | | <el-select v-model="searchForm.distanceStatus" clearable filterable placeholder="è¯·éæ©äº¤éè§åç¶æ" @change="search"> |
| | | <el-option :value="2" label="æªå®ä½"></el-option> |
| | | <el-option :value="0" label="æªè§å"></el-option> |
| | | <el-option :value="1" label="å·²è§å"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button type="primary" :loading="isWorking.export" v-permissions="['business:jkcustomer:exportExcel']" @click="exportExcel">导åº</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:jkcustomer:create', 'business:jkcustomer:delete']"> |
| | | <!-- |
| | | <li><el-button type="primary" @click="$refs.operaJkCustomerWindow.open('æ°å»ºäº¤æ§-客æ·ä¿¡æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:jkcustomer:create']">æ°å»º</el-button></li> |
| | | --> |
| | | <li><el-button icon="el-icon-upload" type="primary" @click="$refs.OperaJkCustomerImportWindowRef.open('客æ·å¯¼å
¥')" v-permissions="['business:jkcustomer:create']">客æ·å¯¼å
¥</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:jkcustomer:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="code" label="客æ·ç®ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="客æ·åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="location" label="å°å" min-width="200px" show-tooltip-when-overflow></el-table-column> |
| | | <el-table-column prop="locationInfo" label="ç»çº¬åº¦" min-width="150px"> </el-table-column> |
| | | <el-table-column prop="lineWeeks" label="é
é卿" min-width="100px"></el-table-column> |
| | | <el-table-column prop="lineName" label="é货线路" min-width="200px" show-tooltip-when-overflow></el-table-column> |
| | | <el-table-column prop="categoryName" label="æå±ä¸»çº¿è·¯" min-width="100px"></el-table-column> |
| | | <el-table-column prop="sortno" label="åºå·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="distanceStatus" label="交éè§åç¶æ" min-width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.distanceStatus === 2" class="red">æªå®ä½</span> |
| | | <span v-else-if="row.distanceStatus === 1" class="green">å·²è§å</span> |
| | | <span v-else class="blue">æªè§å</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="editDate" label="æ´æ°æ¶é´" min-width="140px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:jkcustomer:update', 'business:jkcustomer:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaJkCustomerWindow.open('ç¼è¾å®¢æ·ä¿¡æ¯', row)" icon="el-icon-edit" v-permissions="['business:jkcustomer:update']">ç¼è¾</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:jkcustomer:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaJkCustomerWindow ref="operaJkCustomerWindow" @success="handlePageChange"/> |
| | | <OperaJkCustomerImportWindow ref="OperaJkCustomerImportWindowRef" @success="handlePageChange" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaJkCustomerWindow from '@/components/business/OperaJkCustomerWindow' |
| | | import OperaJkCustomerImportWindow from '@/components/business/OperaJkCustomerImportWindow' |
| | | import { fetchCateList } from '@/api/business/category' |
| | | import { allList } from '@/api/business/jkLine' |
| | | export default { |
| | | name: 'JkCustomer', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaJkCustomerWindow, OperaJkCustomerImportWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | categoryId: '', |
| | | name: '', |
| | | code: '', |
| | | distanceStatus: '', |
| | | location: '', |
| | | lineWeeks: '', |
| | | lineId: '', |
| | | status: '', |
| | | sortnum: '' |
| | | }, |
| | | categoryList: [], |
| | | lineList: [], |
| | | weeksList: ['å¨ä¸', 'å¨äº', 'å¨ä¸', 'å¨å', 'å¨äº', 'å¨å
', '卿¥'] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '交æ§-客æ·ä¿¡æ¯è¡¨', |
| | | api: '/business/jkCustomer', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | this.loadCategory() |
| | | this.loadLines() |
| | | }, |
| | | methods: { |
| | | reset() { |
| | | this.lineList = [] |
| | | this.$refs.searchForm.resetFields() |
| | | this.search() |
| | | }, |
| | | loadCategory () { |
| | | fetchCateList({ |
| | | type: 4 |
| | | }).then(res => { |
| | | this.categoryList = res |
| | | }) |
| | | }, |
| | | loadLines () { |
| | | this.searchForm.lineId ='' |
| | | allList({ |
| | | categoryId: this.searchForm.categoryId |
| | | }).then(res => { |
| | | this.lineList = res |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |