Browse Source

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

tong 4 years ago
parent
commit
f100740054

+ 10 - 1
src/api/warehouseBusiness/warehouseInStock.js

@@ -26,7 +26,16 @@ export function addWarehousebills(data) {
   })
 }
 
-// 入库详情信息入账
+// 撤销入库
+export function updateCredit(data) {
+  return request({
+    url: '/warehouseBusiness/inStock/updateCredit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 入库确认
 export function addWhgenleg(data) {
   return request({
     url: '/warehouseBusiness/inStock/addCredit',

+ 2 - 2
src/views/agreement/agreementTask/index.vue

@@ -192,9 +192,9 @@
     />
 
     <!-- 添加或修改仓储费对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
+    <el-dialog :title="title" :visible.sync="open" width="85%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px"
-               style="display: flex;flex-wrap: wrap;justify-content:space-around"
+               style="display: flex;flex-wrap: wrap;justify-content: flex-start;"
       >
         <el-form-item label="客户名称" prop="fCorpid">
           <el-select

+ 6 - 0
src/views/basicdata/corps/index.vue

@@ -525,12 +525,18 @@
         form: {},
         // 表单校验
         rules: {
+           fTypeid: [
+            { required: true, message: "客户类别不能为空", trigger: "blur" }
+          ],
           fNo: [
             { required: true, message: "编号不能为空", trigger: "blur" }
           ],
           fName: [
             { required: true, message: "名称不能为空", trigger: "blur" }
           ],
+          fCname:[
+            { required: true, message: "简称不能为空", trigger: "blur" }
+          ],
           fStatus: [
             { required: true, message: "状态默认 T ,正常T 停用F 下拉选择不能为空", trigger: "blur" }
           ],

+ 1 - 1
src/views/basicdata/fees/index.vue

@@ -42,7 +42,7 @@
       <el-form-item label="币种" prop="fCurrency">
         <el-input
           v-model="queryParams.fCurrency"
-          placeholder="请输入币种"
+          placeholder="默认RMB"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"

+ 2 - 2
src/views/warehouseBusiness/agreement/index.vue

@@ -192,9 +192,9 @@
     />
 
     <!-- 添加或修改仓储费对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
+    <el-dialog :title="title" :visible.sync="open" width="85%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px"
-               style="display: flex;flex-wrap: wrap;justify-content:space-around"
+               style="display: flex;flex-wrap: wrap;justify-content: flex-start;"
       >
         <el-form-item label="客户名称" prop="fCorpid">
           <el-select

+ 36 - 19
src/views/warehouseBusiness/inStock/index.vue

@@ -774,17 +774,15 @@
       </el-form>
 
       <div class="dialogTableTitle flex a-center jlr" style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
-        
+
         <div>
           <el-button type="primary" :disabled="browseStatus" @click.prevent="addRelevant()"
           >新行
         </el-button>
-        <el-button :disabled="dataListSelection.length <= 0" @click.prevent="creditClick()"
+        <el-button :disabled="dataListSelection.length <= 0" @click.prevent="creditClick"
           >入库确认
         </el-button>
-        <!-- <el-button :disabled="browseStatus" @click.prevent="deleteRoww(warehouseDrList)"
-          >删除
-        </el-button> -->
+        <el-button :disabled="dataWithdrawList.length <= 0" @click.prevent="withdrawClick">撤回入库</el-button>
         <el-button :disabled="browseStatus" type="primary" @click="submitForm(2)">保 存</el-button>
         </div>
         <div>
@@ -1511,7 +1509,7 @@
         <!-- <el-button type="warning">仓储费协议</el-button> -->
         <el-button type="danger">作业费协议</el-button></div>
         <div style="font-size:18px">付款信息</div>
-  
+
       </div>
       <el-table
         :data="warehouseCrList"
@@ -2139,6 +2137,7 @@
 import print from "print-js";
 import {
   addWhgenleg,
+  updateCredit,
   listWarehousebills,
   getWarehousebills,
   delWarehousebills,
@@ -2231,6 +2230,8 @@ export default {
       whgenlegTotal: 0,
        // 库存明细入账数组
       dataListSelection: [],
+       // 库存明细撤回入账数组
+      dataWithdrawList: [],
       fSbuOptions: [],
       // 操作员
       userOptions: [],
@@ -2730,11 +2731,13 @@ export default {
         for (let se in selection) {
           if (!selection[se].fBillstatus || selection[se].fBillstatus !== '6') {
             this.dataListSelection.push(selection[se]);
+          } else if (selection[se].fBillstatus && selection[se].fBillstatus === '6') {
+            this.dataWithdrawList.push(selection[se])
           }
         }
         if (this.dataListSelection.length > 0) {
           this.fTruckno = selection[0].fTruckno;
-           this.fCntrtype = selection[0].fCntrtype;
+          this.fCntrtype = selection[0].fCntrtype;
           this.fGoodsids = selection[0].fGoodsids;
           var date = new Date(selection[0].fBsdate)
           var Y = date.getFullYear() + '-'
@@ -2844,11 +2847,6 @@ export default {
         this.title = "修改仓入库";
       });
     },
-    // 库存明细多选框结果
-    dataListChange (row) {
-      console.log(JSON.stringify(row))
-      this.dataListSelection = row
-    },
      // 库存总账多选框
     whgenlegSelectionChange(selection) {
       this.dialogWhgenlegList = selection;
@@ -2976,13 +2974,6 @@ export default {
       }
       this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
     },
-    changefBsdate(row) {
-      if (this.dataList.length > 0) {
-        for (var i = 0; i < this.dataList.length; i++) {
-          this.$set(this.dataList[i], "fBsdate", row);
-        }
-      }
-    },
     changefCorpid(row) {
        this.$set(row, "fSbu", row.fCorpid);
        for(let corp in this.fMblnoOptions) {
@@ -3074,6 +3065,32 @@ export default {
         }
       })
     },
+    // 撤回入账
+    withdrawClick() {
+      // 撤回入库
+      let formData = new window.FormData();
+      formData.append("warehouseBills", JSON.stringify(this.form))
+      formData.append("warehousebillsitems", JSON.stringify(this.dataWithdrawList))
+      updateCredit(formData).then((response) => {
+        this.fid = response.data;
+        this.formBrowseStatus = false
+        this.msgSuccess("撤销入账成功");
+        this.$refs.table.clearSelection();
+        for (let li in this.dataWithdrawList) {
+          for (let i in this.dataList) {
+            let fQty = this.dataList[i].fQty === this.dataWithdrawList[li].fQty;
+            let fBsdate = this.dataList[i].fBsdate === this.dataWithdrawList[li].fBsdate;
+            let fGoodsid = this.dataList[i].fGoodsid === this.dataWithdrawList[li].fGoodsid;
+            let fcntrtype = this.dataList[i].fcntrtype === this.dataWithdrawList[li].fcntrtype;
+            let fNetweight = this.dataList[i].fNetweight === this.dataWithdrawList[li].fNetweight;
+            let fGrossweight = this.dataList[i].fGrossweight === this.dataWithdrawList[li].fGrossweight;
+            if (fBsdate && fGoodsid && fcntrtype && fGrossweight && fNetweight && fQty) {
+              this.$set(this.dataList[i], 'fBillstatus', '1')
+            }
+          }
+        }
+      })
+    },
     /** 提交按钮 */
     submitForm(status) {
       this.$refs["form"].validate((valid) => {