Browse Source

销售数据国际化适配,客户/业务员销售TOP10版块明细业务员筛选调整

qymljy 3 months ago
parent
commit
e5a69b12e1

+ 9 - 3
src/views/salesData/components/allSalesTemplate.vue

@@ -214,8 +214,14 @@ export default {
       const userName = JSON.parse(sessionStorage.getItem('active_account')).name
       const userid = JSON.parse(sessionStorage.getItem('active_account')).userid
       if (this.param.content.type == 0){
-        this.person = usertype!==0?this.param.content.dataid:userid === this.param.content.dataid?userName:this.param.content.dataid
-        this.depment = ''
+        if (this.param.content.dataid == -1){
+          this.person = ''
+          this.depment = ''
+        }else {
+          this.person = usertype!==0?this.param.content.dataid:userid === this.param.content.dataid?userName:this.param.content.dataid
+          this.depment = ''
+        }
+
       }else {
         this.depment = this.param.content.dataid
         this.person = ''
@@ -238,7 +244,7 @@ export default {
       const res = await this.$api.requested(this.depmentParam)
       this.deplist = this.createMenu(res.data.dep)
       // this.personnelList = res.data.hr
-      this.personnelList = this.personDatas?this.personDatas:res.data.hr
+      this.personnelList = this.personDatas && this.personDatas.length > 0?this.personDatas:res.data.hr
       this.listData()
       /*if (this.dataid){
         this.depment = this.dataid

+ 2 - 2
src/views/salesData/index.vue

@@ -39,10 +39,10 @@
           <div class="div-box-new-margin" >
             <div class="div-border-box">
               <el-tabs v-model="activeName" @tab-click="handleClick">
-                <el-tab-pane label="客户销售TOP10" name="客户销售">
+                <el-tab-pane :label="$t(`客户销售TOP10`)" name="客户销售">
                   <customerSales :dataid="departmentid" ref="customer"></customerSales>
                 </el-tab-pane>
-                <el-tab-pane label="业务员销售TOP10" name="业务员销售">
+                <el-tab-pane :label="$t(`业务员销售TOP10`)" name="业务员销售">
                   <salespersonSales :dataid="departmentid" ref="salesperson"></salespersonSales>
                 </el-tab-pane>
               </el-tabs>

+ 5 - 4
src/views/salesData/modules/customerAccountBalanceAnalysis.vue

@@ -41,7 +41,7 @@
                 <el-option
                     v-for="item in accountList"
                     :key="item.rowindex"
-                    :label="item.accountname"
+                    :label="$t(item.accountname)"
                     :value="item.accountno">
                 </el-option>
               </el-select>
@@ -192,10 +192,11 @@ export default {
       console.log(nowYear,'nowYear')
       let balance = lastYear.concat(nowYear)
       this.balance = balance.map((item)=>{
-        let value = item.value/10000
+        // let value = item.value/10000
+        let value = this.tool.unitConversion(item.value,10000)
         return {
           "date":item.date,
-          "name":item.name + '(万元)',
+          "name":this.$t(item.name + '(万元)'),
           "value":value
           /*"value":item.value*/
         }
@@ -203,7 +204,7 @@ export default {
       this.tbzzl = res.data.tbzzl.map((item)=>{
         return {
           "date":item.date,
-          "name":item.name,
+          "name":this.$t(item.name),
           "value":Math.round(((item.value *100)*100)/100)
         }
       })

+ 3 - 3
src/views/salesData/modules/delayedShipmentAnalysis.vue

@@ -42,7 +42,7 @@
       <div class="chart">
         <div id="delayedShipmentAnalysisChart" :style="{height: heightChart}"></div>
       </div>
-      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{param.content.dateType?param.content.dateType:'全部'}}</div>
+      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{$t(param.content.dateType?param.content.dateType:'全部')}}</div>
       <div :style="{height: heightTable}">
         <tableTemplate  ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="height">
           <template v-slot:customcol="scope">
@@ -185,8 +185,8 @@ export default {
         return {
           "sequence": item.sequence,
           "value": item.value,
-          "key": item.key,
-          "type":'订单行数'
+          "key": this.$t(item.key),
+          "type":this.$t('订单行数')
         }
       })
       this.chartBar.changeData(this.chartData)

+ 4 - 4
src/views/salesData/modules/digitalSigns.vue

@@ -11,10 +11,10 @@
       </el-button-group>
     </div>
     <div class="container-div">
