Przeglądaj źródła

提交费用修改

bug 4 lat temu
rodzic
commit
608b540b38

+ 15 - 0
src/api/fleet/ftmsorderbillscarstwo.js

@@ -9,7 +9,22 @@ import request from '@/utils/request'
 //   })
 // }
 
+//刪除內容
+export function deleteList(id) {
+  return request({
+    url: '/fleet/ftmsorderbillsfees/modify/' + id,
+    method: 'delete'
+  })
+}
 
+//保存
+export function addStowageTwo(data) {
+  return request({
+    url: '/fleet/ftmsorderbillsfees/addModifyList',
+    method: 'post',
+    data: data
+  })
+}
 // 原始// 提交配车列表
 // export function addStowage(data) {
 //   return request({

+ 56 - 16
src/views/track/costModification/AddOrUpdate.vue

@@ -333,8 +333,8 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            :disabled="scope.row.actId != 1090 || disabled"
-            @click.native.prevent="deleteRow(scope.$index)"
+            :disabled="disabled"
+            @click.native.prevent="change(scope)"
         >变更</el-button>
     </template>
     </el-table-column>
@@ -352,7 +352,7 @@
             type="primary"
             icon="el-icon-plus"
             size="mini"
-            @click="addRelevt"
+            @click="addRelevtTwo"
             :disabled="form.orderStatus < 80"
         >保存</el-button>
       <el-button
@@ -365,7 +365,7 @@
   </div>
 </div>
 </div>
-<el-table :data="feesList" style="width: 100%">
+<el-table :data="formfeesList" style="width: 100%">
 <el-table-column
     prop="fCorpid"
     label="结算单位"
@@ -550,17 +550,23 @@
     align="center"
     class-name="small-padding fixed-width"
     fixed="right"
-    width="100px"
+    width="140px"
 >
   <template slot-scope="scope">
     <el-button
         size="mini"
         type="text"
         icon="el-icon-delete"
-        :disabled="scope.row.actId != 1090 || disabled"
-        @click.native.prevent="deleteRow(scope.$index)"
-    >删除</el-button
-    >
+        :disabled="form.orderStatus < 80"
+        @click.native.prevent="deleteRow(scope,scope.$index)"
+    >删除</el-button>
+    <el-button
+      size="mini"
+      type="text"
+      icon="el-icon-delete"
+      :disabled="form.orderStatus < 80"
+      @click.native.prevent="deleteRow(scope,scope.$index)"
+    >请核</el-button>
 </template>
 </el-table-column>
 </el-table>
@@ -614,14 +620,14 @@
           type="success"
           @click="submitAllowChanges"
           v-hasPermi="['fleet:vehicleStatus:edit']"
-          :disabled="form.orderStatus !== 80"
+          :disabled="form.orderStatus <= 80"
       >修 改</el-button
       >
       <el-button
           type="info"
-          @click="submitSave"
+          @click="addRelevtTwo"
           v-hasPermi="['fleet:vehicleStatus:edit']"
-          :disabled="form.billStatus == 7"
+          :disabled="form.orderStatus <= 80"
       >保 存</el-button
       >
       <!-- <el-button type="warning" @click="submitRetreat">撤 回</el-button> -->
@@ -635,7 +641,8 @@ import {
   removeFtmsorderbillscars,
   driverSaveFtmsorderbillscars,
   insertDriverFtmsorderbillscars,
-} from "@/api/fleet/ftmsorderbillscars";
+  deleteList
+} from "@/api/fleet/ftmsorderbillscarstwo";
 import {getBasicInformation} from "@/api/kaihe/basicdata/container";
 import {listGoods} from "@/api/basicdata/goods";
 import {listCorps} from "@/api/basicdata/corps";
@@ -650,6 +657,7 @@ import {
 } from "@/api/track/singleCost";
 import Cookies from "js-cookie";
 import {getToken} from "@/utils/auth";
+import {addStowageTwo} from "../../../api/fleet/ftmsorderbillscarstwo";
 
 export default {
   name: "plans",
@@ -681,6 +689,10 @@ export default {
       type: Array,
       default: () => [],
     },
+    formfeesList: {
+      type: Array,
+      default: () => [],
+    },
     allfMblnoOptions: {
       type: Array,
       default: [],
@@ -772,6 +784,18 @@ export default {
     this.username = Cookies.get("userName");
   },
   methods: {
+    //变更按钮
+    change(scope){
+      console.log(scope)
+      for (let item in this.formfeesList){
+        if (scope.row.fId === this.formfeesList[item].fId) return this.$message({
+          showClose: true,
+          message: '已有相同单据',
+          type: 'error'
+        });
+      }
+      this.formfeesList.push(scope.row)
+    },
     // 新增附件上传
     addRelevt4() {
       this.chiFeesList.push({
@@ -840,9 +864,12 @@ export default {
       };
       tableData.push(obj);
     },
-    //删除行
-    deleteRow(index, rows) {
-      rows.splice(index, 1);
+    //內容删除
+    deleteRow(rows,index) {
+      deleteList(rows.row.fId).then(res =>{
+        console.log(res);
+        this.formfeesList.splice(index, 1);
+      })
     },
     // 上传成功返回数据
     showFile(row) {
@@ -851,6 +878,19 @@ export default {
         this.$set(this.relevantAttachments[list], "attachName", row.fileName);
       }
     },
+    addRelevtTwo(){
+      let formData = new window.FormData();
+      formData.append("status", "6");
+      formData.append("cars", JSON.stringify(this.form));
+      formData.append("ftmsorderbillsfees", JSON.stringify(this.formfeesList));
+      addStowageTwo(formData).then((response) => {
+        if (response.code == 200) {
+          this.msgSuccess("保存成功");
+          this.$parent.getList();
+          // this.$parent.getSave(response);
+        }
+      });
+    },
     addRelevt2() {
       let arr = this.chiFeesList;
       arr.filter((e) => e.actId == "1080");

+ 5 - 2
src/views/track/costModification/index.vue

@@ -497,6 +497,7 @@
         :relevantAttachments="relevantAttachments"
         :disabled="disabled"
         :feesList="feesList"
+        :formfeesList="formfeesList"
         :allfMblnoOptions="allfMblnoOptions"
         :carsTable="carsTable"
         @changeShow="showAddOrUpdate"
@@ -560,6 +561,7 @@ export default {
         ],
       },
       feesList: [],
+      formfeesList:[],
       // 控制新增编辑弹窗的显示与隐藏
       addOrUpdateVisible: false,
       // 非单个禁用
@@ -1142,7 +1144,7 @@ export default {
         if (response.data.cars.billType) {
           response.data.cars.billType = response.data.cars.billType.toString();
         }
-        response.data.feesList.map((e) => {
+        response.data.feesListAudited.map((e) => {
           if (e.fFeeunitid) {
             e.fFeeunitid = e.fFeeunitid.toString();
           }
@@ -1150,7 +1152,8 @@ export default {
         this.title = "查看详情页";
         this.form = response.data.cars;
         // this.relevantAttachments = response.data.attachs;
-        this.feesList = response.data.feesList;
+        this.feesList = response.data.feesListAudited;
+        this.formfeesList = response.data.feesListModify;
         this.addOrUpdateVisible = !this.addOrUpdateVisible;
         this.carsTable = response.data.carsTable;
       });