Sfoglia il codice sorgente

fixed: 设备管理增添点数功能;企业认证取消新增时清空相册

Vccc6 4 anni fa
parent
commit
4412307b2d
2 ha cambiato i file con 105 aggiunte e 4 eliminazioni
  1. 2 0
      src/pages/authentication/index.vue
  2. 103 4
      src/pages/equipment/index.vue

+ 2 - 0
src/pages/authentication/index.vue

@@ -488,6 +488,8 @@ export default {
         ac_website:'',
         ac_zizhi:'',
       }
+      this.fileList = []
+      this.fileList2 = []
     },
     async save (id = '', state = '') {
       await this.$http({

+ 103 - 4
src/pages/equipment/index.vue

@@ -58,6 +58,30 @@
       </div>
     </el-dialog>
 
+    <el-dialog width="450px" title="点数修改" :visible.sync="pointVisible">
+      <el-form :model="pointData">
+        <el-form-item>
+          <div style="display: flex;justify-content: space-between;font-size: 14px;">
+            <span>设备ID:<span>{{currChildName}}</span></span>
+            <span>当前余额:<span>{{currBalance}}</span></span>
+          </div>
+        </el-form-item>
+        <el-form-item label="充值类型">
+          <el-select v-model="pointData.region" placeholder="请选择点数修改类型">
+            <el-option label="系统赠送" value=0></el-option>
+            <el-option label="退充值款" value=-2></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="充值点数" width="100%">
+          <el-input @keyup.enter="_checkInput" maxlength="5" :suffix-icon="pointData.region==-2?'el-icon-minus':'el-icon-plus'" v-model.number="pointData.point"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="pointVisible = false">取 消</el-button>
+        <el-button type="primary" @click="_modifyPoints">确 定</el-button>
+      </div>
+    </el-dialog>
+
     <div class="h-header">
       <vcenter>
         <div class="h-input">
@@ -90,14 +114,14 @@
           :label="item.label"
         >
         </el-table-column>
-        <!-- <el-table-column label="操作">
+        <el-table-column label="操作">
           <template slot-scope="scope">
             <div>
-              <span>点数</span>
-              <span>解绑</span>
+              <span style="cursor:pointer;color:#0175dc;" @click="pointCharge(scope.row)">点数</span>
+              <!-- <span>解绑</span> -->
             </div>
           </template>
-        </el-table-column> -->
+        </el-table-column>
       </el-table>
       <div class="p-con">
         <el-pagination
@@ -164,6 +188,19 @@ export default {
         orderSn: [{required: true, message:'订单号不能为空', trigger: 'blur'}],
         companyId: [{required: true, message:'客户名称不能为空', trigger: 'blur'}]
       },
+      pointVisible: false,
+      pointData:{
+        point: '',
+        region: '',
+        date1: '',
+        date2: '',
+        delivery: false,
+        type: [],
+        resource: '',
+        desc: ''
+      },
+      currChildName:'',
+      currBalance:'',
       // addEq: {
       //   userName: "",
       //   companyId: "",
@@ -271,8 +308,60 @@ export default {
         }
       });
     },
+    pointCharge(row){
+      this.pointVisible = true
+      this.pointData.region = ''
+      this.pointData.point = ''
+      this.currChildName = row.childName
+      this.currBalance = row.balance
+    },
+    _checkInput: function (e) {
+      this.pointData.point += ''
+      this.pointData.point = this.form.point.replace(/[^\d]/g, '')
+      if (Number(this.pointData.point) && this.pointData.point > 10000) {
+        this.pointData.point = 10000
+      }
+    },
+    _modifyPoints(){
+      let params = {
+        body: this.pointData.region,
+        points: this.pointData.point,
+        cameraId: this.pointData.childName
+      }
+
+      if(!body){
+        this.$alert('请选择充值类型','提示',{
+          confirmButtonText: '确定',
+          callback: action => {
+
+          }
+        })
+      }else{
+        this.$http.post({
+          method: 'post',
+          url: '',
+          params: params,
+          headers: {
+            token: window.location.getItem('zfb_token')
+          }
+        }).then(res => {
+          if(res.code === 200){
+            this.$alert('充值成功!','提示',{
+              confirmButtonText: '确定'
+            })
+            this.pointVisible = false
+            this.refresh()
+          }else{
+            this.$alert(res.message,'提示',{
+              confirmButtonText: '确定'
+            })
+          }
+        })
+      }
+    },
     clearData(){
       this.cameraVisible = false
+      this.pointVisible = false
       this.ruleForm = {
         wifiName: "",
         address: "",
@@ -285,6 +374,16 @@ export default {
         companyId: "",
         childName:""
       }
+      this.pointData = {
+        point: '',
+        region: '',
+        date1: '',
+        date2: '',
+        delivery: false,
+        type: [],
+        resource: '',
+        desc: ''
+      }
     },
     ownToName(own){
       switch(own){