Bladeren bron

公务用车 后台界面 修改
公务用车 大屏界面 修改
工程现场 字段不匹配 修复

zhanghao 3 maanden geleden
bovenliggende
commit
04da34f97a

+ 16 - 8
src/api/screen/service.js

@@ -861,11 +861,11 @@ export function getIssueListLastWeek(appOrg, date = null) {
 // 更改问题状态
 export function changeIssueStatus(data) {
   return request({
-    url: '/large/check/changeIssueStatus', 
+    url: '/large/check/changeIssueStatus',
     method: 'post',
     data: data,
     headers: {
-      'Content-Type': 'application/json', 
+      'Content-Type': 'application/json',
     },
   });
 }
@@ -873,11 +873,11 @@ export function changeIssueStatus(data) {
 // 提交问题
 export function add(data) {
   return request({
-    url: '/check/large/issue/add', 
+    url: '/check/large/issue/add',
     method: 'post',
     data: data,
     headers: {
-      'Content-Type': 'application/json', 
+      'Content-Type': 'application/json',
     },
   });
 }
@@ -944,18 +944,26 @@ export function getResource(appOrg) {
 }
 
 // 2025年度公务车车辆明细
-export function getCarDetail(appOrg) {
+export function getCarDetail(appOrg, flag) {
   return request({
     url: '/large/car/carDetail',
-    method: 'get'
+    method: 'get',
+    params: {
+      appOrg: appOrg,
+      flag: flag
+    }
   })
 }
 
 // 公务车预警明细
-export function getWarnDetail(appOrg) {
+export function getWarnDetail(appOrg, alertType) {
   return request({
     url: '/large/car/warnDetail',
-    method: 'get'
+    method: 'get',
+    params: {
+      appOrg: appOrg,
+      alertType: alertType
+    }
   })
 }
 

+ 12 - 0
src/api/zcustom/carDetail.js

@@ -51,3 +51,15 @@ export function delPlatPublicCarChangeDetail(id) {
     method: 'get'
   })
 }
+
+// 导入json
+export function uploadJson(json, flag) {
+  return request({
+    url: '/zcustom/carDetail/upload',
+    data: json,
+    params: {
+      flag: flag
+    },
+    method: 'post'
+  })
+}

+ 12 - 0
src/api/zcustom/warnDetail.js

@@ -51,3 +51,15 @@ export function delPlatPublicCarWarnDetail(id) {
     method: 'get'
   })
 }
+
+// 导入json
+export function uploadJson(json, alertType) {
+  return request({
+    url: '/zcustom/warnDetail/upload',
+    data: json,
+    params: {
+      alertType: alertType
+    },
+    method: 'post'
+  })
+}

+ 2 - 2
src/views/screen/engineering/currentArea.vue

@@ -120,11 +120,11 @@
             <div class="table-bot">
               <div class="table-roll">
                 <div class="table-list" v-for="(item, index) in thisweek" :key="index">
-                  <div class="fir">{{ item.head }}</div>
+                  <div class="fir">{{ item.projectName }}</div>
                   <div class="snd">{{ item.content }}</div>
                   <div class="thd">{{ item.startTime }}</div>
                   <div class="fir">{{ item.endTime }}</div>
-                  <div class="fiv">{{ item.projectName }}</div>
+                  <div class="fiv">{{ item.head  }}</div>
                 </div>
               </div>
             </div>

+ 17 - 15
src/views/screen/map/mapTwo.vue

