소스 검색

大件删除车辆

wangzhuo 1 년 전
부모
커밋
044bdad2aa
2개의 변경된 파일55개의 추가작업 그리고 3개의 파일을 삭제
  1. 29 2
      src/views/SpecialTrade/placeAnOrder/detailPage.vue
  2. 26 1
      src/views/landTransportation/placeAnOrder/detailPage.vue

+ 29 - 2
src/views/SpecialTrade/placeAnOrder/detailPage.vue

@@ -462,6 +462,9 @@
                 <span class="el-button--text" style="cursor: pointer"
                       @click="openTrack(row)">{{ row.plateNo }}</span>
         </template>
+        <template slot-scope="scope" slot="menu">
+          <el-link type="primary" :disabled="vehicleDelete" style="font-size: 1px" @click="vehicleClick(scope.row)">删 除</el-link>
+        </template>
       </avue-crud>
     </trade-card>
     <trade-card title="杂费明细">
@@ -640,6 +643,8 @@ import {contrastList, contrastObj} from "@/util/contrastData";
 
 import { getAdminProfilesById } from "@/api/specialTrade/placeAnOrder/detailPage";
 
+import { getUserInfo } from "@/api/system/user"
+
 export default {
   comments: {
     trackPlayback
@@ -671,6 +676,8 @@ export default {
       KeyBox: 0,
       KeyBoxTwo: 0,
       typeTwo: false,
+      // 车辆信息删除权限
+      vehicleDelete: true,
       type: false,
       enclosure: false,
       orderList: [],
@@ -696,7 +703,7 @@ export default {
         align: 'center',
         menuAlign: 'center',
         refreshBtn: false,
-        menu: false,
+        menu: true,
         index: true,
         stripe: true,
         cellBtn: false,
@@ -1823,6 +1830,13 @@ export default {
       //   // console.log(this.lineArr[this.lineArr.length - 1])
       // })
     },
+    vehicleClick(row) {
+      console.log(row)
+      if (row.plateNo == null || row.plateNo == '') {
+        console.log(row)
+        this.vehicleList.splice(row.$index, 1);
+      }
+    },
     getCropId(row) {
       if (row) {
         this.goodsForm.corpId = row.id
@@ -2260,6 +2274,18 @@ export default {
       this.goodsOptionForm.disabled = false
       this.goodsOptionFormTwo.disabled = false
       this.typeTwo = true
+
+      getUserInfo().then(res => {
+        var user = res.data.data;
+        let postName = user.account;
+        console.log(user)
+        let postNameList = postName.split(",");
+        for (const iterator of postNameList) {
+          if (iterator == 'admin') {
+            this.vehicleDelete = false
+          }
+        }
+      })
       // }else {
       //   this.$message.error('不允许变更')
       // }
@@ -2305,10 +2331,11 @@ export default {
                 orderAddressList: data,
                 fileList: this.orderFilesList,
                 itemList: this.entrustList,
-                orderItemList: [],
+                orderItemList: this.vehicleList,
                 orderFeeList: this.collectionList.concat(this.paymentList)
               }).then(res => {
                 this.$message.success('保存成功');
+                this.vehicleDelete = true
                 this.typeTwo = false
                 this.refreshData()
               })

+ 26 - 1
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -452,6 +452,9 @@
                 <span class="el-button--text" style="cursor: pointer"
                       @click="openTrack(row)">{{ row.plateNo }}</span>
         </template>
+        <template slot-scope="scope" slot="menu">
+          <el-link type="primary" :disabled="vehicleDelete" style="font-size: 1px" @click="vehicleClick(scope.row)">删 除</el-link>
+        </template>
       </avue-crud>
     </trade-card>
     <trade-card title="杂费明细">
@@ -629,6 +632,8 @@ import {gaude, location} from "@/api/gaude";
 import trackPlayback from "@/components/trackPlayback"
 import {contrastList, contrastObj} from "@/util/contrastData";
 
+import { getUserInfo } from "@/api/system/user"
+
 export default {
   comments: {
     trackPlayback
@@ -659,6 +664,8 @@ export default {
       KeyBoxTwo: 0,
       typeTwo: false,
       type: false,
+      // 车辆信息删除权限
+      vehicleDelete: true,
       enclosure: false,
       orderList: [],
       goodsForm: {},
@@ -1750,6 +1757,11 @@ export default {
       //   // console.log(this.lineArr[this.lineArr.length - 1])
       // })
     },
+    vehicleClick(row) {
+      if (row.plateNo == null || row.plateNo == '') {
+        this.vehicleList.splice(row.$index, 1);
+      }
+    },
     getCropId(row) {
       if (row) {
         this.goodsForm.corpId = row.id
@@ -2151,6 +2163,18 @@ export default {
       this.goodsOptionForm.disabled = false
       this.goodsOptionFormTwo.disabled = false
       this.typeTwo = true
+
+      getUserInfo().then(res => {
+        var user = res.data.data;
+        let postName = user.account;
+        console.log(user)
+        let postNameList = postName.split(",");
+        for (const iterator of postNameList) {
+          if (iterator == 'admin') {
+            this.vehicleDelete = false
+          }
+        }
+      })
       // }else {
       //   this.$message.error('不允许变更')
       // }
@@ -2193,10 +2217,11 @@ export default {
                 orderAddressList: data,
                 fileList: this.orderFilesList,
                 itemList: this.entrustList,
-                orderItemList: [],
+                orderItemList: this.vehicleList,
                 orderFeeList: this.collectionList.concat(this.paymentList)
               }).then(res => {
                 this.$message.success('保存成功');
+                this.vehicleDelete = true
                 this.typeTwo = false
                 this.refreshData()
               })