فهرست منبع

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

gjy 2 سال پیش
والد
کامیت
2c241bbf53

+ 10 - 10
public/static/payprint1.html

@@ -166,7 +166,7 @@
         
         .sfcard-content img {
             width: 100%;
-            height: 130vh;
+            height: 100vh;
         }
         
         .sfcard-title {
@@ -175,11 +175,11 @@
         }
         
         .center {
-            height: 140vh;
+            height: 110vh;
         }
         
         .part2 {
-            height: 140vh;
+            height: 110vh;
             /* background: red; */
         }
         
@@ -546,9 +546,9 @@
                             </div>
                             <!-- <img :src="customerList1[index].imgURl.imageUrl3" class="avatar" /> -->
                             <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl3" class="avatar" />
-                            <img v-else  class="avatar" />
-                            <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl4" class="avatar" />
-                            <img v-else  class="avatar" />
+                            <img v-else class="avatar" />
+                            <!-- <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl4" class="avatar" />
+                            <img v-else class="avatar" /> -->
 
                         </div>
                         <!--          <div class="sfcard-content part2">
@@ -867,12 +867,12 @@
                     </div>
                     <img :src="imageUrl1" class="avatar" />
                 </div>
-                <div class="sfcard-content">
+                <!-- <div class="sfcard-content">
                     <div class="sfcard-title">
                         {{ printData.customerName}}{{ printData.identityAuthenticationInfo.customerNumberCard}}
                     </div>
                     <img :src="imageUrl2" class="avatar" />
-                </div>
+                </div> -->
             </div>
 
             <div class="bankcard part4" v-if="isShowPrintType2">
@@ -882,12 +882,12 @@
                     </div>
                     <img :src="imageUrl3" class="avatar" />
                 </div>
-                <div class="sfcard-content">
+                <!-- <div class="sfcard-content">
                     <div class="sfcard-title">
                         {{printData.bankDeposit}}{{printData.bankCard}}
                     </div>
                     <img :src="imageUrl4" class="avatar" />
-                </div>
+                </div> -->
 
             </div>
         </div>

+ 1271 - 0
public/static/payprint1A5.html

