zhuxinbo 4 gadi atpakaļ
vecāks
revīzija
89477e32aa

+ 2 - 2
src/utils/request.js

@@ -13,8 +13,8 @@ if (process.env.NODE_ENV == 'development') {
 else if (process.env.NODE_ENV == 'debug') { 
 } 
 else if (process.env.NODE_ENV == 'production') { 
-    // axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
-axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
+    axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
+// axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 80 - 26
src/views/modules/Statistics/mediaReport.vue

@@ -34,9 +34,9 @@
 
           </span>
           <span>:</span>
+          <!-- @focus="handleFocus" @blur="handleBlur" @change="advertisersChange" -->
           <a-select show-search placeholder='请选择或搜索广告主' option-filter-prop="children" style="width: 300px"
-            :filter-option="filterOption" @focus="handleFocus" @blur="handleBlur" @change="advertisersChange"
-            v-model="advertiser">
+            :filter-option="filterOption" v-model="advertiser" @change="advertisersChange">
             <a-select-option value="">全部</a-select-option>
             <a-select-option v-for="item in advertisersArr" :key="item.id" :value='item.id'>
               {{item.name}}
@@ -99,7 +99,8 @@
 
           </span>
           <span>:</span>
-          <a-date-picker @change="onChange" v-model="dateValue" placeholder='请选择日期' :disabled-date="disabledDate" />
+          <a-date-picker @change="onChange" v-model="dateValue" :allowClear="false" placeholder='请选择日期'
+            :disabled-date="disabledDate" />
 
         </span>
 
@@ -120,9 +121,18 @@
               <span v-if="text==4">快手内广</span>
               <span v-if="text=='-'">-</span>
             </span>
-            <span slot="yesterdayCost" slot-scope="yesterdayCost">{{yesterdayCost | decimalsHandle}}</span>
-            <span slot="todayCost" slot-scope="todayCost">{{todayCost | decimalsHandle}}</span>
-            <span slot="diffCost" slot-scope="diffCost">{{diffCost | decimalsHandle}}</span>
+            <!-- <span slot="yesterdayCost" slot-scope="yesterdayCost,record">
+              <span v-if="record.mediaType == 1">{{yesterdayCost | decimalsHandle}}</span>
+              <span v-else>{{yesterdayCost | decimalsHandleThree}}</span>
+            </span>
+            <span slot="todayCost" slot-scope="todayCost,record">
+              <span v-if="record.mediaType == 1">{{todayCost | decimalsHandle}}</span>
+              <span v-else>{{todayCost | decimalsHandleThree}}</span>
+            </span>
+            <span slot="diffCost" slot-scope="diffCost,record">
+              <span v-if="record.mediaType == 1">{{diffCost | decimalsHandle}}</span>
+              <span v-else>{{diffCost | decimalsHandleThree}}</span>
+            </span> -->
             <span slot="operatorManger" slot-scope="operatorManger">{{ operatorManger | blankHandle}}</span>
             <span slot="operator" slot-scope="operator">{{ operator | blankHandle}}</span>
             <span slot="sale" slot-scope="sale">{{ sale | blankHandle}}</span>
@@ -233,11 +243,13 @@
             }
           },
           {
-              title: '公司',
-              dataIndex: 'companyName',
-              align: 'center',
-              scopedSlots: { customRender: 'companyName' },
-              width:200
+            title: '公司',
+            dataIndex: 'companyName',
+            align: 'center',
+            scopedSlots: {
+              customRender: 'companyName'
+            },
+            width: 200
           },
           {
             title: '运营',
@@ -318,19 +330,12 @@
         if (this.advertiser == '' || this.advertiser == undefined) {
 
           this.project = undefined;
-          this.projectArr = [];
+		  this.projectArr = [];
+		  this.getPruduct()
         } else {
           this.project = undefined;
           this.projectArr = [];
-          getAction('/ctop/media/report/getProject', {
-            companyId: this.company,
-            advertiserId: this.advertiser
-          }).then(res => {
-            if (res.success) {
-              console.log(res)
-              this.projectArr = res.result
-            }
-          })
+          this.getPruduct()
         }
       },
       projectChange(value) {
@@ -455,12 +460,12 @@
 
 
         downFilePost('/ctop/media/report/exportMediaReportExcel', {
-        //   companyId: company,
-        //   advertiserId: advertiser,
-        //   projectId: project,
+          //   companyId: company,
+          //   advertiserId: advertiser,
+          //   projectId: project,
           mediaType,
           todayDate: this.dateValue.format('YYYY-MM-DD'),
-        //   yesterdayDate: moment(this.dateValue).subtract(1, "days").format('YYYY-MM-DD'),
+          //   yesterdayDate: moment(this.dateValue).subtract(1, "days").format('YYYY-MM-DD'),
         }).then(res => {
           let blob = new Blob([res], {
             type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
@@ -493,7 +498,8 @@
       },
       getPruduct() {
         postAction('/ctop/media/report/getAllProductList', {
-          "mediaType": this.noTitleKey
+          "mediaType": this.noTitleKey,
+          advertiserId: this.advertiser==""?null:this.advertiser
         }).then(res => {
           if (res.success) {
             console.log(res)
@@ -589,6 +595,54 @@
           return 0
         }
       },
+      //保留两位小数并且变成货币格式
+      decimalsHandleThree(val) {
+
+        if (val && typeof val != 'string') {
+          if (val >= 0) {
+            val = parseFloat(val).toFixed(3);
+            let numberStr = val.toString()
+            let str = numberStr.split('.')
+
+            let str0 = str[0].split('').reverse();
+            for (let i = 0; i < str0.length; i++) {
+              if ((i + 1) % 4 === 0) {
+                str0.splice(i, 0, ',')
+              }
+            }
+            str0.reverse()
+            let handleResult = ''
+            for (let j = 0; j < str0.length; j++) {
+              handleResult += str0[j]
+            }
+
+            return handleResult + '.' + str[1]
+          } else {
+            val = parseFloat(val).toFixed(3);
+            let numberStr = val.toString()
+            let str = numberStr.split('.')
+
+            let str0 = str[0].substr(1).split('').reverse();
+            for (let i = 0; i < str0.length; i++) {
+              if ((i + 1) % 4 === 0) {
+                str0.splice(i, 0, ',')
+              }
+            }
+            str0.reverse()
+            let handleResult = ''
+            for (let j = 0; j < str0.length; j++) {
+              handleResult += str0[j]
+            }
+
+            return '-' + handleResult + '.' + str[1]
+          }
+
+        } else if (typeof val == 'string') {
+          return val
+        } else {
+          return 0
+        }
+      },
       //变成货币格式
       formatCurrency(val) {
         if ((val || val == 0) && typeof val != 'string') {

+ 2 - 2
src/views/modules/advertiser/modules/productModal.vue

@@ -7,8 +7,8 @@
           <a-radio-group @change="onChange" v-model="model.mediaId">
             <a-radio-button value="1">头条</a-radio-button>
             <a-radio-button value="2">快手</a-radio-button>
-            <a-radio-button value="3">头条内广</a-radio-button>
-            <a-radio-button value="4">快手内广</a-radio-button>
+            <!-- <a-radio-button value="3">头条内广</a-radio-button>
+            <a-radio-button value="4">快手内广</a-radio-button> -->
           </a-radio-group>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">

+ 1 - 1
src/views/modules/advertiser/productList.vue

@@ -70,7 +70,7 @@
     <project-modal ref="modalForm" @ok="modalFormOk"></project-modal>
     <a-modal title="项目展示" :width="800" :visible="visible" :footer="null" @cancel="handleCancel" destroyOnClose
       cancelText="关闭">
-      <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin-bottom:20px">新增</a-button>
+      <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin:20px 0">新增</a-button>
       <a-list bordered :data-source="dataList">
         <a-list-item slot="renderItem" slot-scope="item, index">
           {{ item.projectName }}

+ 5 - 2
src/views/modules/material/videoMaterial.vue

@@ -1082,7 +1082,7 @@
                     }}
                   </a-select-option>
                 </a-select>
-                <a-button type="primary" @click="getWater">生成</a-button>
+                <a-button type="primary" @click="getWater" :loading="waterLoading">生成</a-button>
               </a-form-item>
             </div>
             <div>
@@ -1482,7 +1482,8 @@
         kuaishouData: null,
         douyinData: null,
         bohui: "",
-        bohuiShow: false
+        bohuiShow: false,
+        waterLoading:false
       }
     },
     filters: {
@@ -1827,6 +1828,7 @@
         })
       },
       getWater() {
+        this.waterLoading = true
         var params = qs.stringify({
           id: this.id,
           watermarkTemplateId: this.size
@@ -1842,6 +1844,7 @@
             this.refuseReason = ''
             closeAllVideoFun()
             this.loadData()
+            this.waterLoading = false
           }
         })
       },

+ 5 - 4
vue.config.js

@@ -34,7 +34,6 @@ module.exports = {
       .set('@layout', resolve('src/layout'))
       .set('@static', resolve('src/static'))
   },
-
   css: {
     loaderOptions: {
       less: {
@@ -53,15 +52,17 @@ module.exports = {
   },
 
   devServer: {
-    hot:true,
+    inline: true, // 实时刷新
+    hot: true,
     port: 3000,
+    open : true,
     proxy: {
       '/jeecg-boot': {
-        target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        // target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
-        // target: 'http://192.168.1.94:8088', //请求本地 需要jeecg-boot后台项目  孙震
+        target: 'http://192.168.1.94:8088', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.0.230:8088', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.1.51:8080', //请求本地 需要jeecg-boot后台项目  毕洁泉