shish 2 лет назад
Родитель
Сommit
5e59051bdd

+ 2 - 0
ghs/src/cool/request/index.js

@@ -47,12 +47,14 @@ import customBalanceChange from '@/service/custom-balance-change/index';
 import customDebtChange from '@/service/custom-debt-change/index';
 import checkOrder from '@/service/check-order/index';
 import ghsDebtRecord from '@/service/ghs-debt-record/index';
+import statCgGhs from '@/service/stat-cg-ghs/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		statCgGhs,
 		ghsDebtRecord,
 		checkOrder,
 		statCg,

+ 3 - 2
ghs/src/mock/userInfo.js

@@ -151,7 +151,7 @@ let menu = {
         {id: '201',parentId: 2,name: '客户列表',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/list',viewPath: 'views/member/list.vue',keepAlive: 1},
 		{id: '221',parentId: 2,name: '余额变动',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/custom-balance-list',viewPath: 'views/member/custom-balance-list.vue',keepAlive: 1},
 		{id: '228',parentId: 2,name: '客户业绩',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/yj',viewPath: 'views/custom/yj.vue',keepAlive: 1},
-		{id: '226',parentId: 2,name: '当前应收',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/account',viewPath: 'views/custom/account.vue',keepAlive: 1},
+		{id: '226',parentId: 2,name: '实时应收',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/account',viewPath: 'views/custom/account.vue',keepAlive: 1},
 		{id: '230',parentId: 2,name: '历史应收',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/pastAccount',viewPath: 'views/custom/pastAccount.vue',keepAlive: 1},
 		{id: '230',parentId: 2,name: '历收明细',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/pastAccountChange',viewPath: 'views/custom/pastAccountChange.vue',keepAlive: 1},
 
@@ -167,7 +167,8 @@ let menu = {
 		
 		{id: '15',parentId: null,name: '供货商',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs',viewPath: 'views/in/ghs.vue',keepAlive: 1},
 		{id: '1505',parentId: 15,name: '商家列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs',viewPath: 'views/in/ghs.vue',keepAlive: 1},
-		{id: '1515',parentId: 15,name: '当前应付',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/due',viewPath: 'views/in/due.vue',keepAlive: 1},
+		{id: '1509',parentId: 15,name: '供货业绩',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/yj',viewPath: 'views/in/yj.vue',keepAlive: 1},
+		{id: '1515',parentId: 15,name: '实时应付',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/due',viewPath: 'views/in/due.vue',keepAlive: 1},
 		{id: '1522',parentId: 15,name: '历史应付',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/pastDue',viewPath: 'views/in/pastDue',keepAlive: 1},
 		{id: '1530',parentId: 15,name: '历付明细',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs-debt-record',viewPath: 'views/in/ghs-debt-record.vue',keepAlive: 1},
 

+ 7 - 0
ghs/src/service/ghs-debt-record/index.js

@@ -9,5 +9,12 @@ export class GhsDebtRecordService extends BaseService {
 		});
 	}
 
+	getPastList(data) {
+		return this.request({
+			url: '/past-list',
+			params: data
+		});
+	}
+
 }
 export default new GhsDebtRecordService();

+ 13 - 0
ghs/src/service/stat-cg-ghs/index.js

@@ -0,0 +1,13 @@
+import { BaseService, Service } from '@/cool';
+@Service('stat-cg-ghs')
+export class StatCgGhsService extends BaseService {
+
+	getProfile(data) {
+		return this.request({
+			url: '/profile',
+			params: data
+		});
+	}
+
+}
+export default new StatCgGhsService();

+ 7 - 22
ghs/src/views/in/ghs-debt-record.vue

@@ -33,8 +33,8 @@ export default {
 			],
 			ghsInfoList: [],
 			loading: false,
-			currentGhsName:'',
-			ghsId:0
+			ghsId:0,
+            endTime:''
 		};
 	},
 	methods: {
@@ -43,9 +43,10 @@ export default {
 
 			if (this.$route.query.ghsId) {
 				this.ghsId = this.$route.query.ghsId;
-				this.currentGhsName = this.$route.query.ghsName ? this.$route.query.ghsName : ''
 			}
-
+			if (this.$route.query.endTime) {
+				this.endTime = this.$route.query.endTime
+			}
 			ctx.service(this.$service.ghsDebtRecord)
 				.set('table', {
 					columns: [
@@ -123,24 +124,8 @@ export default {
 					['flex1', 'pagination']
 				])
 				.done();
-				app.refresh({type:0,ghsId:this.ghsId })
-		},
-		getCurrentCp(e){
-			this.ghsId = e
-			this.app.refresh({ ghsId:this.ghsId,type:0 })
-		},
-		searchCpInfo(query) {
-			let that = this
-			if (query !== '') {
-				this.loading = true;
-				this.$service.ghs.list({name:query,type:0}).then(res=>{
-					that.loading = false
-					that.ghsInfoList = res.list	
-				})
-			} else {
-				this.ghsInfoList = []
-			}
-		},
+				app.refresh({type:0,ghsId:this.ghsId,endTime:this.endTime })
+		}
 	}
 };
 </script>

+ 13 - 7
ghs/src/views/in/list.vue

@@ -183,7 +183,6 @@ export default {
       optionData: {},
       orderData:'',
       addPop:false,
-      name:'',
       location:0,
       searchContent:'',
       startTime:'',
@@ -370,6 +369,18 @@ export default {
       if(this.$route.query.status){
         this.tabIndex = this.$route.query.status
       }
+      if(this.$route.query.ghsName){
+        this.searchContent = this.$route.query.ghsName
+      }
+      if(this.$route.query.searchTime){
+        this.searchTime = this.$route.query.searchTime
+      }
+      if(this.$route.query.startTime){
+        this.startTime = this.$route.query.startTime
+      }
+      if(this.$route.query.endTime){
+        this.endTime = this.$route.query.endTime
+      }
       ctx.service(this.$service.purchaseOrder)
           .set('table', {
             columns: [
@@ -500,14 +511,9 @@ export default {
           .on('refresh', async (params, { next }) => {
             let  asset  = await next(params);
             this.searchContent = params.name?params.name:''
-            // this.tabsData[0].val = asset.shop && asset.shop.totalOrder ? asset.shop.totalOrder : 0;
-            // this.tabsData[1].val = asset.shop && asset.shop.unPayOrder?asset.shop.unPayOrder:0;
-            // this.tabsData[2].val = asset.shop && asset.shop.unSendOrder?asset.shop.unSendOrder:0;
-            // this.tabsData[3].val = asset.shop && asset.shop.sendingOrder?asset.shop.sendingOrder:0;
-            // this.tabsData[4].val = asset.shop && asset.shop.finishOrder?asset.shop.finishOrder:0;
           })
           .done();
-          app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})
+          app.refresh({ status: this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.searchContent})
     }
   }
 };

+ 4 - 9
ghs/src/views/in/pastDue.vue

@@ -41,12 +41,12 @@ export default {
 	methods: {
 		goChange(data){
 			let query = {};
-			query.customId = data.id
+			query.ghsId = data.id
 			query.endTime = this.endTime
-			this.$router.push({ path: '/custom/pastAccountChange', query });
+			this.$router.push({ path: '/in/ghs-debt-record', query });
 		},
 		exportDue(){
-			this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
+			this.$service.ghsDebtRecord.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
@@ -56,7 +56,7 @@ export default {
                 this.app = app;
                 ctx.service({
                     page: () => {
-                        return this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
+                        return this.$service.ghsDebtRecord.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
                             this.totalAmount = res.totalAmount ? res.totalAmount : 0
                             return {
                                 list: res.list
@@ -76,11 +76,6 @@ export default {
 							prop: 'name',
 							align: 'center',
 						},
-						{
-							label: '手机号',
-							prop: 'mobile',
-							align: 'center',
-						},
 						{
 							label: '欠款金额',
 							prop: 'currentDebAmount',

+ 212 - 0
ghs/src/views/in/yj.vue

@@ -0,0 +1,212 @@
+<template>
+	<div class="shop-list">
+		<x-crud @load="onLoad">
+			<template #slot-date-select>
+                <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
+                end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
+			</template>
+
+			<template #slot-order-debt="{scope}">
+				<el-radio-group v-model="debt" @change="changeDebt" style="margin-right:20px;padding-top:6px;margin-left:20px;">
+				<el-radio label="0">全部</el-radio>
+				<el-radio label="1">待结款</el-radio>
+                <el-radio label="2">已结款</el-radio>
+				</el-radio-group>
+			</template>
+
+            <template #slot-total-amount>
+				<span style="font-size:15px;font-weight:bold;">订单数:{{ totalNum }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">订单金额:{{ totalOrderPrice }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">退款金额:{{ totalTkPrice }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">实际金额:{{ totalActPrice }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">含(纸箱:{{ totalCarton }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">打包费:{{ totalPack }}</span>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">运费:{{ totalFreight }})</span>
+			</template>
+
+			<template #slot-export-data>
+				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出数据</el-button>
+			</template>
+
+			<template #slot-column-option="{scope}">
+				<el-button size="small" type="primary" @click="goChange(scope.row)">查看明细</el-button>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+	data() {
+		return {
+			crud: null,
+            pickerOptions: {
+            shortcuts: [{
+                text: '最近一周',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近一个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近三个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+                }
+            }]
+            },
+            currentDateList:'',
+            startTime:'',
+            endTime:'',
+            searchTime:'',
+            totalActPrice:0,
+			totalOrderPrice:0,
+			totalCarton:0,
+			totalPack:0,
+			totalFreight:0,
+			totalTkPrice:0,
+			totalNum:0,
+            debt:'0'
+		};
+	},
+	computed: {
+		...mapGetters(['shopInfo']),
+	},
+	methods: {
+		goChange(data){
+			let query = {};
+			query.ghsName = data.name
+			query.startTime = this.startTime
+			query.endTime = this.endTime
+			query.searchTime = this.searchTime
+			query.status = 4
+			this.$router.push({ path: '/in/list', query });
+		},
+		exportDue(){
+			this.$service.statCgGhs.getProfile({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
+				if(res.file){
+					window.location.href = res.file
+				}
+			})
+		},
+		onLoad({ ctx, app }) {
+                this.app = app;
+                ctx.service({
+                    page: () => {
+                        return this.$service.statCgGhs.getProfile({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt}).then((res) => {
+                            this.totalActPrice = res.totalActPrice ? res.totalActPrice : 0
+							this.totalOrderPrice = res.totalOrderPrice ? res.totalOrderPrice : 0
+							this.totalCarton = res.totalCarton ? res.totalCarton : 0
+							this.totalPack = res.totalPack ? res.totalPack : 0
+							this.totalFreight = res.totalFreight ? res.totalFreight : 0
+							this.totalTkPrice = res.totalTkPrice ? res.totalTkPrice : 0
+							this.totalNum = res.totalNum?res.totalNum:0
+                            return {
+                                list: res.list
+                            };
+                        });
+                    }
+                })
+				.set('table', {
+					columns: [
+						{
+							label: 'ID',
+							prop: 'id',
+							align: 'center',
+						},
+						{
+							label: '供货商',
+							prop: 'name',
+							align: 'center',
+						},
+						{
+							label: '订单数',
+							prop: 'num',
+							align: 'center',
+						},
+						{
+							label: '订单金额',
+							prop: 'orderPrice',
+							align: 'center',
+						},
+						{
+							label: '退款金额',
+							prop: 'tkPrice',
+							align: 'center',
+						},
+						{
+							label: '实际金额',
+							prop: 'actPrice',
+							align: 'center',
+						},
+						{
+							label: '纸箱费',
+							prop: 'carton',
+							align: 'center',
+						},
+						{
+							label: '打包费',
+							prop: 'pack',
+							align: 'center',
+						},
+						{
+							label: '运费',
+							prop: 'freight',
+							align: 'center',
+						},						
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 250,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: ['slot-column-option']
+					}
+				})
+				.set('layout', [
+					[   'slot-date-select',
+                        'slot-order-debt',
+						'flex1',
+                        'slot-export-data'
+					],
+					[ 'data-table' ],
+                    ['slot-total-amount','flex1']
+				])
+				.done();
+			    app.refresh();
+		},
+        getSearchDate(){
+            this.searchTime = 'custom'
+            this.startTime = this.currentDateList[0]
+            this.endTime = this.currentDateList[1]
+            this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt});
+        },
+    	changeDebt(e){
+			this.debt = e
+			this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt})
+		},
+	},
+};
+</script>
+
+<style lang="stylus" scoped>
+.shop-list {
+  height: 100%;
+}
+</style>

+ 1 - 1
ghsApp/src/admin/home/apply.vue

@@ -52,7 +52,7 @@ export default {
                         {name: "花材销量",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/productSale"},
                         {name: "客户业绩",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/customSale"},
                         {name: "收支分类",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/classProfit"},
-                        {name: "供货业绩",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgStat"},
+                        {name: "供货业绩",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgStat"},
                         {name: "采购人业绩",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgYj"},
                         {name: "采购花材",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgItem"},
                         {name: "采购运费",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgFreight"},

+ 6 - 6
ghsApp/src/ext.json

@@ -1,12 +1,12 @@
 {
   "extEnable": true,
-  "extAppid": "wxcf32b3f0684c2433",
+  "extAppid": "wx21b7c3ef12082099",
   "directCommit": false,
   "ext": {
-    "account": 12358,
-    "apiHost": "https://api.shop.wixhb.com",
-    "socketApiHost": "api.shop.wixhb.com",
-    "imgHost": "https://img.wixhb.com",
-    "name":"销花宝"
+    "account": 12362,
+    "apiHost": "http://api.shop.hzghd.com",
+    "socketApiHost": "api.shop.hzghd.com",
+    "imgHost": "https://img.hzghd.com",
+    "name":"花掌柜"
   }
 }

+ 1 - 1
ghsApp/src/pages.json

@@ -276,7 +276,7 @@
 				{"path": "customSale","style": {"navigationBarTitleText": "客户下单排行"}},
 				{"path": "clear","style": {"navigationBarTitleText": "结账跟踪"}},
 				{"path": "incomeStat","style": {"navigationBarTitleText": "应收款"}},
-				{"path": "cgStat","style": {"navigationBarTitleText": "供货业绩"}},
+				{"path": "cgStat","style": {"navigationBarTitleText": "供货业绩"}},
 				{"path": "cgItem","style": {"navigationBarTitleText": "采购花材"}},
 				{"path": "cgYj","style": {"navigationBarTitleText": "采购人业绩"}},
 				{"path": "cgFreight","style": {"navigationBarTitleText": "采购运费统计"}},