Bläddra i källkod

前端更新sdy

zhongtianhaoyuan 3 år sedan
förälder
incheckning
9dcaa59c81

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

@@ -70,5 +70,7 @@ export const API_POST_PAYMENT_DEL = '/paymentManagement/api/deleteInfo'
 export const API_POST_PAYMENT_AUDIT = '/paymentManagement/api/openAuditFlow'
 //付款提交
 export const API_POST_PAYMENT_PAYMENTSUBMIT = '/paymentManagement/api/payMoney'
+//付款结算修改
+export const API_POST_PAYMENT_SETTLEMENTEDIT = '/paymentManagement/api/editCollect'
 
 

+ 4 - 1
src/model/houseSelfCollect/index.js

@@ -37,7 +37,8 @@ import {
   API_GET_WEIGHTCHECK_GETPRINT,
   API_POST_PAYMENT_DEL,
   API_POST_PAYMENT_AUDIT,
-  API_POST_PAYMENT_PAYMENTSUBMIT
+  API_POST_PAYMENT_PAYMENTSUBMIT,
+  API_POST_PAYMENT_SETTLEMENTEDIT
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -111,3 +112,5 @@ export const delpayment  = appRx.post(API_POST_PAYMENT_DEL, errorCatcher, errorH
 export const auditpayment  = appRx.post(API_POST_PAYMENT_AUDIT, errorCatcher, errorHandle, filter)
 //付款提交
 export const paymentCommit = appRx.post(API_POST_PAYMENT_PAYMENTSUBMIT, errorCatcher, errorHandle, filter)
+//付款结算修改
+export const settlementEdit = appRx.post(API_POST_PAYMENT_SETTLEMENTEDIT, errorCatcher, errorHandle, filter)

+ 5 - 5
src/views/houseSelfCollect/component/paymentPrint.vue

@@ -129,11 +129,11 @@
         <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 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>
 </template>

+ 4 - 6
src/views/houseSelfCollect/component/weightCheckPrint.vue

@@ -77,11 +77,11 @@
             <div class="autograph">客户签名:</div>
           </div>
           <div class="bottom-row3">扫一扫</div>
-           <div class="bottom-row4">
-        <el-button type="primary">关闭</el-button>
+           <!-- <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>
+        <el-button type="primary" @click="printBig">打印单据</el-button> 
+      </div> -->
         </div>
         
     </div>
@@ -102,13 +102,11 @@ export default{
       methods:{
         
             printSmall() {
-                  console.log(this.tableData,"对象")
       window.location.href =
         '../../../../static/weightCheck.html?type=1&tableData=' +
         JSON.stringify(this.tableData)
     },
     printBig() {
-           console.log(this.tableData,"对象")
       window.location.href =
         '../../../../static/weightCheck.html?type=2&tableData=' +
         JSON.stringify(this.tableData)

+ 5 - 4
src/views/houseSelfCollect/inspectInfo.vue

@@ -135,7 +135,7 @@
     getamount,
     getCount,
   } from '@/model/houseSelfCollect/index'
-  import {
+   import {
     packList
   } from '@/model/contarct/index'
   import inspectInfoPrint from './component/inspectInfoPrint.vue'
@@ -170,9 +170,11 @@
         typeList: ['干粮', '潮粮'],
         purchasePriceList: [],
         id: '',
+        imgUrl:"",
       }
     },
     activated() {
+      
       this.types = this.$route.query.type
       this.cangid = this.$route.query.cangid
       this.warehouseName = this.$route.query.warehouseName
@@ -227,7 +229,7 @@
           let dataURL = canvas.toDataURL("image/png");
           this.imgUrl = dataURL;
           if (this.imgUrl !== "") {
-            let b = this.dataURLtoFile(this.imgUrl, "aa")
+            let b = this.dataURLtoFile(this.imgUrl, "printImg")
             console.log(b)
             let formdata = new FormData();
             formdata.append("file", b);
@@ -456,6 +458,7 @@
         }
       },
       cancel() {
+        this.inspect = [] 
         this.$router.push({
           path: 'inspectionManagement'
         })
@@ -486,7 +489,6 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                console.log(this.purchasePriceList[i].saleLimit - response)
                 if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
                     this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
@@ -551,7 +553,6 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                console.log(this.purchasePriceList[i].saleLimit - response)
                 if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
                     this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',

+ 57 - 14
src/views/houseSelfCollect/paymentManagement.vue

@@ -150,24 +150,22 @@
     </el-table>
     <!-- 付款弹窗 -->
     <el-dialog width="40%" :visible.sync="paymentForm" :append-to-body="true">
-      <ws-form>
+      <div class="tanchuang">
+        <ws-form>
         <ws-info-table>
-          <ws-form-item label="未付金额(元)" prop="waterContent">
-            <ws-input
-              placeholder="请输入未付金额(元)"
-              maxlength="100"
-              size="small"
-            />
+          <ws-form-item label="未付金额(元)" prop="amountNotPayable">
+           {{payments.amountNotPayable}}
           </ws-form-item>
-          <ws-form-item label="本次付款金额(元)" prop="waterContent">
+          <ws-form-item label="本次付款金额(元)" prop="money">
             <ws-input
+            v-model="payments.money"
               placeholder="请输入本次付款金额(元)"
               maxlength="100"
               size="small"
             />
           </ws-form-item>
-          <ws-form-item label="付款日期" prop="waterContent">
-            <el-date-picker v-model="value1" type="date" placeholder="选择日期">
+          <ws-form-item label="付款日期" prop=" paymentDate">
+            <el-date-picker v-model="payments.paymentDate" type="date" placeholder="选择日期">
             </el-date-picker>
           </ws-form-item>
         </ws-info-table>
@@ -176,6 +174,7 @@
           <el-button @click="paymentSubmit">提交</el-button>
         </div>
       </ws-form>
+      </div>
     </el-dialog>
     <div style="text-align:center">
     <el-pagination
@@ -195,6 +194,12 @@
       title="中天昊元粮食贸易有限公司结算凭证"
     >
       <paymentPrint :printData="printData"></paymentPrint>
+      <div style="text-align:center">
+        <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
+        <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
+        <el-button type="primary" @click="printBig">打印单据</el-button>
+      </div>
+       
     </el-dialog>
     </div>
   </div>
@@ -228,11 +233,14 @@ export default {
       warehouse:[],
       value1: '', //付款日期
       modification: [],
-      userJurisdiction:true
+      userJurisdiction:true,
+      payments:{
+        amountNotPayable:0,
+      }
     }
   },
   activated() {
-         this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
+      this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
      selectWarehouseSelf({
         compId: sessionStorage.getItem('ws-pf_compId'),
         personCharge: sessionStorage.getItem('ws-pf_staffName'),
@@ -249,6 +257,16 @@ export default {
 
   },
   methods: {
+     printSmall() {
+        window.location.href =
+          '../../../../../static/payprint.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      },
+      printBig() {
+        window.location.href =
+          '../../../../../static/payprint.html?type=2&dataList=' +
+          JSON.stringify(this.printData)
+      },
    getList(){
      getpayment({
        currentPage:this.currentPage,
@@ -450,6 +468,14 @@ export default {
 
     handleSelectionChange(val) {
       this.modification = val
+      console.log(this.modification[0].amountNotPayable)
+      let sum = 0
+      for(let i = 0 ; i < this.modification.length ; i++){
+        sum += this.modification[i].amountNotPayable
+
+      }
+      this.payments.amountNotPayable = sum
+      console.log(this.payment.amountNotPayable)
     },
     // handleRowClick(row) {
     //   if (row.approveStatus == null) {
@@ -502,6 +528,15 @@ export default {
 /deep/.ws-info-table .el-form-item .el-form-item__content {
   border: none;
 }
+
+/deep/.el-dialog__title {
+  font-size: 24px !important;
+}
+/deep/.el-dialog__header {
+  text-align: center !important;
+  padding: 10px 0 !important;
+  height: auto !important;
+}
 .title {
   font-size: 16px;
   font-weight: 600;
@@ -535,6 +570,14 @@ table {
   padding:10px;
   text-align:center;
 }
-
-
+.tanchuang{
+  margin: 0 auto;
+}
+.tanchuang .ws-info-table{
+  display: initial;
+}
+.tanchuang .ws-info-table .el-form-item{
+  margin: 0 auto;
+  
+}
 </style>

+ 208 - 119
src/views/houseSelfCollect/settlement.vue

@@ -24,7 +24,7 @@
     <div class="substance">
       <ws-form>
         <div style="width: 50%; margin: 0 auto">
-          <div class="title">基本信息</div>
+          <div class="titles">基本信息</div>
           <ws-info-table>
             <ws-form-item label="编号" span="1" prop="paymentNo">
               <ws-input
@@ -72,7 +72,7 @@
                 <ws-input v-model="paymentList.solidGrainPrice" placeholder="请输入干粮单价" maxlength="100" size="small" :disabled='disabled' />
             </ws-form-item>
           </ws-info-table>
-          <div class="title">质检数据</div>
+          <div class="titles">质检数据</div>
           <ws-info-table>
             <ws-form-item label="等级" span="1" prop="waterContent">
               <ws-input v-model="paymentList.qualityInspectionManagement.grade" placeholder="请输入等级" maxlength="100" size="small" disabled />
@@ -127,7 +127,7 @@
             </ws-form-item>
           </ws-info-table>
 
-          <div v-if='paymentList.type=="潮粮"' class="title">单价核算</div>
+          <div v-if='paymentList.type=="潮粮"' class="titles">单价核算</div>
           <ws-info-table v-if='paymentList.type=="潮粮"'>
             <ws-form-item label="潮粮水分(%)" span="1" prop="waterContent">
               <ws-input
@@ -209,7 +209,7 @@
             </ws-form-item>
           </ws-info-table>
 
-          <div class="title">结算金额(元)</div>
+          <div class="titles">结算金额(元)</div>
           <ws-info-table>
             <ws-form-item v-if='paymentList.type=="潮粮"'
               label="粮款 = 净重 x 净重单价 ="
@@ -368,15 +368,33 @@
         </div>
       </ws-form>
     </div>
-    <!-- <houseSelfCollectPrint v-show="false"></houseSelfCollectPrint> -->
+     <el-dialog
+      width="70%"
+      class="table-content"
+      center
+      :visible.sync="isShowPrint"
+      title="中天昊元粮食贸易有限公司结算凭证"
+       @close="closeDialog"
+    >
+      <paymentPrint :printData="printData" ref="saveImg"></paymentPrint>
+      <div style="text-align:center">
+        <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
+        <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
+        <el-button type="primary" @click="printBig">打印单据</el-button>
+      </div>
+       
+    </el-dialog>
+
   </div>
 </template>
 <script>
-import {getpaymentexamine,postpaymentedit} from '@/model/houseSelfCollect/index'
-// import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
+import {getpaymentexamine,postpaymentedit,settlementEdit} from '@/model/houseSelfCollect/index'
+import paymentPrint from './component/paymentPrint.vue'
+import html2canvas from "html2canvas"
+import axios from "axios"
 export default {
   components: {
-    // houseSelfCollectPrint,
+    paymentPrint
   },
   watch: {},
   data() {
@@ -390,8 +408,10 @@ export default {
      },
       disabled:false,
       types:'',
-
+      isShowPrint:false,
       information:'结算',
+      printData:{},
+      imgUrl:"",
     }
   },
   activated() {
@@ -406,6 +426,41 @@ export default {
    this.getList()
   },
   methods: {
+    closeDialog(){
+      debugger
+      html2canvas(this.$refs.saveImg.$el).then((canvas) => {
+        let dataURL = canvas.toDataURL('image/png')
+        this.imgUrl = dataURL
+        if (this.imgUrl !== '') {
+          let b = this.dataURLtoFile(this.imgUrl, 'printImage')
+          let formdata = new FormData()
+          formdata.append('file', b)
+          axios({
+            method: 'post',
+            url: 'https://www.zthymaoyi.com/upload/admin',
+            data: formdata,
+          }).then((response) => {
+            //编辑接口
+            this.paymentList.pictureAddress = response.data.url
+            settlementEdit(this.paymentList)
+              .toPromise()
+              .then((response) => {})
+          })
+          this.dialogTableVisible = true
+        }
+      })
+
+    },
+    printSmall() {
+        window.location.href =
+          '../../../../../static/payprint.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      },
+      printBig() {
+        window.location.href =
+          '../../../../../static/payprint.html?type=2&dataList=' +
+          JSON.stringify(this.printData)
+      },
     getList(){
       getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
           this.paymentList = response
@@ -524,126 +579,120 @@ export default {
           return chineseStr;
         },
     print() {
-       if (!this.paymentList.buckleWeightRatio) {
-          this.$message({
-            message: '扣重比不能为空',
-            type: 'warning',
-          })
-          return
-        }
-        if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
-          this.$message({
-            message: '扣重比输入错误',
-            type: 'warning',
-          })
-          return
-        }
+      //  if (!this.paymentList.buckleWeightRatio) {
+      //     this.$message({
+      //       message: '扣重比不能为空',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
+      //   if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
+      //     this.$message({
+      //       message: '扣重比输入错误',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
 
-        if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
-          this.$message({
-            message: '称重补助范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
+      //     this.$message({
+      //       message: '称重补助范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
      
-        if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
-          this.$message({
-            message: '称重扣款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
+      //     this.$message({
+      //       message: '称重扣款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
         
-        if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
-          this.$message({
-            message: '运费补助范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
+      //     this.$message({
+      //       message: '运费补助范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
      
-        if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
-          this.$message({
-            message: '运费扣款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
+      //     this.$message({
+      //       message: '运费扣款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
       
-        if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
-          this.$message({
-            message: '卸车补助范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
+      //     this.$message({
+      //       message: '卸车补助范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
       
-        if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
-          this.$message({
-            message: '卸车扣款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
+      //     this.$message({
+      //       message: '卸车扣款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
        
-        if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
-          this.$message({
-            message: '其他补助范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
+      //     this.$message({
+      //       message: '其他补助范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
        
-        if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
-          this.$message({
-            message: '质量扣款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
+      //     this.$message({
+      //       message: '质量扣款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
       
-        if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
-          this.$message({
-            message: '其他扣款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
-      //   if (
-      //   String(this.paymentList.actualPayment).indexOf('.') != -1 &&
-      //   String(this.paymentList.actualPayment).length -
-      //     (String(this.paymentList.actualPayment).indexOf('.') + 1) >
-      //     2
-      // ) {
-      //   this.$message({
-      //     message: '毛重输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-        if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
-          this.$message({
-            message: '实际付款范围应在0-100000内',
-            type: 'warning',
-          })
-          return
-        }
-        if (this.paymentList.remarks.length > 20) {
-          this.$message({
-            message: '记事字数应在0-20个字',
-            type: 'warning',
-          })
-          return
-        }
+      //   if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
+      //     this.$message({
+      //       message: '其他扣款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
+      //   if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
+      //     this.$message({
+      //       message: '实际付款范围应在0-100000内',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
+      //   if (this.paymentList.remarks.length > 20) {
+      //     this.$message({
+      //       message: '记事字数应在0-20个字',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
+
       this.paymentList.id=this.$route.query.id 
       this.paymentList.settlementClerk =  sessionStorage.getItem('ws-pf_staffName')
       postpaymentedit(this.paymentList).toPromise().then((response) => {
-          this.$router.push({ path: 'houseSelfCollectPrint',
-            query:{
-          name:"123"
-        }
-        })
+         getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
+             this.printData= response
+         })
+         this.isShowPrint = true
+           
+        //   this.$router.push({ path: 'houseSelfCollectPrint',
+        //     query:{
+        //   name:"123"
+        // }
+        // })
         },
         )
     },
@@ -662,6 +711,7 @@ export default {
       
     },
     cancel() {
+      this.paymentList = [] 
       this.$router.push({ path: 'paymentManagement' })
     },
   },
@@ -689,12 +739,12 @@ export default {
 /deep/.ws-info-table .el-form-item .el-form-item__content {
   border: none;
 }
-.title {
+.titles {
   font-size: 16px;
   font-weight: 600;
   margin: 10px;
 }
-.title::before {
+.titles::before {
   content: '';
   display: inline-block;
   width: 5px;
@@ -750,4 +800,43 @@ export default {
       overflow: scroll;
     height: 86vh;
 }
+/deep/.el-table .el-table__header .cell,
+.el-table .el-table__body .cell {
+  text-align: center;
+}
+/deep/.el-table--enable-row-transition .el-table__body td {
+  text-align: center;
+}
+.title{
+  padding:10px;
+  text-align:center;
+}
+
+/deep/.el-dialog__title {
+  font-size: 24px !important;
+}
+/deep/.el-dialog__header {
+  text-align: center !important;
+  padding: 10px 0 !important;
+  height: auto !important;
+}
+.title {
+  font-size: 16px;
+  font-weight: 600;
+}
+table,
+table tr th,
+table tr td {
+  border: 2px solid #333333;
+  padding: 5px 0;
+}
+
+table {
+  width: 100%;
+  min-height: 25px;
+  line-height: 25px;
+  text-align: center;
+  border-collapse: collapse;
+  border: 3px solid #333333;
+}
 </style>

+ 15 - 0
src/views/houseSelfCollect/weighingManagement.vue

@@ -118,6 +118,11 @@
       title="粮食检斤单"
     >
       <weightCheckPrint :tableData="dialogData"></weightCheckPrint>
+      <div style="text-align:center">
+      <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
+      <el-button type="primary" @click="printSmall">打印小票</el-button>
+      <el-button type="primary" @click="printBig">打印单据</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -162,6 +167,16 @@ export default {
    
   },
   methods: {
+     printSmall() {
+      window.location.href =
+        '../../../../static/weightCheck.html?type=1&tableData=' +
+        JSON.stringify(this.dialogData)
+    },
+    printBig() {
+      window.location.href =
+        '../../../../static/weightCheck.html?type=2&tableData=' +
+        JSON.stringify(this.dialogData)
+    },
     print(row) {
        getPrint({
       id:row.id

+ 15 - 9
src/views/houseSelfCollect/weightCheck.vue

@@ -162,11 +162,15 @@
       :visible.sync="isShowPrint"
       title="粮食检斤单"
       @close="closeDialog"
+      
     >
-      <weightCheckPrint :tableData="inspect"></weightCheckPrint>
-      <el-button type="primary" @click="inspect = false">关闭</el-button>
+      <weightCheckPrint :tableData="inspect" ref="saveImg"></weightCheckPrint>
+      <div style="text-align:center">
+      <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
       <el-button type="primary" @click="printSmall">打印小票</el-button>
       <el-button type="primary" @click="printBig">打印单据</el-button>
+      </div>
+      
     </el-dialog>
   </div>
 </template>
@@ -178,6 +182,8 @@ import {
   getPrint,
 } from '@/model/houseSelfCollect/index'
 import weightCheckPrint from './component/weightCheckPrint.vue'
+  import html2canvas from "html2canvas"
+  import axios from "axios"
 export default {
   components: {
     weightCheckPrint,
@@ -197,6 +203,7 @@ export default {
       warehouseId: '',
       purchasePriceList: [],
       isShowPrint: false,
+      tableData:{}
     }
   },
   activated() {
@@ -239,20 +246,19 @@ export default {
     printSmall() {
       window.location.href =
         '../../../../static/weightCheck.html?type=1&tableData=' +
-        JSON.stringify(this.tableData)
+        JSON.stringify(this.inspect)
     },
     printBig() {
       window.location.href =
         '../../../../static/weightCheck.html?type=2&tableData=' +
-        JSON.stringify(this.tableData)
+        JSON.stringify(this.inspect)
     },
     closeDialog() {
       html2canvas(this.$refs.saveImg.$el).then((canvas) => {
         let dataURL = canvas.toDataURL('image/png')
         this.imgUrl = dataURL
         if (this.imgUrl !== '') {
-          let b = this.dataURLtoFile(this.imgUrl, 'aa')
-          console.log(b)
+          let b = this.dataURLtoFile(this.imgUrl, 'printImage')
           let formdata = new FormData()
           formdata.append('file', b)
           axios({
@@ -262,11 +268,10 @@ export default {
           }).then((response) => {
             //编辑接口
             this.weighingList.pictureAddress = response.data.url
-            getinspectEdit(this.weighingList)
+            tare(this.weighingList)
               .toPromise()
               .then((response) => {})
           })
-
           this.dialogTableVisible = true
         }
       })
@@ -416,8 +421,9 @@ export default {
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      this.inspect.a = "中天"
+                      // this.tableData = response
                       this.isShowPrint = true
-                      console.log(this.dialogData)
                     })
                     .catch((response) => {
                       // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))