@@ -0,0 +1,1271 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8" />
+    <link rel="stylesheet" href="../cdn/element-ui/2.13.2/theme-chalk/index.css">
+    <title></title>
+    <style>
+        table tr td {
+            border: 2px solid #333333;
+            padding: 5px 0;
+        }
+        
+        #app {
+            height: 88vh;
+            position: relative;
+        }
+        
+        .simple {
+            height: 120vh !important;
+        }
+        
+        .content {
+            width: 1000px;
+            margin: auto;
+        }
+        
+        table {
+            width: 100%;
+            text-align: center;
+            border-collapse: collapse;
+        }
+        
+        .col-bgc {
+            background: #f6f7fb;
+        }
+        
+        .bottom-row1 {
+            display: flex;
+            justify-content: space-between;
+            margin: 20px 0;
+        }
+        
+        .bottom-row2 {
+            display: flex;
+            margin: 10px 0;
+        }
+        
+        img {
+            width: 80px;
+            height: 80px;
+            /* margin-right: 118px; */
+        }
+        
+        .leftimg {
+            width: 80px;
+            height: 80px;
+            position: absolute;
+            right: 20px;
+            top: 3px;
+        }
+        
+        .config {
+            margin-right: 240px;
+        }
+        
+        .bottom-row3 {
+            margin: 10px 0;
+        }
+        
+        .title {
+            text-align: center;
+            font-size: 24px;
+        }
+        
+        .number {
+            text-align: right;
+            margin-bottom: 10px;
+        }
+        
+        .number1 {
+            text-align: right;
+            margin-bottom: 10px;
+            margin-top: 60px;
+        }
+        
+        .small-row {
+            display: flex;
+        }
+        
+        .small-content {
+            width: 400px;
+            margin: 0 auto;
+            border: 1px solid #ccc;
+            padding: 20px 20px 160px 20px;
+            position: absolute;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            margin: auto;
+            height: 650px;
+        }
+        
+        .small-title {
+            text-align: center;
+            font-size: 18px;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+        }
+        
+        .small-row {
+            display: flex;
+            justify-content: space-between;
+            margin: 10px;
+        }
+        
+        .small-img {
+            margin-right: 0;
+        }
+        
+        .sign {
+            margin-right: 100px;
+        }
+        
+        .header {
+            display: flex;
+            justify-content: space-between;
+            font-size: 16px;
+            margin: 10px 0;
+        }
+        
+        .header1 {
+            font-size: 24px;
+            /* margin: 30px 60px 10px 60px; */
+            display: flex;
+            justify-content: center;
+        }
+        
+        .line {
+            height: 2px;
+            width: 410px;
+            margin: 3px auto;
+            background: black;
+        }
+        
+        .line:nth-of-type(3) {
+            margin-bottom: 30px;
+        }
+        
+        .header-top {
+            display: flex;
+            justify-content: space-between;
+        }
+        
+        .sfcard {
+            background: red;
+        }
+        
+        .sfcard-content {
+            /*        display: flex;
+        align-items: center;
+        justify-content: space-evenly; */
+        }
+        
+        .sfcard-content img {
+            width: 100%;
+            height: 130vh;
+        }
+        
+        .sfcard-title {
+            font-size: 28px;
+            text-align: center;
+        }
+        
+        .center {
+            height: 140vh;
+        }
+        
+        .part2 {
+            height: 140vh;
+            /* background: red; */
+        }
+        
+        .part5 {
+            width: 100%
+        }
+        
+        .paymentScreenshot {
+            width: 100%;
+            height: 130vh
+        }
+        /* .onlypz-center{
+        height: 130vh;
+      } */
+    </style>
+</head>
+
+<body>
+    <div id="app">
+        <div v-if="selectPrint">
+            <div v-for="(item,index) in printData1" :key="index">
+                <div class="content">
+                    <!-- <div class="part5" v-if="isShowPrintType5">
+                        <div class="header1">
+                            付款回执单
+                        </div>
+                        <img :src="printData1[index].codeUrl" class="paymentScreenshot" />
+                    </div> -->
+                    <div class="center" v-if="isShowPrintType3">
+                        <div class="header1">{{ printData1[index].compName}}结算凭证</div>
+                        <div class="line"></div>
+                        <div class="line"></div>
+                        <div class="header">
+                            <div>单位名称:{{ printData1[index].compName}}</div>
+                            <!-- <div>税务登记编号:91230230MA1BNL7Q93</div> -->
+                        </div>
+                        <div class="header-top">
+                            <div>单位:公斤/元</div>
+                            <div>No.</div>
+                        </div>
+                        <div class="header-top">
+                            <div>开票日期:{{printData1[index].createDate}}</div>
+                            <!-- <div>开票日期:{{new Date(yyyy,mm,dd)}}</div> -->
+                            <div class="number">
+                                {{dealNo(printData1[index].paymentNo)}}
+                            </div>
+                        </div>
+                        <table class="table">
+                            <tr class="row">
+                                <td rowspan="4" class="col col-bgc">买方</td>
+                                <td class="col col-bgc">单位名称</td>
+                                <td class="col" colspan="3">
+                                    {{ printData1[index].compName}}
+                                </td>
+                                <td rowspan="4" class="col col-bgc">卖方</td>
+                                <td class="col col-bgc">姓名</td>
+                                <td class="col" colspan="4">
+                                    {{ printData1[index].customerName}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">税务登记号</td>
+                                <td class="col" colspan="3">
+                                    {{ printData1[index].taxRegistrationNo}}
+                                </td>
+                                <td class="col col-bgc">身份证号</td>
+                                <td class="col" colspan="4">
+                                    {{ printData1[index].identityAuthenticationInfo.customerNumberCard}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">业务编号</td>
+                                <td class="col" colspan="3">
+                                    {{ printData1[index].paymentNo}}
+                                </td>
+                                <td class="col col-bgc">卡号</td>
+                                <td class="col" colspan="4">
+                                    {{printData1[index].identityAuthenticationInfo.bankDeposit}}{{printData1[index].identityAuthenticationInfo.bankCard}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">收货仓库</td>
+                                <td class="col" colspan="3">
+                                    {{printData1[index].warehouseName}}
+                                </td>
+                                <td class="col col-bgc">地址</td>
+                                <td class="col" colspan="4">
+                                    {{printData1[index].identityAuthenticationInfo.compAddress}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">货名</td>
+                                <td class="col col-bgc">类型</td>
+                                <td class="col col-bgc">等级</td>
+                                <td class="col col-bgc">水分%</td>
+                                <td class="col col-bgc">杂质%</td>
+                                <td class="col col-bgc">容重(克/升)</td>
+                                <td class="col col-bgc">毛重</td>
+                                <td class="col col-bgc">皮重</td>
+                                <td class="col col-bgc">扣杂重</td>
+                                <td class="col col-bgc">净重</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col">{{ printData1[index].goodsName}}</td>
+                                <td class="col">{{ printData1[index].type}}</td>
+                                <td class="col">
+                                    {{ printData1[index].qualityInspectionManagement.grade}}
+                                </td>
+                                <td class="col">
+                                    {{ printData1[index].qualityInspectionManagement.waterContent}}
+                                </td>
+                                <td class="col">
+                                    {{ printData1[index].qualityInspectionManagement.impurity}}
+                                </td>
+                                <td class="col">
+                                    {{printData1[index].weighingManagement.qualityInspectionManagement?printData1[index].weighingManagement.qualityInspectionManagement.bulkDensity:''}}
+                                </td>
+                                <td class="col">{{ printData1[index].grossWeight}}</td>
+                                <td class="col">{{ printData1[index].tare}}</td>
+                                <td class="col">
+                                    {{printData1[index].weighingManagement?printData1[index].weighingManagement.buckleMiscellaneous:''}}
+                                </td>
+                                <td class="col">{{ printData1[index].netWeight}}</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">纯重</td>
+                                <td class="col col-bgc" v-if="printData1[index].type == '潮粮'">
+                                    净重单价
+                                </td>
+                                <td class="col col-bgc" v-if="printData1[index].type == '干粮'">
+                                    单价
+                                </td>
+                                <td class="col col-bgc">扣单价</td>
+                                <td class="col col-bgc">粮款</td>
+                                <td class="col col-bgc">称重补助</td>
+                                <td class="col col-bgc">运费补助</td>
+                                <td class="col col-bgc">卸车补助</td>
+                                <td class="col col-bgc">其他补助</td>
+                                <td class="col col-bgc">称重扣款</td>
+                                <td class="col col-bgc">运费扣款</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col">{{ printData1[index].pureWeight}}</td>
+                                <td class="col " v-if="printData1[index].type == '潮粮'">
+                                    {{printData1[index].tidalGrainPrice}}
+                                </td>
+                                <td class="col " v-if="printData1[index].type == '干粮'">
+                                    {{printData1[index].qualityInspectionManagement.dryGrainPrice}}
+                                </td>
+                                <td class="col ">{{ printData1[index].unitDeduction}}</td>
+                                <td class="col ">{{ printData1[index].grainMoney}}</td>
+                                <td class="col ">{{ printData1[index].weighingSubsidy}}</td>
+                                <td class="col ">{{ printData1[index].freightSubsidy}}</td>
+                                <td class="col ">{{ printData1[index].unloadSubsidy}}</td>
+                                <td class="col ">{{ printData1[index].otherSubsidy}}</td>
+                                <td class="col ">{{ printData1[index].weighingDeduction}}</td>
+                                <td class="col ">{{ printData1[index].freightDeduction}}</td>
+                                <!-- <td class="col ">{{ printData1[index].unloadDeduction}}</td> -->
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">卸车扣款</td>
+                                <td class="col col-bgc">质量扣款</td>
+                                <td class="col col-bgc">其他扣款</td>
+                                <!-- <td class="col col-bgc" v-if="printData.type == '潮粮'">
+                                    纯重单价
+                                </td> -->
+                                <td class="col col-bgc">合计应付</td>
+                                <td class="col col-bgc">购粮性质</td>
+                                <td class="col col-bgc">车牌号</td>
+                                <td class="col col-bgc" colspan="4">记事</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col ">{{ printData1[index].unloadDeduction}}</td>
+                                <td class="col ">{{ printData1[index].qualityDeduction}}</td>
+                                <td class="col ">{{ printData1[index].otherDeduction}}</td>
+                                <!-- <td class="col " v-if="printData1[index].type == '潮粮'">
+                                    {{ printData1[index].solidGrainPrice}}
+                                </td> -->
+                                <td class="col ">
+                                    {{ printData1[index].calculationPayable}}
+                                </td>
+                                <td class="col ">
+                                    {{ printData1[index].qualityInspectionManagement.natureOfGrainPurchase}}
+                                </td>
+                                <td class="col ">{{ printData1[index].carNo}}</td>
+                                <td class="col " colspan="4">
+                                    {{ printData1[index].remarks}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">实付金额</td>
+                                <td class="col " colspan="2">
+                                    {{printData1[index].actualPayment}}
+                                </td>
+                                <td class="col col-bgc" colspan="3">人民币(大写)</td>
+                                <td class="col " colspan="4">
+                                    {{printData1[index].capitalize}}
+                                </td>
+                            </tr>
+                        </table>
+
+                        <div class="bottom">
+                            <div class="bottom-row1">
+                                <div>
+                                    质检:{{ printData1[index].qualityInspectionManagement.qualityInspector}}
+                                </div>
+                                <div>
+                                    毛检:{{ printData1[index].weighingManagement.secretaryWeigher}}
+                                </div>
+                                <div>
+                                    皮检:{{ printData1[index].weighingManagement.skinInspector}}
+                                </div>
+                                <div>结算:{{ printData1[index].settlementClerk}}</div>
+                                <div>付款:{{ printData1[index].cashier}}</div>
+                                <div>复点:{{ }}</div>
+                                <div></div>
+                            </div>
+                            <div class="bottom-row2">
+                                <!-- <div class="left">
+                   <img src="../../../../public/img/add.png" alt="" />
+                 </div> -->
+                                <div class="config">收货单位签名或盖章</div>
+                                <div class="">客户签名</div>
+                            </div>
+                            <!-- <div class="bottom-row3">扫一扫</div> -->
+                            <!-- <div class="bottom-row4">
+                 <el-button type="primary">关闭</el-button>
+                  <el-button type="primary" @click="printSmall">打印小票</el-button>
+                  <el-button type="primary" @click="printBig">打印单据</el-button>
+               </div> -->
+                        </div>
+                    </div>
+                    <div v-if="isShowPrintType4" class="part2">
+                        <div style="height: 120px;">
+
+                            <div class="title">入库检斤单</div>
+                            <!-- <div class="leftimg">
+                                <img :src="printData1[index].weighingManagement.codeUrl" alt="">
+                            </div> -->
+                            <div class="number1">{{printData1[index].weighingManagement.number}}</div>
+                        </div>
+
+                        <table class="table">
+                            <tr class="row">
+                                <td class="col col-bgc">客户姓名</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.customer}}</td>
+                                <td class="col col-bgc">客户电话</td>
+                                <td class="col">{{printData1[index].weighingManagement.customerPhone}}</td>
+                                <td class="col col-bgc">车牌号</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.carNumber}}</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">收货单位</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.compName}}</td>
+                                <td class="col col-bgc">联系人</td>
+                                <td class="col">{{printData1[index].weighingManagement.person}}</td>
+                                <td class="col col-bgc">联系电话</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.personPhone}}</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">货名</td>
+                                <td class="col">{{printData1[index].weighingManagement.goodsName}}</td>
+                                <td class="col col-bgc">类型</td>
+                                <td class="col">{{printData1[index].weighingManagement.type}}</td>
+                                <td class="col col-bgc">容量(克/升)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.bulkDensity:''}}
+                                </td>
+                                <td class="col col-bgc">不完善粒(%)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.imperfectGrain:''}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">等级</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.grade:''}}
+                                </td>
+                                <td class="col col-bgc">水分(%)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.waterContent:''}}
+                                </td>
+                                <td class="col col-bgc">热损伤(%)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.jiaorenli:''}}
+                                </td>
+                                <td class="col col-bgc">质检时间</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.qualityDate:''}}
+                                </td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">杂质(%)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.impurity:''}}
+                                </td>
+                                <td class="col col-bgc">霉变粒(%)</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.mildewGrain:''}}
+                                </td>
+                                <td class="col col-bgc">扣杂</td>
+                                <td class="col">
+                                    {{printData1[index].qualityInspectionManagement?printData1[index].qualityInspectionManagement.buckleMiscellaneous:''}}
+                                </td>
+                                <td class="col " colspan="2"></td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc">毛重(公斤)</td>
+                                <td class="col">{{printData1[index].weighingManagement.grossWeight}}</td>
+                                <td class="col col-bgc">皮重(公斤)</td>
+                                <td class="col">{{printData1[index].weighingManagement.tare}}</td>
+                                <td class="col col-bgc">扣重(公斤)</td>
+                                <td class="col">{{printData1[index].weighingManagement.buckleMiscellaneous}}</td>
+                                <td class="col col-bgc">净重(公斤)</td>
+                                <td class="col">{{printData1[index].weighingManagement.netWeight}}</td>
+                            </tr>
+                            <tr class="row">
+                                <td class="col col-bgc" colspan="2">毛重检斤时间</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.grossDate}}</td>
+                                <td class="col col-bgc" colspan="2">皮重检斤时间</td>
+                                <td class="col" colspan="2">{{printData1[index].weighingManagement.tareDate}}</td>
+                            </tr>
+                        </table>
+
+                        <div class="bottom">
+                            <div class="bottom-row1">
+                                <div>毛检:{{printData1[index].weighingManagement.secretaryWeigher}}</div>
+                                <div style="margin-left:60px">
+                                    皮检:{{printData1[index].weighingManagement.skinInspector}}
+                                </div>
+                                <!-- <div>{{tableData.qualityDate}}</div> -->
+                            </div>
+                            <div class="bottom-row2">
+                                <!-- <div class="leftimg">
+                    <img src="../img/add.png" alt="">
+                  </div> -->
+                                <div class="config">收货单位签名或盖章:</div>
+                                <div class="autograph">客户签名:</div>
+                            </div>
+                            <!-- <div class="bottom-row3">扫一扫</div> -->
+                        </div>
+                    </div>
+
+                    <div class="part1" v-if="isShowPrintType1">
+                        <div class="sfcard-content">
+                            <div class="sfcard-title">
+                                {{ printData1[index].customerName}}{{printData1[index].identityAuthenticationInfo.customerNumberCard}}
+                            </div>
+                            <img :src="customerList1[index].imgURl.imageUrl1" class="avatar" />
+                        </div>
+                        <!--     <div class="sfcard-content">
+                <div class="sfcard-title">
+                  {{
+                  printData1[index].customerName}}{{printData1[index].identityAuthenticationInfo.customerNumberCard}}
+                </div>
+                <img :src="customerList1[index].imgURl.imageUrl2" class="avatar" />
+              </div> -->
+                    </div>
+                    <div class="bankcard" v-if="isShowPrintType2">
+
+                        <div class="sfcard-content part2">
+                            <div class="sfcard-title">
+                                {{printData1[index].bankDeposit}}{{printData1[index].bankCard}}
+                            </div>
+                            <!-- <img :src="customerList1[index].imgURl.imageUrl3" class="avatar" /> -->
+                            <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl3" class="avatar" />
+                            <img v-else class="avatar" />
+                            <!-- <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl4" class="avatar" />
+                            <img v-else class="avatar" /> -->
+
+                        </div>
+                        <!--          <div class="sfcard-content part2">
+                <div class="sfcard-title">
+                  {{printData1[index].identityAuthenticationInfo.bankDeposit}}{{printData1[index].identityAuthenticationInfo.bankCard}}
+                </div>
+                <img :src="customerList1[index].imgURl.imageUrl4" class="avatar" />
+              </div> -->
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="content" v-else>
+            <!-- <div class="part5" v-if="isShowPrintType5">
+                <div class="header1">
+                    付款回执单
+                </div>
+                <img :src="printData.paymentScreenshot" class="paymentScreenshot" />
+            </div> -->
+            <div class="center part1" v-if="isShowPrintType3" :class="!selectPrint? 'simple':''">
+                <div class="header1">{{ printData.compName}}结算凭证</div>
+                <div class="line"></div>
+                <div class="line"></div>
+                <div class="header">
+                    <div>单位名称:{{ printData.compName}}</div>
+                    <!-- <div>税务登记编号:91230230MA1BNL7Q93</div> -->
+                </div>
+                <div class="header-top">
+                    <div>单位:公斤/元</div>
+                    <div>No.</div>
+                </div>
+                <div class="header-top">
+                    <div>开票日期:{{printData.createDate}}</div>
+                    <!-- <div>开票日期:{{new Date(yyyy,mm,dd)}}</div> -->
+                    <div class="number">{{dealNo(printData.paymentNo)}}</div>
+                </div>
+                <table class="table">
+                    <tr class="row">
+                        <td rowspan="4" class="col col-bgc">买方</td>
+                        <td class="col col-bgc">单位名称</td>
+                        <td class="col" colspan="3">{{ printData.compName}}</td>
+                        <td rowspan="4" class="col col-bgc">卖方</td>
+                        <td class="col col-bgc">姓名</td>
+                        <td class="col" colspan="4">{{ printData.customerName}}</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">税务登记号</td>
+                        <td class="col" colspan="3">{{ printData.taxRegistrationNo}}</td>
+                        <td class="col col-bgc">身份证号</td>
+                        <td class="col" colspan="4">
+                            {{ printData.identityAuthenticationInfo.customerNumberCard}}
+                        </td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">业务编号</td>
+                        <td class="col" colspan="3">{{ printData.paymentNo}}</td>
+                        <td class="col col-bgc">卡号</td>
+                        <td class="col" colspan="4">
+                            {{printData.identityAuthenticationInfo.bankDeposit}}{{printData.identityAuthenticationInfo.bankCard}}
+                        </td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">收货仓库</td>
+                        <td class="col" colspan="3">{{printData.warehouseName}}</td>
+                        <td class="col col-bgc">地址</td>
+                        <td class="col" colspan="4">
+                            {{printData.identityAuthenticationInfo.compAddress}}
+                        </td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">货名</td>
+                        <td class="col col-bgc">类型</td>
+                        <td class="col col-bgc">等级</td>
+                        <td class="col col-bgc">水分%</td>
+                        <td class="col col-bgc">杂质%</td>
+                        <td class="col col-bgc">毛重</td>
+                        <td class="col col-bgc">皮重</td>
+                        <td class="col col-bgc">扣杂重</td>
+                        <td class="col col-bgc">净重</td>
+                        <td class="col col-bgc"></td>
+                        <!-- <td class="col col-bgc">出库净重</td> -->
+                        <!-- <td class="col col-bgc">纯重</td> -->
+                    </tr>
+                    <tr class="row">
+                        <td class="col">{{ printData.goodsName}}</td>
+                        <td class="col">{{ printData.type}}</td>
+                        <td class="col">
+                            {{ printData.qualityInspectionManagement.grade}}
+                        </td>
+                        <td class="col">
+                            {{ printData.qualityInspectionManagement.waterContent}}
+                        </td>
+                        <td class="col">
+                            {{ printData.qualityInspectionManagement.impurity}}
+                        </td>
+                        <td class="col">{{ printData.grossWeight}}</td>
+                        <td class="col">{{ printData.tare}}</td>
+                        <td class="col">
+                            {{ printData.weighingManagement.buckleMiscellaneous}}
+                        </td>
+                        <td class="col">{{ printData.netWeight}}</td>
+                        <td class="col"></td>
+                        <!-- <td class="col">{{ printData.pureWeight}}</td> -->
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">纯重</td>
+                        <td class="col col-bgc" v-if="printData.type == '潮粮'">
+                            净重单价
+                        </td>
+                        <td class="col col-bgc" v-if="printData.type == '干粮'">单价</td>
+                        <td class="col col-bgc">扣单价</td>
+                        <td class="col col-bgc">粮款</td>
+                        <td class="col col-bgc">称重补助</td>
+                        <td class="col col-bgc">运费补助</td>
+                        <td class="col col-bgc">卸车补助</td>
+                        <td class="col col-bgc">其他补助</td>
+                        <td class="col col-bgc">称重扣款</td>
+                        <td class="col col-bgc">运费扣款</td>
+                        <!-- <td class="col col-bgc">1卸车扣款</td> -->
+                    </tr>
+                    <tr class="row">
+                        <td class="col">{{ printData.pureWeight}}</td>
+                        <td class="col " v-if="printData.type == '潮粮'">
+                            {{printData.tidalGrainPrice}}
+                        </td>
+                        <td class="col " v-if="printData.type == '干粮'">
+                            {{printData.qualityInspectionManagement.dryGrainPrice}}
+                        </td>
+                        <td class="col ">{{ printData.unitDeduction}}</td>
+                        <td class="col ">{{ printData.grainMoney}}</td>
+                        <td class="col ">{{ printData.weighingSubsidy}}</td>
+                        <td class="col ">{{ printData.freightSubsidy}}</td>
+                        <td class="col ">{{ printData.unloadSubsidy}}</td>
+                        <td class="col ">{{ printData.otherSubsidy}}</td>
+                        <td class="col ">{{ printData.weighingDeduction}}</td>
+                        <td class="col ">{{ printData.freightDeduction}}</td>
+                        <!-- <td class="col ">{{ printData.unloadDeduction}}</td> -->
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">卸车扣款</td>
+                        <td class="col col-bgc">质量扣款</td>
+                        <td class="col col-bgc">其他扣款</td>
+                        <!-- <td class="col col-bgc" v-if="printData.type == '潮粮'">
+                            纯重单价
+                        </td> -->
+                        <td class="col col-bgc">合计应付</td>
+                        <td class="col col-bgc">购粮性质</td>
+                        <td class="col col-bgc">车牌号</td>
+                        <td class="col col-bgc" colspan="4">记事</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col ">{{ printData.unloadDeduction}}</td>
+                        <td class="col ">{{ printData.qualityDeduction}}</td>
+                        <td class="col ">{{ printData.otherDeduction}}</td>
+                        <!-- <td class="col " v-if="printData.type == '潮粮'">
+                            {{ printData.solidGrainPrice}}
+                        </td> -->
+                        <td class="col ">{{ printData.calculationPayable}}</td>
+                        <td class="col ">
+                            {{ printData.qualityInspectionManagement.natureOfGrainPurchase}}
+                        </td>
+                        <td class="col ">{{ printData.carNo}}</td>
+                        <td class="col " colspan="4">{{ printData.remarks}}</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">实付金额</td>
+                        <td class="col " colspan="2">{{printData.actualPayment}}</td>
+                        <td class="col col-bgc" colspan="3">人民币(大写)</td>
+                        <td class="col " colspan="4">{{printData.capitalize}}</td>
+                    </tr>
+                </table>
+                <div class="bottom">
+                    <div class="bottom-row1">
+                        <div>
+                            质检:{{ printData.qualityInspectionManagement.qualityInspector}}
+                        </div>
+                        <div>
+                            毛检:{{ printData.weighingManagement.secretaryWeigher}}
+                        </div>
+                        <div>皮检:{{ printData.weighingManagement.skinInspector}}</div>
+                        <div>结算:{{ printData.settlementClerk}}</div>
+                        <div>付款:{{ printData.cashier}}</div>
+                        <div>复点:{{ }}</div>
+                        <div></div>
+                    </div>
+                    <div class="bottom-row2">
+                        <!-- <div class="left">
+               <img src="../../../../public/img/add.png" alt="" />
+             </div> -->
+                        <div class="config">收货单位签名或盖章</div>
+                        <div class="">客户签名</div>
+                    </div>
+                    <!-- <div class="bottom-row3">扫一扫</div> -->
+                    <!-- <div class="bottom-row4">
+             <el-button type="primary">关闭</el-button>
+              <el-button type="primary" @click="printSmall">打印小票</el-button>
+              <el-button type="primary" @click="printBig">打印单据</el-button>
+           </div> -->
+                </div>
+            </div>
+
+            <div v-if="isShowPrintType4" class="part2">
+                <div>
+
+                    <div class="title">入库检斤单</div>
+                    <!-- <div class="leftimg">
+                        <img :src="tableData.codeUrl" alt="">
+                    </div> -->
+                    <div class="number1">{{tableData.number}}</div>
+                </div>
+                <table class="table">
+                    <tr class="row">
+                        <td class="col col-bgc">客户姓名</td>
+                        <td class="col" colspan="2">{{tableData.customer}}</td>
+                        <td class="col col-bgc">客户电话</td>
+                        <td class="col">{{tableData.customerPhone}}</td>
+                        <td class="col col-bgc">车牌号</td>
+                        <td class="col" colspan="2">{{tableData.carNumber}}</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">收货单位</td>
+                        <td class="col" colspan="2">{{tableData.compName}}</td>
+                        <td class="col col-bgc">联系人</td>
+                        <td class="col">{{tableData.person}}</td>
+                        <td class="col col-bgc">联系电话</td>
+                        <td class="col" colspan="2">{{tableData.personPhone}}</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">货名</td>
+                        <td class="col">{{tableData.goodsName}}</td>
+                        <td class="col col-bgc">类型</td>
+                        <td class="col">{{tableData.type}}</td>
+                        <td class="col col-bgc">容量(克/升)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.bulkDensity:''}}
+                        </td>
+                        <td class="col col-bgc">不完善粒(%)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.imperfectGrain:''}}
+                        </td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">等级</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.grade:''}}
+                        </td>
+                        <td class="col col-bgc">水分(%)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.waterContent:''}}
+                        </td>
+                        <td class="col col-bgc">热损伤(%)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.jiaorenli:''}}
+                        </td>
+                        <td class="col col-bgc">质检时间</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.qualityDate:''}}
+                        </td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">杂质(%)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.impurity:''}}
+                        </td>
+                        <td class="col col-bgc">霉变粒(%)</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.mildewGrain:''}}
+                        </td>
+                        <td class="col col-bgc">扣杂</td>
+                        <td class="col">
+                            {{tableData.qualityInspectionManagement?tableData.qualityInspectionManagement.buckleMiscellaneous:''}}
+                        </td>
+                        <td class="col " colspan="2"></td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc">毛重(公斤)</td>
+                        <td class="col">{{tableData.grossWeight}}</td>
+                        <td class="col col-bgc">皮重(公斤)</td>
+                        <td class="col">{{tableData.tare}}</td>
+                        <td class="col col-bgc">扣重(公斤)</td>
+                        <td class="col">{{tableData.buckleMiscellaneous}}</td>
+                        <td class="col col-bgc">净重(公斤)</td>
+                        <td class="col">{{tableData.netWeight}}</td>
+                    </tr>
+                    <tr class="row">
+                        <td class="col col-bgc" colspan="2">毛重检斤时间</td>
+                        <td class="col" colspan="2">{{tableData.grossDate}}</td>
+                        <td class="col col-bgc" colspan="2">皮重检斤时间</td>
+                        <td class="col" colspan="2">{{tableData.tareDate}}</td>
+                    </tr>
+                </table>
+
+                <div class="bottom">
+                    <div class="bottom-row1">
+                        <div>毛检:{{tableData.secretaryWeigher}}</div>
+                        <div style="margin-left:60px">
+                            皮检:{{tableData.skinInspector}}
+                        </div>
+                        <!-- <div>{{tableData.qualityDate}}</div> -->
+                    </div>
+                    <div class="bottom-row2">
+                        <!-- <div class="left">
+                <img src="../img/add.png" alt="">
+              </div> -->
+                        <div class="config">收货单位签名或盖章:</div>
+                        <div class="autograph">客户签名:</div>
+                    </div>
+                    <!-- <div class="bottom-row3">扫一扫</div> -->
+                </div>
+            </div>
+
+            <div class="sfcard part3" v-if="isShowPrintType1">
+                <div class="sfcard-content">
+                    <div class="sfcard-title">
+                        {{ printData.customerName}}{{ printData.identityAuthenticationInfo.customerNumberCard}}
+                    </div>
+                    <img :src="imageUrl1" class="avatar" />
+                </div>
+                <!-- <div class="sfcard-content">
+                    <div class="sfcard-title">
+                        {{ printData.customerName}}{{ printData.identityAuthenticationInfo.customerNumberCard}}
+                    </div>
+                    <img :src="imageUrl2" class="avatar" />
+                </div> -->
+            </div>
+
+            <div class="bankcard part4" v-if="isShowPrintType2">
+                <div class="sfcard-content">
+                    <div class="sfcard-title">
+                        {{printData.bankDeposit}}{{printData.bankCard}}
+                    </div>
+                    <img :src="imageUrl3" class="avatar" />
+                </div>
+                <!-- <div class="sfcard-content">
+                    <div class="sfcard-title">
+                        {{printData.bankDeposit}}{{printData.bankCard}}
+                    </div>
+                    <img :src="imageUrl4" class="avatar" />
+                </div> -->
+
+            </div>
+        </div>
+
+        <div class="small-content" v-if="smallContent">
+            <div class="small-title">
+                <div>
+                    {{printData.compName}}结算凭证
+                </div>
+                <img class="small-img" src="../img/add.png" alt="" />
+            </div>
+            <div class="small-row">
+                <div>开票日期</div>
+                <div>{{printData.createDate}}</div>
+            </div>
+            <div class="small-row">
+                <div>买方单位名称</div>
+                <div>{{printData.compName}}</div>
+            </div>
+            <div class="small-row">
+                <div>买方姓名</div>
+                <div>{{printData.customerName}}</div>
+            </div>
+            <div class="small-row">
+                <div>税务登记号</div>
+                <div>{{printData.taxRegistrationNo}}</div>
+            </div>
+            <div class="small-row">
+                <div>身份证号</div>
+                <div>{{printData.customerNumberCard}}</div>
+            </div>
+            <div class="small-row">
+                <div>化验单号</div>
+                <div>{{printData.paymentNo}}</div>
+            </div>
+            <div class="small-row">
+                <div>卡号</div>
+                <div>{{printData.bankCard}}</div>
+            </div>
+            <div class="small-row">
+                <div>收货仓库</div>
+                <div>{{printData.warehouseName}}</div>
+            </div>
+            <div class="small-row">
+                <div>货名</div>
+                <div>{{printData.goodsName}}</div>
+            </div>
+            <div class="small-row">
+                <div>类型</div>
+                <div>{{printData.type}}</div>
+            </div>
+            <div class="small-row">
+                <div>等级</div>
+                <div>{{printData.grade}}</div>
+            </div>
+            <div class="small-row">
+                <div>水分%</div>
+                <div>{{printData.waterContent}}</div>
+            </div>
+            <div class="small-row">
+                <div>杂质%</div>
+                <div>{{printData.impurity}}</div>
+            </div>
+            <div class="small-row">
+                <div>毛重</div>
+                <div>{{printData.grossWeight}}</div>
+            </div>
+            <div class="small-row">
+                <div>皮重</div>
+                <div>{{printData.tare}}</div>
+            </div>
+            <div class="small-row">
+                <div>扣杂重</div>
+                <div>{{printData.weighingManagement.buckleMiscellaneous}}</div>
+            </div>
+            <div class="small-row">
+                <div>净重</div>
+                <div>{{printData.netWeight}}</div>
+            </div>
+            <div class="small-row">
+                <div>纯重</div>
+                <div>{{printData.pureWeight}}</div>
+            </div>
+            <div class="small-row">
+                <div>净重单价</div>
+                <div>{{printData.tidalGrainPrice}}</div>
+            </div>
+            <div class="small-row">
+                <div>粮款</div>
+                <div>{{printData.grainMoney}}</div>
+            </div>
+            <div class="small-row">
+                <div>称重补助</div>
+                <div>{{printData.weighingSubsidy}}</div>
+            </div>
+            <div class="small-row">
+                <div>运费补助</div>
+                <div>{{printData.freightSubsidy}}</div>
+            </div>
+            <div class="small-row">
+                <div>卸车补助</div>
+                <div>{{printData.unloadSubsidy}}</div>
+            </div>
+            <div class="small-row">
+                <div>其他补助</div>
+                <div>{{printData.otherSubsidy}}</div>
+            </div>
+            <div class="small-row">
+                <div>称重扣款</div>
+                <div>{{printData.weighingDeduction}}</div>
+            </div>
+            <div class="small-row">
+                <div>运费扣款</div>
+                <div>{{printData.freightDeduction}}</div>
+            </div>
+            <div class="small-row">
+                <div>卸车扣款</div>
+                <div>{{printData.unloadDeduction}}</div>
+            </div>
+            <div class="small-row">
+                <div>质量扣款</div>
+                <div>{{printData.qualityDeduction}}</div>
+            </div>
+            <div class="small-row">
+                <div>其他扣款</div>
+                <div>{{printData.otherDeduction}}</div>
+            </div>
+            <div class="small-row">
+                <div>纯重单价</div>
+                <div>{{printData.solidGrainPrice}}</div>
+            </div>
+            <div class="small-row">
+                <div>合计应付</div>
+                <div>{{printData.calculationPayable}}</div>
+            </div>
+            <div class="small-row">
+                <div>购粮性质</div>
+                <div>{{printData.natureOfGrainPurchase}}</div>
+            </div>
+            <div class="small-row">
+                <div>车牌号</div>
+                <div>{{printData.carNo}}</div>
+            </div>
+            <div class="small-row">
+                <div>记事</div>
+                <div>{{printData.remarks}}</div>
+            </div>
+            <div class="small-row">
+                <div>实付金额</div>
+                <div>{{printData.actualPayment}}</div>
+            </div>
+            <div class="small-row">
+                <div>人民币(大写)</div>
+                <div>{{printData.capitalize}}</div>
+            </div>
+            <div class="small-row">
+                <div>质检</div>
+                <div>{{printData.qualityInspector}}</div>
+            </div>
+            <div class="small-row">
+                <div>毛检</div>
+                <div>{{printData.secretaryWeigher}}</div>
+            </div>
+            <div class="small-row">
+                <div>皮检</div>
+                <div>{{printData.skinInspector}}</div>
+            </div>
+            <div class="small-row">
+                <div>结算</div>
+                <div>{{printData.settlementClerk}}</div>
+            </div>
+            <div class="small-row">
+                <div>付款</div>
+                <div>{{printData.actualPayment}}</div>
+            </div>
+            <div class="small-row">
+                <div>复点</div>
+                <div>&nbsp;&nbsp;&nbsp;</div>
+            </div>
+        </div>
+    </div>
+</body>
+<script src="../cdn/vue/2.6.10/vue.min.js"></script>
+<script src="../cdn/element-ui/2.13.2/index.js"></script>
+<script type="text/javascript">
+    new Vue({
+        el: '#app',
+        data: {
+            isShowPrintType1: false,
+            isShowPrintType2: false,
+            isShowPrintType3: false,
+            isShowPrintType4: false,
+            isShowPrintType5: false,
+            showType: [],
+            printData: {},
+            printData1: [],
+            customerList: {},
+            customerList1: [],
+            name: '',
+            bigContent: false,
+            smallContent: false,
+            date: '',
+            imageUrl1: '',
+            imageUrl2: '',
+            imageUrl3: '',
+            imageUrl4: '',
+            identity: [],
+            bank: [],
+            selectPrint: false,
+            onlyShowPz: false,
+            tableData: []
+        },
+        computed: {},
+        methods: {
+            dealNo(str) {
+                return str.slice(4)
+            },
+            tableRowClassName({
+                row,
+                rowIndex
+            }) {
+                if (rowIndex === 1) {
+                    return 'warning-row'
+                } else if (rowIndex === 3) {
+                    return 'success-row'
+                }
+                return ''
+            },
+            getQueryVariable(variable) {
+                var query = window.location.search.substring(1)
+                var vars = query.split('&')
+                for (var i = 0; i < vars.length; i++) {
+                    var pair = vars[i].split('=')
+                    if (pair[0] == variable) {
+                        return pair[1]
+                    }
+                }
+                return false
+            },
+            printSmall() {},
+            printBig() {}
+        },
+        mounted() {
+            this.date = new Date().toLocaleString()
+                // let _data = decodeURIComponent(this.getQueryVariable('dataList'))
+            let _data = {}
+            if (localStorage.getItem('print_pay_data')) {
+                _data = localStorage.getItem('print_pay_data')
+            } else {
+                _data = decodeURIComponent(this.getQueryVariable("dataList"))
+            }
+            if (!_data || _data == 'false') {
+                this.selectPrint = true
+                this.printData1 = JSON.parse(
+                    localStorage.getItem('selectPrint_selectPrintList')
+                )
+                console.log("对象", this.printData1)
+                console.log("对象", this.printData)
+                for (let i = 0; i < this.printData1.length; i++) {
+                    if (!this.printData1[i].identityAuthenticationInfo.compAddress) this.printData1[i]
+                        .identityAuthenticationInfo.compAddress = ''
+                    if (this.printData1[i].identityAuthenticationInfo.compAddress.length > 24) {
+                        this.printData1[i].identityAuthenticationInfo.compAddress = this.printData1[i]
+                            .identityAuthenticationInfo
+                            .compAddress.substring(0, 24)
+                    }
+                }
+            } else {
+                this.printData = JSON.parse(_data)
+                    //地址过长截取
+                if (this.printData.identityAuthenticationInfo && this.printData.identityAuthenticationInfo.compAddress.length > 24) {
+                    this.printData.identityAuthenticationInfo.compAddress = this.printData.identityAuthenticationInfo
+                        .compAddress.substring(0, 24)
+                }
+                this.selectPrint = false
+            }
+            let _type = decodeURIComponent(this.getQueryVariable('type'))
+            this.showType = decodeURIComponent(
+                    this.getQueryVariable('printTypeList')
+                )
+                // this.pzList = this.showType.split(',')
+                // if((this.showType.indexOf('打印结算凭证')>-1)&&this.pzList.length==1){
+                //   this.onlyShowPz = true
+                // }
+                // this.pageType = decodeURIComponent(this.getQueryVariable('printTypeList'))
+            let _data1 = decodeURIComponent(this.getQueryVariable('customerList'))
+            if (!_data1) {
+                this.customerList1 = JSON.parse(
+                    localStorage.getItem('selectPrint_selectCustomerList')
+                )
+            } else {
+                this.customerList = JSON.parse(_data1)
+            }
+            console.log('cwprint', localStorage.getItem('cwprint'))
+            var cwprint = localStorage.getItem('cwprint')
+            if (cwprint == 'true') {
+                if (this.selectPrint) {
+                    for (let i = 0; i < this.customerList1.length; i++) {
+                        let _url1 = this.customerList1[i].cardAddressUrl.split(',')
+                            // let _url2 = this.customerList1[i].payeeAddressUrl.split(',')
+                        this.customerList1[i].imgURl = {
+                            imageUrl1: _url1[0],
+                            imageUrl2: _url1[1],
+                            // imageUrl3: _url2[0],
+                            // imageUrl4: _url2[0]
+                        }
+                    }
+                    for (let i = 0; i < this.printData1.length; i++) {
+                        if (this.printData1[i].payeeAddressUrl) {
+                            let _url2 = this.printData1[i].payeeAddressUrl.split(',')
+                            this.printData1[i].imgURl = {
+                                imageUrl3: _url2[0],
+                                imageUrl4: _url2[1]
+                            }
+                        }
+
+                    }
+                } else {
+                    if (this.customerList.cardAddressUrl) {
+                        this.identity = this.customerList.cardAddressUrl.split(',')
+                        this.imageUrl1 = this.identity[0]
+                        this.imageUrl2 = this.identity[1]
+                    }
+                    console.log(this.customerList)
+                    if (this.customerList.payeeAddressUrl) {
+                        this.bank = this.customerList.payeeAddressUrl.split(',')
+                        this.imageUrl3 = this.bank[0]
+                        this.imageUrl4 = this.bank[1]
+                    }
+                    if (this.printData.payeeAddressUrl) {
+                        this.bank = this.printData.payeeAddressUrl.split(',')
+                        this.imageUrl3 = this.bank[0]
+                        this.imageUrl4 = this.bank[1]
+                    }
+
+                    this.tableData = this.printData.weighingManagement
+                }
+                let _lsit = this.showType.split(',')
+                for (let i = 0; i < _lsit.length; i++) {
+                    switch (_lsit[i]) {
+                        case '打印身份证':
+                            this.isShowPrintType1 = !this.isShowPrintType1
+                            break
+                        case '打印银行卡':
+                            this.isShowPrintType2 = !this.isShowPrintType2
+                            break
+                        case '打印结算凭证':
+                            this.isShowPrintType3 = !this.isShowPrintType3
+                            break
+                        case '打印检斤单':
+                            this.isShowPrintType4 = !this.isShowPrintType4
+                            break
+                        case '打印回执单':
+                            this.isShowPrintType5 = !this.isShowPrintType5
+                            break
+                    }
+                }
+            } else {
+                this.isShowPrintType3 = true
+            }
+            if (_type == 2) {
+                this.bigContent = true
+                this.smallContent = false
+            } else {
+                this.smallContent = true
+                this.bigContent = false
+            }
+            if (this.printData.compName == undefined) this.printData.compName = ''
+            document.title = this.printData.compName + '结算凭证'
+            window.print()
+                // sessionStorage.removeItem('selectPrint_selectPrintList');
+                // sessionStorage.removeItem('selectPrint_selectCustomerList');
+            window.onafterprint = function(event) {
+                window.history.back(-1)
+            }
+        },
+        watch: {}
+    })
+</script>
+
+</html>

