shish před 2 roky
rodič
revize
4bbe81a047

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

@@ -46,12 +46,14 @@ import purchaseOrderItem from '@/service/purchase-order-item/index';
 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';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
 	// const ignore = ['./request.js'];
 
 	let modules = {
+		ghsDebtRecord,
 		checkOrder,
 		statCg,
 		statItem,

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

@@ -153,7 +153,7 @@ let menu = {
 		{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: '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},
+		{id: '230',parentId: 2,name: '历明细',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/pastAccountChange',viewPath: 'views/custom/pastAccountChange.vue',keepAlive: 1},
 
 		{id: '3',parentId: null,name: '订单',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
         {id: '301',parentId: 3,name: '订单列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
@@ -167,7 +167,9 @@ 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: '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},
 
 		{id: '4',parentId: null,name: '花材',type: 0,icon: 'iconshangpinguanli',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
 		{id: '405',	parentId: '4',name: '花材列表',type: 1,icon: 'icon-user',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},

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

@@ -0,0 +1,13 @@
+import { BaseService, Service } from '@/cool';
+@Service('ghs-debt-record')
+export class GhsDebtRecordService extends BaseService {
+
+	getList(data) {
+		return this.request({
+			url: '/list',
+			params: data
+		});
+	}
+
+}
+export default new GhsDebtRecordService();

+ 189 - 0
ghs/src/views/in/ghs-debt-record.vue

@@ -0,0 +1,189 @@
+<template>
+	<div class="app-list-content">
+		<x-crud class="liu-crud-wrap" @load="onLoad">
+
+			<template #slot-tabs>
+				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex">
+					<el-tab-pane v-for="(item, index) in tabsData" :key="index" :label="`${item.text}`" :name="item.key" ></el-tab-pane>
+				</el-tabs>
+			</template>
+
+			<template #table-column-amount="{scope}">
+				<span> {{ scope.row.io == 1 ? '+' : '-' }} {{ scope.row.amount }} </span>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters, mapActions } from 'vuex';
+export default {
+	components: {
+	},
+	data() {
+		return {
+			app: null,
+			tabIndex: '0',
+			tabsData: [
+				{
+					text: '列表',
+					key: '0',
+					val: 0
+				},
+			],
+			ghsInfoList: [],
+			loading: false,
+			currentGhsName:'',
+			ghsId:0
+		};
+	},
+	methods: {
+		onLoad({ ctx, app }) {
+			this.app = app;
+
+			if (this.$route.query.ghsId) {
+				this.ghsId = this.$route.query.ghsId;
+				this.currentGhsName = this.$route.query.ghsName ? this.$route.query.ghsName : ''
+			}
+
+			ctx.service(this.$service.ghsDebtRecord)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center',
+							width: 100
+						},
+						{
+							prop: 'addTime',
+							label: '日期',
+							align: 'center',
+							width: 180
+						},
+						{
+							prop: 'ghsId',
+							label: '供货商ID',
+							align: 'center',
+							width: 150
+						},
+						{
+							prop: 'event',
+							label: '事项',
+							align: 'center',
+							width: 260
+						},
+						{
+							prop: 'staffName',
+							label: '人员',
+							align: 'center',
+							width: 100
+						},
+						{
+							prop: 'amount',
+							label: '变动',
+							align: 'center',
+							width: 120
+						},
+						{
+							prop: 'balance',
+							label: '余额',
+							align: 'center',
+							width: 120
+						},
+						{
+							prop: 'remark',
+							label: '备注',
+							align: 'center',
+							width: 280
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 220,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: ['slot-column-option']
+					}
+				})
+				.set('dict', {
+					search: {
+						keyWord: 'name'
+					}
+				})
+				.set('search', {
+					key: { placeholder: '...' }
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['data-table'],
+					['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 = []
+			}
+		},
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.user-name-warp {
+	display: flex;
+	align-items: center;
+	span {
+		margin-left: 6px;
+	}
+}
+.recharge-modal-content {
+	@include disFlex(center, space-around);
+	.card-name {
+		width: 200px;
+		height: 100%;
+		border-right: 1px solid $borderColor;
+	}
+}
+
+.store-icon {
+	i {
+		font-size: 18px;
+	}
+
+	.el-icon-check {
+		color: #fee470;
+	}
+
+	.el-icon-close {
+		color: #999;
+	}
+}
+.accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
+</style>

+ 8 - 7
ghs/src/views/in/ghs.vue

@@ -29,14 +29,9 @@
 				<span v-else>-</span>
 			</template>
 
-			<template #table-header-debtAmount>
-				<div class="set-sort">
-				<span style="color:blue;">欠款</span>
-				</div>
-			</template>
 			<template #table-column-debtAmount="{scope}">
-				<span v-if="scope.row.debtAmount > 0" style="color:blue;">{{ scope.row.debtAmount?parseFloat(scope.row.debtAmount):0 }}</span>
-				<span v-else>0</span>
+				<span v-if="scope.row.debtAmount > 0" style="color:blue;cursor: pointer;" @click="goDebtChange(scope.row)">{{ scope.row.debtAmount?parseFloat(scope.row.debtAmount):0 }}</span>
+				<span v-else style="cursor: pointer;" @click="goDebtChange(scope.row)">0</span>
 			</template>
 
 			<template #table-column-balance="{scope}">
@@ -179,6 +174,12 @@ export default {
 	},
 	methods: {
 		...mapActions(['getLevel']),
+		goDebtChange(data){
+			let query = {};
+			query.ghsId = data.id
+			query.ghsName = data.name
+			this.$router.push({ path: '/in/ghs-debt-record', query });
+		},
 		goClear(){
 			this.$message({message: '开发中',type: 'warning'})
 		},

+ 130 - 0
ghs/src/views/in/pastDue.vue

@@ -0,0 +1,130 @@
+<template>
+	<div class="shop-list">
+		<x-crud @load="onLoad">
+
+			<template #slot-date-select>
+				<el-date-picker v-model="endTime" type="date" placeholder="选择日期" @change="getSearchDate" value-format="yyyy-MM-dd"> </el-date-picker>
+			</template>
+
+            <template #slot-total-amount>
+				<span style="font-size:15px;font-weight:bold;">累计金额:{{ totalAmount }}</span>
+			</template>
+
+			<template #slot-export-due>
+				<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,
+            currentDateList:'',
+            startTime:'',
+            endTime:'',
+            searchTime:'',
+            totalAmount:0,
+            debt:'-1'
+		};
+	},
+	computed: {
+		...mapGetters(['shopInfo']),
+	},
+	methods: {
+		goChange(data){
+			let query = {};
+			query.customId = data.id
+			query.endTime = this.endTime
+			this.$router.push({ path: '/custom/pastAccountChange', query });
+		},
+		exportDue(){
+			this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
+				if(res.file){
+					window.location.href = res.file
+				}
+			})
+		},
+		onLoad({ ctx, app }) {
+                this.app = app;
+                ctx.service({
+                    page: () => {
+                        return this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
+                            this.totalAmount = res.totalAmount ? res.totalAmount : 0
+                            return {
+                                list: res.list
+                            };
+                        });
+                    }
+                })
+				.set('table', {
+					columns: [
+						{
+							label: 'ID',
+							prop: 'id',
+							align: 'center',
+						},
+						{
+							label: '名称',
+							prop: 'name',
+							align: 'center',
+						},
+						{
+							label: '手机号',
+							prop: 'mobile',
+							align: 'center',
+						},
+						{
+							label: '欠款金额',
+							prop: 'currentDebAmount',
+							align: 'center',
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 250,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: ['slot-column-option']
+					}
+				})
+				.set('layout', [
+					[   'slot-date-select',
+						'flex1',
+                        'slot-export-due',
+						'refresh-btn',
+					],
+					[ 'data-table' ],
+                    ['slot-total-amount','flex1']
+				])
+				.done();
+			    app.refresh();
+		},
+        getSearchDate(){
+            this.searchTime = 'custom'
+            this.startTime = this.endTime
+            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>

+ 8 - 7
ghs/src/views/member/list.vue

@@ -32,16 +32,11 @@
 				<span style="cursor: pointer;" @click="goBalanceChange(scope.row)">{{ scope.row.balance }}</span>
 			</template>
 
-			<template #table-header-actDebt>
-				<div class="set-sort">
-				<span style="color:blue;">待结欠款</span>
-				</div>
-			</template>
 			<template #table-column-actDebt="{scope}">
-				<span v-if="Number(scope.row.debtAmount) > Number(scope.row.balance)" style="color:blue;font-weight:bold;">
+				<span v-if="Number(scope.row.debtAmount) > Number(scope.row.balance)" style="color:blue;font-weight:bold;cursor: pointer;" @click="goChange(scope.row)">
 					{{ parseFloat((Number(scope.row.debtAmount)-Number(scope.row.balance)).toFixed(2)) }}
 				</span>
-				<span v-else>-</span>
+				<span v-else style="font-weight:bold;cursor: pointer;" @click="goChange(scope.row)">-</span>
 			</template>
 
 			<template #table-column-debt="{scope}">
@@ -244,6 +239,12 @@ export default {
 	},
 	methods: {
 		...mapActions(['getLevel']),
+		goChange(data){
+			let query = {};
+			query.customId = data.id
+			query.endTime = ''
+			this.$router.push({ path: '/custom/pastAccountChange', query });
+		},
 		exportCustom(){
 			this.$service.custom.shopListAll({ type: this.tabIndex,export:1}).then(res => {
 				if(res.file){

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

@@ -39,7 +39,7 @@ export default {
                         {name: "批量改价",img: `${this.$constant.imgUrl}/ghs/home/gj.png`,url:"/admin/changePrice/batchChange"},
                         {name: "批量移动",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/changeClass"},
                         {name: "加价管理",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
-                        {name: "批量排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
+                        {name: "花材排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "已下架",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/outList"},
                         {name: "已删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/stopList"}
                     ]

+ 1 - 1
ghsApp/src/pages.json

@@ -443,7 +443,7 @@
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "花材分类"}},
 				{"path": "add","style": {"navigationBarTitleText": "加价管理"}},
-				{"path": "sort","style": {"navigationBarTitleText": "批量排序"}},
+				{"path": "sort","style": {"navigationBarTitleText": "花材排序"}},
 				{"path": "addPrice","style": {"navigationBarTitleText": "修改加价"}},
 				{"path": "more","style": {"navigationBarTitleText": "修改排序"}}
 			]