Browse Source

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

wengyuwen 4 years ago
parent
commit
855b9ca9d4

+ 8 - 0
src/api/finance/charge.js

@@ -92,3 +92,11 @@ export function backCharge(queryParameter) {
     data: queryParameter
   })
 }
+// 撤销审批
+export function revocation(data) {
+  return request({
+    url: '/warehouse/paths/revoke',
+    method: 'post',
+    data: data
+  })
+}

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

@@ -17,7 +17,7 @@ export function getWarehousebills(fId) {
   })
 }
 
-// 新增仓库主(出入库)
+// 新增仓库主(出入库保存)
 export function addWarehousebills(data) {
   return request({
     url: '/warehouseBusiness/inStock/add',
@@ -25,6 +25,15 @@ export function addWarehousebills(data) {
     data: data
   })
 }
+// 新增仓库主(出入库提交)
+export function addWarehouse(data) {
+  return request({
+    url: '/warehouseBusiness/inStock/warehouseSubmission',
+    method: 'post',
+    data: data
+  })
+}
+
 
 // 撤销入库
 export function updateCredit(data) {

+ 65 - 9
src/views/finance/charge/index.vue

@@ -269,7 +269,7 @@
         <el-button type="success" size="small" @click="revokeCharge" v-if="queryParams.fBillstatus === '6'">撤销收费</el-button>
         <el-button type="info" size="small" @click="printing" :disabled="notChange">打印</el-button>
 <!--        <el-button type="danger" size="small" :disabled="notChange" v-show="Lander == Operator">撤销审批</el-button>-->
-        <el-button type="danger" size="small" :disabled="tablefilter" v-show="queryParams.fBillstatus === '4'">撤销审批</el-button>
+        <el-button type="danger" size="small" :disabled="tablefilter" @click="approvalRevocation" v-show="queryParams.fBillstatus === '4'">撤销审批</el-button>
       </div>
       <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
         <!-- <el-table-column type="selection" width="55" align="center"/> -->
@@ -314,11 +314,13 @@
         </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
-        <el-button v-if="approve === true">审批</el-button>
+        <el-button v-if="approve === true" @click="immediateApproval">审批</el-button>
         <el-button type="primary" v-if="notChange" @click="addOrUpdateHandle">查看审批流</el-button>
         <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+        <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
         <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
-        <el-button @click="cancel">取 消</el-button>
+        <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
+        <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
       </div>
       <el-dialog :close-on-click-modal="false" width="70%" :visible.sync="innerVisible" title="导入数据" append-to-body>
         <el-form ref="form" :model="queryParameter" :rules="rules" label-width="80px"
@@ -517,13 +519,15 @@ import {
   search,
   listCorps,
   delCharge_s,
-  backCharge
+  backCharge,
+  revocation
 } from '@/api/finance/charge'
 import { listFees } from '@/api/basicdata/fees'
 import print from 'print-js'
 import AddOrUpdate from '@/views/viewApproval'
 import ApprovalComments from '@/views/startApproval'
 import { queryUserVal } from '@/api/warehouseBusiness/agreement'
+import Global from '@/layout/components/global'
 
 export default {
   name: 'Charge',
@@ -554,6 +558,7 @@ export default {
       chargeList_s: [],
       selection: '',
       increase_s: [],
+      cancelButton:true,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -608,6 +613,7 @@ export default {
         fAccbilldate: null,
         fDeptid: null
       },
+      addOrUpdateVisib: false,
       // 主表查询参数
       tableFilter: {
         pageNum: 1,
@@ -666,18 +672,38 @@ export default {
   created() {
     this.getList()
     this.register()
+
+  },
+  activated(){
     this.adoPt()
   },
   methods: {
+    approvalRevocation(){
+      let  data = {
+        id:this.queryParams.fId,
+        actId:this.contrastId,
+        billId:this.queryParams.fId
+      }
+      console.log(this.queryParams)
+      revocation(data).then(data =>{
+        console.log(data)
+        if (data.code === 200){
+          this.$message.success('撤销成功');
+          this.open = false
+        }
+      })
+    },
+    returnData(){
+      this.addOrUpdateVisib = false
+    },
     adoPt(){
       this.approval = this.$route.query.data
-      // this.approval = JSON.parse()
-      console.log(this.approval)
       if (this.approval){
-        console.log('张三')
+        this.approval = JSON.parse(this.approval)
         this.hide = false
         this.notChange = true
         this.approve = true
+        this.cancelButton = false
         this.reset()
         this.pass = {
           fAmtdr: '',    //应收合计
@@ -687,7 +713,7 @@ export default {
           fFeesName: '',   //结算单位
           fCorpid: ''     //结算单位ID
         }
-        getCharge(32).then(response => {
+        getCharge(this.approval.billId).then(response => {
           console.log(response)
           this.Operator = response.data.tFee.createBy
           this.increase_s = response.data.feeDoList
@@ -700,11 +726,39 @@ export default {
         })
       }
     },
+    homePage(){
+      this.open = false
+      let view = {
+        fullPath: "/finance/charge",
+        hash: "",
+        matched: Array(2),
+        meta: Object,
+        name: "Charge",
+        params: Object,
+        path: "/finance/charge",
+        query: Object,
+        title: "收费"
+      }
+      this.$router.push({ path: '/index'})
+      this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
+        if (this.isActive(view)) {
+          this.toLastView(visitedViews, view)
+        }
+      })
+      Global.$emit("removeCache", "closeSelectedTag", view);
+    },
     register(){
       queryUserVal().then((response)=>{
         this.Lander = response.user.userName
       })
     },
+    immediateApproval(){
+      this.addOrUpdateVisib = true
+      console.log(this.approval)
+      this.$nextTick(() => {
+        this.$refs.ApprovalComments.init(this.approval.billId,this.approval.actId)
+      })
+    },
     getDataList(){
       this.addOrUpdateVisible = false
     },
@@ -750,10 +804,11 @@ export default {
         this.title = '收费列表'
         console.log(this.Lander)
         console.log(this.Operator)
+        this.tablefilter = true
         if (res == 1){
           this.notChange = true
-          this.tablefilter = false
           if (this.Operator == this.Lander){
+            this.tablefilter = false
             this.reset()
             this.pass = {
               fAmtdr: '',    //应收合计
@@ -1117,6 +1172,7 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       console.log(row)
+      this.approve = false
       this.hide = false
       this.notChange = false
       this.reset()

+ 4 - 4
src/views/index.vue

@@ -82,7 +82,8 @@
         <el-table-column prop="refno1" :show-overflow-tooltip="true" label="委托方"></el-table-column>
         <el-table-column prop="auditItem" :show-overflow-tooltip="true" label="日期">
           <template slot-scope="scope">
-            <span>{{ scope.row.auditItem.slice(0,10) }}</span>
+            <span v-if="!scope.row.auditItem">无时间</span>
+            <span v-else>{{ scope.row.auditItem.slice(0,10) }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="refno3" :show-overflow-tooltip="true" label="提单号"></el-table-column>
@@ -213,12 +214,11 @@ export default {
           break
         }
         case 'SF':{
-          this.$router.push({ path: '/finance/charge',query:{data:row}})
+          this.$router.push({ path: '/finance/charge',query:{data:JSON.stringify(row)}})
           break
         }
         case 'DZ':{
-          this.$router.push({ path: '/finance/charge',query:{data:row}})
-          // this.$router.push({ path: '/finance/contrast',query:{data:row}})
+          this.$router.push({ path: '/finance/contrast',query:{data:row}})
           break
         }
         case 'FF':{

+ 3 - 0
src/views/startApproval.vue

@@ -68,8 +68,11 @@ import { queryUserVal } from '@/api/warehouseBusiness/agreement'
         }
         this.dataForm.id = id
         this.dataForm.actId = actId
+        this.dataForm.billId = id
       },
       approved () {
+        console.log(this.dataForm)
+        this.dataForm.auditUserId = ''
         this.$confirm(`是否通过审批?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',

+ 11 - 4
src/views/warehouseBusiness/agreement/index.vue

@@ -424,7 +424,14 @@ export default {
       loading: true,
       loading_s: false,
       browseStatus: false,
-      jFeetunitOptions:[],
+      // 计价单位
+      jFeetunitOptions: [
+        { dictLabel: "件数", dictValue: "1" },
+        { dictLabel: "毛重", dictValue: "2" },
+        { dictLabel: "净重", dictValue: "3" },
+        { dictLabel: "尺码", dictValue: "4" },
+        { dictLabel: "固定", dictValue: "5" },
+      ],
       goodsOptions:[],
       fTypeidOptions: [],
       // 选中数组
@@ -506,9 +513,9 @@ export default {
     this.getDicts("data_goods_category").then(response => {
       this.fTypeidOptions = response.data;
     });
-    this.getDicts("data_unitfees").then(response => {
-      this.jFeetunitOptions = response.data;
-    });
+    // this.getDicts("data_unitfees").then(response => {
+    //   this.jFeetunitOptions = response.data;
+    // });
   },
   methods: {
     // 仓储费状态修改

+ 32 - 27
src/views/warehouseBusiness/inStock/index.vue

@@ -463,7 +463,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-
         <el-row>
           <el-col :span="8">
             <el-form-item label="计划件数" prop="fPlanqty">
@@ -471,7 +470,7 @@
                 v-model="form.fPlanqty"
                 style="width: 80%"
                 laceholder="计划件数"
-                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+                oninput='this.value=this.value.replace(/\D/g,"")' 
                 :disabled="browseStatus"
               />
             </el-form-item>
@@ -787,21 +786,12 @@
             >新行
           </el-button>
           <el-button
-            :disabled="dataListSelection.length <= 0"
-            @click.prevent="creditClick"
-            >入库确认
-          </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>
           <el-button
@@ -814,19 +804,29 @@
             >作业单
           </el-button>
           <el-button @click="discharge">卸货 </el-button>
+          <el-button
+            :disabled="dataListSelection.length <= 0"
+            @click.prevent="creditClick"
+            >入库确认
+          </el-button>
+          <el-button
+            :disabled="dataWithdrawList.length <= 0"
+            @click.prevent="withdrawClick"
+            >撤回入库</el-button
+          >
           <el-button type="success" prop="打印" @click="showEditDialog_ss"
             >收货单
           </el-button>
           <el-button type="warning" prop="打印" @click="showEditDialog_s"
             >入库单
           </el-button>
-
+<!-- 
           <el-button
             :disabled="browseStatus"
             type="primary"
             @click="submitForm(2)"
             >保 存</el-button
-          >
+          > -->
           <el-button
             :disabled="browseStatus"
             style="background-color: #008000; color: #fff"
@@ -2500,6 +2500,7 @@ import {
   getWarehousebills,
   delWarehousebills,
   addWarehousebills,
+  addWarehouse,
   updateWarehousebills,
   exportWarehousebills,
 } from "@/api/warehouseBusiness/warehouseInStock";
@@ -2733,7 +2734,6 @@ export default {
         fPlannetweight: [{ required: true, message: " ", trigger: "blur" }],
         fChargedate: [{ required: true, message: " ", trigger: "blur" }],
         fMarks: [{ required: true, message: " ", trigger: "blur" }],
-        fBillingway: [{ required: true, message: " ", trigger: "blur" }],
         fBsdate: [{ required: true, message: " ", trigger: "blur" }],
         fTrademodeid: [{ required: true, message: " ", trigger: "blur" }],
         fSbu: [{ required: true, message: " ", trigger: "blur" }],
@@ -3101,6 +3101,7 @@ export default {
         fAmount: null,
         fCurrency: "RMB",
         fExrate: "1",
+        fTaxrate: this.fTaxrate,
         fCxrate: null,
         fRate: null,
         remarks: null,
@@ -3116,6 +3117,7 @@ export default {
         fAmount: null,
         fCurrency: "RMB",
         fExrate: "1",
+        fTaxrate: this.fTaxrate,
         fCxrate: null,
         fRate: null,
         remarks: null
@@ -3476,6 +3478,7 @@ export default {
       const fId = row.fId || this.ids;
       this.dataList = [];
       getWarehousebills(fId).then((response) => {
+        console.log(response)
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
           if(this.form.fBillstatus > 2) {
@@ -4086,6 +4089,7 @@ export default {
           }
         let formDatae = new window.FormData();
         // 附件数据
+        this.form.fBillingway = this.form.fFeetunit;
         formDatae.append("tWarehouseBills", JSON.stringify(this.form));
         console.log(this.form);
         // 库存明细
@@ -4185,14 +4189,14 @@ export default {
           if (!this.form.fId) {
             this.form.fId = this.fid;
           }
-        
-
         let formData = new window.FormData();
         // 附件数据
+        this.form.fBillingway = this.form.fFeetunit;
         formData.append("tWarehouseBills", JSON.stringify(this.form));
         console.log(this.form);
         // 库存明细
         formData.append("tWarehousebillsitems", JSON.stringify(this.dataList));
+        console.log(this.dataList)
         // 附件数据
         formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
         // 费用明细付款
@@ -4205,17 +4209,18 @@ export default {
           "tWarehousebillsfeesDr",
           JSON.stringify(this.warehouseDrList)
         );
-        addWarehousebills(formData).then((response) => {
+        addWarehouse(formData).then((response) => {
+          console.log(response)
           this.msgSuccess("提交成功");
-          this.dataList = response.data.warehousebillsitems;
-          for (let list in this.dataList) {
-            this.$set(
-              this.dataList[list],
-              "fBsdate",
-              Date.parse(this.dataList[list].fBsdate)
-            );
-          }
-          this.fid = response.data.warehouseBills.fId;
+          // this.dataList = response.data.warehousebillsitems;
+          // for (let list in this.dataList) {
+          //   this.$set(
+          //     this.dataList[list],
+          //     "fBsdate",
+          //     Date.parse(this.dataList[list].fBsdate)
+          //   );
+          // }
+          // this.fid = response.data.warehouseBills.fId;
           this.open = false;
           this.getList();
         });

+ 37 - 54
src/views/warehouseBusiness/outStock/index.vue

@@ -151,10 +151,10 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="唛头" prop="fMarks">
+      <el-form-item label="品牌" prop="fMarks">
         <el-input
           v-model="queryParams.fMarks"
-          placeholder="请输入唛头"
+          placeholder="请输入品牌"
           clearable
           size="small"
           style="width: 80%"
@@ -249,7 +249,7 @@
         prop="fCorpid"
       />
       <el-table-column label="提单号" align="center" prop="fMblno" />
-      <el-table-column label="唛头" align="center" prop="fMarks" />
+      <el-table-column label="品牌" align="center" prop="fMarks" />
       <el-table-column
         label="出库日期"
         align="center"
@@ -574,12 +574,12 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="唛头" prop="fMarks">
+            <el-form-item label="品牌" prop="fMarks">
               <el-input
                 v-model="form.fMarks"
                 style="width: 80%"
                 :disabled="browseStatus || formBrowseStatus"
-                placeholder="唛头"
+                placeholder="品牌"
               />
             </el-form-item>
           </el-col>
@@ -730,32 +730,33 @@
             @click.prevent="addRelevant(10)"
             >新行
           </el-button>
-          <el-button
-            :disabled="dataListSelection.length <= 0"
-            @click.prevent="creditClick"
-            >出库确认
-          </el-button>
-          <el-button
-            :disabled="dataWithdrawList.length <= 0"
-            @click.prevent="withdrawClick"
-            >撤回出库</el-button
-          >
           <!-- <el-button :disabled="browseStatus" @click.prevent="deleteRow(warehouseDrList)"
           >删除
         </el-button> -->
-          <el-button type="primary" @click="saveForm">保 存</el-button>
+          <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
         </div>
         <div style="display: flex">
           <el-button @click="detailsHidden ? (detailsHidden = false) : (detailsHidden = true)">{{ detailsHidden ? "隐藏" : "展开" }}</el-button>
           <el-button type="info" :disabled="printinglist.length <= 0" prop="打印" @click="printJobSheet">作业单</el-button>
           <el-button :disabled="printinglist.length <= 0" @click="discharge">装货</el-button>
+          <el-button
+            :disabled="dataListSelection.length <= 0 || browseStatus"
+            @click.prevent="creditClick"
+            >出库确认
+          </el-button>
+          <el-button
+            :disabled="dataWithdrawList.length <= 0 || browseStatus"
+            @click.prevent="withdrawClick"
+            >撤回出库</el-button
+          >
           <el-button type="warning" prop="打印" :disabled="printinglist.length <= 0" @click="showEditDialog_s"
             >出库单
           </el-button>
-          <el-button type="primary" @click="saveForm">保 存</el-button>
+          <!-- <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button> -->
           <el-button
             style="background-color: #008000; color: #fff"
             @click="submitForm(6)"
+            :disabled="browseStatus"
             >请核</el-button
           >
         </div>
@@ -804,7 +805,7 @@
           header-align="center"
           align="center"
           width="140px"
-          label="*唛头"
+          label="*品牌"
         >
         </el-table-column>
         <el-table-column
@@ -1226,10 +1227,12 @@
           <el-button :disabled="browseStatus" @click.prevent="addCollection()"
             >新行
           </el-button>
-          <el-button type="primary" @click="saveForm">保 存</el-button>
+          <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
           <!--暂时隐藏-->
 <!--          <el-button type="warning" @click.prevent="addStorages('Dr')">仓储费协议</el-button >-->
-          <el-button type="danger" @click.prevent="addAgreement('Dr')"
+          <el-button type="danger"
+                     :disabled="browseStatus"
+                     @click.prevent="addAgreement('Dr')"
             >作业费协议</el-button
           >
         </div>
@@ -1470,11 +1473,13 @@
           <!-- <el-button :disabled="browseStatus" @click.prevent="deleteRow(warehouseDrList)"
           >删除
         </el-button> -->
-          <el-button type="primary" @click="saveForm">保 存</el-button>
+          <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
           <!--暂时隐藏-->
 <!--          <el-button type="warning" @click.prevent="addStorages('Cr')">仓储费协议</el-button>-->
-          <el-button type="danger" @click.prevent="addAgreement('Cr')"
-            >作业费协议</el-button
+          <el-button type="danger"
+                     :disabled="browseStatus"
+                     @click.prevent="addAgreement('Cr')"
+          >作业费协议</el-button
           >
         </div>
         <div style="font-size: 18px">付款信息</div>
@@ -1702,17 +1707,18 @@
         <!-- <el-button type="success" prop="打印" @click="showEditDialog_ss"
           >收货单
         </el-button> -->
-        <el-button type="warning" prop="打印" :disabled="printinglist.length <= 0" @click="showEditDialog_s"
+        <el-button type="warning" prop="打印" :disabled="printinglist.length <= 0 || browseStatus" @click="showEditDialog_s"
           >出库单
         </el-button>
-        <el-button :disabled="printinglist.length <= 0" @click="discharge">装货</el-button>
-        <el-button type="info" prop="打印" :disabled="printinglist.length <= 0" @click="printJobSheet"
+        <el-button :disabled="printinglist.length <= 0 || browseStatus" @click="discharge">装货</el-button>
+        <el-button type="info" prop="打印" :disabled="printinglist.length <= 0 || browseStatus" @click="printJobSheet"
           >作业单
         </el-button>
-        <el-button type="primary" @click="saveForm">保 存</el-button>
+        <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
         <el-button
           style="background-color: #008000; color: #fff"
           @click="submitForm"
+          :disabled="browseStatus"
           >请核</el-button
         >
         <el-button @click="cancel">取 消</el-button>
@@ -1775,7 +1781,7 @@
             prop="fMarks"
             header-align="center"
             align="center"
-            label="唛头"
+            label="品牌"
           >
           </el-table-column>
         </el-table>
@@ -1787,7 +1793,7 @@
           @pagination="getWhgenlegList"
         />
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="whgenlegData">导入</el-button>
+          <el-button type="primary" @click="whgenlegData">导入库存总账</el-button>
           <el-button @click="whgenlegVisible = false">取 消</el-button>
         </div>
       </el-dialog>
@@ -3444,6 +3450,7 @@ export default {
               for (let li in this.dataList) {
                 if (this.dataList[li].fId === dataitem[ite].fId) {
                   this.$set(this.dataList[li], 'fBillstatus', dataitem[ite].fBillstatus)
+                  this.$set(this.dataList[li], 'fSerialNumber', dataitem[ite].fSerialNumber)
                 }
               }
             }
@@ -3617,24 +3624,6 @@ export default {
           this.$message.error('请新增库存明细!')
           return false
         }
-        // if (this.relevantAttachments.length === 0) {
-        //   this.$message.error("请新增附件上传!");
-        //   return false;
-        // }
-        if (this.warehouseDrList.length === 0) {
-          this.$message.error('请新增收款信息!')
-          return false
-        }
-        if (this.warehouseCrList.length === 0) {
-          this.$message.error('请新增付款信息!')
-          return false
-        }
-        for (let list in this.dataList) {
-          if (!this.dataList[list].fWarehouselocid) {
-            this.$message.error('请输入库区!')
-            return false
-          }
-        }
         for (let list in this.dataList) {
           if (this.dataList[list].fQty === 0) {
             this.$message.error('请输入出库件数!')
@@ -3648,17 +3637,11 @@ export default {
             this.$message.error('请输入出库毛重!')
             return false
           }
-          if (this.dataList[list].fBillstatus != 40) {
+          if (this.dataList[list].fBillstatus !== 40) {
             this.$message.error('请入账库存明细!')
             return false
           }
         }
-        // for (let list in this.relevantAttachments) {
-        //   if (this.relevantAttachments[list].fName === null) {
-        //     this.$message.error("请输入附件名称!");
-        //     return false;
-        //   }
-        // }
         for (let list in this.warehouseDrList) {
           if (!this.warehouseDrList[list].fCorpid) {
             this.$message.error('请选择客户名称')