+ 64 - 81
public/static/payprint2.html

@@ -10,48 +10,48 @@
             border: 2px solid #333333;
             padding: 5px 0;
         }
-
+        
         #app {
             height: 88vh;
             position: relative;
         }
-
+        
         .simple {
-            height: 100vh !important;
+            height: 120vh !important;
         }
-
+        
         .content {
             width: 1000px;
             margin: auto;
         }
-
+        
         table {
             width: 100%;
             text-align: center;
             border-collapse: collapse;
         }
-
+        
         .col-bgc {
             background: #f6f7fb;
         }
-
+        
         .bottom-row1 {
             display: flex;
             justify-content: space-between;
             margin: 20px 0;
         }
-
+        
         .bottom-row2 {
             display: flex;
             margin: 10px 0;
         }
-
+        
         img {
             width: 80px;
             height: 80px;
             /* margin-right: 118px; */
         }
-
+        
         .leftimg {
             width: 80px;
             height: 80px;
@@ -59,35 +59,35 @@
             right: 20px;
             top: 3px;
         }
-
+        
         .config {
             margin-right: 240px;
         }
-
+        
         .bottom-row3 {
             margin: 10px 0;
         }
-
+        
         .title {
             text-align: center;
             font-size: 24px;
         }
-
+        
         .number {
             text-align: right;
             margin-bottom: 10px;
         }