@@ -54,17 +54,17 @@ export default {
         晋城市: 晋城市,
       },
       points:[
-        { name: "太原市", coordinate: [112.3493, 37.7570], appOrg: "1A003", x: "399", y: "2" },
-        { name: "大同市", coordinate: [113.3002, 40.0768], appOrg: "1B001", x: "399", y: "2" },
-        { name: "阳泉市", coordinate: [113.6805, 37.7863], appOrg: "1C001", x: "399", y: "2" },
-        { name: "长治市", coordinate: [113.1163, 36.1954], appOrg: "1D001", x: "399", y: "2" },
-        { name: "晋城市", coordinate: [113.1513, 35.5907], appOrg: "1E001", x: "399", y: "2" },
-        { name: "朔州市", coordinate: [112.4329, 39.5312], appOrg: "1F001", x: "399", y: "2" },
-        { name: "晋中市", coordinate: [113.2527, 37.3870], appOrg: "1K001", x: "399", y: "2" },
-        { name: "临汾市", coordinate: [111.5186, 35.8582], appOrg: "1L001", x: "399", y: "2" },
-        { name: "忻州市", coordinate: [112.7341, 38.6167], appOrg: "1H001", x: "399", y: "2" },
-        { name: "运城市", coordinate: [110.9069, 34.9264], appOrg: "1M001", x: "399", y: "2" },
-        { name: "吕梁市", coordinate: [111.1443, 37.4183], appOrg: "1J001", x: "399", y: "2" }
+        { name: "太原市", coordinate: [112.3493, 37.7570], appOrg: "1A003", x: "0", y: "2" },
+        { name: "大同市", coordinate: [113.3002, 40.0768], appOrg: "1B001", x: "0", y: "2" },
+        { name: "阳泉市", coordinate: [113.6805, 37.7863], appOrg: "1C001", x: "0", y: "2" },
+        { name: "长治市", coordinate: [113.1163, 36.1954], appOrg: "1D001", x: "0", y: "2" },
+        { name: "晋城市", coordinate: [113.1513, 35.5907], appOrg: "1E001", x: "0", y: "2" },
+        { name: "朔州市", coordinate: [112.4329, 39.5312], appOrg: "1F001", x: "0", y: "2" },
+        { name: "晋中市", coordinate: [113.2527, 37.3870], appOrg: "1K001", x: "0", y: "2" },
+        { name: "临汾市", coordinate: [111.5186, 35.8582], appOrg: "1L001", x: "0", y: "2" },
+        { name: "忻州市", coordinate: [112.7341, 38.6167], appOrg: "1H001", x: "0", y: "2" },
+        { name: "运城市", coordinate: [110.9069, 34.9264], appOrg: "1M001", x: "0", y: "2" },
+        { name: "吕梁市", coordinate: [111.1443, 37.4183], appOrg: "1J001", x: "0", y: "2" }
       ]
     }
   },
