瀏覽代碼

0609commit

zhengwei 4 年之前
父節點
當前提交
0f647565b2
共有 6 個文件被更改,包括 282 次插入268 次删除
  1. 14 3
      src/Global.js
  2. 41 11
      src/grpc/readme.md
  3. 1 0
      src/views/Auth/Login.vue
  4. 207 242
      src/views/Class/ClassManage.vue
  5. 1 0
      src/views/Member/MemberFull.vue
  6. 18 12
      src/views/SystemManage/ShopDevice.vue

+ 14 - 3
src/Global.js

@@ -352,6 +352,17 @@ turnResToOptionByShopRegion = function (data) {
     });
     return ids
 };
+turnResToOptionByRegionDev = function (data) {
+    if (!data) return false;
+    let ids = data.map(item => {
+        return {
+            label: item.eq_name,
+            key: item.eqsn,
+            value: item.uu_eq_id
+        }
+    });
+    return ids
+};
 turnResToOptionByTempUser = function (data) {
     if (!data) return false;
     let ids = data.map(item => {
@@ -367,11 +378,11 @@ turnResToOptionByTempUser = function (data) {
 
 turnResToOptionByCoach = function (data) {
     if (!data) return false;
-    let ids = data.map(item => {
+    let ids = data.map((item,index) => {
         return {
             label: item.Name + ' ' + item.Phone,
-            key: parseInt(item.TeacherId),
-            value: parseInt(item.TeacherId),
+            key: item.Id,
+            value: item.Id,
         }
     });
     return ids

+ 41 - 11
src/grpc/readme.md

@@ -1,25 +1,55 @@
-# readme
-##grpc调试
-#im
-grpcui -port 20001 -plaintext 192.168.0.3:20011
-#base
-grpcui -port 20002 -plaintext 192.168.0.3:20014
+# Readme
+准备工作,安装protobuf和grpc-web
 
-go get github.com/fullstorydev/grpcui/...
-go install github.com/fullstorydev/grpcui/cmd/grpcui
+#Mac使用步骤
+##需要安装protobuf
+mac 可用用 homebrew 安装,我装的版本为 3.7.1
+brew install protobuf
 
+##安装protoc-gen-grpc-web
+###下载 'protoc-gen-grpc-web' 文件
+https://github.com/grpc/grpc-web/releases
+选择protoc-gen-grpc-web-1.0.6-darwin-x86_64
 
-## 生成服务
+###移动到系统环境变量
+$ sudo mv ~/Downloads/protoc-gen-grpc-web-1.0.6-darwin-x86_64 /usr/local/bin/protoc-gen-grpc-web
+$ chmod +x /usr/local/bin/protoc-gen-grpc-web
+
+##安装grpc-web和google-protobuf
+
+yarn add grpc-web
+yarn add google-protobuf
 
-执行gen.bat 重新生成服务文件
 
-### 安装依赖
 
+# Win安装依赖
 cnpm i google-protobuf   
 cnpm install --save grpc-web
 
+
+## 生成grpc.js
+
+执行gen.bat 重新生成服务文件
+
+##需要nmp 生成编译 grpc/package.json
+主要的依赖库protobuf和grpc的版本与服务端一定要保持一致
+机器安装的probobuf和grpc-web版本也要和package.json一致
+
+执行命令
+cnpm install
+
+
 ### 使用
 
+##grpc调试地址
+#im
+grpcui -port 20001 -plaintext 192.168.0.3:20011
+#base
+grpcui -port 20002 -plaintext 192.168.0.3:20014
+
+go get github.com/fullstorydev/grpcui/...
+go install github.com/fullstorydev/grpcui/cmd/grpcui
+
 #### 单页引用
 
 import {SignInPasswordRequest, FlushDataRequest, Data} from "@/assets/grpcBack/im_pb"; //{}内容为传入参数的方法名,按实际需求添加

+ 1 - 0
src/views/Auth/Login.vue

@@ -212,6 +212,7 @@ export default {
       console.log(localStorage.token);
       that.client.manageableShopList(paraRequest, {"Token": localStorage.token}, (err, ShopListReply) => {
             if (err == null) {
+              console.log(ShopListReply);
               let res = ShopListReply.getListList();
               if (res) {
                 //账号下只有一家店铺

+ 207 - 242
src/views/Class/ClassManage.vue

@@ -75,26 +75,26 @@
         </el-table-column>
         <el-table-column prop="Status" label="操作">
           <template slot-scope="scope">
+            <!--未上课的-->
             <el-button type="primary" round size="mini" v-if="scope.row.finish_class == 0"
-                       @click="showDialogClassOn(scope.row)"> 上课
+                       @click="showDialogClassOn(scope.row)">
+              上课
             </el-button>
-            <el-button type="primary" round size="mini"
-                       v-if="scope.row.finish_class == 3 || scope.row.finish_class == 2"
-                       @click="classManage(scope.row)">
-              管理
-            </el-button>
-            <!--修改区域 todo-->
-            <el-button type="primary" round plain size="mini" v-if="scope.row.finish_class == 3"
+            <!--准备上课的才能看编辑-->
+            <el-button type="primary" round plain size="mini" v-if="scope.row.finish_class == 1"
                        @click="classEdit(scope.row)">
               编辑
             </el-button>
+            <!--准备上课和上课中的-->
+            <el-button type="primary" round size="mini" v-if="scope.row.finish_class == 2"
+                       @click="classManage(scope.row)">
+              管理
+            </el-button>
             <!--已完成才能看详情-->
-            <el-button type="primary" round plain size="mini"
-                       v-if="scope.row.finish_class == 1 || scope.row.finish_class == 4"
+            <el-button type="primary" round plain size="mini" v-if="scope.row.finish_class == 4"
                        @click="classDetail(scope.row)">
               详情
             </el-button>
-
           </template>
         </el-table-column>
       </el-table>
@@ -109,7 +109,7 @@
           <el-form ref="form" :model="form" label-width="160px">
             <!--选教练,非必选-->
             <el-form-item label="上课教练">
-              <el-select v-model="coachValue" filterable placeholder="请选择">
+              <el-select v-model="form.coachValue" filterable placeholder="请选择">
                 <el-option v-for="item in form.coachData" :key="item.key" :label="item.label"
                            :value="item.value">
                 </el-option>
@@ -146,19 +146,18 @@
             </el-form-item>
 
             <!--选择区域-->
-            <el-form-item label="区域" :required="true">
+            <el-form-item label="上课区域" :required="true">
               <el-select v-model="form.svId" filterable placeholder="请选择" @change="changeLocationValue">
-                <el-option v-for="item in form.svList" :key="item.SvId" :label="item.Name"
-                           :value="item.SvId">
+                <el-option v-for="item in form.svList" :key="item.key" :label="item.label"
+                           :value="item.value">
                 </el-option>
               </el-select>
             </el-form-item>
             <!--显示设备-->
-            <el-form-item label="显示设备">
-              <el-checkbox-group v-model="form.equipList">
-                <el-checkbox label="复选框 A"></el-checkbox>
-                <el-checkbox label="复选框 B"></el-checkbox>
-                <el-checkbox label="复选框 C"></el-checkbox>
+            <el-form-item label="显示设备" v-if="form.svId">
+              <el-checkbox-group v-model="form.equipShow">
+                <el-checkbox v-for="item in form.equipList" :key="item.value" :label="item.label"
+                             :value="item.value"></el-checkbox>
               </el-checkbox-group>
             </el-form-item>
             <!--上课方式-->
@@ -170,7 +169,7 @@
               </el-select>
             </el-form-item>
             <!--分队方式-->
-            <el-form-item label="分队方式" v-if="form.classLabel == 2">
+            <el-form-item label="分队方式" v-if="form.classType == 2">
               <el-select v-model="form.pkNum" filterable placeholder="请选择">
                 <el-option v-for="item in form.PKTypeOptions" :key="item.value" :label="item.label"
                            :value="item.value">
@@ -182,12 +181,10 @@
         </div>
       </div>
       <div class="dialogFooter">
-        <el-button type="primary" size="small" v-if="form.btnType == 0" :disabled="PrepareBtnStatus"
-                   @click="getClassStartPrepare()">确定
-        </el-button>
-        <el-button type="primary" size="small" v-if="form.btnType == 1" @click="getClassStartPrepareForEdit()">
-          确定
+        <el-button size="small" type="primary" v-if="form.btnType == 0" @click="classStatOn()"
+                   :disabled="PrepareBtnStatus">确定
         </el-button>
+        <el-button size="small" type="primary" v-if="form.btnType == 1" @click="classOnEdit()">确定</el-button>
         <el-button size="small" @click="dialogClassPrepareVisible = false">取消</el-button>
       </div>
     </el-dialog>
@@ -197,7 +194,6 @@
 <script>
 import Global from '../../Global.js'
 import {
-  ClassOverPrepare,
   QueryShopVenue,
   ClassStartPrepare,
   DispPlanInfoEdit,
@@ -205,7 +201,8 @@ import {
 } from "../../api/getApiRes";
 
 import {
-  StandardRequest
+  StandardRequest,
+  ManageableSimpleQueryRequest
 } from "@/grpc/base_pb";
 
 let qs = require('qs');
@@ -216,7 +213,6 @@ export default {
       searchBtnStatus: false,
       PrepareBtnStatus: false,
       dialogTitle: '上课准备',
-      coachValue: [],
       className: '',
       current: getNowDate(),
       dialogValue: [],
@@ -246,19 +242,18 @@ export default {
       },
       form: {
         svId: '',
-        StdId: '',
+        stdId: '',
         IsHr: 1,
         IsScore: 1,
-        svName: '',
-        equipList: ['选中且禁用', '复选框 A'],
+        equipShow: [],
         classType: 1,//课程类型
         courseType: 1,//课程标签
-        coach: '',
         coachOptions: [],
         pkNum: 2,
         btnType: 0,//0新建,1编辑
         svList: [],//区域列表
-        coachData: [],//穿梭已选
+        coachData: [],
+        equipList: [],
         courseTypeOptions: [
           {value: 1, label: '室内课'},
           {value: 2, label: '户外课'},
@@ -285,75 +280,203 @@ export default {
     goType(url) {
       this.$router.push({path: '/' + url});
     },
-    // 更改上课区域
-    classEdit(row) {
+    //上课按钮弹出
+    showDialogClassOn(row) {
       this.dialogClassPrepareVisible = true;
-      this.form.btnType = 1;//0新建,1编辑
-      // 读取本行信息
+      this.form.btnType = 0;//0新建,1编辑编辑
+      //清空一些值
+      this.form.svId = '';
+      this.form.svList = '';
+      this.form.coachValue = '';
+      this.form.coachData = '';
+      //填充一些值
+      this.form.stdId = row.uu_std_id;
+      this.form.ClassName = row.class_name;
+      this.form.BeginStr = row.begin_str;
+      this.form.EndStr = row.end_str;
+      this.form.FinishClass = row.finish_class;
+      this.form.ClassType = row.class_type;
+      this.form.courseType = row.course_type;
+      this.form.PkNum = row.pk_num;
       this.className = row.class_name + ' ' + row.begin_str + ' - ' + row.end_str;
-      this.form.StdId = row.std_id;
+      this.getCoachOption();
       this.getQueryShopVenue();
-      this.form.svId = row.sv_id;
-      this.form.classType = row.class_type;
-      this.form.courseType = row.course_type;
-      this.form.pkNum = row.pk_num;
+    },
+    // 获取教练选项
+    getCoachOption() {
+      let that = this;
+      let paraRequest = new ManageableSimpleQueryRequest();
+      paraRequest.setShopid(localStorage.shopId);
+      paraRequest.setRoleid(0);
+      that.client.manageableSimpleQuery(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
+        if (err == null) {
+          console.log(StandardReply);
+          let res = JSON.parse(StandardReply);
+          that.form.coachData = turnResToOptionByCoach(res);
+        } else {
+          let res = err;
+          that.form.coachData = [];
+          that.$message.error(res.message + ',错误代码:' + res.code);
+          console.log(res);
+        }
+      });
+    },
+    // 获取区域列表
+    getQueryShopVenue() {
+      let that = this;
+      const jsonStr = {
+        shopId: localStorage.shopId
+      };
+      let paraRequest = new StandardRequest();
+      paraRequest.setShopid(localStorage.shopId);
+      paraRequest.setJsonstr(JSON.stringify(jsonStr));
+      paraRequest.setSign(getSignStr(jsonStr));
+      console.log(paraRequest);
+      that.client.shopVenueQuery(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
+        if (err == null) {
+          console.log(StandardReply.getJsonrst());
+          let res = JSON.parse(StandardReply);
+          if (res.code === 0) {
+            if (res.rs) {
+              that.form.svList = turnResToOptionByShopRegion(res.rs);
+            } else {
+              that.regionList = [];
+            }
+          } else {
+            that.$message.error(res.memo + ',错误代码:' + res.code);
+          }
+        } else {
+          let res = err;
+          that.$message.error(res.message + ',错误代码:' + res.code);
+          console.log(res);
+        }
+      });
+    },
+    // 获取select的label
+    changeLocationValue() {
+      let that = this;
+
+      const jsonStr = {
+        UUSvId: that.form.svId,
+        UUStdId: that.form.stdId,
+        shopId: localStorage.shopId,
+        eqType: 1
+      };
+
+      let paraRequest = new StandardRequest();
+      paraRequest.setShopid(localStorage.shopId);
+      paraRequest.setJsonstr(JSON.stringify(jsonStr));
+      paraRequest.setSign(getSignStr(jsonStr));
+      console.log(paraRequest);
+      that.client.eqSimpleQuery(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
+        if (err == null) {
+          console.log(StandardReply.getJsonrst());
+          let res = JSON.parse(StandardReply);
+          if (res.code === 0) {
+            if (res.rs) {
+              that.form.equipList = turnResToOptionByRegionDev(res.rs);
+            } else {
+              that.form.equipList = [];
+            }
+          } else {
+            that.$message.error(res.memo + ',错误代码:' + res.code);
+          }
+        } else {
+          let res = err;
+          that.$message.error(res.message + ',错误代码:' + res.code);
+          console.log(res);
+        }
+      });
     },
     // 准备上课
-    getClassStartPrepare() {
+    classStatOn() {
       let that = this;
+      if (!that.form.courseType) {
+        that.$message.error('课程类型不能为空');
+        return false
+      }
       if (!that.form.svId) {
         that.$message.error('上课区域不能为空');
         return false
       }
+      if (!that.form.classType) {
+        that.$message.error('上课方式不能为空');
+        return false
+      }
       that.PrepareBtnStatus = true;
-      // 不是竞技pk的时候为0
-      let uppkNum = that.form.classType == 2 ? that.form.pkNum : 0;
-      let tid = that.coachValue.toString();
-      let param = {
-        token: localStorage.token,
-        stdId: that.form.StdId,
-        svId: that.form.svId,
-        svName: that.form.svName,
-        classType: that.form.classType,
-        pkNum: uppkNum,
-        tid: tid,//教练id
-      };
       that.searchBtnStatus = true;
       let totalTime = 2;
-      let clock = window.setInterval(() => {
+      window.setInterval(() => {
         totalTime--;
         if (totalTime < 0) {
           totalTime = 2;
           that.searchBtnStatus = false;
         }
       }, 1000);
-      let postdata = qs.stringify(param);
-      ClassStartPrepare(postdata).then(res => {
+      const jsonStr = {
+        shopId: localStorage.shopId,
+        UUStdId: that.form.stdId,
+        tid: that.form.coachValue,
+        isHr: that.form.IsHr ? 1 : 0,
+        courseType: that.form.courseType,
+        hrClassType: that.form.classType,
+        hrPkNum: that.form.pkNum,
+        hrUUSvId: that.form.svId,
+        hrUUeqIdList: that.form.equipShow,
+        isScore: that.form.IsScore ? 1 : 0,
+      };
+
+      let paraRequest = new StandardRequest();
+      paraRequest.setShopid(localStorage.shopId);
+      paraRequest.setJsonstr(JSON.stringify(jsonStr));
+      paraRequest.setSign(getSignStr(jsonStr));
+      console.log(paraRequest);
+      that.client.classStartPrepare(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
         that.PrepareBtnStatus = false;
-        let json = res;
-        if (json.Code == 0) {
-          this.$router.push({
-            path: '/classEdit',
-            query: {
-              StdId: that.form.StdId,
-              ClassName: that.form.ClassName,
-              BeginStr: that.form.BeginStr,
-              EndStr: that.form.EndStr,
-              FinishClass: 3,
-              ClassType: that.form.classType,
-              PkNum: uppkNum,
-            }
-          });
-          that.dialogClassPrepareVisible = false;
-          this.getTableQuery();
+        if (err == null) {
 
+          console.log(StandardReply.getJsonrst());
+          let res = JSON.parse(StandardReply);
+          if (res.code === 0) {
+            this.$router.push({
+              path: '/classEdit',
+              query: {
+                StdId: that.form.stdId,
+                ClassName: that.form.ClassName,
+                BeginStr: that.form.BeginStr,
+                EndStr: that.form.EndStr,
+                ClassType: that.form.courseType,
+                PkNum: that.form.pkNum,
+                FinishClass: 3
+              }
+            });
+            that.dialogClassPrepareVisible = false;
+            this.getTableQuery();
+          } else {
+            that.$message.error(res.memo + ',错误代码:' + res.code);
+          }
         } else {
-          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+          let res = err;
+          that.$message.error(res.message + ',错误代码:' + res.code);
+          console.log(res);
         }
-      })
+      });
+    },
+    // 更改上课区域
+    classEdit(row) {
+      this.dialogClassPrepareVisible = true;
+      this.form.btnType = 1;//0新建,1编辑
+      // 读取本行信息
+      this.className = row.class_name + ' ' + row.begin_str + ' - ' + row.end_str;
+      this.form.stdId = row.std_id;
+      this.getQueryShopVenue();
+      this.form.svId = row.sv_id;
+      this.form.classType = row.class_type;
+      this.form.courseType = row.course_type;
+      this.form.pkNum = row.pk_num;
     },
-    // 编辑
-    getClassStartPrepareForEdit() {
+    //上课编辑
+    classOnEdit() {
       let that = this;
       if (!that.form.svId) {
         that.$message.error('上课区域不能为空');
@@ -364,7 +487,7 @@ export default {
 
       let param = {
         token: localStorage.token,
-        stdId: that.form.StdId,
+        stdId: that.form.stdId,
         svId: that.form.svId,
         svName: that.form.svName,
         classType: that.form.classType,
@@ -382,6 +505,8 @@ export default {
         }
       })
     },
+
+    //查看课程详情
     classDetail(row) {
       this.$router.push({
         path: '/classInfoDetail', query: {
@@ -392,6 +517,7 @@ export default {
         }
       });
     },
+    //查看课程管理
     classManage(row) {
       this.$router.push({
         path: '/classEdit', query: {
@@ -405,165 +531,6 @@ export default {
         }
       });
     },
-    // 关课
-    closeLesson(row) {
-      that.$message.error('功能未上线,请耐心等候');
-      return false;
-      let that = this;
-      let param = {
-        token: localStorage.token,
-        hrId: row.HrId,
-        status: 9,//
-      };
-      let postdata = qs.stringify(param);
-      this.$confirm('此操作将永久关闭当前课程, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        HrSensorsStatusEdit(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: '已取消关课'
-        });
-      });
-    },
-    // 获取select的label
-    changeLocationValue(val) {
-      //locations是v-for里面的也是datas里面的值
-      let obj = {};
-      obj = this.form.svList.find((item) => {
-        return item.SvId === val;
-      });
-      this.form.svName = obj.Name;
-    },
-    // 获取区域列表
-    getQueryShopVenue() {
-      let that = this;
-      let param = {
-        key: localStorage.ServiceKey,
-        shopId: localStorage.ServiceId,
-      };
-      if (!localStorage.ServiceKey) {
-        that.$message.error('还未与心率系统对接,请联系管理员');
-        return false
-      }
-      let postdata = qs.stringify(param);
-      QueryShopVenue(postdata).then(res => {
-        let json = res;
-        if (json.Code == 0) {
-          that.form.svList = json.Rs;
-        } else {
-          that.$message.error(json.Memo + ' 错误码:' + json.Code);
-        }
-      })
-    },
-    vipSelect(stdId) {
-      let that = this;
-      // 筛选相同的stdid的classId
-      that.form.stdList.map(function (item) {
-        if (item.value == stdId) {
-          let param = {
-            token: localStorage.token,
-            // classId: item.classId
-          };
-          let postdata = qs.stringify(param);
-          // VipUserListQuery
-          VipUserSimpleQuery(postdata).then(res => {
-            let json = res;
-            if (json.Code == 0) {
-              that.form.userId = '';
-              that.form.userList = turnResToOptionBySimViper(json.Rs);
-            } else {
-              that.$message.error(json.Memo + ' 错误码:' + json.Code);
-            }
-          })
-        }
-      })
-    },
-    //上课按钮弹出框
-    showDialogClassOn(row) {
-      this.dialogClassPrepareVisible = true;
-      this.form.btnType = 0;//0新建,1编辑编辑
-      // clear
-      this.form.svList = "";
-      this.form.StdId = row.std_id;
-      this.form.ClassName = row.class_name;
-      this.form.BeginStr = row.begin_str;
-      this.form.EndStr = row.end_str;
-      this.form.FinishClass = row.finish_class;
-      this.form.ClassType = row.class_type;
-      this.form.courseType = row.course_type;
-      this.form.PkNum = row.pk_num;
-      this.className = row.class_name + ' ' + row.begin_str + ' - ' + row.end_str;
-      this.form.StdId = row.std_id;
-      this.getCoachOption();
-      this.getQueryShopVenue();
-    },
-    // 获取教练选项
-    getCoachOption() {
-      let that = this;
-      let param = {
-        token: localStorage.token,
-        name: this.panel.name,//
-        phone: this.panel.phone,//
-        shopId: localStorage.ShopId,//
-        adminType: 4,//
-        start: 1,//
-        tableMax: 299,//
-      };
-      let postdata = qs.stringify(param);
-      ShopManagerListQuery(postdata).then(res => {
-        let json = res;
-        if (json.Code == 0) {
-          that.form.coachData = turnResToOptionByUsers(json.Rs);
-        } else {
-          that.$message.error(json.Memo + ' 错误码:' + json.Code);
-        }
-      })
-    },
-    // 检测当前课是否处于可改变状态
-    // 固定下当前已预约人数列表
-    checkClassOverPrepare(row) {
-      let that = this;
-      let param = {
-        token: localStorage.token,
-        stdId: row.std_id,
-      };
-      let postdata = qs.stringify(param);
-      ClassOverPrepare(postdata).then(res => {
-        let json = res;
-        if (json.Code == 0) {
-          that.goFinish(row);
-        } else {
-          that.$message.error(json.Memo + ' 错误码:' + json.Code);
-        }
-      })
-    },
-    goFinish(row) {
-      this.$router.push({
-        path: '/classFinishDetail', query: {
-          id: row.std_id,
-          classId: row.ClassId,
-          ClassName: row.class_name,
-          BeginTime: row.begin_time,
-        }
-      });
-    },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
@@ -635,7 +602,6 @@ export default {
       // 分页属性
       let that = this;
       that.pagination.total = that.recordsTotal;
-
       // 默认分页
       that.tableData = that.allTableData.filter((item, index) => {
         return index < that.pagination.pageItem;
@@ -659,7 +625,7 @@ export default {
       let nums = that.pagination.pageItem * pageIndex;
       // 容器
       let tables = [];
-      for (var i = index; i < nums; i++) {
+      for (let i = index; i < nums; i++) {
         if (that.allTableData[i]) {
           tables.push(that.allTableData[i])
         }
@@ -670,7 +636,6 @@ export default {
     },
     // 过滤时间
     filterFmtDate(value, row, column) {
-      let that = this;
       return nonTfmtDate(column, 11);
     },
   },

+ 1 - 0
src/views/Member/MemberFull.vue

@@ -966,6 +966,7 @@ export default {
       standardReq.setShopid(localStorage.shopId);
       standardReq.setSign(getSignStr(jsonStr));
       standardReq.setJsonstr(JSON.stringify(jsonStr));
+      console.log(standardReq);
       that.client.vipClassRelationEdit(standardReq, {"Token": localStorage.token}, (err, StandardReply) => {
         if (err == null) {
           let res = JSON.parse(StandardReply);

+ 18 - 12
src/views/SystemManage/ShopDevice.vue

@@ -122,8 +122,11 @@
                 </el-option>
               </el-select>
             </el-form-item>
+            <el-form-item label="设备名称">
+              <el-input v-model="form.eqName"></el-input>
+            </el-form-item>
             <el-form-item label="设备序列号">
-              <el-input v-model="form.eqSn "></el-input>
+              <el-input v-model="form.eqSn"></el-input>
             </el-form-item>
             <el-form-item label="版本号">
               <el-input v-model="form.version"></el-input>
@@ -186,7 +189,7 @@ export default {
       form: {
         eqId: '',
         eqSn: '',
-        name: '',
+        eqName: '',
         version: '',
         userCode: '',
         shopId: '',
@@ -222,11 +225,13 @@ export default {
     },
     clearForm() {
       // clear
-      this.form.name = '';
+      this.form.eqName = '';
       this.form.userCode = '';
       this.form.shopId = '';
       this.form.eqSn = '';
+      this.form.uuSvId = '';
       this.form.version = '';
+      this.form.eqType = '';
       this.form.equipType = 1;
     },
     // 新增区域设备
@@ -234,7 +239,6 @@ export default {
       this.clearForm();
       this.dialogMemberVisible = true;
       this.btnType = 0;
-      this.uuSvId = '';
       this.dialogTitle = '新增区域设备'
     },
     // 确认提交新增区域设备
@@ -253,9 +257,10 @@ export default {
       const jsonStr = {
         shopId: localStorage.shopId,
         eqsn: this.form.eqSn,
+        eqName: this.form.eqName,
         eqType: this.form.equipType,
         version: this.form.version,
-        UuSvId: this.form.region,
+        UuSvId: this.form.uuSvId,
       };
 
       let paraRequest = new StandardRequest();
@@ -298,6 +303,8 @@ export default {
       let row = this.tableRadio;
       this.form.uuSvId = row.uu_sv_id;
       this.form.eqSn = row.eqsn.trim();
+      this.form.eqId = row.uu_eq_id;
+      this.form.eqName = row.eq_name;
       this.form.version = row.version.trim();
       this.form.equipType = row.equip_type;
       this.dialogVisible = true;
@@ -318,14 +325,12 @@ export default {
         this.$message.error('错了哦,版本号字符不能超过10位');
         return false
       }
-      let param = {
-        key: localStorage.ServiceKey,
-
-      };
       const jsonStr = {
-        eqSn: this.form.eqSn,
+        UuEqId: this.form.eqId,
+        eqsn: this.form.eqSn,
         shopId: localStorage.shopId,
         eqType: this.form.equipType,
+        eqName: this.form.eqName,
         version: this.form.version,
         UuSvId: this.form.uuSvId
       };
@@ -335,7 +340,7 @@ export default {
       paraRequest.setJsonstr(JSON.stringify(jsonStr));
       paraRequest.setSign(getSignStr(jsonStr));
       console.log(paraRequest);
-      that.client.shopVenueEquipAdd(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
+      that.client.shopVenueEquipEdit(paraRequest, {"Token": localStorage.token}, (err, StandardReply) => {
         if (err == null) {
           console.log(StandardReply.getJsonrst());
           let res = JSON.parse(StandardReply);
@@ -370,7 +375,7 @@ export default {
       }).then(() => {
         const jsonStr = {
           UuEqId: row.uu_eq_id,
-          status: 1//1启用 0禁用 9删除
+          status: 9//1启用 0禁用 9删除
         };
         let paraRequest = new StandardRequest();
         paraRequest.setShopid(localStorage.shopId);
@@ -557,6 +562,7 @@ export default {
       const jsonStr = {
         shopId: localStorage.shopId,
         eqsn: that.panel.eqSn,
+        UUSvId: that.panel.region,
         eqType: that.panel.equipType//1:TVBox  2:蓝牙心率Hub 3:演示Pad  -99全部
       };