-
+        
         .number1 {
             text-align: right;
             margin-bottom: 10px;
             margin-top: 60px;
         }
-
+        
         .small-row {
             display: flex;
         }
-
+        
         .small-content {
             width: 400px;
             margin: 0 auto;
@@ -101,7 +101,7 @@
             margin: auto;
             height: 650px;
         }
-
+        
         .small-title {
             text-align: center;
             font-size: 18px;
@@ -109,99 +109,88 @@
             justify-content: space-between;
             align-items: center;
         }
-
+        
         .small-row {
             display: flex;
             justify-content: space-between;
             margin: 10px;
         }
-
+        
         .small-img {
             margin-right: 0;
         }
-
+        
         .sign {
             margin-right: 100px;
         }
-
+        
         .header {
             display: flex;
             justify-content: space-between;
             font-size: 16px;
             margin: 10px 0;
         }
-
+        
         .header1 {
             font-size: 24px;
             /* margin: 30px 60px 10px 60px; */
             display: flex;
             justify-content: center;
         }
-
+        
         .line {
             height: 2px;
             width: 410px;
             margin: 3px auto;
             background: black;
         }
-
+        
         .line:nth-of-type(3) {
             margin-bottom: 30px;
         }
-
+        
         .header-top {
             display: flex;
             justify-content: space-between;
         }
-
+        
         .sfcard {
-            /* background: red; */
+            background: red;
         }
-
+        
         .sfcard-content {
             /*        display: flex;
         align-items: center;
         justify-content: space-evenly; */
-            /* background-color: red; */
-            /* height: 100vh; */
-        }
-        .sfcard-content_other{
-              height: 100vh;
         }
         