@@ -73,10 +73,12 @@ export default {
   methods: {
     start(){
       this.$nextTick(() => {
-        let i = 0
-        for (let it of this.points){
-          it.x = this.mapData[i]
-          i++
+        if (this.mapData.length > 0){
+          let i = 0
+          for (let it of this.points){
+            it.x = this.mapData[i]
+            i++
+          }
         }
         imgElement = document.getElementById("mapBackground");
         setTimeout(() => {

+ 6 - 49
src/views/screen/official/carCost.vue

@@ -15,11 +15,11 @@
             <div class="flex-column" style="width: 20%">配置日期</div>
           </div>
           <div class="flex-row" v-for="(item,index) in dataList" :key="index" @click="choose()">
-            <div class="flex-column" style="width: 30%">{{item.a}}</div>
-            <div class="flex-column" style="width: 20%">{{item.b}}</div>
-            <div class="flex-column" style="width: 20%">{{item.c}}</div>
-            <div class="flex-column" style="width: 30%">{{item.d}}</div>
-            <div class="flex-column" style="width: 20%">{{item.e}}</div>
+            <div class="flex-column" style="width: 30%">{{item.appName}}</div>
+            <div class="flex-column" style="width: 20%">{{item.vehicleNum}}</div>
+            <div class="flex-column" style="width: 20%">{{item.useProperty}}</div>
+            <div class="flex-column" style="width: 30%">{{item.assetsCard}}</div>
+            <div class="flex-column" style="width: 20%">{{item.orgDate}}</div>
           </div>
         </div>
       </div>
@@ -34,6 +34,7 @@ import pinyin from "../data/pinyin.js";
 export default {
   name: "CarCost",
   props: {
+    dataList: Array,
     week: {
       type: String,
       default: "",
@@ -45,50 +46,6 @@ export default {
   },
   data() {
     return {
-      dataList: [
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "354393827402910740183",
-          e: "20224-12-15",
-        },
-        ],
     };
   },
   mounted() {},

+ 7 - 49
src/views/screen/official/carHealth.vue

@@ -15,11 +15,11 @@
             <div class="flex-column" style="width: 20%">处置日期</div>
           </div>
           <div class="flex-row" v-for="(item,index) in dataList" :key="index" @click="choose()">
-            <div class="flex-column" style="width: 30%">{{item.a}}</div>
-            <div class="flex-column" style="width: 20%">{{item.b}}</div>
-            <div class="flex-column" style="width: 20%">{{item.c}}</div>
-            <div class="flex-column" style="width: 30%">{{item.d}}</div>
-            <div class="flex-column" style="width: 20%">{{item.e}}</div>
+            <div class="flex-column" style="width: 30%">{{item.appName}}</div>
+            <div class="flex-column" style="width: 20%">{{item.vehicleNum}}</div>
+            <div class="flex-column" style="width: 20%">{{item.useProperty}}</div>
+            <div class="flex-column" style="width: 30%">{{item.handleReason}}</div>
+            <div class="flex-column" style="width: 20%">{{item.handleDate}}</div>
           </div>
         </div>
       </div>
@@ -34,6 +34,7 @@ import pinyin from "../data/pinyin.js";
 export default {
   name: "CarCost",
   props: {
+    dataList: Array,
     week: {
       type: String,
       default: "",
@@ -45,50 +46,7 @@ export default {
   },
   data() {
     return {
-      dataList: [
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "使用年数过久",
-          e: "2022-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "发生车祸",
-          e: "2022-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "未通过安全检查",
-          e: "2022-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "不清楚",
-          e: "20224-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "重要零件损坏",
-          e: "2022-12-15",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋C36727",
-          c: "生产服务用车",
-          d: "醉酒驾车",
-          e: "2022-12-15",
-        },
-      ],
+
     };
   },
   mounted() {},

+ 7 - 7
src/views/screen/official/carWarning.vue

@@ -105,7 +105,7 @@
         <div class="dataBody" ref="scrollContainer" style="padding-bottom: 140px">
           <div class="flex-row" style="margin-bottom: 10px" v-for="(item,index) in manageLastHalf.list" :key="index" @click="choose()">
             <div class="flex-column" style="width: 50%">{{item.orgName}}</div>
-            <div class="flex-column">{{item.vechileNum}}</div>
+            <div class="flex-column">{{item.vehicleNum}}</div>
             <div class="flex-column">{{item.pcdCount}}</div>
           </div>
         </div>
@@ -206,7 +206,7 @@ export default {
             }
           },
           barWidth: 10,
-          data: this.manageLastHalf.x1,
+          data: this.manageLastHalf.x2,
         },
         {
           name: "派车单数",
@@ -231,12 +231,12 @@ export default {
             }
           },
           barWidth: 10,
-          data: this.manageLastHalf.y1,
+          data: this.manageLastHalf.y2,
         },
       ],
       barAxisTop:{
         type: "category",
-        data: this.manageLastHalf.z1,
+        data: this.manageLastHalf.z2,
         axisLabel: {
           color: "white",
           fontSize: 12,
@@ -272,7 +272,7 @@ export default {
             }
           },
           barWidth: 10,
-          data: this.manageLastHalf.x2,
+          data: this.manageLastHalf.x1,
         },
         {
           name: "派车单数",
@@ -297,12 +297,12 @@ export default {
             }
           },
           barWidth: 10,
-          data: this.manageLastHalf.y2,
+          data: this.manageLastHalf.y1,
         },
       ],
       barAxisLast:{
         type: "category",
-        data: this.manageLastHalf.z2,
+        data: this.manageLastHalf.z1,
         axisLabel: {
           color: "white",
           fontSize: 12,

+ 32 - 13
src/views/screen/official/main.vue

@@ -4,7 +4,6 @@
       <div class="left-cont" v-if="leftShow">
         <div
           class="left-top"
-          @click="showDialog(1)"
           @mouseover="showDialog(1)"
         >
           <div class="cont-title-area">
@@ -20,7 +19,6 @@
           </div>
         </div>
         <div class="left-bottom"
-             @click="showDialog(2)"
              @mouseover="showDialog(2)"
         >
           <div class="cont-title-area">
@@ -154,9 +152,9 @@
       <car-stock-dialog
         v-if="dialogType === 2"
         :monitorData="monitorData"
-        @chooseX="chooseOp('未带工单预警数')"
-        @chooseY="chooseOp('超速预警数')"
-        @chooseZ="chooseOp('节假日预警数')"
+        @chooseX="chooseOp('未带工单预警数', '未带工单报警')"
+        @chooseY="chooseOp('超速预警数', '超速报警')"
+        @chooseZ="chooseOp('节假日预警数', '节假日用车报警')"
         @closeDialog="closeDialog"
       ></car-stock-dialog>
     </div>
@@ -166,13 +164,16 @@
         <resource-list
           v-if="showRes === 1"
           :op = "op"
+          :dataList = "dataList"
           @close="onCloseRes"
         ></resource-list>
         <car-cost
+          :dataList = "dataList"
           v-if="showCost === 1"
           @close="onCloseCost"
         ></car-cost>
         <car-health
+          :dataList = "dataList"
           v-if="showHealth === 1"
           @close="onCloseHealth"
         ></car-health>
@@ -197,11 +198,12 @@ import CarHealth from '@/views/screen/official/carHealth.vue'
 import CarStockDialog from "@/views/screen/logistics/car/carStockDialog.vue";
 import MapTwo from '@/views/screen/map/mapTwo.vue'
 import {
+  getCarDetail,
   getMonitor,
   getOperationManageLastHalf,
   getOperationManageTopHalf,
   getResource,
-  getSelfCarNum
+  getSelfCarNum, getWarnDetail
 } from '@/api/screen/service'
 
 
@@ -230,6 +232,7 @@ export default {
   // },
   data() {
     return {
+      dataList: [],
       mapData:[],
       flag: 0,
       carActivationNum:[],
@@ -367,11 +370,16 @@ export default {
     },
 
 
-    chooseOp(title){
+    chooseOp(title, alertType){
       this.op = title
       this.closeDialog()
-      this.showC = true
-      this.showRes = 1
+      getWarnDetail(this.appOrg, alertType).then(res => {
+        if (Number(res.code) === 200) {
+          this.dataList = res.data
+          this.showC = true
+          this.showRes = 1
+        }
+      })
     },
 
     chooseRes(){
@@ -386,8 +394,13 @@ export default {
 
     chooseCost(){
       this.closeDialog()
-      this.showC = true
-      this.showCost = 1
+      getCarDetail(this.appOrg, 0).then(res => {
+        if (Number(res.code) === 200) {
+          this.dataList = res.data
+          this.showC = true
+          this.showCost = 1
+        }
+      })
     },
     onCloseCost(){
       this.showC = false
@@ -396,8 +409,13 @@ export default {
 
     chooseHealth(){
       this.closeDialog()
-      this.showC = true
-      this.showHealth = 1
+      getCarDetail(this.appOrg, 1).then(res => {
+        if (Number(res.code) === 200) {
+          this.dataList = res.data
+          this.showC = true
+          this.showHealth = 1
+        }
+      })
     },
     onCloseHealth(){
       this.showC = false
@@ -405,6 +423,7 @@ export default {
     },
 
     showDialog(type) {
+      console.log("触发了:" + type)
       if (type < 4) {
         this.leftShow = false;
         this.rightShow = true;

+ 7 - 49
src/views/screen/official/resourceList.vue

@@ -16,11 +16,11 @@
             <div class="flex-column" style="width: 20%">警终止时间</div>
           </div>
           <div class="flex-row" v-for="(item,index) in dataList" :key="index" @click="choose()">
-            <div class="flex-column" style="width: 30%">{{item.a}}</div>
-            <div class="flex-column" style="width: 15%">{{item.b}}</div>
-            <div class="flex-column" style="width: 15%">{{item.c}}</div>
-            <div class="flex-column" style="width: 20%">{{item.d}}</div>
-            <div class="flex-column" style="width: 20%">{{item.e}}</div>
+            <div class="flex-column" style="width: 30%">{{item.appName}}</div>
+            <div class="flex-column" style="width: 15%">{{item.vehicleNum}}</div>
+            <div class="flex-column" style="width: 15%">{{item.alertType}}</div>
+            <div class="flex-column" style="width: 20%">{{item.startTime}}</div>
+            <div class="flex-column" style="width: 20%">{{item.endTime}}</div>
           </div>
         </div>
       </div>
@@ -35,6 +35,7 @@ import pinyin from "../data/pinyin.js";
 export default {
   name: "CarCost",
   props: {
+    dataList: Array,
     op: {
       type: String,
       required: true,
@@ -43,50 +44,7 @@ export default {
   },
   data() {
     return {
-      dataList: [
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-        {
-          a: "国网电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-        {
-          a: "国网山西省晋源区电力公司",
-          b: "晋K3P058",
-          c: "类型一",
-          d: "2025-01-10 16:08",
-          e: "2025-02-10 16:08",
-        },
-      ],
+
     };
   },
   mounted() {},

+ 3 - 2
src/views/screen/official/terminalDataDialog.vue

@@ -84,7 +84,8 @@
               <div style="position: relative">
                 <img src="../../../assets/zhang/publicCar/arcBlueEx.png" width="90" style="margin: 20px 5px 0 33px">
                 <div style="position: absolute;color: #00FFFF;width: 158px;top: 5px;font-size: 34px;font-family: 'electronicFont';text-align: center">
-                  {{ resourceData.percentageLack }}<span style="font-size: 12px">%</span></div>
+                  {{ Number.isNaN(resourceData.percentageLack) ? 0 : resourceData.percentageLack }}<span style="font-size: 12px">%</span>
+                </div>
               </div>
 
             </div>
@@ -97,7 +98,7 @@
             <div style="display: flex;align-items: center">
               <div style="position: relative">
                 <img src="../../../assets/zhang/publicCar/arcBlueEx.png" width="90" style="margin: 20px 5px 0 33px">
-                <div style="position: absolute;color: #00FFFF;width: 158px;top: 5px;font-size: 34px;font-family: 'electronicFont';text-align: center">{{ resourceData.percentagePosess }}<span style="font-size: 12px">%</span></div>
+                <div style="position: absolute;color: #00FFFF;width: 158px;top: 5px;font-size: 34px;font-family: 'electronicFont';text-align: center">{{ Number.isNaN(resourceData.percentagePosess) ? 0 : resourceData.percentagePosess }}<span style="font-size: 12px">%</span></div>
               </div>
             </div>
           </div>

+ 67 - 2
src/views/zcustom/carDetail/index.vue

@@ -43,6 +43,14 @@
           v-hasPermi="['zcustom:platPublicCarChangeDetail:remove']"
         >删除</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleUpload"
+        >导入</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -141,16 +149,40 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="导入json" :visible.sync="op" :close-on-click-modal="false" width="600px" append-to-body>
+      <el-form ref="form" :rules="rules" label-width="80px">
+        <el-form-item label="类型">
+          <el-select v-model="value" placeholder="请选择类型">
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="json数据">
+          <el-input v-model="json" type="textarea" placeholder="请输入json数据" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="sure">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listPlatPublicCarChangeDetail, getPlatPublicCarChangeDetail, delPlatPublicCarChangeDetail, addPlatPublicCarChangeDetail, updatePlatPublicCarChangeDetail } from "@/api/zcustom/carDetail";
+import { uploadJson, listPlatPublicCarChangeDetail, getPlatPublicCarChangeDetail, delPlatPublicCarChangeDetail, addPlatPublicCarChangeDetail, updatePlatPublicCarChangeDetail } from "@/api/zcustom/carDetail";
 
 export default {
   name: "PlatPublicCarChangeDetail",
   data() {
     return {
+      json: undefined,
+      op:false,
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
       // 遮罩层
@@ -188,6 +220,15 @@ export default {
       },
       // 表单参数
       form: {},
+      value: null,
+      options:[
+        {
+          value: 0,
+          label: "增加"
+        }, {
+          value: 1,
+          label: "减少"
+        }],
       // 表单校验
       rules: {
         id: [
@@ -227,7 +268,24 @@ export default {
     this.getList();
   },
   methods: {
-
+    sure(){
+      if (this.value === null){
+        this.$message.error('请选择类型')
+        this.json = null
+        return
+      }
+      const jsonString = JSON.parse(this.json)
+      uploadJson(jsonString, this.value).then(res => {
+        if (res.code === 200){
+          this.$message.success('导入成功')
+        }
+        else {
+          this.$message.error('导入失败')
+        }
+        this.json = null
+        this.value = null
+      })
+    },
     /** 查询公务用车年度增加减少列表 */
     getList() {
       this.loading = true;
@@ -240,6 +298,9 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
+      this.json = undefined
+      this.value = null
+      this.op = false;
       this.reset();
     },
     // 表单重置
@@ -319,6 +380,10 @@ export default {
         this.getList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
+    },
+    /** 导入操作 */
+    handleUpload(){
+      this.op = true
     }
   }
 };

+ 9 - 8
src/views/zcustom/carRank/index.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
-      <el-form-item label="车牌号" prop="vechileNum">
+      <el-form-item label="车牌号" prop="vehicleNum">
         <el-input
-          v-model="queryParams.vechileNum"
+          v-model="queryParams.vehicleNum"
           placeholder="请输入车牌号"
           clearable
           @keyup.enter.native="handleQuery"
@@ -62,7 +62,7 @@
         </template>
       </el-table-column>
       <el-table-column label="派车单总数" align="center" prop="pcdCount" />
-      <el-table-column label="车牌号" align="center" prop="vechileNum" />
+      <el-table-column label="车牌号" align="center" prop="vehicleNum" />
       <el-table-column label="单位编码" align="center" prop="appEncode" />
       <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -98,8 +98,8 @@
         <el-form-item label="派车单总数" prop="pcdCount">
           <el-input v-model="form.pcdCount" placeholder="请输入派车单总数" />
         </el-form-item>
-        <el-form-item label="车牌号" prop="vechileNum">
-          <el-input v-model="form.vechileNum" placeholder="请输入车牌号" />
+        <el-form-item label="车牌号" prop="vehicleNum">
+          <el-input v-model="form.vehicleNum" placeholder="请输入车牌号" />
         </el-form-item>
         <el-form-item label="具体单位">
           <el-cascader :options="treeList" placeholder="请选择单位" v-model="form.appEncode" :props="props" style="width: 400px">
@@ -173,7 +173,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         pcdCount: null,
-        vechileNum: null,
+        vehicleNum: null,
         appEncode: null
       },
       // 表单参数
@@ -189,7 +189,7 @@ export default {
         pcdCount: [
           { required: true, message: "派车单总数不能为空", trigger: "blur" }
         ],
-        vechileNum: [
+        vehicleNum: [
           { required: true, message: "车牌号不能为空", trigger: "blur" }
         ],
         appEncode: [
@@ -212,6 +212,7 @@ export default {
         else {
           this.$message.error('导入失败')
         }
+        this.json = null
       })
     },
     getListTree(){
@@ -241,7 +242,7 @@ export default {
         id: null,
         delFlag: null,
         pcdCount: null,
-        vechileNum: null,
+        vehicleNum: null,
         appEncode: null
       };
       this.resetForm("form");

+ 4 - 1
src/views/zcustom/public/index.vue

@@ -433,7 +433,6 @@ export default {
     },
     sure(){
       const jsonString = JSON.parse(this.json)
-      console.log(jsonString)
       uploadJson(this.value, jsonString).then(res => {
         if (res.code === 200){
           this.$message.success('新增成功')
@@ -441,6 +440,8 @@ export default {
         else {
           this.$message.error('新增失败')
         }
+        this.json = null
+        this.value = null
       })
     },
 
@@ -457,6 +458,8 @@ export default {
     cancel() {
       this.open = false;
       this.op = false;
+      this.json = null
+      this.value = null
       this.reset();
     },
     // 表单重置

+ 63 - 5
src/views/zcustom/warnDetail/index.vue

@@ -43,6 +43,14 @@
           v-hasPermi="['zcustom:platPublicCarWarnDetail:remove']"
         >删除</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleUpload"
+        >导入</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -125,25 +133,50 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="导入json" :visible.sync="op" :close-on-click-modal="false" width="600px" append-to-body>
+      <el-form ref="form" :rules="rules" label-width="80px">
+        <el-form-item label="类型">
+          <el-select v-model="value" placeholder="请选择类型">
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.label">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="json数据">
+          <el-input v-model="json" type="textarea" placeholder="请输入json数据" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="sure">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listPlatPublicCarWarnDetail, getPlatPublicCarWarnDetail, delPlatPublicCarWarnDetail, addPlatPublicCarWarnDetail, updatePlatPublicCarWarnDetail } from "@/api/zcustom/warnDetail";
+import { uploadJson, listPlatPublicCarWarnDetail, getPlatPublicCarWarnDetail, delPlatPublicCarWarnDetail, addPlatPublicCarWarnDetail, updatePlatPublicCarWarnDetail } from "@/api/zcustom/warnDetail";
 
 export default {
   name: "PlatPublicCarWarnDetail",
   data() {
     return {
+      json: undefined,
+      op:false,
+      value: null,
       options: [{
         value: 1,
-        label: '未带工单'
+        label: '未带工单报警'
       }, {
         value: 2,
-        label: '超速'
+        label: '超速报警'
       }, {
         value: 3,
-        label: '节假日'
+        label: '节假日用车报警'
       }],
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
@@ -208,11 +241,29 @@ export default {
     this.getList();
   },
   methods: {
+    sure(){
+      if (this.value === null){
+        this.$message.error('请选择类型')
+        this.json = null
+        return
+      }
+      const jsonString = JSON.parse(this.json)
+      uploadJson(jsonString, this.value).then(res => {
+        if (res.code === 200){
+          this.$message.success('导入成功')
+        }
+        else {
+          this.$message.error('导入失败')
+        }
+        this.json = null
+        this.value = null
+      })
+    },
     /** 查询公务用车预警明细列表 */
     getList() {
       this.loading = true;
       listPlatPublicCarWarnDetail(this.queryParams).then(response => {
-        this.platPublicCarWarnDetailList =  response.data.records;
+        this.platPublicCarWarnDetailList = response.data.records;
         this.total = response.data.total;
         this.loading = false;
       });
@@ -220,6 +271,9 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
+      this.json = undefined
+      this.value = null
+      this.op = false;
       this.reset();
     },
     // 表单重置
@@ -296,6 +350,10 @@ export default {
         this.getList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
+    },
+    /** 导入操作 */
+    handleUpload(){
+      this.op = true
     }
   }
 };