Bläddra i källkod

财务结算 修改BUG

jiayufei 3 år sedan
förälder
incheckning
cc9b9ae838

+ 2 - 2
src/views/modules/settlement-account/settlement-account-server.js

@@ -5,7 +5,7 @@
 
 //  export const urlAcount = 'http://118.24.244.213:8808'; // 线上
 //  export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
-// export const urlAcount = 'http://192.168.1.43:9999'; // 子安
- export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
+export const urlAcount = 'http://192.168.1.43:9999'; // 子安
+//  export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
 // export const urlAcount = 'http://192.168.1.8:9999'; // 学超
  

+ 1 - 1
src/views/modules/settlement-account/settlement-account.vue

@@ -597,7 +597,7 @@ export default {
             let that = this;
             this.$confirm({
                 title: '提示',
-                content: '确认删除该条数据',
+                content: '是否确认删除该条数据',
                 onOk() {
                     getAction(urlAcount + '/finance/settLementController/deleteSettlementById', {id: list.id}).then(result => {
                         if (result.code === 0) {

+ 2 - 2
src/views/modules/settlement-information/settlement-information-server.js

@@ -5,7 +5,7 @@
 
 //  export const urlAcount = 'http://118.24.244.213:8808'; // 线上
 //  export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
-//  export const urlAcount = 'http://192.168.1.43:9999'; // 子安
- export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
+ export const urlAcount = 'http://192.168.1.43:9999'; // 子安
+//  export const urlAcount = 'http://gateway.tjyourong.com.cn'; // 测试
 // export const urlAcount = 'http://192.168.1.8:9999'; // 学超
  

+ 80 - 16
src/views/modules/settlement-information/settlement-information.vue

@@ -174,6 +174,16 @@
                     :label-col="labelCol"
                     :wrapper-col="wrapperCol"
                 >
+                    <a-form-model-item label="选择媒体">
+                        <a-radio-group
+                            v-model="policyOperationForm.mediaId"
+                            button-style="solid"
+                            @change="handlePolicyUploadChange"
+                        >
+                            <a-radio-button :value="1">头条</a-radio-button>
+                            <a-radio-button :value="2">快手</a-radio-button>
+                        </a-radio-group>
+                    </a-form-model-item>
                     <a-form-model-item label="选择广告主公司名称" prop="advertiserId">
                         <a-select
                             v-model="policyOperationForm.advertiserId"
@@ -207,12 +217,6 @@
                             </a-select-option>
                         </a-select>
                     </a-form-model-item>
-                    <a-form-model-item label="选择媒体">
-                        <a-radio-group v-model="policyOperationForm.mediaId" button-style="solid" @change="handlePolicyUploadChange">
-                            <a-radio-button :value="1">头条</a-radio-button>
-                            <a-radio-button :value="2">快手</a-radio-button>
-                        </a-radio-group>
-                    </a-form-model-item>
                     <a-form-model-item label="时间" prop="uploadYears">
                         <a-month-picker
                             v-model="policyOperationForm.uploadYears"
@@ -254,6 +258,16 @@
                     :label-col="labelCol"
                     :wrapper-col="wrapperCol"
                 >
+                    <a-form-model-item label="选择媒体">
+                        <a-radio-group
+                            v-model="settlementModalForm.mediaId"
+                            button-style="solid"
+                            @change="handleMediaIdChange"
+                        >
+                            <a-radio-button :value="1">头条</a-radio-button>
+                            <a-radio-button :value="2">快手</a-radio-button>
+                        </a-radio-group>
+                    </a-form-model-item>
                     <a-form-model-item label="选择广告主公司名称" prop="advertiserId">
                         <a-select
                             v-model="settlementModalForm.advertiserId"
@@ -288,12 +302,6 @@
                             </a-select-option>
                         </a-select>
                     </a-form-model-item>
-                    <a-form-model-item label="选择媒体">
-                        <a-radio-group v-model="settlementModalForm.mediaId" button-style="solid" @change="handleMediaIdChange">
-                            <a-radio-button :value="1">头条</a-radio-button>
-                            <a-radio-button :value="2">快手</a-radio-button>
-                        </a-radio-group>
-                    </a-form-model-item>
                     <a-form-model-item label="时间" prop="uploadYears">
                         <a-month-picker
                             v-model="settlementModalForm.uploadYears"
@@ -305,7 +313,7 @@
                     <a-form-model-item label="账户数量">
                         <span>{{ downLoadAccountNum }}</span>
                     </a-form-model-item>
-                    <a-form-model-item label="截图已上传">
+                    <a-form-model-item label="截图已上传账户数量">
                         <span>{{ downLoadImgNum }}</span>
                     </a-form-model-item>
                 </a-form-model>
@@ -533,7 +541,9 @@ export default {
             this.allAdverListOption = [];
             this.settlementModalForm.productId = undefined;
             this.allProductListOption = [];
-            this.handleGetDownLoadAllNum();
+            this.downLoadAccountNum = 0;
+            this.downLoadImgNum = 0;
+            this.settlementModalForm.uploadYears = '';
             this.handleGetAllAdverList(e.target.value);
         },
         handleGetDownLoadAllNum() {
@@ -620,7 +630,7 @@ export default {
         handleInitTable() {
             this.controlLoading = true;
             const paramsData = {
-                userId: this.userInfo().id,
+                createUserId: this.userInfo().id,
                 productName: this.configForm.productName,
                 projectName: this.configForm.projectName,
                 accountName: this.configForm.accountName,
@@ -666,8 +676,33 @@ export default {
                             this.$message.error(result.message);
                         }
                         else {
+                            // const url = `${urlAcount}${urlData}?startTime=${paramsData.startTime}&endTime=${paramsData.endTime}`;
+                            // this.downloadLoadingStatus = true;
+                            // this.downTypeName = '利润单';
+                            // setTimeout(() => {
+                            //     this.downloadLoadingStatus = false;
+                            // }, 3000);
+                            this.$message.success('正在下载利润单,请稍后...', 4);
+
                             window.location.href = `${urlAcount}${urlData}?startTime=${paramsData.startTime}&endTime=${paramsData.endTime}`;
+                            // if (window.navigator.msSaveOrOpenBlob) {
+                            //     // 兼容ie11
+                            //     var blobObject = new Blob([res.result]);
+                            //     window.navigator.msSaveOrOpenBlob(blobObject, name);
+                            // }
+                            // else {
+                            //     let url = URL.createObjectURL(new Blob([res]));
+                            //     let a = document.createElement("a");
+                            //     document.body.appendChild(a);
+                            //     a.href = url;
+                            //     a.download = '';
+                            //     a.target = "_blank";
+                            //     a.click();
+                            //     a.remove();
+                            // }
                             this.handleSettlementModalnCancel();
+
+                            // this.handleDownUpdate(url);
                         }
                     }).catch(error => {
                         console.log(error, 'eeee');
@@ -678,6 +713,32 @@ export default {
                 }
             });
         },
+        handleDownUpdate(url) {
+            let xhr = new XMLHttpRequest();
+            xhr.open('GET', url, true);    // 也可用POST方式
+            xhr.responseType = "blob";
+            xhr.onload = function () {
+                if (this.status === 200) {
+                    var blob = this.response;
+                    if (navigator.msSaveBlob == null) {
+                        var a = document.createElement('a');
+                        var headerName = xhr.getResponseHeader("Content-disposition");
+                        var fileName = decodeURIComponent(headerName).substring(20);
+                        a.download = fileName;
+                        a.href = URL.createObjectURL(blob);
+                        document.body.appendChild(a)
+                        // $("body").append(a);    // 修复firefox中无法触发click
+                        a.click();
+                        URL.revokeObjectURL(a.href);
+                        a.remove();
+                    } else {
+                        navigator.msSaveBlob(blob, fileName);
+                    }
+                }
+                disload();
+            };
+            xhr.send()
+        },
         handleProfitModalnCancel() {
             this.profitModalForm = {
                 mediaId: 1,
@@ -701,6 +762,7 @@ export default {
                             this.$message.error(result.message);
                         }
                         else {
+                            this.$message.success('正在下载结算单,请稍后...', 4);
                             window.location.href = `${urlAcount}${urlData}?advertiserId=${advertiserId}&productId=${productId}&mediaId=${mediaId}&uploadYears=${paramsData.uploadYears}`;
                             this.handleSettlementModalnCancel();
                         }
@@ -720,6 +782,8 @@ export default {
                 mediaId: 1,
                 uploadYears: ''
             };
+            this.downLoadAccountNum = 0;
+            this.downLoadImgNum = 0;
             this.settlementModalStatus = false;
         },
         // 月份时间选择器
@@ -923,7 +987,7 @@ export default {
             };
             this.$confirm({
                 title: '提示',
-                content: '确认删除该条数据',
+                content: '是否确认删除该条数据',
                 onOk() {
                     getAction(urlAcount + '/finance/settLementFileController/deleteSettlementFile', paramsData).then(result => {
                         if (result.code === 0) {