-
-        .sfcard-content img ,.sfcard-content_other img{
+        .sfcard-content img {
             width: 100%;
-            height: calc(100vh - 100px);
+            height: 100vh;
         }
-
+        
         .sfcard-title {
             font-size: 28px;
             text-align: center;
         }
-
+        
         .center {
-            height: 100vh;
+            height: 110vh;
         }
-
+        
         .part2 {
-            height: 100vh;
+            height: 110vh;
             /* background: red; */
         }
-
+        
         .part5 {
             width: 100%
         }
-
+        
         .paymentScreenshot {
             width: 100%;
             height: 130vh
         }
-        .bankCard_css{
-            width: 100%;
-            height: 100vh;
-        }
-
         /* .onlypz-center{
         height: 130vh;
       } */
@@ -535,10 +524,9 @@
                     </div>
 
                     <div class="part1" v-if="isShowPrintType1">
-                        <div class="sfcard-content_other">
+                        <div class="sfcard-content">
                             <div class="sfcard-title">
-                                {{
-                                printData1[index].customerName}}{{printData1[index].identityAuthenticationInfo.customerNumberCard}}
+                                {{ printData1[index].customerName}}{{printData1[index].identityAuthenticationInfo.customerNumberCard}}
                             </div>
                             <img :src="customerList1[index].imgURl.imageUrl1" class="avatar" />
                         </div>
@@ -551,22 +539,17 @@
               </div> -->
                     </div>
                     <div class="bankcard" v-if="isShowPrintType2">
-                        <div class="sfcard-content">
+
+                        <div class="sfcard-content part2">
                             <div class="sfcard-title">
                                 {{printData1[index].bankDeposit}}{{printData1[index].bankCard}}
                             </div>
                             <!-- <img :src="customerList1[index].imgURl.imageUrl3" class="avatar" /> -->
-                            <div class="bankCard_css">
-                                <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl3"
-                                class="avatar" />
+                            <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl3" class="avatar" />
                             <img v-else class="avatar" />
+                            <!-- <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl4" class="avatar" />
+                            <img v-else class="avatar" /> -->
 
-                            </div>
-                            <div class="bankCard_css">
-                                <img v-if="printData1[index].imgURl" :src="printData1[index].imgURl.imageUrl4"
-                                class="avatar" />
-                                <img v-else class="avatar" />
-                            </div>
                         </div>
                         <!--          <div class="sfcard-content part2">
                 <div class="sfcard-title">
@@ -884,12 +867,12 @@
                     </div>
                     <img :src="imageUrl1" class="avatar" />
                 </div>
-                <div class="sfcard-content">
+                <!-- <div class="sfcard-content">
                     <div class="sfcard-title">
                         {{ printData.customerName}}{{ printData.identityAuthenticationInfo.customerNumberCard}}
                     </div>
                     <img :src="imageUrl2" class="avatar" />
-                </div>
+                </div> -->
             </div>
 
             <div class="bankcard part4" v-if="isShowPrintType2">
@@ -899,12 +882,12 @@
                     </div>
                     <img :src="imageUrl3" class="avatar" />
                 </div>
-                <div class="sfcard-content">
+                <!-- <div class="sfcard-content">
                     <div class="sfcard-title">
                         {{printData.bankDeposit}}{{printData.bankCard}}
                     </div>
                     <img :src="imageUrl4" class="avatar" />
-                </div>
+                </div> -->
 
             </div>
         </div>
@@ -1144,12 +1127,12 @@
                 }
                 return false
             },
-            printSmall() { },
-            printBig() { }
+            printSmall() {},
+            printBig() {}
         },
         mounted() {
             this.date = new Date().toLocaleString()
-            // let _data = decodeURIComponent(this.getQueryVariable('dataList'))
+                // let _data = decodeURIComponent(this.getQueryVariable('dataList'))
             let _data = {}
             if (localStorage.getItem('print_pay_data')) {
                 _data = localStorage.getItem('print_pay_data')
@@ -1174,7 +1157,7 @@
                 }
             } else {
                 this.printData = JSON.parse(_data)
-                //地址过长截取
+                    //地址过长截取
                 if (this.printData.identityAuthenticationInfo && this.printData.identityAuthenticationInfo.compAddress.length > 24) {
                     this.printData.identityAuthenticationInfo.compAddress = this.printData.identityAuthenticationInfo
                         .compAddress.substring(0, 24)
@@ -1183,13 +1166,13 @@
             }
             let _type = decodeURIComponent(this.getQueryVariable('type'))
             this.showType = decodeURIComponent(
-                this.getQueryVariable('printTypeList')
-            )
-            // this.pzList = this.showType.split(',')
-            // if((this.showType.indexOf('打印结算凭证')>-1)&&this.pzList.length==1){
-            //   this.onlyShowPz = true
-            // }
-            // this.pageType = decodeURIComponent(this.getQueryVariable('printTypeList'))
+                    this.getQueryVariable('printTypeList')
+                )
+                // this.pzList = this.showType.split(',')
+                // if((this.showType.indexOf('打印结算凭证')>-1)&&this.pzList.length==1){
+                //   this.onlyShowPz = true
+                // }
+                // this.pageType = decodeURIComponent(this.getQueryVariable('printTypeList'))
             let _data1 = decodeURIComponent(this.getQueryVariable('customerList'))
             if (!_data1) {
                 this.customerList1 = JSON.parse(
@@ -1204,7 +1187,7 @@
                 if (this.selectPrint) {
                     for (let i = 0; i < this.customerList1.length; i++) {
                         let _url1 = this.customerList1[i].cardAddressUrl.split(',')
-                        // let _url2 = this.customerList1[i].payeeAddressUrl.split(',')
+                            // let _url2 = this.customerList1[i].payeeAddressUrl.split(',')
                         this.customerList1[i].imgURl = {
                             imageUrl1: _url1[0],
                             imageUrl2: _url1[1],
@@ -1275,9 +1258,9 @@
             if (this.printData.compName == undefined) this.printData.compName = ''
             document.title = this.printData.compName + '结算凭证'
             window.print()
-            // sessionStorage.removeItem('selectPrint_selectPrintList');
-            // sessionStorage.removeItem('selectPrint_selectCustomerList');
-            window.onafterprint = function (event) {
+                // sessionStorage.removeItem('selectPrint_selectPrintList');
+                // sessionStorage.removeItem('selectPrint_selectCustomerList');
+            window.onafterprint = function(event) {
                 window.history.back(-1)
             }
         },

+ 1 - 1
src/layout/index/top/index.vue

@@ -56,7 +56,7 @@
       </div>
       <div class="compName-row">
         <!-- <span class="compName">{{compName}}</span> -->
-        <el-select style='width:260px;' @change='compNameChange' v-model="compName" placeholder="请选择">
+        <el-select style='width:260px;' @change='compNameChange' disabled v-model="compName" placeholder="请选择">
         <el-option
           v-for="item in compNameoptions"
           :key="item"

+ 1 - 1
src/views/home/index.vue

@@ -169,7 +169,7 @@ export default {
 
     this.dataListTimer = setInterval(() => {
       this.selectData(1)
-      }, 30000);
+      }, 10*60000);
     
 
   },

+ 33 - 25
src/views/profitable/cashout.vue

@@ -116,24 +116,24 @@
           <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select> -->
-         <ws-select :disabled='disabled' v-model="moneys" v-if='mode!="暂不分配"' placeholder="费用分配金额">
+         <ws-select style="margin-left: 10px" :disabled='disabled' v-model="moneys" v-if='mode!="暂不分配"' placeholder="费用分配金额">
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        <div style='width:30%;' v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>
+        <div style='width:30%;margin-left: 10px' v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>
             <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
               start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
               @change="dateChange">
             </el-date-picker>
         </div>
-        <ws-select v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"' :disabled='disabled' v-model="orderId" placeholder="全部客户" 
+        <el-button style="margin-left: 10px" type="primary" @click="queren" v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>确认</el-button>
+        <ws-select style="margin-left: 25px" v-if='(deptBudgetList.purpose == "库点费用"  &&mode != "暂不分配"&& deptBudgetList.flag == "否")'  v-model="goodsSource" placeholder="全部客户" 
             @change='sourceChange'>
-            <ws-option key="全部客户" label="全部客户" value="" style="color: #8890b1" />
-            <ws-option v-for="item in customerList" :key="item.id" :label="item.goodsSource" :value="item.id"
+            <ws-option key="全部客户" label="全部客户" value="全部客户" style="color: #8890b1" />
+            <ws-option v-for="item in customerList" :key="item.orderId" :label="item.goodsSource" :value="item.orderId"
               style="color: #8890b1" />
         </ws-select>
-        <el-button @click="queren" v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>确认</el-button>
-        <span style="margin-top:5px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
+        <span style="margin-top:5px;margin-left: 10px;" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
         <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"&&deptBudgetList.flag!="是"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column  width="150" v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
@@ -167,11 +167,16 @@
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.purpose=="合同费用"' prop="date" label="货源">
               <template slot-scope="scope">
                 <!-- {{scope.row.goodsourcelist}} -->
-                <el-select class="goodsource" v-if="scope.row.orderId &&confirmFlag==0" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                <!-- <el-select class="goodsource" v-if="scope.row.orderId &&confirmFlag==0" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
                     <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
                 </el-select>
-                <el-select class="goodsource" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                <el-select class="goodsource" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})"> -->
+                <el-select style="width: 100%;" v-if="(scope.row.orderId &&confirmFlag==0 && !scope.row.goodsSource)" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select>
+                <el-select style="width: 100%;" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
                     <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
                 </el-select>
@@ -292,29 +297,32 @@
     // 计算属性的 getter
       amount: function () {
         // `this` 指向 vm 实例
-        var num=0
-        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          if(this.feeDetailsDistributions[i].distributionMoney){
-            num+=Number(this.feeDetailsDistributions[i].distributionMoney)
-          }
-        }
-        return num
-      }
+         var num = 0
+         if (this.feeDetailsDistributions) {
+           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+             if (this.feeDetailsDistributions[i].distributionMoney) {
+               num += Number(this.feeDetailsDistributions[i].distributionMoney)
+             }
+           }
+           return num
+         }
+       }
     },
     methods: {
       sourceChange(e) {
       if (e == '') {
         this.goodsSource = '全部客户'
-        this.selectOrderList()
       } else {
-        for (let i = 0; i < this.customerList.length; i++) {
-          if (this.customerList[i].id == e) {
-            this.goodsSource = this.customerList[i].goodsSource
-            this.orderId = this.customerList[i].id
-            this.selectOrderList()
+        for(let i=0;i<this.customerList.length;i++){
+          if(this.customerList[i].orderId == e){
+            this.orderId = this.customerList[i].orderId
+            this.goodsSource  = this.customerList[i].goodsSource
+            break;
           }
         }
+        
       }
+        this.selectOrderList()
     },
       getNowTime() {
       const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
@@ -541,7 +549,7 @@
               this.datas.push(response.records[i])
             }
             for (let z = 0; z < this.datas.length; z++) {
-              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id:'', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
             }
             this.feeDetailsDistributions = arr
           } else {
@@ -551,7 +559,7 @@
               }
             }
             for (let z = 0; z < this.datas.length; z++) {
-              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id:'', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
             }
             this.feeDetailsDistributions = arr
 

+ 6 - 2
src/views/profitable/cashoutaduit.vue

@@ -29,6 +29,10 @@
                 <ws-option label="保证金" value="5" style="color: #8890b1" />
             </ws-select>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -129,7 +133,7 @@
           </el-table>
 
       </div> -->
-      <div>
+      <div v-if='(deptBudgetList.expensesPurpose==2)'>
         <div class="wenzi">车辆详情</div>
         <el-table :data="deptBudgetList.tranSettlementReportList" style="width: 90%; margin: 20px auto; " ref="warehouseList"  >
         <el-table-column type="index" label="序号" width="50"></el-table-column>
@@ -217,7 +221,7 @@ import WsUpload from '@/components/WsUpload'
       return {
         value: [],
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         mode:'全部分配',

+ 233 - 27
src/views/profitable/cashoutaduitNQ.vue

@@ -24,6 +24,10 @@
               <span v-if='deptBudgetList.costType==3'>非粮款</span>
               <span v-if='deptBudgetList.costType==5'>保证金</span>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -71,8 +75,8 @@
             <el-input disabled class='input50 input_css' placeholder="输入开户支行" v-model="deptBudgetList.bankBranch"></el-input>
           </el-form-item>
         </el-form>
-        <div class="wenzi">车辆详情</div>
-        <el-table :data="deptBudgetList.tranSettlementReportList" style="width: 90%; margin: 20px auto; " ref="warehouseList"  >
+        <div class="wenzi" v-if='(deptBudgetList.expensesPurpose==2)'>车辆详情</div>
+        <el-table :data="deptBudgetList.tranSettlementReportList" v-if='(deptBudgetList.expensesPurpose==2)' style="width: 90%; margin: 20px auto; " ref="warehouseList"  >
         <el-table-column type="index" label="序号" width="50"></el-table-column>
         <el-table-column class="table_td" prop="contractNo" width="120" label="合同编号"></el-table-column>
         <el-table-column class="table_td" prop="startAddress" width="120" label="发货库"></el-table-column>
@@ -116,17 +120,35 @@
           </el-table>
         <!-- 经营性费用不分配 -->
         <div v-if='deptBudgetList.expensesPurpose!=5'>
-          <div style='margin:0 50px 10px;font-weight:bold'>费用分配</div>
-        <div style='margin:10px auto;width:90%;'>
+          <div style="display:flex">
+            <div style='margin:0 50px 10px;font-weight:bold'>费用分配</div>
+            <div>可分配金额{{deptBudgetList.unallocatedAmount}}元</div>
+          </div>
+        <div style='margin:10px auto;width:90%;display: flex;'>
             <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" >
+         <ws-select style='margin-left: 10px' v-model="moneys" placeholder="费用分配金额" class="typeselect" >
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        合计分配:{{amount}}元
+        <div style='width:30%;margin-left: 10px' v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>
+            <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
+              start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
+              @change="dateChange">
+            </el-date-picker>
+        </div>
+        <!-- && deptBudgetList.flag == "否" -->
+        <!-- :disabled='disabled' -->
+        <el-button style='margin-left: 10px' type="primary" @click="queren" v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>确认</el-button>
+        <ws-select style='margin-left: 25px' v-if='(deptBudgetList.purpose == "库点费用"  &&mode != "暂不分配"&& deptBudgetList.storageFeeFlag==0)'  v-model="goodsSource" placeholder="全部客户" 
+            @change='sourceChange'>
+            <ws-option key="全部客户" label="全部客户" value="全部客户" style="color: #8890b1" />
+            <ws-option v-for="item in customerList" :key="item.orderId" :label="item.goodsSource" :value="item.orderId"
+              style="color: #8890b1" />
+        </ws-select>
+        <span style="margin-top:5px;margin-left: 10px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
         </div>
         </div>
  
@@ -156,7 +178,15 @@
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
               <template slot-scope="scope">
                 <!-- {{scope.row.goodsourcelist}} -->
-                <el-select class="goodsource" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                <!-- <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select> -->
+                <el-select style="width: 100%;" v-if="(scope.row.orderId &&confirmFlag==0 && !scope.row.goodsSource)" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select>
+                <el-select style="width: 100%;" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
                     <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
                 </el-select>
@@ -220,13 +250,30 @@
     import {
     woekflowhandle
   } from '@/model/tasksport/index'
-  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo,getwarehousingorderList,deloneallocationinfo } from '@/model/profitable/index'
   export default {
     components: {
       WsUpload,
     },
     data() {
       return {
+        customerList: [],
+        goodsSource: '',
+        value2: '',
+        endDate: '',
+        startDate: '',
+        baseId: '',
+        warehouseName:'',
+        currentPage: 1,
+        pageSize: 10,
+        searchType: '',
+        searchKeyWord: '',
+        goodsName: '',
+        //是否按时间筛选标识,1是
+        confirmFlag: 0,
+        datas: [],
+        datas1: [],
+        orderId: '',
         value: [],
         profitList: [{
           name: '玉米',
@@ -269,22 +316,131 @@
       }
     },
     activated() {
+      this.value2 = this.getNowTime()
       this.getList()
     },
     computed: {
     // 计算属性的 getter
       amount: function () {
         // `this` 指向 vm 实例
-        var num=0
-        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          if(this.feeDetailsDistributions[i].distributionMoney){
-            num+=Number(this.feeDetailsDistributions[i].distributionMoney)
+        var num = 0
+        if (this.feeDetailsDistributions) {
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if (this.feeDetailsDistributions[i].distributionMoney) {
+              num += Number(this.feeDetailsDistributions[i].distributionMoney)
+            }
           }
+          return num
         }
-        return num
       }
     },
     methods: {
+      sourceChange(e) {
+      if (e == '') {
+        this.goodsSource = '全部客户'
+      } else {
+        for(let i=0;i<this.customerList.length;i++){
+          if(this.customerList[i].orderId == e){
+            this.orderId = this.customerList[i].orderId
+            this.goodsSource  = this.customerList[i].goodsSource
+            break;
+          }
+        }
+        
+      }
+        this.selectOrderList()
+    },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间1天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      // console.log([start.split(' '), end])
+      return [start.split(' ')[0], end.split(' ')[0]]
+    },
+      queren() {
+      this.confirmFlag = 1
+      this.selectOrderList()
+    },
+    dateChange(e) {
+      this.value2 = e
+    },
+    selectOrderList() {
+      var arr = []
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      this.startDate = this.value2[0]
+      this.endDate = this.value2[1]
+      getwarehousingorderList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        startDate: this.startDate,
+        endDate: this.endDate,
+        baseId: this.deptBudgetList.warehouseId,
+        warehouseName : this.deptBudgetList.warehouseName,
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+        goodsName: this.goodsName,
+        goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
+      })
+        .toPromise()
+        .then((response) => {
+          this.datas = []
+          this.datas1 = []
+          if (this.goodsSource && this.goodsSource != '全部客户') {
+            for (let i = 0; i < response.records.length; i++) {
+              this.datas.push(response.records[i])
+            }
+            //
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource ,orderId:this.datas[z].id, id: '', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+          } else {
+            for (let i = 0; i < response.records.length; i++) {
+              for (let j = 0; j < response.records[i].warehousingOrderList.length; j++) {
+                this.datas.push(response.records[i].warehousingOrderList[j])
+              }
+              
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: '', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+
+            //获取客户
+            this.customerList = this.unique(arr)
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            this.feeDetailsDistributions[i].inWarehouseWeight = this.feeDetailsDistributions[i].weight
+            weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+          }
+          if (this.moneys == '按重量自动分配') {
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+            }
+          }
+        })
+    },
+    unique(arr) {
+      const res = new Map();
+      return arr.filter((arr) => !res.has(arr.goodsSource) && res.set(arr.goodsSource, 1));
+    },
       handleClose(){
         this.rejectshow=false
       },
@@ -322,6 +478,7 @@
       },
       selectgoodsSource(e,item,index){
         var weight=0
+        var moneyDiff = 0
         console.log(e)
         var money=0
         if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
@@ -342,17 +499,35 @@
             this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
             this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
             this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
+            this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
             }
         }
