|
|
@@ -1,664 +1,779 @@
|
|
|
<template>
|
|
|
- <div class="context">
|
|
|
- <el-page-header @back="goBack" content="演示设备"></el-page-header>
|
|
|
- <div class="panel">
|
|
|
- <br>
|
|
|
- <h5> {{regionName}}</h5>
|
|
|
- </div>
|
|
|
- <div class="change">
|
|
|
- <el-button @click="addMember" type="primary">新增演示设备</el-button>
|
|
|
- <el-button @click="editList">编辑演示设备</el-button>
|
|
|
- <!--<el-button @click="delList" type="danger">删除区域设备</el-button>-->
|
|
|
- </div>
|
|
|
- <div class="table">
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- is-horizontal-resize
|
|
|
- :default-sort="{prop: 'date', order: 'descending'}"
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
- class=""
|
|
|
- @selection-change="handleSelectionChange" @current-change="clickChange"
|
|
|
-
|
|
|
- >
|
|
|
- <el-table-column label="选择" width="55">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- type="index"
|
|
|
- label="序号"
|
|
|
- align="center"
|
|
|
- width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="EqSn"
|
|
|
- label="序列号"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="Version"
|
|
|
- label="版本"
|
|
|
- sortable
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="EquipType"
|
|
|
- label="类型"
|
|
|
- sortable
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.EquipType == 1">TVBox</span>
|
|
|
- <span v-if="scope.row.EquipType == 2">BLEHub</span>
|
|
|
- <span v-if="scope.row.EquipType == 3">演示设备</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="Status"
|
|
|
- label="状态"
|
|
|
- sortable
|
|
|
- >
|
|
|
- <!--1:启用 8:暂停 9:删除-->
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.Status == 1" style="color: yellowgreen">启用</span>
|
|
|
- <span v-if="scope.row.Status == 8" style="color: yellow">暂停</span>
|
|
|
- <span v-if="scope.row.Status == 9" style="color: red">删除</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="address"
|
|
|
- label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!--<el-button type="success" @click="run(scope.row)" v-if="scope.row.Status == 8">开启</el-button>-->
|
|
|
- <!--<el-button type="danger" @click="pause(scope.row)" v-if="scope.row.Status == 1">暂停</el-button>-->
|
|
|
- <span v-if="scope.row.EquipType != 3" style="color: red">
|
|
|
- <el-button type="danger" size="mini"
|
|
|
+ <div class="context">
|
|
|
+ <el-page-header @back="goBack" content="演示设备"></el-page-header>
|
|
|
+ <div class="panel">
|
|
|
+ <br>
|
|
|
+ <h5> {{regionName}}</h5>
|
|
|
+ </div>
|
|
|
+ <div class="change">
|
|
|
+ <el-button @click="addMember" type="primary">新增演示设备</el-button>
|
|
|
+ <el-button @click="editList">编辑演示设备</el-button>
|
|
|
+ <!--<el-button @click="delList" type="danger">删除演示设备</el-button>-->
|
|
|
+ </div>
|
|
|
+ <div class="table">
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ is-horizontal-resize
|
|
|
+ :default-sort="{prop: 'date', order: 'descending'}"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ class=""
|
|
|
+ @selection-change="handleSelectionChange" @current-change="clickChange"
|
|
|
+
|
|
|
+ >
|
|
|
+ <el-table-column label="选择" width="55">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ align="center"
|
|
|
+ width="50">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="EqSn"
|
|
|
+ label="序列号"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Version"
|
|
|
+ label="版本"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="ShopName"
|
|
|
+ label="所属门店"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="SvName"
|
|
|
+ label="所属区域"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Status"
|
|
|
+ label="状态"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ <!--1:启用 8:暂停 9:删除-->
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.Status == 1" style="color: yellowgreen">启用</span>
|
|
|
+ <span v-if="scope.row.Status == 8" style="color: yellow">暂停</span>
|
|
|
+ <span v-if="scope.row.Status == 9" style="color: red">删除</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="id"
|
|
|
+ label="操作"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <!--<el-button type="success" v-if="scope.row.Status == 8" size="mini"-->
|
|
|
+ <!--@click="pauseRow(scope.row,1)">-->
|
|
|
+ <!--启用-->
|
|
|
+ <!--</el-button>-->
|
|
|
+ <!--<el-button type="warning" v-if="scope.row.Status == 1" size="mini"-->
|
|
|
+ <!--@click="pauseRow(scope.row,8)">-->
|
|
|
+ <!--禁用-->
|
|
|
+ <!--</el-button>-->
|
|
|
+
|
|
|
+ <el-button type="danger" size="mini"
|
|
|
@click="pauseRowDel(scope.row)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <br>
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- :total="pageination.total"
|
|
|
- :page-size="pageination.pageItem"
|
|
|
- @current-change="pageChange"
|
|
|
- ></el-pagination>
|
|
|
- </div>
|
|
|
- <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="650px">
|
|
|
- <div class="dialogContent">
|
|
|
- <div class="">
|
|
|
- <el-form ref="form" :model="form" label-width="160px">
|
|
|
- <el-form-item label="设备序列号">
|
|
|
- <el-input v-model="form.eqSn "></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="版本号">
|
|
|
- <el-input v-model="form.version"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备类型">
|
|
|
- <el-select v-model="form.equipType " placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <br>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :total="pageination.total"
|
|
|
+ :page-size="pageination.pageItem"
|
|
|
+ @current-change="pageChange"
|
|
|
+ ></el-pagination>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="dialogFooter">
|
|
|
- <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
|
|
|
- <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
|
|
|
- </el-button>
|
|
|
- <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="650px">
|
|
|
+ <div class="dialogContent">
|
|
|
+ <div class="">
|
|
|
+ <el-form ref="form" :model="form" label-width="160px">
|
|
|
+ <el-form-item label="设备序列号">
|
|
|
+ <el-input v-model="form.eqSn "></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="版本号">
|
|
|
+ <el-input v-model="form.version"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="店面列表">
|
|
|
+ <el-select v-model="form.shopId"
|
|
|
+ @change="changeShopId"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in form.shopOptions"
|
|
|
+ :key="item.ShopID"
|
|
|
+ :label="item.ShopName"
|
|
|
+ :value="item.ShopID">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="区域列表">
|
|
|
+ <el-select v-model="form.venveId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in form.venveOptions"
|
|
|
+ :key="item.SvId"
|
|
|
+ :label="item.Name"
|
|
|
+ :value="item.SvId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="dialogFooter">
|
|
|
+ <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Global from '../Global.js'
|
|
|
-import {
|
|
|
- testTable,
|
|
|
- ShopManagerStatusEdit,
|
|
|
- QueryVenueEquip,
|
|
|
- AddShopVenueEquip,
|
|
|
- EditShopVenueEquip,
|
|
|
- ShopVenueEquipEditStatus
|
|
|
-} from "../api/getApiRes";
|
|
|
-
|
|
|
-let qs = require('qs');
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- regionName: '',
|
|
|
- dialogVisible: false,
|
|
|
- dialogMemberVisible: false,
|
|
|
- dialogTitle: '新增区域设备',
|
|
|
- // panel 配置项目
|
|
|
- multipleSelection: [],
|
|
|
- tableRadio: [],
|
|
|
- pageination: {
|
|
|
- pageItem: 100,
|
|
|
- pageoptions: pageOptions(),
|
|
|
- total: 100,
|
|
|
- pageIndex: 1,
|
|
|
- },
|
|
|
- form: {
|
|
|
- eqId: '',
|
|
|
- eqSn: '',
|
|
|
- name: '',
|
|
|
- version: '',
|
|
|
- userCode: '',
|
|
|
- shopId: '',
|
|
|
- btnType: 0,
|
|
|
- equipType: 1,
|
|
|
- },
|
|
|
- options: [
|
|
|
- {value: 1, label: 'TVBox'},
|
|
|
- {value: 2, label: 'BLEHub'},
|
|
|
- {value: 3, label: '演示设备'},
|
|
|
- ],
|
|
|
- shops: [],
|
|
|
- tableData: [],
|
|
|
- serachBtnStatus: false,
|
|
|
+ import Global from '../Global.js'
|
|
|
+ import {
|
|
|
+ QueryDemoVenueEquip,
|
|
|
+ ShopListQuery,
|
|
|
+ QueryShopVenue,
|
|
|
+ QueryVenueEquip,
|
|
|
+ AddShopVenueEquip,
|
|
|
+ EditShopVenueEquip,
|
|
|
+ ShopVenueEquipEditStatus
|
|
|
+ } from "../api/getApiRes";
|
|
|
+
|
|
|
+ let qs = require('qs');
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ regionName: '',
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogMemberVisible: false,
|
|
|
+ dialogTitle: '新增演示设备',
|
|
|
+ // panel 配置项目
|
|
|
+ multipleSelection: [],
|
|
|
+ tableRadio: [],
|
|
|
+ ShopList: [],
|
|
|
+ pageination: {
|
|
|
+ pageItem: 100,
|
|
|
+ pageoptions: pageOptions(),
|
|
|
+ total: 100,
|
|
|
+ pageIndex: 1,
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ eqId: '',
|
|
|
+ eqSn: '',
|
|
|
+ name: '',
|
|
|
+ version: '',
|
|
|
+ userCode: '',
|
|
|
+ venveId: '',
|
|
|
+ shopId: '',
|
|
|
+ ServiceKey: '',
|
|
|
+ ServiceId: '',
|
|
|
+ btnType: 0,
|
|
|
+ equipType: 1,
|
|
|
+ shopOptions: [],
|
|
|
+ venveOptions: [],
|
|
|
+ },
|
|
|
+ options: [
|
|
|
+ {value: 1, label: 'TVBox'},
|
|
|
+ {value: 2, label: 'BLEHub'},
|
|
|
+ {value: 3, label: '演示设备'},
|
|
|
+ ],
|
|
|
+ shops: [],
|
|
|
+ tableData: [],
|
|
|
+ serachBtnStatus: false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getShopListSelect();
|
|
|
+ this.getTableQuery();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 选择店铺后重新加载区域选择列表
|
|
|
+ changeShopId(i) {
|
|
|
+ let that = this;
|
|
|
+ let row = '';
|
|
|
+ that.ShopList.map(function (item) {
|
|
|
+ if (parseInt(item.ShopID) == parseInt(i)) {
|
|
|
+ row = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ that.getQueryShopVenue(row.ServiceKey, row.ServiceId);
|
|
|
+ },
|
|
|
+ // 获取店面列表
|
|
|
+ getShopListSelect() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ shopId: localStorage.ServiceId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ShopListQuery(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ if (json.Rs == '') {
|
|
|
+ that.$message.error('当前没有可选的店铺,请先在店面管理中添加店铺!');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.form.shopOptions = json.Rs;
|
|
|
+ that.ShopList = json.Rs;
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取区域列表
|
|
|
+ getQueryShopVenue(ServiceKey, ServiceId) {
|
|
|
+ let that = this;
|
|
|
+ this.form.ServiceKey = ServiceKey;
|
|
|
+ this.form.ServiceId = ServiceId;
|
|
|
+ that.loading = true;
|
|
|
+ let param = {
|
|
|
+ key: ServiceKey,
|
|
|
+ shopId: ServiceId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ that.form.venveId = '';
|
|
|
+ QueryShopVenue(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.loading = false;
|
|
|
+ if (json.Rs) {
|
|
|
+ that.form.venveOptions = json.Rs;
|
|
|
+ } else {
|
|
|
+ that.form.venveOptions = []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!localStorage.ServiceKey) {
|
|
|
+ that.$message.error('还未与心率系统对接,请联系管理员');
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/region', query: {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ pauseRowDel(row) {
|
|
|
+ let that = this;
|
|
|
+ let line = "";
|
|
|
+ that.ShopList.map(function (item) {
|
|
|
+ console.log(item);
|
|
|
+ if (parseInt(item.ServiceId) == parseInt(row.ShopID)) {
|
|
|
+ line = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(row);
|
|
|
+ console.log(line);
|
|
|
+ let param = {
|
|
|
+ key: line.ServiceKey,
|
|
|
+ shopId: line.ServiceId,
|
|
|
+ svId: row.SvId,
|
|
|
+ eqId: row.EqId,
|
|
|
+ status: 9,//1:启用 8:暂停 9:删除
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ this.$confirm('此操作将永久删除该演示设备, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '选中的演示设备已删除!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clearForm() {
|
|
|
+ // clear
|
|
|
+ this.form.eqSn = '';
|
|
|
+ this.form.version = '';
|
|
|
+ this.form.shopId = '';
|
|
|
+ this.form.venveId = '';
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
+ // 新增演示设备
|
|
|
+ addMember() {
|
|
|
+ this.clearForm();
|
|
|
+ this.dialogMemberVisible = true;
|
|
|
+ this.btnType = 0;
|
|
|
+ this.dialogTitle = '新增演示设备';
|
|
|
+ this.getShopListSelect();
|
|
|
+ },
|
|
|
+ clickChange(item) {
|
|
|
+ this.tableRadio = item
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ delList() {
|
|
|
+ let that = this;
|
|
|
+ if (this.tableRadio.length == 0) {
|
|
|
+ this.$message.error("请先选中一条记录");
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let userId = this.tableRadio.Id;
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ key: localStorage.ServiceKey,
|
|
|
+ shopId: localStorage.ServiceId,
|
|
|
+ svId: this.$route.query.svId,
|
|
|
+ eqId: this.tableRadio.EqId,
|
|
|
+ status: 9,//1:启用 8:暂停 9:删除
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+
|
|
|
+ this.$confirm('此操作将永久删除该演示设备, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '选中的演示设备已删除!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ editList() {
|
|
|
+ let that = this;
|
|
|
+ this.clearForm();
|
|
|
+ if (this.tableRadio.length == 0) {
|
|
|
+ this.$message.error("请先选中一条记录");
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let row = this.tableRadio;
|
|
|
+ let line = '';
|
|
|
+ that.ShopList.map(function (item) {
|
|
|
+ if (parseInt(item.ShopID) == parseInt(row.ShopID)) {
|
|
|
+ that.form.shopId = parseInt(item.ServiceId);
|
|
|
+ line = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ that.getQueryShopVenue(line.ServiceKey, line.ServiceId);
|
|
|
+
|
|
|
+ this.form.venveId = row.SvId;
|
|
|
+ this.form.userId = row.Id;
|
|
|
+ this.form.name = row.Name;
|
|
|
+ this.form.userCode = row.Usercode;
|
|
|
+ this.form.password = '';
|
|
|
+ this.form.phone = row.Phone;
|
|
|
+ this.form.eqId = row.EqId;
|
|
|
+ this.form.eqSn = row.EqSn.trim();
|
|
|
+ this.form.version = row.Version.trim();
|
|
|
+ this.form.equipType = row.EquipType;
|
|
|
+ this.form.memo = row.Memo;
|
|
|
+ this.form.adminType = row.AdminType;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.dialogTitle = '编辑演示设备';
|
|
|
+ this.form.btnType = 1;
|
|
|
+ this.dialogMemberVisible = true
|
|
|
+ },
|
|
|
+ // 确认提交新增演示设备
|
|
|
+ confirmMember() {
|
|
|
+ let that = this;
|
|
|
+ // checkNum
|
|
|
+ if (!that.form.eqSn) {
|
|
|
+ this.$message.error('错了哦,设备序列号不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (that.form.version.length > 10) {
|
|
|
+ this.$message.error('错了哦,版本号字符不能超过10位');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!that.form.shopId) {
|
|
|
+ this.$message.error('错了哦,所选商家不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!that.form.venveId) {
|
|
|
+ this.$message.error('错了哦,所选区域不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ key: this.form.ServiceKey,
|
|
|
+ shopId: this.form.ServiceId,
|
|
|
+ svId: this.form.venveId,
|
|
|
+ eqSn: this.form.eqSn,
|
|
|
+ version: this.form.version,
|
|
|
+ equipType: 3,//1:TVBox 2:BLEHub 3:演示设备
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ AddShopVenueEquip(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ // 关闭弹窗
|
|
|
+ that.dialogMemberVisible = false;
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '所属设备添加成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmEditMember() {
|
|
|
+ let that = this;
|
|
|
+ // checkNum
|
|
|
+ if (!that.form.eqSn) {
|
|
|
+ this.$message.error('错了哦,设备序列号不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (that.form.version.length > 10) {
|
|
|
+ this.$message.error('错了哦,版本号字符不能超过10位');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let param = {
|
|
|
+ key: this.form.ServiceKey,
|
|
|
+ shopId: this.form.ServiceId,
|
|
|
+ svId: this.form.venveId,
|
|
|
+ eqId: this.form.eqId,
|
|
|
+ eqSn: this.form.eqSn,
|
|
|
+ version: this.form.version,
|
|
|
+ equipType: 3,//1:TVBox 2:BLEHub 3:演示设备
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ EditShopVenueEquip(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ // 关闭弹窗
|
|
|
+ that.dialogMemberVisible = false;
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '演示设备信息编辑成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询按钮
|
|
|
+ query() {
|
|
|
+ // 按钮倒计时
|
|
|
+ let that = this;
|
|
|
+ that.serachBtnStatus = true;
|
|
|
+ let totalTime = 2;
|
|
|
+ let clock = window.setInterval(() => {
|
|
|
+ totalTime--;
|
|
|
+ if (totalTime < 0) {
|
|
|
+ totalTime = 2;
|
|
|
+ that.serachBtnStatus = false;
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ this.getTableQuery();
|
|
|
+ this.$message.success('查询完毕');
|
|
|
+ },
|
|
|
+ // 页面数据查询
|
|
|
+ getTableQuery() {
|
|
|
+ let that = this;
|
|
|
+ that.loading = true;
|
|
|
+ let param = {
|
|
|
+ // key: localStorage.ServiceKey,
|
|
|
+ key: '73c845ca89d952074b36a5b18d961cac',
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ QueryDemoVenueEquip(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.loading = false;
|
|
|
+ if (json.Rs) {
|
|
|
+ that.allTableData = json.Rs;
|
|
|
+ that.recordsTotal = json.Rs.length;
|
|
|
+ } else {
|
|
|
+ that.allTableData = [];
|
|
|
+ that.recordsTotal = 0;
|
|
|
+ }
|
|
|
+ // 设置分页数据
|
|
|
+ that.setPaginations();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 设置分页数据
|
|
|
+ setPaginations() {
|
|
|
+ // 分页属性
|
|
|
+ let that = this;
|
|
|
+ that.pageination.total = that.recordsTotal;
|
|
|
+ // 默认分页
|
|
|
+ that.tableData = that.allTableData.filter((item, index) => {
|
|
|
+ return index < that.pageination.pageItem;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 每页显示数量
|
|
|
+ handleSizeChange() {
|
|
|
+ let that = this;
|
|
|
+ that.tableData = that.allTableData.filter((item, index) => {
|
|
|
+ return index < that.pageination.pageItem;
|
|
|
+ });
|
|
|
+ that.draw = that.pageination.pageItem;
|
|
|
+ that.getTableQuery();
|
|
|
+ },
|
|
|
+ // 翻页
|
|
|
+ pageChange(pageIndex) {
|
|
|
+ let that = this;
|
|
|
+ // 获取当前页
|
|
|
+ let index = that.pageination.pageItem * (pageIndex - 1);
|
|
|
+ // 数据总数
|
|
|
+ let nums = that.pageination.pageItem * pageIndex;
|
|
|
+ // 容器
|
|
|
+ let tables = [];
|
|
|
+ for (var i = index; i < nums; i++) {
|
|
|
+ if (that.allTableData[i]) {
|
|
|
+ tables.push(that.allTableData[i])
|
|
|
+ }
|
|
|
+ this.tableData = tables;
|
|
|
+ }
|
|
|
+ that.start = index * that.draw;
|
|
|
+ // that.getTableQuery();
|
|
|
+ },
|
|
|
+ // 自动排序
|
|
|
+ sortChange(params) {
|
|
|
+ console.log(params)
|
|
|
+ },
|
|
|
+ // 过滤时间
|
|
|
+ filterFmtDate(value, row, column) {
|
|
|
+ let that = this;
|
|
|
+ return nonTfmtDate(column, 11);
|
|
|
+ },
|
|
|
+ // 暂停
|
|
|
+ pause(row) {
|
|
|
+ let that = this;
|
|
|
+ console.log(row);
|
|
|
+ this.$confirm('是否暂停设备' + row.EqSn + '?', '暂停操作', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ key: localStorage.ServiceKey,
|
|
|
+ shopId: localStorage.ServiceId,
|
|
|
+ svId: this.$route.query.svId,
|
|
|
+ eqId: row.EqId,
|
|
|
+ status: 8,//1:启用 8:暂停 9:删除
|
|
|
+ };
|
|
|
+
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: row.EqSn + '暂停成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // table 重载
|
|
|
+ that.getTableQuery();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消暂停'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 开启
|
|
|
+ run(row) {
|
|
|
+ let that = this;
|
|
|
+ this.$confirm('是否开启设备' + row.EqSn + '?', '开启操作', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ key: localStorage.ServiceKey,
|
|
|
+ shopId: localStorage.ServiceId,
|
|
|
+ svId: this.$route.query.svId,
|
|
|
+ eqId: row.EqId,
|
|
|
+ status: 1,//1:启用 8:暂停 9:删除
|
|
|
+ };
|
|
|
+
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: row.EqSn + '开启成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // table 重载
|
|
|
+ that.getTableQuery();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消开启'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route(to) {
|
|
|
+ if (to.name == 'heartLog') {
|
|
|
+ this.regionName = this.$route.query.name;
|
|
|
+ this.getTableQuery();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.regionName = this.$route.query.name;
|
|
|
- this.getTableQuery();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- goBack() {
|
|
|
- this.$router.push({
|
|
|
- path: '/region', query: {}
|
|
|
- });
|
|
|
- },
|
|
|
- // 删除
|
|
|
- pauseRowDel(row) {
|
|
|
- let that = this;
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: row.SvId,
|
|
|
- eqId: row.EqId,
|
|
|
- status: 9,//1:启用 8:暂停 9:删除
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- this.$confirm('此操作将永久删除该区域设备, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: '选中的区域设备已删除!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- // 重载列表
|
|
|
- that.getTableQuery();
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- });
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- clearForm() {
|
|
|
- // clear
|
|
|
- this.form.name = '';
|
|
|
- this.form.userCode = '';
|
|
|
- this.form.shopId = '';
|
|
|
- this.form.eqSn = '';
|
|
|
- this.form.version = '';
|
|
|
- this.form.equipType = 1;
|
|
|
- },
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
- },
|
|
|
- // 新增区域设备
|
|
|
- addMember() {
|
|
|
- this.clearForm();
|
|
|
- this.dialogMemberVisible = true;
|
|
|
- this.btnType = 0;
|
|
|
- this.dialogTitle = '新增区域设备'
|
|
|
- },
|
|
|
- clickChange(item) {
|
|
|
- this.tableRadio = item
|
|
|
- },
|
|
|
- // 删除
|
|
|
- delList() {
|
|
|
- let that = this;
|
|
|
- if (this.tableRadio.length == 0) {
|
|
|
- this.$message.error("请先选中一条记录");
|
|
|
- return false
|
|
|
- }
|
|
|
- let userId = this.tableRadio.Id;
|
|
|
-
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- eqId: this.tableRadio.EqId,
|
|
|
- status: 9,//1:启用 8:暂停 9:删除
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
-
|
|
|
- this.$confirm('此操作将永久删除该区域设备, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: '选中的区域设备已删除!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- // 重载列表
|
|
|
- that.getTableQuery();
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- });
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- // 编辑
|
|
|
- editList() {
|
|
|
- let that = this;
|
|
|
- this.clearForm();
|
|
|
- if (this.tableRadio.length == 0) {
|
|
|
- this.$message.error("请先选中一条记录");
|
|
|
- return false
|
|
|
- }
|
|
|
- let row = this.tableRadio;
|
|
|
- this.form.shopid = row.ShopId;
|
|
|
- this.form.userId = row.Id;
|
|
|
- this.form.name = row.Name;
|
|
|
- this.form.userCode = row.Usercode;
|
|
|
- this.form.password = '';
|
|
|
- this.form.phone = row.Phone;
|
|
|
- this.form.eqId = row.EqId;
|
|
|
- this.form.eqSn = row.EqSn.trim();
|
|
|
- this.form.version = row.Version.trim();
|
|
|
- this.form.equipType = row.EquipType;
|
|
|
- this.form.memo = row.Memo;
|
|
|
- this.form.adminType = row.AdminType;
|
|
|
- this.dialogVisible = true;
|
|
|
- this.dialogTitle = '编辑区域设备';
|
|
|
- this.form.btnType = 1;
|
|
|
- this.dialogMemberVisible = true
|
|
|
- },
|
|
|
- // 确认提交新增区域设备
|
|
|
- confirmMember() {
|
|
|
- let that = this;
|
|
|
- // checkNum
|
|
|
- if (!that.form.eqSn) {
|
|
|
- this.$message.error('错了哦,设备序列号不能为空');
|
|
|
- return false
|
|
|
- }
|
|
|
- if (that.form.version.length > 10) {
|
|
|
- this.$message.error('错了哦,版本号字符不能超过10位');
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- eqSn: this.form.eqSn,
|
|
|
- version: this.form.version,
|
|
|
- equipType: this.form.equipType,
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- AddShopVenueEquip(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- // 关闭弹窗
|
|
|
- that.dialogMemberVisible = false;
|
|
|
- // 重载列表
|
|
|
- that.getTableQuery();
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: '所属设备添加成功!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- confirmEditMember() {
|
|
|
- let that = this;
|
|
|
- console.log(that.form.version.length);
|
|
|
- // checkNum
|
|
|
- if (!that.form.eqSn) {
|
|
|
- this.$message.error('错了哦,设备序列号不能为空');
|
|
|
- return false
|
|
|
- }
|
|
|
- if (that.form.version.length > 10) {
|
|
|
- this.$message.error('错了哦,版本号字符不能超过10位');
|
|
|
- return false
|
|
|
- }
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- eqId: this.form.eqId,
|
|
|
- eqSn: this.form.eqSn,
|
|
|
- version: this.form.version,
|
|
|
- equipType: this.form.equipType,
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- EditShopVenueEquip(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- // 关闭弹窗
|
|
|
- that.dialogMemberVisible = false;
|
|
|
- // 重载列表
|
|
|
- that.getTableQuery();
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: '区域设备信息编辑成功!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询按钮
|
|
|
- query() {
|
|
|
- // 按钮倒计时
|
|
|
- let that = this;
|
|
|
- that.serachBtnStatus = true;
|
|
|
- let totalTime = 2;
|
|
|
- let clock = window.setInterval(() => {
|
|
|
- totalTime--;
|
|
|
- if (totalTime < 0) {
|
|
|
- totalTime = 2;
|
|
|
- that.serachBtnStatus = false;
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
-
|
|
|
- this.getTableQuery();
|
|
|
- this.$message.success('查询完毕');
|
|
|
- },
|
|
|
- // 页面数据查询
|
|
|
- getTableQuery() {
|
|
|
- let that = this;
|
|
|
- that.loading = true;
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- QueryVenueEquip(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.loading = false;
|
|
|
- if (json.Rs) {
|
|
|
- that.allTableData = json.Rs;
|
|
|
- that.recordsTotal = json.Rs.length;
|
|
|
- } else {
|
|
|
- that.allTableData = [];
|
|
|
- that.recordsTotal = 0;
|
|
|
- }
|
|
|
- // 设置分页数据
|
|
|
- that.setPaginations();
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 设置分页数据
|
|
|
- setPaginations() {
|
|
|
- // 分页属性
|
|
|
- let that = this;
|
|
|
- that.pageination.total = that.recordsTotal;
|
|
|
- // 默认分页
|
|
|
- that.tableData = that.allTableData.filter((item, index) => {
|
|
|
- return index < that.pageination.pageItem;
|
|
|
- });
|
|
|
- },
|
|
|
- // 每页显示数量
|
|
|
- handleSizeChange() {
|
|
|
- let that = this;
|
|
|
- that.tableData = that.allTableData.filter((item, index) => {
|
|
|
- return index < that.pageination.pageItem;
|
|
|
- });
|
|
|
- that.draw = that.pageination.pageItem;
|
|
|
- that.getTableQuery();
|
|
|
- },
|
|
|
- // 翻页
|
|
|
- pageChange(pageIndex) {
|
|
|
- let that = this;
|
|
|
- // 获取当前页
|
|
|
- let index = that.pageination.pageItem * (pageIndex - 1);
|
|
|
- // 数据总数
|
|
|
- let nums = that.pageination.pageItem * pageIndex;
|
|
|
- // 容器
|
|
|
- let tables = [];
|
|
|
- for (var i = index; i < nums; i++) {
|
|
|
- if (that.allTableData[i]) {
|
|
|
- tables.push(that.allTableData[i])
|
|
|
- }
|
|
|
- this.tableData = tables;
|
|
|
- }
|
|
|
- that.start = index * that.draw;
|
|
|
- // that.getTableQuery();
|
|
|
- },
|
|
|
- // 自动排序
|
|
|
- sortChange(params) {
|
|
|
- console.log(params)
|
|
|
- },
|
|
|
- // 过滤时间
|
|
|
- filterFmtDate(value, row, column) {
|
|
|
- let that = this;
|
|
|
- return nonTfmtDate(column, 11);
|
|
|
- },
|
|
|
- // 暂停
|
|
|
- pause(row) {
|
|
|
- let that = this;
|
|
|
- console.log(row);
|
|
|
- this.$confirm('是否暂停设备' + row.EqSn + '?', '暂停操作', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
-
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- eqId: row.EqId,
|
|
|
- status: 8,//1:启用 8:暂停 9:删除
|
|
|
- };
|
|
|
-
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: row.EqSn + '暂停成功!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- // table 重载
|
|
|
- that.getTableQuery();
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消暂停'
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- // 开启
|
|
|
- run(row) {
|
|
|
- let that = this;
|
|
|
- this.$confirm('是否开启设备' + row.EqSn + '?', '开启操作', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
-
|
|
|
- let param = {
|
|
|
- key: localStorage.ServiceKey,
|
|
|
- shopId: localStorage.ServiceId,
|
|
|
- svId: this.$route.query.svId,
|
|
|
- eqId: row.EqId,
|
|
|
- status: 1,//1:启用 8:暂停 9:删除
|
|
|
- };
|
|
|
-
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- ShopVenueEquipEditStatus(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.$message({
|
|
|
- showClose: true,
|
|
|
- message: row.EqSn + '开启成功!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- // table 重载
|
|
|
- that.getTableQuery();
|
|
|
- } else {
|
|
|
- that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消开启'
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- $route(to) {
|
|
|
- if (to.name == 'heartLog') {
|
|
|
- this.regionName = this.$route.query.name;
|
|
|
- this.getTableQuery();
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-@import "../assets/css/panel.css";
|
|
|
-
|
|
|
-.context {
|
|
|
- height: 770px;
|
|
|
- overflow-y: scroll;
|
|
|
-
|
|
|
- display: block;
|
|
|
- margin: 0 auto;
|
|
|
- background-color: #fff !important;
|
|
|
- padding: 30px;
|
|
|
- padding-bottom: 60px;
|
|
|
-}
|
|
|
-
|
|
|
-.panel-body {
|
|
|
- padding: 20px;
|
|
|
- background: #F0F2F5;
|
|
|
-}
|
|
|
-
|
|
|
-.change {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- display: block;
|
|
|
- margin: 0 auto;
|
|
|
- padding-top: 10px;
|
|
|
- padding-bottom: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.change button {
|
|
|
- float: left;
|
|
|
-}
|
|
|
-
|
|
|
-.change button.pull-right {
|
|
|
- float: right;
|
|
|
-}
|
|
|
-
|
|
|
-.dialogTitle {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- display: block;
|
|
|
- margin: 0 auto;
|
|
|
- color: #000000;
|
|
|
- font-size: 18px;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
-
|
|
|
-.dialogTitle em {
|
|
|
- float: none;
|
|
|
- font-style: normal;
|
|
|
- color: #3799FF;
|
|
|
- margin: 0;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .el-transfer-panel__item .el-checkbox__input {
|
|
|
- left: 40px;
|
|
|
-}
|
|
|
-
|
|
|
-.dialogFooter {
|
|
|
- width: 90%;
|
|
|
- overflow: hidden;
|
|
|
- display: block;
|
|
|
- margin: 0 auto;
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.dialogFooter button {
|
|
|
- float: right;
|
|
|
- margin-left: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .el-date-editor .el-range__icon {
|
|
|
- line-height: 22px;
|
|
|
-}
|
|
|
-
|
|
|
-.panel /deep/ .el-date-editor .el-range-separator {
|
|
|
- line-height: 22px;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .el-select {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-.panel h5 {
|
|
|
- font-size: 24px;
|
|
|
-}
|
|
|
-
|
|
|
-/*ipad only*/
|
|
|
-@media only screen and (max-width: 1366px) {
|
|
|
- .panel /deep/ .el-date-editor--daterange {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
-}
|
|
|
+ @import "../assets/css/panel.css";
|
|
|
+
|
|
|
+ .context {
|
|
|
+ height: 770px;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ background-color: #fff !important;
|
|
|
+ padding: 30px;
|
|
|
+ padding-bottom: 60px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel-body {
|
|
|
+ padding: 20px;
|
|
|
+ background: #F0F2F5;
|
|
|
+ }
|
|
|
+
|
|
|
+ .change {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ padding-top: 10px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .change button {
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+
|
|
|
+ .change button.pull-right {
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialogTitle {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ color: #000000;
|
|
|
+ font-size: 18px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialogTitle em {
|
|
|
+ float: none;
|
|
|
+ font-style: normal;
|
|
|
+ color: #3799FF;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-transfer-panel__item .el-checkbox__input {
|
|
|
+ left: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialogFooter {
|
|
|
+ width: 90%;
|
|
|
+ overflow: hidden;
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialogFooter button {
|
|
|
+ float: right;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-date-editor .el-range__icon {
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel /deep/ .el-date-editor .el-range-separator {
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-select {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel h5 {
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*ipad only*/
|
|
|
+ @media only screen and (max-width: 1366px) {
|
|
|
+ .panel /deep/ .el-date-editor--daterange {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
</style>
|