| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:device:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item title="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </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"> |
| | | <li><el-button type="primary" @click="synchronousData">忥</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column label="åºå·" width="55" fixed><template slot-scope="scope" >{{scope.$index+1}}</template></el-table-column> |
| | | <el-table-column prop="name" label="åç§°"></el-table-column> |
| | | <el-table-column prop="hkId" label="广æç¹å¯ä¸æ è¯" min-width="200"></el-table-column> |
| | | <el-table-column prop="channelInfo" label="广æç¹ç±»å"></el-table-column> |
| | | <el-table-column prop="channelNo" label="ééå·"></el-table-column> |
| | | <el-table-column prop="regionName" label="åºååç§°"></el-table-column> |
| | | <el-table-column prop="hkDate" label="忥æ¶é´"></el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="send(row)" icon="el-icon-edit" >åéææ¥</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <el-dialog |
| | | :visible.sync="visibleSend" |
| | | style="z-index: 100000" |
| | | append-to-body |
| | | width="50%" |
| | | height="50%" |
| | | :title="'åéææ¥-'+ form.name" |
| | | > |
| | | <el-form :model="form" ref="form" > |
| | | <el-form-item label="ææ¥å
容" prop="name" required> |
| | | <el-input v-model="form.sendInfo" type="textarea" placeholder="请è¾å
¥ææ¥å
容" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template v-slot:footer > |
| | | <el-button @click="sendBobao()" type="primary" :loading="isWorkSending">确认</el-button> |
| | | <el-button @click="sendClose()">è¿å</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { syncDevices, updateEntranceById } from '@/api/business/device' |
| | | export default { |
| | | name: 'Device', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorName: '', |
| | | regionPathName: '', |
| | | isEntrance: '', |
| | | online: '', |
| | | type: 3 |
| | | }, |
| | | isWorkSending: false, |
| | | form: { |
| | | sendInfo: '', |
| | | id: '', |
| | | hkId: '', |
| | | name: '' |
| | | }, |
| | | visibleSend: false, |
| | | options: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ä¿¡æ¯è¡¨', |
| | | api: '/business/device', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | sendBobao () { |
| | | if (!this.form.sendInfo) { |
| | | return |
| | | } |
| | | this.$dialog.actionConfirm('确认è¿è¡å¹¿æææ¥åï¼', 'æä½ç¡®è®¤æé') |
| | | .then(() => { |
| | | this.isWorkSending = true |
| | | this.api.sendBobao(this.form) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'ææ¥è¯·æ±æå') |
| | | this.sendClose() |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.isWorkSending = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | send (row) { |
| | | this.visibleSend = true |
| | | this.form = { sendInfo: '', id: row.id, hkId: row.hkId, name: row.name } |
| | | }, |
| | | sendClose () { |
| | | this.visibleSend = false |
| | | this.isWorkSending = false |
| | | this.form = { sendInfo: '', id: '', hkId: '', name: '' } |
| | | }, |
| | | changeManufature (e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | | }) |
| | | }, |
| | | synchronousData () { |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({ type: 3 }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | | </script> |