Browse Source

设备管理

chenrui 2 years ago
parent
commit
8c1a9dc76e

+ 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 => {

+ 3 - 1
src/views/power/equipment/addEquipmentModal.vue

@@ -93,6 +93,7 @@ export default {
             handDeviceSave(params).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
+                _this.$emit('confirm', _this.form)
                 _this.isShow = false
               }
             })
@@ -100,6 +101,7 @@ export default {
             handDeviceEdit(params).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
+                _this.$emit('confirm', _this.form)
                 _this.isShow = false
               }
             })
@@ -114,11 +116,11 @@ export default {
     getDetail () {
       handDeviceDetail({ id: this.itemId }).then(res => {
         if (res.status == 200) {
-          debugger
           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()
         }

+ 8 - 9
src/views/power/equipment/equipmentManagement.vue

@@ -82,8 +82,8 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
         dealerSn: undefined,
-        deviceCode: undefined,
-        deviceName: undefined,
+        deviceCode: '',
+        deviceName: '',
         enabledFlag: undefined,
         provinceSn: undefined
       },
@@ -97,7 +97,7 @@ export default {
         { title: '绑定客户', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '所属省份', dataIndex: 'dealer.provinceName', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否启用', scopedSlots: { customRender: 'isEnabled' }, align: 'center' },
-        { title: '添加时间', dataIndex: 'addTime', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '添加时间', dataIndex: 'createDate', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -125,9 +125,6 @@ export default {
           this.addrProvinceList = []
         }
       })
-    },
-    modalOk () {
-
     },
     // 选择客户
     custChange (val) {
@@ -141,11 +138,12 @@ export default {
       })
     },
     handleDel (row) {
+      const _this = this
       this.$warning({
         title: '提示',
         content: '删除该设备后,所有绑定数据将被清除,并且不能继续操作。',
+        okText: '删除',
         onOk () {
-          const _this = this
           handDeviceDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -163,10 +161,11 @@ export default {
     },
     // 重置
     resetSearchForm () {
-      this.queryParam.dealerSn = ''
+      this.queryParam.dealerSn = undefined
       this.queryParam.deviceCode = ''
       this.queryParam.deviceName = ''
-      this.queryParam.enabledFlag = ''
+      this.queryParam.enabledFlag = undefined
+      this.queryParam.provinceSn = undefined
       this.$refs.table.refresh(true)
     }
   }