Bläddra i källkod

Merge branch 'master' of git.echepei.com:zhujiawei/Warehouse_management_ui

caojunjie 4 år sedan
förälder
incheckning
2d090d5464

+ 6 - 1
src/api/finance/applyForInvoice/invoiceInformation.js

@@ -7,4 +7,9 @@ export function listCorps(query) {
     params: query
   })
 }
-
+export function listDelete(fId) {
+  return request({
+    url: '/financial/invoiceApplyFor/queryRemove/'+ fId,
+    method: 'delete'
+  })
+}

+ 18 - 0
src/api/fleet/ftmsorderbillscars.js

@@ -9,6 +9,24 @@ import request from '@/utils/request'
 //   })
 // }
 
+
+// 提交配车列表
+export function addStowage(data) {
+  return request({
+    url: '/fleet/ftmsorderbillscars/addStowage',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 撤销配车
+export function revokeStowage(id) {
+  return request({
+    url: '/fleet/ftmsorderbillscars/revokeStowage/'+ id,
+    method: 'get',
+  })
+}
 // 查询可配车列表
 export function selectStowage(query) {
   return request({

+ 7 - 3
src/views/finance/applyForInvoice/feeDetail/index.vue

@@ -260,7 +260,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            @click.native.prevent="deleteRow(scope.$index, invoiceList)"
+            @click.native.prevent="deleteRow(scope.$index, feeList)"
           >删除
           </el-button>
         </template>
@@ -328,7 +328,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            @click.native.prevent="deleteRow(scope.$index, invoiceList)"
+            @click.native.prevent="deleteRoww(scope.$index, invoiceList)"
           >删除
           </el-button>
         </template>
@@ -783,7 +783,8 @@ export default {
         fSrcid:fSrcid,
         fSrcpid:fSrcpid,
         fCorpid:this.queryParams.fCorpidName,
-        billsType:this.queryParams.fBilltype
+        billsType:this.queryParams.fBilltype,
+        fId:this.queryParams.fId
       }
       this.$router.push({
         path:'/finance/generalLedger',
@@ -996,6 +997,9 @@ export default {
     deleteRow(index, rows) {
       rows.splice(index, 1);
     },
+    deleteRoww(index, rows) {
+      rows.splice(index, 1);
+    },
 
   }
 }

+ 13 - 50
src/views/finance/applyForInvoice/invoiceInformation/index.vue

@@ -316,7 +316,7 @@
 </template>
 
 <script>
-import { listCorps } from "@/api/finance/applyForInvoice/invoiceInformation";
+import { listCorps,listDelete } from "@/api/finance/applyForInvoice/invoiceInformation";
 import { listFees } from "@/api/basicdata/fees";
 import AddOrUpdate from "@/views/viewApproval";
 import ApprovalComments from "@/views/startApproval";
@@ -528,7 +528,7 @@ export default {
     this.getRow();
   },
   activated() {
-
+    this.getList();
   },
   methods: {
 
@@ -766,55 +766,18 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const fIds = row.fId || this.ids;
-      let tips = "";
-      if (Cookies.get("sysType") == 1) {
-        //大木
-        delCharge_s(fIds).then((data) => {
-          switch (data.msg) {
-            case "0": {
-              this.$message.error("当前数据已被其他操作员操作请刷新页面");
-              break;
-            }
-            case "1": {
-              tips = "当前主表有数据从表无数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            case "2": {
-              tips = "当前主表有数据从表有数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            default: {
-              return this.$message.error("未知错误,无状态");
-            }
-          }
-        });
-      } else if (Cookies.get("sysType") == 2) {
-        // 车队;
-        delCharge_ss(fIds).then((data) => {
-          switch (data.msg) {
-            case "0": {
-              this.$message.error("当前数据已被其他操作员操作请刷新页面");
-              break;
-            }
-            case "1": {
-              tips = "当前主表有数据从表无数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            case "2": {
-              tips = "当前主表有数据从表有数据是否删除";
-              this.delete_S(fIds, tips);
-              break;
-            }
-            default: {
-              return this.$message.error("未知错误,无状态");
-            }
-          }
+      this.$confirm( '是否删除此条数据',"警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+      .then(function(){
+        return listDelete(row.fId);
+      })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
         });
-      }
     },
     delete_S(fIds, tips) {
       this.$confirm(tips, "警告", {

+ 105 - 44
src/views/finance/generalLedger/index.vue

@@ -471,6 +471,8 @@ import Vue from "vue";
 import Cookies from "js-cookie";
 import { addSet, select } from "@/api/system/set";
 import { getVesselName, listChange } from '@/api/finance/applyForInvoice/feeDetail'
+import { MessageBox } from 'element-ui'
+import store from '@/store'
 Vue.directive("dialogDrag", {
   bind(el, binding, vnode, oldVnode) {
     const dialogHeaderEl = el.querySelector(".el-dialog__header");
@@ -787,30 +789,35 @@ export default {
     // this.getRow();
   },
   activated() {
-    this.doNot = true
-    listCorps().then((response) => {
-      this.fMblnoOptions = response;
-      let data = JSON.parse(this.$route.query.data)
-      this.queryParams.fCorpid = data.fCorpid
-      this.queryParams.fSrcidList = data.fSrcid
-      this.queryParams.fSrcpidList = data.fSrcpid
-      this.queryParams.billsType = data.billsType
-      let list = this.queryParams
-      console.log(this.fMblnoOptions)
-      for (let item in this.fMblnoOptions){
-        console.log(data.fCorpid)
-        if (data.fCorpid == this.fMblnoOptions[item].fName){
-          list.fCorpid = this.fMblnoOptions[item].fId
-          console.log('1111')
-          getcontrastList(list).then(response=>{
-            console.log(response)
-            if(response.rows){
-              this.chargeList = response.rows
-            }
-          })
+    if(this.$route.query.data){
+      listCorps().then((response) => {
+        this.fMblnoOptions = response;
+        let data = JSON.parse(this.$route.query.data)
+        let queryParams = {}
+        this.queryParams.fCorpid = data.fCorpid
+        queryParams.fCorpid = data.fCorpid
+        queryParams.fCorpid = data.fCorpid
+        queryParams.fSrcidList = data.fSrcid
+        queryParams.fSrcpidList = data.fSrcpid
+        queryParams.billsType = data.billsType
+        this.queryParams.fId = data.fId
+        // let list = queryParams
+        for (let item in this.fMblnoOptions){
+          if (data.fCorpid == this.fMblnoOptions[item].fName){
+            this.doNot = true
+            queryParams.fCorpid = this.fMblnoOptions[item].fId
+            this.queryParams.fCorpid = this.fMblnoOptions[item].fId
+            console.log(queryParams.fCorpid)
+            getcontrastList(queryParams).then(response=>{
+              console.log(response)
+              if(response.rows){
+                this.chargeList = response.rows
+              }
+            })
+          }
         }
-      }
-    });
+      });
+    }
   },
   methods: {
     //提交按钮
@@ -828,34 +835,84 @@ export default {
           }
           if(value === 1 ){
             for(let item in this.fMblnoOptions){
-              this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
+              if(this.queryParams.fCtrlcorpid == this.fMblnoOptions[item].fId){
+                this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
+              }
+              console.log(this.fMblnoOptions[item].fName)
+            }
+          }
+          let aug = []
+          let bug = []
+          for (let item in this.selection) {
+            for (let li in this.selection) {
+              if (item != li) {
+                if (this.selection[item].fSrcid == this.selection[li].fSrcid) {
+                  console.log(this.selection[item], this.selection[li])
+                  aug.push({
+                    index: this.selection[item].fSrcid,
+                    id: item,
+                    index2: this.selection[li].fSrcid,
+                    id2: li
+                  })
+                }
+              }
             }
           }
-          this.queryParams.tMblno = this.queryParams.fMblno
-          let formData = new window.FormData();
-          formData.append('tFee',JSON.stringify(this.queryParams))
-          formData.append('tFeeDo',JSON.stringify(this.chargeList))
-          formData.append('billsType',this.queryParams.billsType)
-          formData.append('tFeeInvoice','')
-          addPreservation(formData).then(response=>{
-            this.$message.success("操作成功")
-            if(this.queryParams.billsType == 'ApplyFP'){
-              this.$router.push({path:'/finance/invoiceInformation'})
 
-            }else if(this.queryParams.billsType == 'DZ'){
-              this.$router.push({path:'/finance/contrast'})
+          console.log(aug)
+          let add =''
+          let addold =''
+          for(let li in aug){
+            for(let item in aug)
+            if(aug[item].id == aug[li].id2 && aug[item].id2 == aug[li].id){
+              aug.splice(item, 1);
+            }
+          }
+          if(aug.length != 0){
+            for (let item in aug){
+              addold = parseInt(aug[item].id2)+1
+              add += Number(aug[item].id)+1 +'行、'+ addold + '行/'
+            }
+            MessageBox.confirm("第" + add + "重复,请重新选择",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            ).then(() => {
+              return
+            })
+          }else {
+            this.queryParams.tMblno = this.queryParams.fMblno
+            for(let item in this.fMblnoOptions){
+              if(this.queryParams.fToCorpid == this.fMblnoOptions[item].fId){
+                this.queryParams.fToCorpid = this.fMblnoOptions[item].fName
+              }
+            }
+            let formData = new window.FormData();
+            formData.append('tFee',JSON.stringify(this.queryParams))
+            formData.append('tFeeDo',JSON.stringify(this.selection))
+            formData.append('billsType',this.queryParams.billsType)
+            formData.append('tFeeInvoice','')
+            addPreservation(formData).then(response=>{
+              this.$message.success("操作成功")
+              if(this.queryParams.billsType == 'ApplyFP'){
+                this.$router.push({path:'/finance/invoiceInformation'})
 
-            }else if(this.queryParams.billsType == 'SF'){
-              this.$router.push({path:'/finance/charge'})
+              }else if(this.queryParams.billsType == 'DZ'){
+                this.$router.push({path:'/finance/contrast'})
 
-            }else if(this.queryParams.billsType == 'FF'){
-              this.$router.push({path:'/finance/payment'})
+              }else if(this.queryParams.billsType == 'SF'){
+                this.$router.push({path:'/finance/charge'})
 
-            }else if(this.queryParams.billsType == 'invoiceFP'){
-              this.$router.push({path:'/finance/controlOverInvoices/invoice'})
+              }else if(this.queryParams.billsType == 'FF'){
+                this.$router.push({path:'/finance/payment'})
 
-            }
-          })
+              }else if(this.queryParams.billsType == 'invoiceFP'){
+                this.$router.push({path:'/finance/controlOverInvoices/invoice'})
+
+              }
+            })
+          }
         }
       })
     },
@@ -1060,7 +1117,11 @@ export default {
     getList() {
       this.loading = true;
       getcontrastList(this.queryParams).then((response) => {
+        if(this.doNot == true){
+          this.chargeList = this.chargeList.concat(response.rows)
+        }else {
           this.chargeList = response.rows;
+        }
           this.total = response.total;
           this.loading = false;
         });

+ 83 - 4
src/views/fleet/sendcar/AddOrUpdate.vue

@@ -732,6 +732,12 @@
                     />
                   </template>
                 </el-table-column>
+                 <el-table-column
+                  label="运单号"
+                  align="center"
+                  prop="orderNo"
+                  width="100"
+                />
                 <el-table-column label="备注" align="center" prop="remarks">
                   <template slot-scope="scope">
                     <el-input
@@ -815,7 +821,7 @@
                     <el-button
                       size="mini"
                       type="text"
-                      icon="el-icon-document-delete"
+                      icon="el-icon-document-checked"
                       @click.native.prevent="selectStowage(scope.row)"
                       v-if="schedulingList[0].transProp == '1'"
                       :disabled="scope.row.mBillNo"
@@ -826,7 +832,7 @@
                       size="mini"
                       type="text"
                       icon="el-icon-document-delete"
-                      @click.native.prevent="changescarsRow(scope.row)"
+                      @click.native.prevent="changeStowageRow(scope.row)"
                       v-if="schedulingList[0].transProp == '1'"
                       :disabled="!scope.row.mBillNo"
                       v-hasPermi="['fleet:ftmsorderbillscars:edit']"
@@ -1371,6 +1377,32 @@
       <!-- <el-button type="warning" @click="submitRetreat">撤 回</el-button> -->
       <el-button @click="showDialog = false">取 消</el-button>
     </span>
+    <el-dialog
+      width="70%"
+      title="配载表"
+      :visible.sync="stowageDialog"
+      append-to-body
+    >
+      <span>
+        <el-table
+          :data="stowageList"
+          style="width: 100%"
+          @selection-change="handleSelectionChange"
+          ref="multipleTable"
+          @row-click="handleRowClick"
+        >
+          <el-table-column type="selection" width="55" />
+          <el-table-column prop="mblno" label="提单号" />
+          <el-table-column prop="orderNo" label="运单号" />
+          <el-table-column prop="loadAddr" label="提箱地点" />
+          <el-table-column prop="loadDate" label="提箱时间" />
+        </el-table>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="stowageForm">确认</el-button>
+        <el-button @click="stowageDialog = false">取 消</el-button>
+      </span>
+    </el-dialog>
   </el-dialog>
 </template>
 
@@ -1389,7 +1421,9 @@ import {
   changeFtmsorderbillscars,
   addFtmsorderbillscars,
   singleChangeFtmsorderbillscars,
-  selectStowage
+  selectStowage,
+  addStowage,
+  revokeStowage,
 } from "@/api/fleet/ftmsorderbillscars";
 import { getBasicInformation } from "@/api/kaihe/basicdata/container";
 import { company } from "@/api/fleet/carManage";
@@ -1447,6 +1481,7 @@ export default {
   },
   data() {
     return {
+      multipleSelection: [],
       companyList: [],
       lbStatus: {},
       dcList: [
@@ -1522,10 +1557,12 @@ export default {
       polList: [],
       podList: [],
       collapses2: [],
+      stowageSelection: [],
       uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
+      addStowagData: "",
     };
   },
   created() {
@@ -1579,6 +1616,48 @@ export default {
     this.username = Cookies.get("userName");
   },
   methods: {
+    changeStowageRow(row) {
+      revokeStowage(row.id).then((response) => {
+        if (response.code == 200) {
+          this.msgSuccess("配载撤销成功");
+          this.$set(row, "mBillNo", response.data.mBillNo);
+          this.$set(row, "billKind", response.data.billKind);
+        }
+      });
+    },
+    handleSelectionChange(val) {
+      if (val.length > 1) {
+        this.$refs.multipleTable.clearSelection();
+        this.$refs.multipleTable.toggleRowSelection(val.pop());
+      } else {
+        this.addStowagData = val[0];
+      }
+    },
+    handleRowClick(row) {
+      this.$refs.multipleTable.toggleRowSelection(row);
+    },
+    stowageForm() {
+      if (this.addStowagData) {
+        addStowage({
+          mBillNo: this.addStowagData.orderNo,
+          id: this.addStowagData.id,
+        }).then((response) => {
+          if (response.code == 200) {
+            this.msgSuccess("配载成功");
+            this.stowageDialog = false;
+            let row = response.data;
+            this.vehicleList.map((e) => {
+              if (e.id == row.id) {
+                e.mBillNo = row.mBillNo;
+              }
+            });
+            this.addStowagData = "";
+          }
+        });
+      } else {
+        this.$message.error("请选择一条配载信息");
+      }
+    },
     carChange(row) {
       let arr = [];
       arr = this.carManages.filter((e) => e.carNum == row.carregNo);
@@ -1656,7 +1735,7 @@ export default {
     addRow2(tableData, event) {
       tableData.push({
         cntrId: this.schedulingList[0].cntrId,
-        pid: this.schedulingList[0].id,
+        pId: this.schedulingList[0].id,
         carcorPid: this.schedulingList[0].carcorPid,
         freightPriceDr: this.schedulingList[0].freightPriceDr,
         freightPriceCr: this.schedulingList[0].freightPriceCr,