-      <boxLine :title="$t(`订单`)" ref="order"   :typeDate="dataType"  :style="{width:windowWidth > 1880? '49%':'100%',marginRight: windowWidth > 1880?'1%':'0',marginBottom:windowWidth > 1880?'16px':'16px'}"></boxLine>
-      <boxLine :title="$t(`出货`)" ref="shipment"  :typeDate="dataType" :style="{width:windowWidth > 1880? '50%':'100%',marginBottom:windowWidth > 1880?'16px':'16px'}"></boxLine>
-      <boxLine :title="$t(`开票`)" ref="invoicing"  :typeDate="dataType" :style="{width:windowWidth > 1880? '49%':'100%',marginRight: windowWidth > 1880?'1%':'0',marginBottom:windowWidth > 1880?'0':'16px'}"></boxLine>
-      <boxLine :title="$t(`回款`)" ref="returned"  :typeDate="dataType" :style="{width:windowWidth > 1880? '50%':'100%'}"></boxLine>
+      <boxLine title="订单" ref="order"   :typeDate="dataType"  :style="{width:windowWidth > 1880? '49%':'100%',marginRight: windowWidth > 1880?'1%':'0',marginBottom:windowWidth > 1880?'16px':'16px'}"></boxLine>
+      <boxLine title="出货" ref="shipment"  :typeDate="dataType" :style="{width:windowWidth > 1880? '50%':'100%',marginBottom:windowWidth > 1880?'16px':'16px'}"></boxLine>
+      <boxLine title="开票" ref="invoicing"  :typeDate="dataType" :style="{width:windowWidth > 1880? '49%':'100%',marginRight: windowWidth > 1880?'1%':'0',marginBottom:windowWidth > 1880?'0':'16px'}"></boxLine>
+      <boxLine title="回款" ref="returned"  :typeDate="dataType" :style="{width:windowWidth > 1880? '50%':'100%'}"></boxLine>
     </div>
   </div>
 </template>

+ 3 - 3
src/views/salesData/modules/financialCollectionAnalysis.vue

