zhangyuewww 2 年之前
父節點
當前提交
810d4fb537

+ 2 - 2
package.json

@@ -51,9 +51,9 @@
     "base-core-lib": "^1.3.16",
     "base-template-lib": "^1.0.7-beta",
     "countup": "^1.8.2",
-    "echarts": "4.2.1",
+    "echarts": "^4.2.1",
     "element-china-area-data": "^5.0.2",
-    "element-ui": "^2.13.2",
+    "element-ui": "^2.15.9",
     "file-saver": "^2.0.5",
     "form-making-advanced": "^1.2.6",
     "html2canvas": "^1.3.2",

+ 2 - 0
src/api/V2/warehouse/index.js

@@ -120,3 +120,5 @@ export const API_SET_PAYMONEY = 'warehousingOrder/api/payMoney'
 // export const API_GET_EXPENSEINFO = '/expenseInfo/selectInfo'z
 //审核
 export const API_WORKFLOWHANDLE ='/newWorkflow/api/handle'
+//查看可分配金额
+export const API_GET_EXPENSE='/expenseAllocationInfo/getExpenseAllocationInfo'

+ 5 - 2
src/model/warehouse/index.js

@@ -58,7 +58,8 @@ import {
     API_GET_WAREHOUSINGORDER,
     API_EDIT_WAREHOUSINGORDER,
     API_SET_PAYMONEY,
-    API_WORKFLOWHANDLE
+    API_WORKFLOWHANDLE,
+    API_GET_EXPENSE
     // API_GET_EXPENSEINFO
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
@@ -178,4 +179,6 @@ export const paymoney = appRx.post(API_SET_PAYMONEY,errorCatcher, errorHandle, f
 //审核
 export const workflowhandle = appRx.post(API_WORKFLOWHANDLE,errorCatcher, errorHandle, filter)
 // //费用详情
-// export const getexenseinfo = appRx.get(API_GET_EXPENSEINFO,errorCatcher, errorHandle, filter)
+// export const getexenseinfo = appRx.get(API_GET_EXPENSEINFO,errorCatcher, errorHandle, filter)
+//查看可分配金额
+export const getExpense = appRx.get(API_GET_EXPENSE,errorCatcher, errorHandle, filter)

+ 1 - 1
src/store/modules/permission.js

@@ -127,7 +127,7 @@ const actions = {
       .catch((err) => {
         clearStorage()
         resetRouter()
-        window.location.href="https://www.eliangeyun.com"
+        // window.location.href="https://www.eliangeyun.com"
       })
         
       const roles = [];

+ 269 - 3
src/views/warehousenew/warehousingOrder.vue

@@ -46,6 +46,8 @@
         <div>{{item.issuingTime}}</div>
         <div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
         <div>
+          <ws-button  type="primary" @click="distribution(item)" >预付款分配</ws-button>
+        <ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button>
             <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
             `warehouseManagement.warehousingOrder.appl`
           ">请款
@@ -159,6 +161,110 @@
           <el-button @click="aduitshow = false">取消</el-button>
           <el-button type="primary" @click="paymentsubmit">确定</el-button>
         </span>
+      </el-dialog>
+            <el-dialog
+        title="预付款分配"
+        :visible.sync="distributionshow"
+        width="50%"
+        :before-close="handleClose1">
+        <div>
+           <!--插槽会替换title显示的内容 -->
+         <div slot="title" class="header-title">
+            <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
+        </div>
+          <el-form ref="form" :model="form" label-width="120px">
+              <el-col class="col1">
+            <el-form-item label="累计预付(元)">
+              <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
+            </el-form-item>
+              </el-col>
+               <el-col class="col1">
+             <el-form-item label="收回预付(元)">
+              <el-input disabled v-model="form.recoveryPrepayments"></el-input>
+            </el-form-item>
+             </el-col>
+             <el-col class="col1">
+            <el-form-item label="已分配(元)">
+              <el-input disabled v-model="form.distributionEd"></el-input>
+            </el-form-item>
+             </el-col>
+              <el-col class="col1">
+             <el-form-item label="可分配(元)">
+              <el-input disabled v-model="form.distributionCan"></el-input>
+            </el-form-item>
+              </el-col>
+              <el-row>
+               <el-col class="col1">
+            <el-form-item label="未付金额(元)">
+              <el-input disabled v-model="form.distributionNot"></el-input>
+            </el-form-item>
+               </el-col>
+              </el-row>
+              <el-row>
+             <el-form-item label="分配金额(元)">
+              <el-input  v-model="form.distributionIng"></el-input>
+            </el-form-item>
+              </el-row>
+
+
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="distributionshow = false">取消</el-button>
+          <el-button type="primary" @click="distributionsubmit">确定</el-button>
+        </span>
+      </el-dialog>
+                  <el-dialog
+        title="保证金分配"
+        :visible.sync="marginshow"
+        width="50%"
+        :before-close="handleClose2">
+        <div>
+           <!--插槽会替换title显示的内容 -->
+         <div slot="title" class="header-title">
+            <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
+        </div>
+          <el-form ref="form" :model="form" label-width="120px">
+              <el-col class="col1">
+            <el-form-item label="累计支付(元)">
+              <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
+            </el-form-item>
+              </el-col>
+               <el-col class="col1">
+             <el-form-item label="累计收回(元)">
+              <el-input disabled v-model="form.recoveryPrepayments"></el-input>
+            </el-form-item>
+             </el-col>
+             <el-col class="col1">
+            <el-form-item label="已分配(元)">
+              <el-input disabled v-model="form.distributionEd"></el-input>
+            </el-form-item>
+             </el-col>
+              <el-col class="col1">
+             <el-form-item label="可分配(元)">
+              <el-input disabled v-model="form.distributionCan"></el-input>
+            </el-form-item>
+              </el-col>
+              <el-row>
+               <el-col class="col1">
+            <el-form-item label="未付金额(元)">
+              <el-input disabled v-model="form.distributionNot"></el-input>
+            </el-form-item>
+               </el-col>
+              </el-row>
+              <el-row>
+             <el-form-item label="分配金额(元)">
+              <el-input  v-model="form.distributionIng"></el-input>
+            </el-form-item>
+              </el-row>
+
+
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="marginshow = false">取消</el-button>
+          <el-button type="primary" @click="marginsubmit">确定</el-button>
+        </span>
       </el-dialog>
       <!-- <el-dialog
       title="提示"
@@ -221,7 +327,7 @@
   getwarehousingorder,
   paymoney,
   editwarehousingorder,
-  getexenseinfo,
+  getExpense,
   workflowhandle
 } from '@/model/warehouse/index'
   import {
@@ -258,7 +364,15 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         dataList:[],
         // 船舶类型
         monetaryKey: null,
-        form:{},
+        form:{
+          accumulatedPrepayment:'',
+          recoveryPrepayments:'',
+          distributionEd:'',
+          distributionCan:'',
+          distributionNot:'',
+          distributionIng:''
+
+        },
         // 表格显示数据
         tableDate: [],
 
@@ -342,6 +456,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         money:0,
         multipleSelection1:{},
         aduitshow:false,
+        distributionshow:false,
+        marginshow:false,
         costlist:[],
         pickerBeginDateBefore: {
           disabledDate: (time) => {
@@ -350,6 +466,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         },
         accessoryTFs: false,
         remarkList: false,
+        dialogTitle:'',
+
         remark:''
       }
     },
@@ -463,6 +581,83 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         }
         
         
+      },
+      marginAllocation(item){
+        let _this= this
+        var arr1=this.multipleSelection1[item.id]
+        for (let i = 0; i < arr1.length; i++) {
+          if(arr1[i].amountNotPayable<0){
+            this.$message({
+              message: '请选择一条有未付金额的条目!',
+              type: 'warning'
+            });
+            return
+          }
+          if(!arr1[i].contractNo){
+            this.$message({
+              message: '请选择货源是采购合同的条目',
+              type: 'warning'
+            });
+            return
+          }
+          _this.dialogTitle=arr1[i].contractNo
+          getExpense({contractNo:arr1[i].contractNo,costType:5}).toPromise()
+          .then((response) => {
+            _this.form.accumulatedPrepayment=response.accumulatedPrepayment
+            _this.form.recoveryPrepayments=response.recoveryPrepayments
+            _this.form.distributionEd=response.distributionMoney
+            _this.form.distributionCan=response.accumulatedPrepayment-response.recoveryPrepayments-response.distributionMoney
+            _this.form.distributionNot=arr1[i].amountNotPayable
+          }).catch(() => {
+           this.$message({
+              message: '无可分配金额',
+              type: 'warning'
+            });
+            return
+          })
+        }
+        this.currectdata=item
+        this.marginshow=true
+      },
+      distribution(item){
+        let _this= this
+        var arr1=this.multipleSelection1[item.id]
+        for (let i = 0; i < arr1.length; i++) {
+          if(arr1[i].amountNotPayable<0){
+            this.$message({
+              message: '请选择一条有未付金额的条目!',
+              type: 'warning'
+            });
+            return
+          }
+          if(!arr1[i].contractNo){
+            this.$message({
+              message: '请选择货源是采购合同的条目',
+              type: 'warning'
+            });
+            return
+          }
+          _this.dialogTitle=arr1[i].contractNo
+          getExpense({contractNo:arr1[i].contractNo,costType:1}).toPromise()
+          .then((response) => {
+            _this.form.accumulatedPrepayment=response.accumulatedPrepayment
+            _this.form.recoveryPrepayments=response.recoveryPrepayments
+            _this.form.distributionEd=response.distributionMoney
+            _this.form.distributionCan=response.accumulatedPrepayment-response.recoveryPrepayments-response.distributionMoney
+            _this.form.distributionNot=arr1[i].amountNotPayable
+          }).catch(() => {
+           this.$message({
+              message: '无可分配金额',
+              type: 'warning'
+            });
+            return
+          })
+        }
+        this.currectdata=item
+
+        this.distributionshow=true
+
+       
       },
       getNowTime() {
       const start = new Date(new Date().getTime() - 3600 * 1000 * 24 )
@@ -624,6 +819,68 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
           })
       },