-        if(this.moneys=='按重量自动分配'){
-          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
-              return total + currentValue.inWarehouseWeight;
-          }, 0)
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
-              money+=this.feeDetailsDistributions[i].distributionMoney
-          }
+        // if(this.moneys=='按重量自动分配'){
+        //   weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+        //       return total + currentValue.inWarehouseWeight;
+        //   }, 0)
+        //   for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+        //       this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+        //       money+=this.feeDetailsDistributions[i].distributionMoney
+        //   }
+        // }
+        if (this.moneys == '按重量自动分配') {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+        }
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
         }
+      }
       },
       selecttime(e,item,index){
         var weight=0
@@ -382,7 +557,7 @@
           }
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.unallocatedAmount)
               money+=this.feeDetailsDistributions[i].distributionMoney
 
           }
@@ -451,6 +626,7 @@
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -481,6 +657,7 @@
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -497,7 +674,7 @@
           }
         }
         if(this.mode=='全部分配'){
-          if(this.amount!=this.deptBudgetList.amountMoney){
+          if(this.amount!=this.deptBudgetList.unallocatedAmount){
             this.$message({
                 message: '请款金额与分配金额不相等!',
                 type: 'warning',
@@ -506,7 +683,7 @@
           }
         }
         if(this.mode=='部分分配'){
-          if(this.amount>this.deptBudgetList.amountMoney){
+          if(this.amount>this.deptBudgetList.unallocatedAmount){
             this.$message({
                 message: '分配金额不可超过请款金额!',
                 type: 'warning',
@@ -608,9 +785,38 @@
       addlist(){
         this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
       },
-      dellist(row){
-          this.feeDetailsDistributions.splice(row.index,1)
-      },
+      dellist(row) {
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (this.feeDetailsDistributions[i]) {
+            if (this.feeDetailsDistributions[i] == row) {
+              this.feeDetailsDistributions.splice(i, 1)
+              if (this.moneys == '按重量自动分配' ) {
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  weight += this.feeDetailsDistributions[i].inWarehouseWeight
+                }
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+              
+                }
+              }
+              deloneallocationinfo({ id: row.id }).toPromise().then((response) => {
+                  })
+            }
+          }
+        }
+    },
       getList() {
         getcontract({
           compId:localStorage.getItem('ws-pf_compId'),

+ 236 - 25
src/views/profitable/expenseallot.vue

@@ -25,6 +25,10 @@
               <span v-if='deptBudgetList.costType==3'>非粮款</span>
               <span v-if='deptBudgetList.costType==5'>保证金</span>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -64,17 +68,30 @@
           <div style='margin:0 50px 10px;font-weight:bold'>费用分配</div>
           <div>可分配金额{{deptBudgetList.unallocatedAmount}}元</div>
         </div>
-        
-        <div style='margin:10px auto;width:90%;'>
+        <div style='margin:10px auto;width:90%;display: flex;'>
             <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" >
+         <ws-select style="margin-left: 10px" v-model="moneys" placeholder="费用分配金额" class="typeselect" >
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        合计分配:{{amount}}元
+        <div style='width:30%;margin-left: 10px' v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>
+            <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
+              start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
+              @change="dateChange">
+            </el-date-picker>
+        </div>
+        <!-- && deptBudgetList.flag == "否"  :disabled='disabled'-->
+        <el-button style="margin-left: 10px" type="primary" @click="queren" v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>确认</el-button>
+        <ws-select style="margin-left: 25px" v-if='(deptBudgetList.purpose == "库点费用"  &&mode != "暂不分配"&& deptBudgetList.storageFeeFlag==0)'  v-model="goodsSource" placeholder="全部客户" 
+            @change='sourceChange'>
+            <ws-option key="全部客户" label="全部客户" value="全部客户" style="color: #8890b1" />
+            <ws-option v-for="item in customerList" :key="item.orderId" :label="item.goodsSource" :value="item.orderId"
+              style="color: #8890b1" />
+        </ws-select>
+        <span style="margin-top:5px;margin-left: 10px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
         <el-table ref="tableref" v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.expensesPurpose==3&&mode!="暂不分配"||deptBudgetList.expensesPurpose==2&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column width="200" v-if='deptBudgetList.expensesPurpose==1' prop="date" label="仓库名称" min-width="110">
@@ -112,9 +129,17 @@
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.expensesPurpose==3||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
-              <template slot-scope="scope">
+              <template slot-scope="scope" >
                 <!-- {{scope.row.goodsourcelist}} -->
-                <el-select class="goodsource" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                <!-- <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select> -->
+                <el-select style="width: 100%;" v-if="(scope.row.orderId && confirmFlag==0 && !scope.row.goodsSource)" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select>
+                <el-select style="width: 100%;" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
                     <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
                 </el-select>
@@ -155,7 +180,7 @@
 </template>
 <script>
   import WsUpload from '@/components/WsUpload'
-  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo,getwarehousingorderList,deloneallocationinfo} from '@/model/profitable/index'
   export default {
     components: {
       WsUpload,
@@ -163,8 +188,25 @@
     data() {
       return {
         value: [],
+        customerList: [],
+        goodsSource: '',
+        value2: '',
+        endDate: '',
+        startDate: '',
+        baseId: '',
+        warehouseName:'',
+        currentPage: 1,
+        pageSize: 10,
+        searchType: '',
+        searchKeyWord: '',
+        goodsName: '',
+        //是否按时间筛选标识,1是
+        confirmFlag: 0,
+        datas: [],
+        datas1:[],
+        orderId: '',
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         mode:'全部分配',
@@ -201,6 +243,7 @@
       }
     },
     activated() {
+      this.value2 = this.getNowTime()
       this.getList()
     },
     computed: {
@@ -208,15 +251,133 @@
       amount: function () {
         // `this` 指向 vm 实例
         var num=0
-        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          if(this.feeDetailsDistributions[i].distributionMoney){
-            num+=Number(this.feeDetailsDistributions[i].distributionMoney)
+        if (this.feeDetailsDistributions) {
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if (this.feeDetailsDistributions[i].distributionMoney) {
+              num += Number(this.feeDetailsDistributions[i].distributionMoney)
+            }
           }
+          return num
         }
-        return num
+        
       }
     },
     methods: {
+      sourceChange(e) {
+      if (e == '') {
+        this.goodsSource = '全部客户'
+      } else {
+        for(let i=0;i<this.customerList.length;i++){
+          if(this.customerList[i].orderId == e){
+            this.orderId = this.customerList[i].orderId
+            this.goodsSource  = this.customerList[i].goodsSource
+            break;
+          }
+        }
+        
+      }
+        this.selectOrderList()
+    },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间1天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      // console.log([start.split(' '), end])
+      return [start.split(' ')[0], end.split(' ')[0]]
+    },
+      queren() {
+      if (!this.deptBudgetList.amountMoney && this.moneys == '按重量自动分配') {
+        this.$message({
+          message: '请输入金额之后进行操作',
+          type: 'warning',
+        })
+        return
+      }
+      this.confirmFlag = 1
+      this.selectOrderList()
+    },
+    dateChange(e) {
+      this.value2 = e
+    },
+    selectOrderList() {
+      var arr = []
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      this.startDate = this.value2[0]
+      this.endDate = this.value2[1]
+      getwarehousingorderList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        startDate: this.startDate,
+        endDate: this.endDate,
+        baseId: this.deptBudgetList.warehouseId,
+        warehouseName : this.deptBudgetList.warehouseName,
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+        goodsName: this.goodsName,
+        goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
+      })
+        .toPromise()
+        .then((response) => {
+          this.datas = []
+          this.datas1 = []
+          if (this.goodsSource && this.goodsSource != '全部客户') {
+            for (let i = 0; i < response.records.length; i++) {
+              this.datas.push(response.records[i])
+              // for (let x = 0; x < response.records[i].expenseAllocationInfoList.length; x++) {
+              //     this.datas1.push(response.records[i].expenseAllocationInfoList[x])
+              //   }
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              // this.datas[z].id
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: '', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+          } else {
+            for (let i = 0; i < response.records.length; i++) {
+              for (let j = 0; j < response.records[i].warehousingOrderList.length; j++) {
+                this.datas.push(response.records[i].warehousingOrderList[j])
+              }
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id:'', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+
+            //获取客户
+            this.customerList = this.unique(arr)
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            this.feeDetailsDistributions[i].inWarehouseWeight = this.feeDetailsDistributions[i].weight
+            weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+          }
+          if (this.moneys == '按重量自动分配') {
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+            }
+          }
+        })
+    },
+    unique(arr) {
+      const res = new Map();
+      return arr.filter((arr) => !res.has(arr.goodsSource) && res.set(arr.goodsSource, 1));
+    },
       modeselect(e){
         if(e=='全部分配'){
           this.moneys='按重量自动分配'
@@ -240,8 +401,8 @@
       },
       selectgoodsSource(e,item,index){
         var weight=0
-        console.log(e)
         var money=0
+        var moneyDiff = 0
         if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             if(this.feeDetailsDistributions[i].orderId==e){
@@ -260,17 +421,35 @@
             this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
             this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
             this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
+            this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
             }
         }
-        if(this.moneys=='按重量自动分配'){
-          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
-              return total + currentValue.inWarehouseWeight;
-          }, 0)
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-              this.$set(this.feeDetailsDistributions[i],'distributionMoney',Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney))
-              money+=this.feeDetailsDistributions[i].distributionMoney
-          }
+        // if(this.moneys=='按重量自动分配'){
+        //   weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+        //       return total + currentValue.inWarehouseWeight;
+        //   }, 0)
+        //   for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+        //       this.$set(this.feeDetailsDistributions[i],'distributionMoney',Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney))
+        //       money+=this.feeDetailsDistributions[i].distributionMoney
+        //   }
+        // }
+        if (this.moneys == '按重量自动分配') {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
         }
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+        }
+      }
       },
       selecttime(e,item,index){
         var weight=0
@@ -301,7 +480,7 @@
           }
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.unallocatedAmount)
               money+=this.feeDetailsDistributions[i].distributionMoney
 
           }
@@ -374,6 +553,7 @@
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -404,6 +584,7 @@
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -462,9 +643,38 @@
       addlist(){
         this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
       },
-      dellist(row){
-          this.feeDetailsDistributions.splice(row.index,1)
-      },
+      dellist(row) {
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (this.feeDetailsDistributions[i]) {
+            if (this.feeDetailsDistributions[i] == row) {
+              this.feeDetailsDistributions.splice(i, 1)
+              if (this.moneys == '按重量自动分配' ) {
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  weight += this.feeDetailsDistributions[i].inWarehouseWeight
+                }
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+              
+                }
+              }
+              deloneallocationinfo({ id: row.id }).toPromise().then((response) => {
+                  })
+            }
+          }
+        }
+    },
       getList() {
         getcontract({
           compId:localStorage.getItem('ws-pf_compId'),
@@ -494,6 +704,7 @@
             response.type='保证金'
           }
           this.deptBudgetList=response 
+          this.feeDetailsDistributions = this.deptBudgetList.expenseAllocationInfoList
           if(response.addressUrl){
             var arr=[]
             var srcs=response.addressUrl.split(',')

+ 6 - 2
src/views/profitable/expenseallotaduit.vue

@@ -31,6 +31,10 @@
                 <ws-option label="保证金" value="5" style="color: #8890b1" />
             </ws-select>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -109,7 +113,7 @@
             </el-table-column>
             <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货源">
                 <template slot-scope="scope">
-                  <ws-select disabled v-model="scope.row.goodsSource" placeholder="选择货源">
+                  <ws-select disabled v-model="scope.row.goodsSource" placeholder="选择货源" style="width: 100%;">
                       <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
                           style="color: #8890b1" />
                   </ws-select>
@@ -175,7 +179,7 @@
       return {
         value: [],
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         mode:'全部分配',

+ 290 - 64
src/views/profitable/expensemanagentedit.vue

@@ -34,6 +34,10 @@
                 <ws-option label="保证金" value="5" style="color: #8890b1" />
             </ws-select>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -86,11 +90,13 @@
               <el-input disabled class='input50 input_css' placeholder="输入开户支行" v-model="deptBudgetList.bankBranch"></el-input>
             </el-form-item>
         </el-form>
-        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2' class='expensetitle'>费用分配</div>
-        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2' style='margin:0  auto 10px;width:90%;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
+        <div style="display:flex" v-if='(deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.storageFeeFlag==0||deptBudgetList.expensesPurpose==2&&deptBudgetList.storageFeeFlag==0)' class='expensetitle'>费用分配
+          <div style="margin-left:15px">可分配金额{{deptBudgetList.unallocatedAmount}}元</div></div>
+        <div v-if='(deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.storageFeeFlag==0||deptBudgetList.expensesPurpose==2&&deptBudgetList.storageFeeFlag==0)' style='margin:0  auto 10px;width:90%;display: flex;'>
+          <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
+            
         </ws-select>
          <!-- <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
           :value="searchType">
@@ -107,11 +113,25 @@
           <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select> -->
-         <ws-select :disabled='disabled' v-model="moneys" placeholder="费用分配金额">
+         <ws-select style='margin-left: 10px' :disabled='disabled' v-model="moneys" placeholder="费用分配金额">
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
+        <div style='width:30%;margin-left: 10px' v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>
+            <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
+              start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
+              @change="dateChange">
+            </el-date-picker>
+        </div>
+        <!-- && deptBudgetList.flag == "否"  :disabled='disabled'-->
+        <el-button style='margin-left: 10px' type="primary" @click="queren" v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>确认</el-button>
+        <ws-select style='margin-left: 25px' v-if='(deptBudgetList.purpose == "库点费用"  &&mode != "暂不分配"&& deptBudgetList.storageFeeFlag==0)'  v-model="goodsSource" placeholder="全部客户" 
+            @change='sourceChange'>
+            <ws-option key="全部客户" label="全部客户" value="全部客户" style="color: #8890b1" />
+            <ws-option v-for="item in customerList" :key="item.orderId" :label="item.goodsSource" :value="item.orderId"
+              style="color: #8890b1" />
+        </ws-select>
+        <span style="margin-top:5px;margin-left: 10px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
         <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"||deptBudgetList.expensesPurpose==2&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column width="150" v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
@@ -153,7 +173,15 @@
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
               <template slot-scope="scope">
                 <!-- {{scope.row.goodsourcelist}} -->
-                <el-select class="goodsource" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                <!-- <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select> -->
+                <el-select style="width: 100%;" v-if="(scope.row.orderId &&confirmFlag==0 && !scope.row.goodsSource)" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
+                        style="color: #8890b1" />
+                </el-select>
+                <el-select style="width: 100%;" v-else v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
                     <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
                 </el-select>
@@ -192,16 +220,34 @@
 </template>
 <script>
   import WsUpload from '@/components/WsUpload'
-  import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo,getwarehousingorderList} from '@/model/profitable/index'
   export default {
     components: {
       WsUpload,
     },
     data() {
       return {
+        customerList: [],
+        goodsSource: '',
+        value2: '',
+        endDate: '',
+        startDate: '',
+        baseId: '',
+        warehouseName:'',
+        currentPage: 1,
+        pageSize: 10,
+        searchType: '',
+        searchKeyWord: '',
+        goodsName: '',
+        storageFeeFlag:'',
+        //是否按时间筛选标识,1是
+        confirmFlag: 0,
+        datas: [],
+        datas1:[],
+        orderId: '',
         value: [],
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         mode:'全部分配',
@@ -214,16 +260,16 @@
         compId:localStorage.getItem('ws-pf_compId'),
         // dateRange: this.disabledDate(),
         feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0,}],
-        deptBudgetList:{purpose:"合同费用",type:'粮款'},
+        deptBudgetList:{purpose:'合同费用',type:'粮款'},
         makeWordData: {},
         warehouseList:[],
         contractList:[],
         choosablewareList:[],
         paymentScreenshot:[],
-        goodsourcelist:[[{goodsName: "玉米",
+        goodsourcelist:[[{goodsName: '玉米',
 goodsNameKey: null,
-goodsSource: "张跃文",
-id: "34e710ed3883484798ab37ec4ee9b9cd",
+goodsSource: '张跃文',
+id: '34e710ed3883484798ab37ec4ee9b9cd',
 weight: 4000}]],
         signingDate:'',
         datelist:[],
@@ -248,6 +294,7 @@ weight: 4000}]],
       // this.makeWordData = this.getData(2)
       // this.initCharts()
       // this.getPassYearFormatDate()
+      this.value2 = this.getNowTime()
       this.getList()
     },
      computed: {
@@ -255,19 +302,125 @@ weight: 4000}]],
       amount: function () {
         // `this` 指向 vm 实例
         var num=0
-        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          num+=Number(this.feeDetailsDistributions[i].distributionMoney)
+         if (this.feeDetailsDistributions) {
+           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+             num += Number(this.feeDetailsDistributions[i].distributionMoney)
+           }
+           return num
+         }
+       }
+    },
+    methods: {
+      sourceChange(e) {
+      if (e == '') {
+        this.goodsSource = '全部客户'
+      } else {
+        for(let i=0;i<this.customerList.length;i++){
+          if(this.customerList[i].orderId == e){
+            this.orderId = this.customerList[i].orderId
+            this.goodsSource  = this.customerList[i].goodsSource
+            break;
+          }
         }
-        return num
+        
       }
+        this.selectOrderList()
+    },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间1天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      // console.log([start.split(' '), end])
+      return [start.split(' ')[0], end.split(' ')[0]]
+    },
+      queren() {
+      this.confirmFlag = 1
+      this.selectOrderList()
+    },
+    dateChange(e) {
+      this.value2 = e
+    },
+    selectOrderList() {
+      var arr = []
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      this.startDate = this.value2[0]
+      this.endDate = this.value2[1]
+      getwarehousingorderList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        startDate: this.startDate,
+        endDate: this.endDate,
+        baseId: this.deptBudgetList.warehouseId,
+        warehouseName : this.deptBudgetList.warehouseName,
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+        goodsName: this.goodsName,
+        goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
+      })
+        .toPromise()
+        .then((response) => {
+          this.datas = []
+          this.datas1 = []
+          if (this.goodsSource && this.goodsSource != '全部客户') {
+            for (let i = 0; i < response.records.length; i++) {
+              this.datas.push(response.records[i])
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: '', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+          } else {
+            for (let i = 0; i < response.records.length; i++) {
+              for (let j = 0; j < response.records[i].warehousingOrderList.length; j++) {
+                this.datas.push(response.records[i].warehousingOrderList[j])
+              }
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: '', weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+
+            //获取客户
+            this.customerList = this.unique(arr)
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            this.feeDetailsDistributions[i].inWarehouseWeight = this.feeDetailsDistributions[i].weight
+            weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+          }
+          if (this.moneys == '按重量自动分配') {
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+            }
+          }
+        })
+    },
+    unique(arr) {
+      const res = new Map();
+      return arr.filter((arr) => !res.has(arr.goodsSource) && res.set(arr.goodsSource, 1));
     },
