浏览代码

Merge branch 'develop_scsb0607' of jianguan-web/qpls-it-html into pre-release

李磊 1 年之前
父节点
当前提交
2951494527

+ 0 - 18
src/api/approveStore.js

@@ -27,21 +27,3 @@ export const xprhStoreApplyDetail = (params) => {
     method: 'get'
   })
 }
-
-// 获取价格显示
-export const queryList = (params) => {
-  return axios({
-    url: `/bizparam/queryList`,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 更新价格显示
-export const updateBatch = (params) => {
-  return axios({
-    url: `/bizparam/updateBatch`,
-    data: params,
-    method: 'post'
-  })
-}

+ 49 - 0
src/api/handDevice.js

@@ -0,0 +1,49 @@
+import { axios } from '@/utils/request'
+
+//  设备管理列表  分页
+export const handDeviceList = (params) => {
+  const url = `/handDevice/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 设备管理  新增
+export const handDeviceSave = (params) => {
+  const url = `/handDevice/create`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 设备管理  详情
+export const handDeviceDetail = (params) => {
+  const url = `/handDevice/findById/${params.id}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'get'
+  })
+}
+// 设备管理  删除
+export const handDeviceDel = (params) => {
+  const url = `/handDevice/delete/${params.id}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'get'
+  })
+}
+// 设备管理  编辑
+export const handDeviceEdit = (params) => {
+  const url = `/handDevice/modify`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 48 - 37
src/config/router.config.js

@@ -59,43 +59,43 @@ export const asyncRouterMap = [
           permission: 'M_numsGoodsShelves'
         },
         children: [
-           {
-             path: '/numsGoodsShelves/approveStore',
-             redirect: '/numsGoodsShelves/approveStore/list',
-             name: 'approveStore',
-             component: BlankLayout,
-             meta: {
-               title: '汽修厂认证审核',
-               icon: 'monitor',
-               permission: 'M_approveStore'
-             },
-             hideChildrenInMenu: true,
-             children: [
-               {
-                 path: 'list',
-                 name: 'approveStoreList',
-                 component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/list.vue'),
-                 meta: {
-                   title: '认证审核列表',
-                   icon: 'monitor',
-                   replaceTab: true,
-                   hidden: true,
-                   permission: 'M_approveStore'
-                 }
-               },
-               {
-                 path: 'authPass/:sn',
-                 name: 'approveStoreAuthPass',
-                 component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/authPass.vue'),
-                 meta: {
-                   title: '审核通过',
-                   icon: 'monitor',
-                   replaceTab: true,
-                   hidden: true
-                 }
-               },
-             ]
-           },
+          {
+            path: '/numsGoodsShelves/approveStore',
+            redirect: '/numsGoodsShelves/approveStore/list',
+            name: 'approveStore',
+            component: BlankLayout,
+            meta: {
+              title: '汽修厂认证审核',
+              icon: 'monitor',
+              permission: 'M_approveStore'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'approveStoreList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/list.vue'),
+                meta: {
+                  title: '认证审核列表',
+                  icon: 'monitor',
+                  replaceTab: true,
+                  hidden: true,
+                  permission: 'M_approveStore'
+                }
+              },
+              {
+                path: 'authPass/:sn',
+                name: 'approveStoreAuthPass',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/approveStore/authPass.vue'),
+                meta: {
+                  title: '审核通过',
+                  icon: 'monitor',
+                  replaceTab: true,
+                  hidden: true
+                }
+              }
+            ]
+          }
         ]
       },
       // 连锁组管理
@@ -310,6 +310,17 @@ export const asyncRouterMap = [
               icon: 'read',
               permission: 'M_operateJournal'
             }
+          },
+          {
+            path: '/setting/equipmentManagement',
+            name: 'equipmentManagement',
+            component: () => import(/* webpackChunkName: "setting" */
+              '@/views/power/equipment/equipmentManagement.vue'),
+            meta: {
+              title: '设备管理',
+              icon: 'read',
+              permission: 'M_equipmentManagement'
+            }
           }
         ]
       }

+ 6 - 2
src/views/common/storeList.vue

@@ -18,9 +18,9 @@
 </template>
 <script>
 import debounce from 'lodash/debounce'
-import {getStoreList} from '@/api/power-superUser'
+import { getStoreList } from '@/api/power-superUser'
 export default {
-  name: "storeList",
+  name: 'StoreList',
   props: {
   },
   data () {
@@ -59,6 +59,10 @@ export default {
     resetForm () {
       this.dealerName = []
     },
+    getInfo (con) {
+      console.log('1111111111111', con)
+      this.dealerName = [{ key: con.key, label: con.name }]
+    },
     // 查询详细
     getDetail (sn) {
       // dealerFindUpdateInfoBySn({ sn: sn }).then(res => {

+ 7 - 123
src/views/numsGoodsShelves/approveStore/authPass.vue

@@ -143,65 +143,6 @@
                   placeholder="请输入大于100的数字(最多允许两位小数)"></a-input-number>
               </a-form-model-item>
             </a-col>
-            <a-col :span="12" v-for="(con, index) in priceList" :key="index" v-if="priceList.length>0">
-              <a-form-model-item :prop="form[con.paramCode]" v-if="con.paramCode == 'shelf_price_show'">
-                <template slot="label">
-                  <a-tooltip placement="top">
-                    <template slot="title">
-                      修理厂登录修配易码通小程序后,
-                      <br />
-                      是否可以看见产品的车主价
-                    </template>
-                    车主价
-                    <a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
-                  </a-tooltip>
-                </template>
-                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
-                  <a-radio value="1">可见</a-radio>
-                  <a-radio value="0">不可见</a-radio>
-                </a-radio-group>
-                <span class="spanStyle">(修理厂的建议销售价)</span>
-              </a-form-model-item>
-              <a-form-model-item :prop="form[con.paramCode]" v-if="con.paramCode == 'shelf_cost_show'">
-                <template slot="label">
-                  <a-tooltip placement="top">
-                    <template slot="title">
-                      修理厂登录修配易码通小程序后,<br>
-                      是否可以看见产品的进货价
-                    </template>
-                    进货价<a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
-                  </a-tooltip>
-                </template>
-                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
-                  <a-radio value="1">
-                    可见
-                  </a-radio>
-                  <a-radio value="0">
-                    不可见
-                  </a-radio>
-                </a-radio-group>
-                <span class="spanStyle">(修理厂的进货价,即汽配商的销售价)</span>
-              </a-form-model-item>
-              <a-form-model-item :prop="form[con.paramCode]" v-if="flag && con.paramCode == 'shelf_not_distribute_show'">
-                <template slot="label">
-                  <a-tooltip placement="top">
-                    <template slot="title">
-                      非铺货产品指不是货架上的产品
-                    </template>
-                    非铺货产品价格<a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
-                  </a-tooltip>
-                </template>
-                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
-                  <a-radio value="1">
-                    显示
-                  </a-radio>
-                  <a-radio value="0">
-                    不显示
-                  </a-radio>
-                </a-radio-group>
-                <span class="spanStyle">(非铺货产品是否显示车主价和进货价)</span>
-              </a-form-model-item>
-            </a-col>
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 30px;">
             <a-button type="primary" @click="saveForm" size="large" id="authPass-btn-submit" style="padding: 0 60px;">审核通过</a-button>
@@ -217,7 +158,7 @@ import { STable, VSelect, Upload } from '@/components'
 import { getAreaCgj } from '@/api/data'
 import dealerList from '@/views/common/dealerList.vue'
 import customeList from '@/views/common/customeList.vue'
-import { xprhStoreApplyDetail, xprhStoreApplyAudit, queryList, updateBatch } from '@/api/approveStore'
+import { xprhStoreApplyDetail, xprhStoreApplyAudit } from '@/api/approveStore'
 export default {
   name: 'ApproveStoreAuthPass',
   components: { STable, VSelect, dealerList, customeList, Upload },
@@ -246,10 +187,7 @@ export default {
         creditLimit: undefined, //  授信额度
         delearSn: undefined,
         applySn: undefined,
-        auditStatus: 'PASS', // 通过
-        shelf_price_show: null,
-        shelf_cost_show: null,
-        shelf_not_distribute_show: null
+        auditStatus: 'PASS' // 通过
       },
       rules: {
         storeImage: [{ required: true, message: '请上传门头照片', trigger: 'change' }],
@@ -262,18 +200,12 @@ export default {
         settleType: [{ required: true, message: '请选择收结算方式', trigger: 'change' }],
         delearSn: [{ required: true, message: '请选择绑定汽配商', trigger: 'change' }],
         customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
-        creditLimit: [{ required: true, message: '请输入授信额度', trigger: 'change' }],
-        shelf_price_show: [{ required: true, message: '请选择车主价权限', trigger: 'change' }],
-        shelf_cost_show: [{ required: true, message: '请选择进货价权限', trigger: 'change' }],
-        shelf_not_distribute_show: [{ required: true, message: '请非铺货价格显示', trigger: 'change' }]
+        creditLimit: [{ required: true, message: '请输入授信额度', trigger: 'change' }]
       },
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      settleStyleList: [], //  收款方式  下拉数据
-      val: '',
-      priceList: [],
-      flag: false
+      settleStyleList: [] //  收款方式  下拉数据
     }
   },
   methods: {
@@ -334,7 +266,7 @@ export default {
             centered: true,
             closable: true,
             onOk () {
-              _this.handleSubit()
+              _this.handleSubmit()
             }
           })
         } else {
@@ -348,7 +280,8 @@ export default {
       xprhStoreApplyAudit(_this.form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.handleSave()
+          _this.handleBack()
+          _this.spinning = false
         } else {
           _this.spinning = false
         }
@@ -430,60 +363,11 @@ export default {
       if (this.$route.params.sn) {
         this.getDetail()
       }
-    },
-    getPriceList () {
-      debugger
-      queryList({ shelfSn: this.$route.params.shelfSn, bizType: 'xprh_shelf_price_show' }).then(res => {
-        if (res.status == 200) {
-          this.priceList = res.data
-          const isFlag = res.data.findIndex(r => {
-            return r.paramValue == 1
-          })
-          if (isFlag != -1) {
-            this.flag = true
-          }
-        }
-      })
-    },
-    onChangePriceType (e, i) {
-      this.$set(this.priceList[i], 'paramValue', e.target.value)
-      this.form[this.priceList[i].paramCode] = i.toString()
-      if (this.priceList[i].paramCode != 'xprh_shelf_price_show') {
-        const isFlag = this.priceList.findIndex(r => {
-          return r.paramValue == 1
-        })
-        if (isFlag != -1) {
-          this.flag = true
-        } else {
-          this.flag = false
-        }
-      }
-    },
-    handleSave () {
-      const _this = this
-      var newArr = []
-      for (var i = 0; i < this.priceList.length; i++) {
-        var obj = {
-          id: _this.priceList[i].id,
-          paramValue: _this.priceList[i].paramValue
-        }
-        newArr.push(obj)
-      }
-      updateBatch(newArr).then(ret => {
-        if (ret.status == 200) {
-          _this.$message.success(ret.message)
-          _this.handleBack()
-          _this.spinning = false
-        } else {
-          _this.spinning = false
-        }
-      })
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.initPage()
-      this.getPriceList()
     }
   },
   activated () {

+ 1 - 1
src/views/numsGoodsShelves/approveStore/list.vue

@@ -158,7 +158,7 @@ export default {
     handleAudit (row, type) {
       // 审核通过
       if (type == 1) {
-        this.$router.push({ name: 'approveStoreAuthPass', params: { sn: row.applySn, shelfSn: row.shelfSn } })
+        this.$router.push({ name: 'approveStoreAuthPass', params: { sn: row.applySn } })
       } else {
         const _this = this
         this.$confirm({

+ 162 - 0
src/views/power/equipment/addEquipmentModal.vue

@@ -0,0 +1,162 @@
+<template>
+  <a-modal
+    centered
+    class="userEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="绑定设备"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <a-form-model
+      id="userEdit-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol">
+      <a-form-model-item label="设备编码" prop="deviceCode">
+        <a-input v-model="form.deviceCode" placeholder="请输入设备编码" />
+      </a-form-model-item>
+      <a-form-model-item label="设备名称" prop="deviceName">
+        <a-input v-model="form.deviceName" placeholder="请输入设备名称" />
+      </a-form-model-item>
+      <a-form-model-item label="绑定经销商" prop="dealerSn">
+        <storeList ref="storeList" @change="custChange"></storeList>
+      </a-form-model-item>
+      <a-form-model-item label="是否启用" prop="enabledFlag">
+        <a-radio-group default-value="0" button-style="solid" v-model="form.enabledFlag">
+          <a-radio-button value="1">
+            是
+          </a-radio-button>
+          <a-radio-button value="0">
+            否
+          </a-radio-button>
+        </a-radio-group>
+      </a-form-model-item>
+      <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+        <a-button :style="{ marginRight: '8px' }" @click="isShow=false">取消</a-button>
+        <a-button type="primary" @click="handleSubmit()" :style="{ marginLeft: '8px' }">确定</a-button>
+      </a-form-model-item>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import storeList from '@/views/common/storeList.vue'
+import { handDeviceSave, handDeviceDetail, handDeviceEdit } from '@/api/handDevice'
+export default {
+  components: { VSelect, storeList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        dealerSn: undefined, // 客户SN
+        deviceCode: '', // 设备编码
+        deviceName: '', // 设备名称
+        enabledFlag: '0'//  启用标记
+      },
+      rules: {
+        deviceCode: [ { required: true, message: '请输入设备编码', trigger: 'blur' } ],
+        deviceName: [ { required: true, message: '请输入设备名称', trigger: 'blur' } ],
+        dealerSn: [ { required: true, message: '请选择绑定经销商', trigger: 'change' } ],
+        enabledFlag: [ { required: true, message: '请选择是否启用', trigger: 'change' } ]
+      }
+    }
+  },
+  methods: {
+    custChange (val) {
+      this.form.dealerSn = val.key
+    },
+    // 保存
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          if (!_this.itemId) {
+            handDeviceSave(params).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$emit('confirm', _this.form)
+                _this.isShow = false
+              }
+            })
+          } else {
+            params.id = _this.itemId
+            handDeviceEdit(params).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$emit('confirm', _this.form)
+                _this.isShow = false
+              }
+            })
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 获取详情
+    getDetail () {
+      handDeviceDetail({ id: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.form.dealerSn = res.data.dealerSn
+          this.form.deviceCode = res.data.deviceCode
+          this.form.deviceName = res.data.deviceName
+          this.form.enabledFlag = res.data.enabledFlag
+          this.$refs.storeList.getInfo({ key: res.data.dealerSn, name: res.data.dealer.dealerName })
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
+    },
+    // 重置数据
+    reset () {
+      this.form = {
+        dealerSn: undefined, // 客户SN
+        deviceCode: '', // 设备编码
+        deviceName: '', // 设备名称
+        enabledFlag: '0'//  启用标记
+      }
+      this.$refs.storeList.resetForm()
+      this.$refs.ruleForm.resetFields()
+    },
+    pageInit (data) {
+      this.getDetail()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.reset()
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 215 - 0
src/views/power/equipment/equipmentManagement.vue

@@ -0,0 +1,215 @@
+<template>
+  <a-card :bordered="false">
+    <div class="equipmentManagement">
+      <!-- 搜索框 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="5" :sm="24">
+              <a-form-item label="设备编码">
+                <a-input allowClear v-model.trim="queryParam.deviceCode" placeholder="请输入设备编码" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="经销商">
+                <storeList ref="storeList" @change="custChange"></storeList>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="所属省份">
+                <a-select id="equipmentManagement-addrProvince" allowClear v-model="queryParam.dealer.provinceSn" placeholder="请选择省">
+                  <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="启用状态">
+                <v-select
+                  v-model="queryParam.enabledFlag"
+                  ref="auditStatus"
+                  code="ENABLE_FLAG"
+                  placeholder="请选择启用状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="equipmentManagement-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="equipmentManagement-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" @click="addEquipment">添加设备</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        bordered>
+        <!-- 地区 -->
+        <template slot="addressInfo" slot-scope="text, record">
+          <span v-if="record.dealer">{{ record.dealer.provinceName }}{{ record.dealer.cityName }}</span>
+        </template>
+        <!--是否启用 -->
+        <template slot="isEnabled" slot-scope="text, record">
+          <a-switch checked-children="是" un-checked-children="否" :checked="record.isChecked" @change="handleChecked(record)" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-primary" @click="handleEdit(record)">编辑</a-button>
+          <a-button size="small" type="link" class="button-primary" @click="handleDel(record)">删除</a-button>
+        </template>
+      </s-table>
+    </div>
+    <!-- 添加设备 -->
+    <addEquipmentModal ref="equipmentBox" :openModal="openModal" :itemId="itemId" @confirm="$refs.table.refresh(true)" @close="openModal=false" />
+  </a-card>
+</template>
+
+<script>
+import storeList from '@/views/common/storeList.vue'
+import { STable, VSelect } from '@/components'
+import addEquipmentModal from './addEquipmentModal'
+import { handDeviceList, handDeviceDel, handDeviceEdit } from '@/api/handDevice.js'
+import { getArea } from '@/api/data'
+export default {
+  name: 'EquipmentManagement',
+  components: { STable, VSelect, storeList, addEquipmentModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      queryParam: {
+        dealerSn: undefined,
+        deviceCode: '',
+        deviceName: '',
+        enabledFlag: undefined,
+        dealer: {
+          provinceSn: undefined
+        }
+      },
+      addrProvinceList: [],
+      openModal: false,
+      itemId: '',
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '设备编码', dataIndex: 'deviceCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '设备名称', dataIndex: 'deviceName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '地区', scopedSlots: { customRender: 'addressInfo' }, align: 'center' },
+        { title: '经销商', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '是否启用', scopedSlots: { customRender: 'isEnabled' }, align: 'center' },
+        { title: '添加时间', dataIndex: 'createDate', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return handDeviceList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            data.list[i].isChecked = data.list[i].enabledFlag == 1
+          }
+          this.disabled = false
+          return data
+        })
+      }
+    }
+  },
+  mounted () {
+    this.getCityList()
+  },
+  methods: {
+    // 新增设备
+    addEquipment () {
+      this.itemId = ''
+      this.openModal = true
+    },
+    // 获取所属省份
+    getCityList () {
+      getArea({ type: '2' }).then(res => {
+        if (res.status == 200) {
+          this.addrProvinceList = res.data || []
+        } else {
+          this.addrProvinceList = []
+        }
+      })
+    },
+    // 修改启用状态
+    handleChecked (row) {
+      const _this = this
+      handDeviceEdit({
+        id: row.id,
+        enabledFlag: row.isChecked ? '0' : '1',
+        dealerSn: row.dealerSn,
+        deviceCode: row.deviceCode,
+        deviceName: row.deviceName
+      }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.resetSearchForm()
+        }
+      })
+    },
+    // 选择客户
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+    },
+    handleEdit (row) {
+      this.itemId = row.id
+      this.$nextTick(() => {
+        this.openModal = true
+        this.$refs.equipmentBox.pageInit()
+      })
+    },
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除该设备后,所有绑定数据将被清除,并且不能继续操作。',
+        okText: '删除',
+        cancelText: '取消',
+        onOk () {
+          handDeviceDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.resetSearchForm()
+            }
+          })
+        },
+        onCancel () {
+          console.log('取消删除')
+        }
+      })
+    },
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.dealerSn = undefined
+      this.queryParam.deviceCode = ''
+      this.queryParam.deviceName = ''
+      this.queryParam.enabledFlag = undefined
+      this.queryParam.dealer.provinceSn = undefined
+      this.$refs.storeList.resetForm()
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style lang="less">
+  .equipmentManagement{
+    .sTable{
+      margin-top: 10px;
+    }
+  }
+</style>

+ 3 - 0
src/views/power/menuMould/setModal.vue

@@ -171,6 +171,9 @@ export default {
 <style lang="less">
   .customerTypeEdit-modal{
     .ant-modal-body {
+      box-sizing:border-box;
+      max-height:77vh;
+      overflow-y:scroll;
       padding: 40px 40px 24px;
     }
     .btn-cont {