@@ -160,10 +160,10 @@ export default {
       this.param.content.where.isleave = isleave
       const res = await this.$api.requested(this.param)
       this.chartData = res.data.map(item=>{
-        let value = item.value/10000
+        let value = this.tool.unitConversion(item.value,10000)
         return {
-          key: item.key + '(万元)',
-          type: item.type,
+          key: this.$t(item.key) + '(' + this.$t('万元') + ')',
+          type: this.$t(item.type),
           value: value
         }
       })

+ 6 - 6
src/views/salesData/modules/invoiceAmountAnalysis.vue

@@ -95,19 +95,19 @@ export default {
       this.param.content.year = new Date(this.yearNow).getFullYear()
       const res = await this.$api.requested(this.param)
       let amount = res.data.map(item=>{
-        let value = item.amount/10000
+        let value = this.tool.unitConversion(item.amount,10000)
         return {
           "value":value,
           "date":item.date,
-          "type":'本期金额(万元)'
+          "type":this.$t('本期金额(万元)')
         }
       })
       let oldamount = res.data.map(item=>{
-        let value = item.oldamount/10000
+        let value = this.tool.unitConversion(item.oldamount,10000)
         return {
           "date":item.date,
           "value":value,
-          "type":'去年同期金额(万元)'
+          "type":this.$t('去年同期金额(万元)')
         }
       })
       this.list = oldamount.concat(amount)
@@ -127,7 +127,7 @@ export default {
         yField: ['value','tbzzl'],
         meta:{
           tbzzl:{
-            alias:'同比增长率'
+            alias:this.$t('同比增长率')
           }
         },
         geometryOptions: [
@@ -161,7 +161,7 @@ export default {
           fields: ['type','tbzzl', 'value'],
           formatter: (datum) => {
             return {
-              name:datum.type === undefined?'同比增长率':datum.type,
+              name:datum.type === undefined?this.$t('同比增长率'):datum.type,
               value:datum.value === undefined?datum.tbzzl + '%':'¥' + this.tool.formatAmount(datum.value,2)
             }
           }

+ 5 - 5
src/views/salesData/modules/orderProductCategory.vue

@@ -39,8 +39,8 @@
           <div class="mt-10 inline-16">
             <p class="search__label">{{$t(`营销类别`)}}:</p>
             <el-select v-model="param.content.itemclass" clearable style="margin-right:10px" size="small" :placeholder="$t(`请选择营销类别`)" @change="queryModel(param.content.dataid,param.content.where.itemclass)" >
-              <el-option label="一级类别" value="一级类别"></el-option>
-              <el-option label="二级类别" value="二级类别"></el-option>
+              <el-option :label="$t(`一级类别`)" value="一级类别"></el-option>
+              <el-option :label="$t(`二级类别`)" value="二级类别"></el-option>
             </el-select>
           </div>
 
@@ -268,14 +268,14 @@ export default {
         sessionStorage.setItem('total',res.total)
       }
       if (this.type === '金额'){
-        this.totalamount = '¥'+this.tool.formatAmount(res.data[0].ratio[0].total/10000,2)+'万'
+        this.totalamount = '¥'+this.tool.formatAmount(this.tool.unitConversion(res.data[0].ratio[0].total,10000),2)+this.$t('万')
       }else {
         this.totalamount = res.data[0].ratio[0].total
       }
       this.chartData = res.data[0].ratio.map(item=>{
         return {
           "totalamount": this.totalamount,//值
-          "type": item.itemclassfullname,
+          "type": this.$t(item.itemclassfullname),
           "itemclassid":item.itemclassid,
           "rowindex": item.rowindex,
           "ratio": Math.round(((item.ratio * 100)*100)/100), //比例
@@ -334,7 +334,7 @@ export default {
             style: {
               fontSize:'16px'
             },
-            content: '总计'
+            content: this.$t('总计')
           },
           content: {
             offsetY: 4,

+ 6 - 5
src/views/salesData/modules/orderTrendAnalysis.vue

@@ -99,21 +99,22 @@ export default {
         return {
           "date":item.date,
           "value":value,
-          "type":'去年同期金额(万元)'
+          "type":this.$t('去年同期金额(万元)')
         }
       })
       let list3 = res.data.map(item=>{
-        let value = item.amount/10000
+        // let value = item.amount/10000
+        let value = this.tool.unitConversion(item.amount,10000)
         return {
           "value":value,
           "date":item.date,
-          "type":'本期金额(万元)',
+          "type":this.$t('本期金额(万元)'),
         }
       })
       this.list1 = res.data.map(item=>{
         return {
           "date":item.date,
-          "type":'同比增长率',
+          "type":this.$t('同比增长率'),
           "value":Math.round(((item.tbzzl * 100)*100)/100)
         }
       })
@@ -171,7 +172,7 @@ export default {
           formatter: (datum) => {
             return {
               name:datum.type ,
-              value:datum.type != '同比增长率'?'¥'+this.tool.formatAmount(datum.value,2):datum.value + '%'
+              value:datum.type != this.$t('同比增长率')?'¥'+this.tool.formatAmount(datum.value,2):datum.value + '%'
             }
           }
         }

+ 3 - 3
src/views/salesData/modules/orderType.vue

@@ -230,14 +230,14 @@ export default {
         sessionStorage.setItem('total',res.total)
       }
       if (this.type === '金额'){
-        this.totalamount = '¥'+this.tool.formatAmount(res.data[0].ratio[0].total/10000,2)+'万'
+        this.totalamount = '¥'+this.tool.formatAmount(this.tool.unitConversion(res.data[0].ratio[0].total,10000),2)+this.$t('万')
       }else {
         this.totalamount = res.data[0].ratio[0].total
       }
       this.chartData = res.data[0].ratio.map(item=>{
         return {
           "totalamount": this.totalamount,//值
-          "type": item.type,
+          "type": this.$t(item.type),
           "rowindex": item.rowindex,
           "ratio": Math.round(((item.ratio * 100)*100)/100), //比例
           "value":item.value
@@ -295,7 +295,7 @@ export default {
             style: {
               fontSize:'16px'
             },
-            content: '总计'
+            content: this.$t('总计')
           },
           content: {
             offsetY: 4,

+ 3 - 3
src/views/salesData/modules/orderUnshippedGoods.vue

@@ -42,7 +42,7 @@
       <div class="chart">
         <div id="orderUnshippedGoodsChart" :style="{height: heightChart}"></div>
       </div>
-      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{param.content.dateType?param.content.dateType:'全部'}}</div>
+      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{$t(param.content.dateType?param.content.dateType:'全部')}}</div>
       <div :style="{height: heightTable}">
         <tableTemplate  ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="height">
           <template v-slot:customcol="scope">
@@ -184,8 +184,8 @@ export default {
         return {
           "sequence": item.sequence,
           "value": item.value,
-          "key": item.key,
-          "type":'订单行数'
+          "key": this.$t(item.key),
+          "type":this.$t('订单行数')
         }
       })
       this.chartBar.changeData(this.chartData)

+ 1 - 1
src/views/salesData/modules/quotationAnalysis.vue

@@ -170,7 +170,7 @@ export default {
       const result = [];
       data.forEach((d) => {
         yFields.forEach((yField) => {
-          const name = meta?.[yField]?.alias || yField;
+          const name = this.$t(meta?.[yField]?.alias || yField) ;
           result.push({ ...d, date: d.date, [seriesKey]: name, [valueKey]: d[yField] });
         });
       });

+ 7 - 7
src/views/salesData/modules/shippingTrendAnalysis.vue

@@ -102,19 +102,19 @@ export default {
       this.param.content.year = new Date(this.yearNow).getFullYear()
       const res = await this.$api.requested(this.param)
       const amount = res.data.map(item=>{
-        let value = item.amount/10000
+        let value = this.tool.unitConversion(item.amount,10000)
         return {
           "value":value,
           "date":item.date,
-          "type":'本期金额(万元)'
+          "type":this.$t('本期金额(万元)')
         }
       })
       const oldamount = res.data.map(item=>{
-        let value = item.oldamount/10000
+        let value = this.tool.unitConversion(item.oldamount,10000)
         return {
           "value":value,
           "date":item.date,
-          "type":'去年同期金额(万元)'
+          "type":this.$t('去年同期金额(万元)')
         }
       })
       this.list = oldamount.concat(amount)
@@ -122,14 +122,14 @@ export default {
         return {
           "value":Math.round(((item.tbzzl * 100)*100)/100),
           "date":item.date,
-          "type":'同比增长率'
+          "type":this.$t('同比增长率')
         }
       })
       const zjl = res.data.map(item=>{
         return {
           "value":Math.round(((item.zjl * 100)*100)/100),
           "date":item.date,
-          "type":'准交率'
+          "type":this.$t('准交率')
         }
       })
       this.list1 = tbzzl.concat(zjl)
@@ -183,7 +183,7 @@ export default {
           formatter: (datum) => {
             return {
               name:datum.type,
-              value:datum.type == '去年同期金额(万元)' || datum.type == '本期金额(万元)'  ?'¥' + this.tool.formatAmount(datum.value,2):datum.value + '%'
+              value:datum.type == this.$t('去年同期金额(万元)') || datum.type == this.$t('本期金额(万元)')  ?'¥' + this.tool.formatAmount(datum.value,2):datum.value + '%'
             }
           }
         }

+ 3 - 3
src/views/salesData/modules/shippingUninvoiceAnalysis.vue

@@ -171,11 +171,11 @@ export default {
       }
       this.chartData = res.data[0].Trend
       this.chartData = this.chartData.map(item=>{
-        let value = item.value/10000
+        let value = this.tool.unitConversion(item.value,10000)
         return {
           "value": value,
-          "key": item.key + '(万元)',
-          "type":"出货未开票金额(万元)"
+          "key": this.$t(item.key) + '(' + this.$t('万元') + ')',
+          "type":this.$t("出货未开票金额(万元)")
         }
       })
       this.chartBar.changeData(this.chartData)

+ 5 - 5
src/views/salesData/modules/uninvoiceAmountAnalysis.vue

@@ -100,7 +100,7 @@ export default {
       const result = [];
       data.forEach((d) => {
         yFields.forEach((yField) => {
-          const name = meta?.[yField]?.alias || yField;
+          const name = this.$t(meta?.[yField]?.alias || yField);
           result.push({ ...d, date: d.date, [seriesKey]: name, [valueKey]: d[yField] });
         });
       });
@@ -118,10 +118,10 @@ export default {
       this.param.content.where.isleave = isleave
       const res = await this.$api.requested(this.param)
       this.list = res.data.map(item=>{
-        let zerotothree = item.zerotothree/10000
-        let threetosix = item.threetosix/10000
-        let sixtotwelve = item.sixtotwelve/10000
-        let twelveup = item.twelveup/10000
+        let zerotothree = this.tool.unitConversion(item.zerotothree,10000)
+        let threetosix = this.tool.unitConversion(item.threetosix,10000)
+        let sixtotwelve = this.tool.unitConversion(item.sixtotwelve,10000)
+        let twelveup = this.tool.unitConversion(item.twelveup,10000)
         return {
           "zerotothree":zerotothree,
           "threetosix":threetosix,

+ 3 - 3
src/views/salesData/modules/unshippedExtensionAnalysis.vue

@@ -42,7 +42,7 @@
       <div class="chart">
         <div id="unshippedExtensionAnalysisChart" :style="{height: heightChart}"></div>
       </div>
-      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{param.content.dateType?param.content.dateType:'全部'}}</div>
+      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{$t(param.content.dateType?param.content.dateType:'全部')}}</div>
       <div :style="{height: heightTable}">
         <tableTemplate  ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="height">
           <template v-slot:customcol="scope">
@@ -181,8 +181,8 @@ export default {
         return {
           "sequence": item.sequence,
           "value": item.value,
-          "key": item.key,
-          "type":'订单行数'
+          "key": this.$t(item.key),
+          "type":this.$t('订单行数')
         }
       })
       this.chartBar.changeData(this.chartData)