-    methods: {
       timeFun(unixtimestamp) {
         var unixtimestamp = new Date(unixtimestamp);
         var year = 1900 + unixtimestamp.getYear();
-        var month = "0" + (unixtimestamp.getMonth() + 1);
-        var date = "0" + unixtimestamp.getDate();
-        return year + "-" + month.substring(month.length - 2, month.length) + "-" +     date.substring(date.length - 2,date.length)      
+        var month = '0' + (unixtimestamp.getMonth() + 1);
+        var date = '0' + unixtimestamp.getDate();
+        return year + '-' + month.substring(month.length - 2, month.length) + '-' +     date.substring(date.length - 2,date.length)      
       },
       selectware(e,index){
         var arr=[]
@@ -283,8 +436,8 @@ weight: 4000}]],
       },
       selectgoodsSource(e,item,index){
         var weight=0
-        console.log(e)
         var money=0
+        var moneyDiff = 0
         if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             if(this.feeDetailsDistributions[i].orderId==e){
@@ -303,17 +456,35 @@ weight: 4000}]],
             this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
             this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
             this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
+            this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
             }
         }
-        if(this.moneys=='按重量自动分配'){
-          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
-              return total + currentValue.inWarehouseWeight;
-          }, 0)
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
-              money+=this.feeDetailsDistributions[i].distributionMoney
-          }
+        // if(this.moneys=='按重量自动分配'){
+        //   weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+        //       return total + currentValue.inWarehouseWeight;
+        //   }, 0)
+        //   for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+        //       this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+        //       money+=this.feeDetailsDistributions[i].distributionMoney
+        //   }
+        // }
+        if (this.moneys == '按重量自动分配') {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+        }
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
         }
