zhongtianhaoyuan 2 лет назад
Родитель
Сommit
23e97a48bb

+ 49 - 14
public/static/weightCheck.html

@@ -588,9 +588,9 @@
             pageType: '',
             isDDPrint: false,
             isEWPrint: false,
-            imgUrl: ""
+            imgUrl: "",
+            serverIp: ""
         },
-        computed: {},
         methods: {
             tableRowClassName({
                 row,
@@ -617,26 +617,32 @@
             printSmall() { },
             printBig() { },
             closeDialog() {
-                if (this.tableData.length == 1) {//this.tableData  条数为1 认为单个打印
+                var that = this
+                if (location.host == "www.eliangeyun.com") {
+                    that.serverIp = "https://api2.eliangeyun.com"
+                } else {
+                    that.serverIp = localStorage.getItem("serverIp")
+                }
+                if (that.tableData.length == 1) {//this.tableData  条数为1 认为单个打印
                     html2canvas(document.querySelector("#saveImg"), { foreignObjectRendering: true, allowTaint: true }).then((canvas) => {
                         let dataURL = canvas.toDataURL('image/png')
-                        this.imgUrl = dataURL
-                        if (this.imgUrl !== '') {
-                            let b = this.dataURLtoFile(this.imgUrl, 'printImage')
+                        that.imgUrl = dataURL
+                        if (that.imgUrl !== '') {
+                            let b = that.dataURLtoFile(that.imgUrl, 'printImage')
                             let formdata = new FormData()
                             formdata.append('file', b)
                             axios({
                                 method: 'post',
-                                url: "http://192.168.110.9:9888/appendix/admin",
+                                url: "https://api2.eliangeyun.com/appendix/admin",
                                 data: formdata,
                             }).then((response) => {
                                 // 编辑接口
-                                this.weighingList = this.tableData[0]
-                                this.weighingList.pictureAddress = response.data.data.url
+                                that.weighingList = that.tableData[0]
+                                that.weighingList.pictureAddress = response.data.data.url
                                 axios({//皮重检斤接口
                                     method: 'post',
-                                    url: "http://192.168.110.9:9888/weighingManagement/api/editTare",
-                                    data: this.weighingList,
+                                    url: that.serverIp + "/weighingManagement/api/editTare",
+                                    data: that.weighingList,
                                 }).then((response) => {//入库单截图上传成功
                                 })
                             })
@@ -644,9 +650,39 @@
                     })
                 }
             },
+            // async getImgBase64() {
+            //     var that = this
+            //     let ele = document.querySelector("#saveImg")
+            //     const width = ele.offsetWidth
+            //     const height = ele.offsetHeight
+            //     let canvas = await html2canvas(ele, {
+            //         scale: 2,
+            //         width,
+            //         height,
+            //         backgroundColor: "red",
+            //         foreignObjectRendering:true,
+            //         allowTaint:true
+            //     })
+            //     let dataURL = canvas.toDataURL('image/png')
+            //     that.imgUrl = dataURL
+            //     if (that.imgUrl !== '') {
+            //         let b = that.dataURLtoFile(that.imgUrl, 'printImage')
+            //         let formdata = new FormData()
+            //         formdata.append('file', b)
+            //         document.body.appendChild(canvas)
+            //         // axios({
+            //         //     method: 'post',
+            //         //     url: "https://api2.eliangeyun.com/appendix/admin",
+            //         //     data: formdata,
+            //         // }).then((response) => { 
+            //         //     debugger
+            //         // })
+            //     }
+            // }
         },
         updated() {
             this.closeDialog()
+            // this.getImgBase64()
         },
         mounted() {
             let _data = {}
@@ -683,13 +719,12 @@
                 this.tableData = JSON.parse(_data.replace(/baifenhao/g, '%'))
             }
             // sessionStorage.setItem('record_print', JSON.stringify(response))
-            // this.tableData = JSON.parse(sessionStorage.getItem("record_print"))
-
+            // this.tableData = JSON.parse(sessionStorage.getItem("record_print")
             document.title = "粮食检斤单"
-            window.print()
             window.onafterprint = function (event) {
                 window.history.back(-1)
             };
+            window.print()
         },
         watch: {}
     })

+ 3 - 1
src/api/V2/profitable/index.js

@@ -103,4 +103,6 @@ export const API_BATCH_DEL_FIXEDINFO = '/fixedAssetsInfo/batchDeleteFixedAssets'
 // 发起人撤回
 export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'
 // 入库单列表
-export const API_GET_WAREHOUSINGORDER_LIST = '/warehousingOrder/selectInfo'
+export const API_GET_WAREHOUSINGORDER_LIST = '/warehousingOrder/selectInfo'
+//费用明细信息
+export const API_POST_EXPORTFILE = '/expenseInfo/exportPc'

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

@@ -53,6 +53,7 @@ import {
   API_BATCH_DEL_FIXEDINFO,
   API_SPONSOR_WITHDRAW,
   API_GET_WAREHOUSINGORDER_LIST,
+  API_POST_EXPORTFILE
 } from '@/api/V2/profitable'
 //收支明细列表
 export const getInOutDetailed = appRx.get(API_GET_INOUTDETAILED, errorCatcher, errorHandle, filter)
@@ -158,4 +159,6 @@ export const batchDelFixedInfo = appRx.post(API_BATCH_DEL_FIXEDINFO, errorCatche
 	// 发起人撤回
   export const sponsorWithdraw = appRx.post(API_SPONSOR_WITHDRAW, errorCatcher, errorHandle, filter)
   //入库单列表
-export const getwarehousingorderList = appRx.get(API_GET_WAREHOUSINGORDER_LIST,errorCatcher, errorHandle, filter)
+export const getwarehousingorderList = appRx.get(API_GET_WAREHOUSINGORDER_LIST,errorCatcher, errorHandle, filter)
+// 导出费用明细信息
+export const exportFile = appRx.post(API_POST_EXPORTFILE)

+ 2 - 0
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -311,6 +311,7 @@
   import BalanceAlert from '@/components/balanceAlert'
   import html2canvas from 'html2canvas'
   import axios from 'axios'
+  import configText from "../../../vue.config.js"
   export default {
     components: {
       weightCheckPrint,
@@ -566,6 +567,7 @@
       }
     },
     mounted() {
+      localStorage.setItem("serverIp",configText.devServer.proxy["/pb"].target)
       if(localStorage.getItem('compNameoptions')){
         var company=JSON.parse(localStorage.getItem('compNameoptions'))
         var extra=company.filter((item)=>{

+ 3 - 3
src/views/houseSelfCollect/settlement.vue

@@ -365,15 +365,15 @@
               data: formdata,
             }).then((response) => {
               //编辑接口
-              this.paymentList.pictureAddress = response.data.url
+              this.paymentList.pictureAddress = response.data.data.url
               settlementEdit(this.paymentList)
                 .toPromise()
-                .then((response) => {})
+                .then((response) => {
+                })
               this.paymentList = []
 
             })
             this.dialogTableVisible = true
-
           }
         })
         this.isShowPrint = false

+ 24 - 1
src/views/profitable/expensemanagementdetails.vue

@@ -69,6 +69,7 @@
           <el-button @click="costChange(1)" :type="expensesPurpose == 1 ? 'primary' : ''">合同费用</el-button>
           <el-button @click="costChange(5)" :type="expensesPurpose == 5 ? 'primary' : ''">经营性费用</el-button>
           <el-button @click="costChange(2)" :type="expensesPurpose == 2 ? 'primary' : ''">运费</el-button>
+          <el-button @click="exportFile" type="primary">导出</el-button>
         </el-col>
         <el-col style="text-align: right" :span="6">
           <el-badge v-if="approveStatus" is-dot class="item">
@@ -303,8 +304,12 @@ import {
   getAuditRecord,
   getfielfillinginfo,
   getXialaList,
-  sponsorWithdraw
+  sponsorWithdraw,
+  exportFile,
 } from '@/model/profitable/index'
+import {
+    downloadFile
+  } from '@/utils/batchDown'
 export default {
   components: {
     WsUpload,
@@ -374,11 +379,29 @@ export default {
     }
   },
   activated() {
+  
     this.getPassYearFormatDate()
     this.getList()
     this.xiala()
   },
   methods: {
+    async exportFile(){
+        let _data = {
+          expenseInfoExportList:this.choiceObj
+        }
+        const {
+          data
+        } = await exportFile(
+          _data, {}, {
+            responseType: 'blob',
+          }
+        ).toPromise()
+        downloadFile({
+          res: data,
+          fileName: `费用明细`,
+          type: 'xls',
+        })
+    },
     withdraw(row) {
       this.$confirm(`撤回成功后,可再次提交,确定撤回吗?`, {
         cancelButtonText: '取消',