From 2c92c7a26a77d61b8f4f2082c3aee431282212d1 Mon Sep 17 00:00:00 2001
From: 18650502300 <18650502300@163.com>
Date: Thu, 18 Jul 2024 18:04:20 +0800
Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/api/system/device.js          |  2 +-
 src/utils/request.js              |  2 +-
 src/views/system/area/index.vue   | 34 ++++++++++++++++++++++++++-----
 src/views/system/device/index.vue |  9 +++++++-
 src/views/system/fault/index.vue  |  8 ++++++++
 src/views/system/map/index.vue    |  4 ++--
 6 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/src/api/system/device.js b/src/api/system/device.js
index 80696d6..e3e54ca 100644
--- a/src/api/system/device.js
+++ b/src/api/system/device.js
@@ -112,7 +112,7 @@ export function ring(data){
 // 坐垫锁
 export function seatCushionLock(data){
   return request({
-    url: '/app/device/seatCushionLockByMac?mac='+data.mac,
+    url: '/appVerify/device/seatCushionLockByMac?mac='+data.mac,
     method: 'post'
   })
 }
diff --git a/src/utils/request.js b/src/utils/request.js
index ffb0d21..e0280bf 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 10000
+  timeout: 12000
 })
 
 // request拦截器
diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue
index f8d0465..f8537f2 100644
--- a/src/views/system/area/index.vue
+++ b/src/views/system/area/index.vue
@@ -42,6 +42,7 @@
     <el-table v-loading="loading" :data="areaList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="运营区域" align="center" prop="areaName" />
+      <el-table-column label="运营商" align="center" prop="deptName" />
       <el-table-column label="车数量" align="center" prop="deviceNum" />
       <el-table-column label="停车区" align="center" :show-overflow-tooltip="true">
         <template slot-scope="scope">
@@ -64,7 +65,7 @@
           </router-link>
         </template>
       </el-table-column>
-      <el-table-column label="收费方式" align="center" prop="ruleStr" />
+      <el-table-column label="收费方式" align="center" prop="ruleStr" :show-overflow-tooltip="true"/>
       <el-table-column label="联系人" align="center" prop="contact" />
       <el-table-column label="联系人电话" align="center" prop="phone" />
       <el-table-column label="状态" align="center" key="status">
@@ -78,7 +79,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
             v-hasPermi="['system:area:edit']">修改</el-button>
@@ -121,6 +122,11 @@
     <el-dialog :title="title" :visible.sync="open" width="1200px"  :before-close="handleClose">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
+          <el-col :span="12" v-if="userName == 'admin'">
+            <el-form-item label="运营商" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择运营商" />
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item label="运营区" prop="areaName">
               <el-input v-model="form.areaName" placeholder="请输入运营区" />
@@ -426,12 +432,15 @@
 import { listArea, getArea, delArea, addArea, updateArea } from "@/api/system/area";
 import AreaMap from "@/components/AreaMap";
 import { listFee } from "@/api/system/fee";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { getDistrictList } from "@/api/common/common";
+import { deptTreeSelect } from '@/api/system/user'
 
 export default {
   name: "Area",
   dicts: ['et_operating_area_status', 'et_operating_area_time', 'et_business_switch'],
-  components: { AreaMap },
+  components: { AreaMap,Treeselect },
   data() {
     return {
       // 遮罩层
@@ -458,6 +467,9 @@ export default {
       XIAN: [],
       // 运营区表格数据
       areaList: [],
+      userName: null,
+      // 运营商树选项
+      deptOptions: undefined,
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -487,12 +499,15 @@ export default {
         contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
         phone: [{ required: true, message: "联系人电话不能为空", trigger: "blur" }],
         autoReplacementOrder: [{ required: true, message: "最低电量不能为空", trigger: "blur" }],
+        deptId: [{ required: true, message: "运营商不能为空", trigger: "blur" }],
       },
     };
   },
   created() {
+    console.log("当前用户信息:",this.$store.state.user.name)
+    this.userName = this.$store.state.user.name;
     this.getList();
-
+    this.getDeptTree();
   },
   methods: {
     getCityList() {
@@ -523,6 +538,12 @@ export default {
         console.log(console.log(this.form.provinceList, ' this.form.provinceList'))
       })
     },
+    /** 查询运营商下拉树结构 */
+    getDeptTree() {
+      deptTreeSelect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
     handleClose(){
       this.open=false
       this.loading = false
@@ -663,7 +684,10 @@ export default {
         this.open = true;
         this.title = "修改运营区";
         this.key++;
-        listFee().then(response => {
+        console.log('this.form.areaId=================',this.form.areaId)
+        console.log('this.form.deptId=================',this.form.deptId)
+
+        listFee({areaId:this.form.areaId}).then(response => {
           this.ruleOptions = response.rows;
           this.open = true;
           this.title = "修改运营区";
diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue
index 512dfcb..5a87c29 100644
--- a/src/views/system/device/index.vue
+++ b/src/views/system/device/index.vue
@@ -475,7 +475,14 @@
     addDevice,
     updateDevice,
     handleLock,
-    handleUnlocking, ring, oneClickOnline, oneClickOffline, reboot, oneClickListing, oneClickWarehousing
+    handleUnlocking,
+    ring,
+    oneClickOnline,
+    oneClickOffline,
+    reboot,
+    oneClickListing,
+    oneClickWarehousing,
+    seatCushionLock
   } from '@/api/system/device'
 import Map from "@/components/Map";
 import OrderRecord from "@/views/system/device/components/orderRecord.vue";
diff --git a/src/views/system/fault/index.vue b/src/views/system/fault/index.vue
index 17a1cd8..619650b 100644
--- a/src/views/system/fault/index.vue
+++ b/src/views/system/fault/index.vue
@@ -46,6 +46,14 @@
 <!--      <el-table-column label="报修id" align="center" prop="faultId" />-->
       <el-table-column label="用户" align="center" prop="userName" />
       <el-table-column label="车辆编号" align="center" prop="sn" />
+      <el-table-column align="center" label="订单编号" width="200"  prop="orderNo">
+        <template slot-scope="scope">
+          <router-link :to="'/system/order/index/' + scope.row.orderNo" class="link-type">
+            <span>{{ scope.row.orderNo }}</span>
+          </router-link>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="订单号" align="center" prop="orderNo" />-->
       <el-table-column label="图片" align="center" prop="picture" width="100">
         <template slot-scope="scope">
           <image-preview :src="scope.row.picture" :width="50" :height="50"/>
diff --git a/src/views/system/map/index.vue b/src/views/system/map/index.vue
index b1e86c9..fd4ae38 100644
--- a/src/views/system/map/index.vue
+++ b/src/views/system/map/index.vue
@@ -35,7 +35,7 @@
         <span class="span-class">未上架/下线</span>
       </div>
     </div>
-    <div class="area-options">
+    <div class="area-options" v-if="userName == 'admin'">
       <span >切换运营区</span>
         <el-select v-model="areaId" placeholder="请选择运营区" clearable @change="handleAreaChange">
           <el-option
@@ -171,7 +171,7 @@
         open2: false,
         // 表单参数
         form: {},
-        areaId: 14,
+        areaId: null,
         areaOptions: [],
         infoWindow: null,
         // 设备表格数据