+      marginsubmit(item){
+        var arr2=this.multipleSelection1[this.currectdata.id]
+          if(this.form.distributionIng>this.form.distributionCan){
+            this.$message({
+              message: '超出可分配金额',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.form.distributionIng>this.form.distributionNot){
+            this.$message({
+              message: '超出未付金额',
+              type: 'warning'
+            });
+            return
+          }
+          paymoney({flag:3,money:this.form.distributionIng,warehousingOrderList:arr2}).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '分配成功',
+              type: 'success'
+            });
+            this.marginshow=false
+            this.getList()
+          }).catch(() => {
+           this.$message({
+              message: '分配失败',
+              type: 'warning'
+            });
+          })
+      },
+      distributionsubmit(item){
+        var arr2=this.multipleSelection1[this.currectdata.id]
+          if(this.form.distributionIng>this.form.distributionCan){
+            this.$message({
+              message: '超出可分配金额',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.form.distributionIng>this.form.distributionNot){
+            this.$message({
+              message: '超出未付金额',
+              type: 'warning'
+            });
+            return
+          }
+          paymoney({flag:2,money:this.form.distributionIng,warehousingOrderList:arr2}).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '分配成功',
+              type: 'success'
+            });
+            this.distributionshow=false
+            this.getList()
+          }).catch(() => {
+           this.$message({
+              message: '分配失败',
+              type: 'warning'
+            });
+          })
+      },
       payment(item){
         if(localStorage.getItem('ws-pf_roleName')=='出纳'){
           this.money=0
@@ -798,7 +1055,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             this.gainList = response.records
             // this.currentPage = response.current
             // this.pageSize = response.size
-            // console.log(arr)
+            console.log(this.gainList,96)
             this.deptBudgetTotal = response.total
           })
       },
@@ -919,6 +1176,12 @@ multiFilter(array, filters) {
       handleClose() {
         this.aduitshow = false
       },
+      handleClose1() {
+        this.distributionshow = false
+      },
+      handleClose2() {
+        this.marginshow = false
+      },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
         this.pageSize = val
@@ -1008,6 +1271,9 @@ multiFilter(array, filters) {
     width: 30%;
     margin-right: 10px;
   }
+  .col1 {
+    width: 50%;
+  }
 .audit {
     margin-bottom: 20px;
     border-bottom: 1px solid #AFB3BF;