+      }
       },
       selecttime(e,item,index){
         var weight=0
@@ -343,7 +514,7 @@ weight: 4000}]],
           }
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.unallocatedAmount)
               money+=this.feeDetailsDistributions[i].distributionMoney
 
           }
@@ -449,7 +620,7 @@ weight: 4000}]],
             this.deptBudgetList.expenseAllocationInfoList=[]
           }
         }
-        if(this.deptBudgetList.expensesPurpose==2){
+        if(this.deptBudgetList.expensesPurpose==2 || this.deptBudgetList.expensesPurpose==3&&this.storageFeeFlag==0){
           this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
         }
          if(this.deptBudgetList.expensesPurpose==1||this.deptBudgetList.expensesPurpose==2){
@@ -460,6 +631,7 @@ weight: 4000}]],
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -482,6 +654,7 @@ weight: 4000}]],
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -513,7 +686,7 @@ weight: 4000}]],
         }
        
         if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='全部分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='全部分配'){
-          if(this.amount!=this.deptBudgetList.amountMoney){
+          if(this.amount!=this.deptBudgetList.unallocatedAmount){
             this.$message({
                 message: '请款金额与分配金额不相等!',
                 type: 'warning',
@@ -522,7 +695,7 @@ weight: 4000}]],
           }
         }
         if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='部分分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='部分分配'){
-          if(this.amount>this.deptBudgetList.amountMoney){
+          if(this.amount>this.deptBudgetList.unallocatedAmount){
             this.$message({
                 message: '分配金额不可超过请款金额!',
                 type: 'warning',
@@ -579,29 +752,80 @@ weight: 4000}]],
         this.feeDetailsDistributions.push({receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',time:0,id:0,weight:0,goodsName:'',goodsSource:'',index:0,   goodsNameKey: null,index:this.feeDetailsDistributions.length})
       },
       dellist(row){
-        if(this.feeDetailsDistributions.length>1){
-          if(row.id==0){
-            this.feeDetailsDistributions.splice(row.index,1)
-          }else{
-            this.feeDetailsDistributions.splice(row.index,1)
-            var data=localStorage.getItem('expensebh')
-            var data1=[]
-            for (let i = 0; i < data.length; i++) {
-              if(data[i].id==row.id){
-                var data1=data.splice(row.i,1)
-              }
-            }
-            if(data1.length>0){
-              localStorage.setItem('expensebh',data1)
-            }else{
-              localStorage.removeItem('expensebh')
-            }
-            
-            deloneallocationinfo({id:row.id}).toPromise().then((response) => {
-            })
-            
+        // var weight=0
+        // var money=0
+        // var moneyDiff = 0
+        // if(this.feeDetailsDistributions.length>1){
+        //   debugger
+        //   if(row.id==0){
+        //     this.feeDetailsDistributions.splice(row.index,1)
+        //   }else{
+        //     this.feeDetailsDistributions.splice(row.index,1)
+        //     var data=localStorage.getItem('expensebh')
+        //     var data1=[]
+        //     for (let i = 0; i < data.length; i++) {
+        //       if(data[i].id==row.id){
+        //         var data1=data.splice(row.i,1)
+               
+        //       }
+        //     }
+        //     if(data1.length>0){
+        //       localStorage.setItem('expensebh',data1)
+        //     }else{
+        //       localStorage.removeItem('expensebh')
+        //     }
+        //     deloneallocationinfo({id:row.id}).toPromise().then((response) => {
+              
+        //     })
             
             
+        //   }
+        var weight = 0
+        var money = 0
+        var moneyDiff = 0
+        if (this.feeDetailsDistributions.length > 1) {
+          if (row.id == 0) {
+            this.feeDetailsDistributions.splice(row.index, 1)
+          } else {
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              if (this.feeDetailsDistributions[i]) {
+                if (this.feeDetailsDistributions[i] == row) {
+                  this.feeDetailsDistributions.splice(i, 1)
+                  if (this.moneys == '按重量自动分配' ) {
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  weight += this.feeDetailsDistributions[i].inWarehouseWeight
+                }
+                for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+                  if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.unallocatedAmount)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+
+                }
+              }
+                  var data = localStorage.getItem('expensebh')
+                  var data1 = []
+                  for (let i = 0; i < data.length; i++) {
+                    if (data[i].id == row.id) {
+                      var data1 = data.splice(row.i, 1)
+                    }
+                  }
+                  if (data1.length > 0) {
+                    localStorage.setItem('expensebh', data1)
+                  } else {
+                    localStorage.removeItem('expensebh')
+                  }
+                  deloneallocationinfo({ id: row.id }).toPromise().then((response) => {
+                  })
+                }
+              }
+            }
           }
         }else{
           this.$message({
@@ -610,17 +834,18 @@ weight: 4000}]],
           })
           return
         }
-        var weight=0
-        var money=0
-        if(this.moneys=='按重量自动分配'){
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          weight+=this.feeDetailsDistributions[i].inWarehouseWeight
-          }
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
-              money+=this.feeDetailsDistributions[i].distributionMoney
-          }
-        }
+        // var weight=0
+        // var money=0
+        // if(this.moneys=='按重量自动分配'){
+        //   for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+        //   weight+=this.feeDetailsDistributions[i].inWarehouseWeight
+        //   }
+        //   for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+        //       this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+        //       money+=this.feeDetailsDistributions[i].distributionMoney
+        //   }
+        // } 
+        
       },
       getList() {
         getcontract({
@@ -652,6 +877,7 @@ weight: 4000}]],
             response.type='保证金'
           }
           this.deptBudgetList=response
+          this.feeDetailsDistributions = this.defineComponent.expenseAllocationInfoList
           this.dataList=[]
           if(response.addressUrl){
             var arr=[]

+ 11 - 5
src/views/profitable/expensemanagentlook.vue

@@ -27,6 +27,10 @@
               <span v-if='deptBudgetList.costType==3'>非粮款</span>
               <span v-if='deptBudgetList.costType==5'>保证金</span>
           </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓储费" span="1" prop="contractNo" class="readonly">
+            <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
+              <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
+          </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouseName" class="readonly">
           {{deptBudgetList.warehouseName}}
           </el-form-item>
@@ -80,8 +84,8 @@
             </el-form-item>
           </el-form>
         </div>
-        <div class="wenzi">车辆详情</div>
-        <el-table :data="deptBudgetList.tranSettlementReportList" style="width: 90%; margin: 20px auto; " ref="warehouseList"  >
+        <div class="wenzi" v-if='deptBudgetList.expensesPurpose==2'>车辆详情</div>
+        <el-table :data="deptBudgetList.tranSettlementReportList" style="width: 90%; margin: 20px auto; " ref="warehouseList" v-if='deptBudgetList.expensesPurpose==2' >
         <el-table-column type="index" label="序号" width="50"></el-table-column>
         <el-table-column class="table_td" prop="contractNo" width="120" label="合同编号"></el-table-column>
         <el-table-column class="table_td" prop="startAddress" width="120" label="发货库"></el-table-column>
@@ -123,7 +127,7 @@
             </template>
             </el-table-column>
           </el-table>
-        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
+        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
           <div style='margin-bottom:20px;'>费用分配</div>
           <!-- <div> -->
           <el-table :data="deptBudgetList.expenseAllocationInfoList">
@@ -153,7 +157,8 @@
             </el-table-column>
             <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货源">
                 <template slot-scope="scope">
-                  <ws-select class="goodsource" disabled v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
+                  <!-- <ws-select class="goodsource" disabled v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})"> -->
+                  <ws-select disabled v-model="scope.row.goodsSource" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
                       <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
                           style="color: #8890b1" />
                   </ws-select>
@@ -191,7 +196,7 @@
       return {
         value: [],
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         deptBudgetList:{},
@@ -228,6 +233,7 @@
         .toPromise()
         .then((response) => {
           this.deptBudgetList=response
+          this.expenseAllocationInfoList = this.deptBudgetList.expenseAllocationInfoList
           this.srcList=[]
           var arr=response.addressUrl.split(',')
           for (let i = 0; i < arr.length; i++) {

+ 21 - 1
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -1754,6 +1754,24 @@
 					var random = this.getdate() + this.MathRand()
 					this.inOutTaskNo = 'YKC' + random
 					this.inOutTaskNo1 = 'YKR' + random
+        //   this.dataList.moveTaskNo = 'YKRW' + random
+		//    this.dataList1.moveTaskNo = 'YKRW' + random
+				} else if (this.dataList.taskTypeKey == 4) {
+					var random = this.getdate() + this.MathRand()
+					this.inOutTaskNo = 'TCC' + random
+					this.inOutTaskNo1 = 'TCR' + random
+				}
+			},
+			tasknumber1() {
+				console.log(this.dataList.taskTypeKey)
+				if (this.dataList.taskTypeKey == 1) {
+					this.inOutTaskNo = 'CK' + this.getdate() + this.MathRand()
+				} else if (this.dataList.taskTypeKey == 2) {
+					this.inOutTaskNo1 = 'RK' + this.getdate() + this.MathRand()
+				} else if (this.dataList.taskTypeKey == 3) {
+					var random = this.getdate() + this.MathRand()
+					this.inOutTaskNo = 'YKC' + random
+					this.inOutTaskNo1 = 'YKR' + random
         //   this.dataList.moveTaskNo = 'YKRW' + random
 		//    this.dataList1.moveTaskNo = 'YKRW' + random
 				} else if (this.dataList.taskTypeKey == 4) {
@@ -1773,8 +1791,10 @@
 			},
 			tasktypechange(e) {
 				localStorage.setItem('taskTypeKey',e)
+				console.log('localStorage.getItem(\'taskTypeKey\')',localStorage.getItem('taskTypeKey'))
+				
 				if (!this.$route.query.relevanceId) {
-					this.tasknumber()
+					this.tasknumber1()
 				}
 				this.dataList1.taskTypeKey = e
 				if (this.dataList.taskTypeKey == 1) {