Browse Source

2024-1-11

cmy 1 year ago
parent
commit
a22657c297
3 changed files with 173 additions and 62 deletions
  1. 8 0
      src/api/order.js
  2. 43 29
      src/pages/agent/kpi/index.vue
  3. 122 33
      src/pages/order/serveList/index.vue

+ 8 - 0
src/api/order.js

@@ -683,4 +683,12 @@ export function member_update(data) {
 	    url: `service/Subscribe/member_update`,
 	    method: 'post',
 	    data});
+}
+
+//服务项目退单
+export function active_refund_order(data) {
+	return request({
+	    url: `/service/active_refund_order`,
+	    method: 'post',
+	    data});
 }

+ 43 - 29
src/pages/agent/kpi/index.vue

@@ -6,13 +6,18 @@
 				<!-- 筛选条件 -->
 				<Form ref="pagination" inline :model="pagination" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
-					
+
 					<FormItem label="选择员工:">
-						<Select v-model="pagination.member_id" class="input-add">
-							<Option v-for="(item, index) in ygList" :value="item.id" :key="index">{{ item.name }}
+						<Select filterable clearable v-model="pagination.member_id" class="input-add">
+							<Option v-for="(item, index) in ygList" :value="item.id" :key="index">{{ item.name }}(ID:{{item.uid}})
 							</Option>
 						</Select>
 					</FormItem>
+					<FormItem label="时间范围:">
+						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
+							type="daterange" placement="bottom-start" placeholder="自定义时间" class="input-add"
+							:options="options"></DatePicker>
+					</FormItem>
 					<FormItem label="业绩类型:">
 						<Select v-model="pagination.type" class="input-add">
 							<Option v-for="(item, index) in num" :value="item.value" :key="index">{{ item.name }}
@@ -24,14 +29,11 @@
 						<Input v-model="pagination.order_id" placeholder="请输入订单号" class="input-add mr14" />
 						
 					</FormItem> -->
-					<!-- <FormItem label="退款时间:">
-						<DatePicker :editable="false" @on-change="onchangeTime" :value="pagination.time" format="yyyy/MM/dd"
-							type="daterange" placement="bottom-start" placeholder="自定义时间" class="input-add"
-							:options="options"></DatePicker>
-					</FormItem> -->
 				</Form>
 			</div>
 		</Card>
+
+		<cards-data :cardLists="cardLists"></cards-data>
 		<Card :bordered="false" dis-hover class="ivu-mt">
 			<!-- 售后订单表格 -->
 			<Table :columns="thead" :data="tbody" ref="table" :loading="loading" highlight-row no-userFrom-text="暂无数据"
@@ -67,7 +69,7 @@
 				</template>
 				<template slot-scope="{ row }" slot="type">
 					<span v-if="row.type == 1">销售业绩</span>
-					<span  v-if="row.type == 2">手工业绩</span>
+					<span v-if="row.type == 2">手工业绩</span>
 				</template>
 				<template slot-scope="{ row, index }" slot="add_time">
 					<span class="tabBox_pice">{{showTime(row.add_time)}}</span>
@@ -104,23 +106,29 @@
 	import {
 		getYgList
 	} from "@/api/store"
-	import { getKpi } from "@/api/agent"
+	import {
+		getKpi
+	} from "@/api/agent"
 	import timeOptions from "@/utils/timeOptions";
+	import cardsData from "@/components/cards/cards";
 	export default {
+		components: {
+			cardsData
+		},
 		data() {
 			return {
+				cardLists: [],
 				modals: false,
 				order_id: '',
 				ygList: [],
 				chooseId: 0,
 				openErp: false,
-				thead: [
-					{
+				thead: [{
 						title: "id",
 						align: "id",
 						key: "id",
 						minWidth: 50,
-					},{
+					}, {
 						title: "服务订单号",
 						align: "order_id",
 						key: "order_id",
@@ -142,7 +150,7 @@
 						key: "performance",
 						minWidth: 70,
 					},
-					
+
 					{
 						title: "业绩值分类",
 						slot: "type",
@@ -166,16 +174,16 @@
 				],
 				tbody: [],
 				num: [{
-					name: '全部',
-					value: 0
-				},{
+						name: '全部',
+						value: 0
+					}, {
 						name: '销售业绩',
 						value: 1
 					},
 					{
 						name: '手工业绩',
 						value: 2
-					}, 
+					},
 				],
 				orderDatalist: null,
 				loading: false,
@@ -189,7 +197,7 @@
 					page: 1,
 					limit: 15,
 					order_id: "",
-					time: "",
+					create_time: "",
 					status: 0
 				},
 				options: timeOptions,
@@ -216,11 +224,11 @@
 			this.getOrderList();
 		},
 		methods: {
-			showName( id) {
+			showName(id) {
 				let yg = this.ygList.find(item => {
 					return item.id == id
 				})
-				return yg? yg.name: ''
+				return yg ? yg.name : ''
 			},
 			getYgList() {
 				getYgList({
@@ -250,21 +258,15 @@
 			},
 			// 具体日期搜索();
 			onchangeTime(e) {
-				console.log(e,'eeeeeee')
+				console.log(e, 'eeeeeee')
 				this.pagination.page = 1;
 				this.timeVal = e;
-				this.pagination.time = this.timeVal[0] ? this.timeVal.join("-") : "";
+				this.pagination.create_time = this.timeVal[0] ? this.timeVal.join("-") : "";
 			},
 			cancal() {
 				this.modals = false
 				this.remark = ''
 			},
-			getygList() {
-				getYgList().then(res => {
-					console.log(res)
-					this.ygList = res.data.list
-				})
-			},
 			//goCancal
 			goCancal() {
 				if (this.chooseId == '') {
@@ -295,6 +297,18 @@
 						} = res.data;
 						this.total = count;
 						this.tbody = list;
+						this.cardLists = [{
+							col: 6,
+							count: res.data.sale_sum,
+							name: "销售总业绩",
+							className: "md-basket",
+						},
+						{
+							col: 6,
+							count: res.data.craft_sum,
+							name: "手工总业绩",
+							className: "md-pricetags",
+						}];
 						// this.num = num;
 						list.forEach((item) => {
 							if (item.id == this.orderId) {

+ 122 - 33
src/pages/order/serveList/index.vue

@@ -7,23 +7,24 @@
 				<Form ref="pagination" inline :model="pagination" :label-width="labelWidth"
 					:label-position="labelPosition" @submit.native.prevent>
 					<FormItem label="订单状态:">
-						<Select v-model="pagination.status" class="input-add">
+						<Select  v-model="pagination.status" class="input-add">
 							<Option v-for="(item, index) in num" :value="item.value" :key="index">{{ item.name }}
 							</Option>
 						</Select>
 					</FormItem>
-					<FormItem label="用户ID:" label-for="title">
-						<div class='flex-search'>
-							<Input v-model="pagination.uid" icon="ios-search" @on-click='openuid' placeholder="请输入用户ID"
-								class="input-add mr14" />
-						</div>
-					</FormItem>
 					<FormItem label="员工ID:" label-for="title">
 						<div class='flex-search'>
 							<Input v-model="pagination.work_member_id" icon="ios-search" @on-click='openmid'
 								placeholder="请输入员工ID" class="input-add mr14" />
 						</div>
 					</FormItem>
+					<FormItem label="用户ID:" label-for="title">
+						<div class='flex-search'>
+							<Input v-model="pagination.uid" icon="ios-search" @on-click='openuid' placeholder="请输入用户ID"
+								class="input-add mr14" />
+						</div>
+					</FormItem>
+					
 					<FormItem label="订单搜索:" label-for="title">
 						<Input v-model="pagination.order_id" placeholder="请输入订单号" class="input-add mr14" />
 						<Button type="primary" @click="orderSearch()">查询</Button>
@@ -48,15 +49,18 @@
 				</template>
 				<template slot-scope="{ row }" slot="info">
 					<div class="tabBox" v-for="(val, i) in row.info" :key="i">
-						<div class="tabBox_img" v-viewer>
-							<img v-lazy="val.slider_image" />
-						</div>
-						<div class="tabBox_content">
-							<div class="tabBox_tit">{{ val.store_name }}</div>
-							<div class="tabBox_pice">{{'¥' + val.pay_price}}</div>
+						<div class="tabRow">
+							<div class="tabBox_img" v-viewer>
+								<img v-lazy="val.slider_image" />
+							</div>
+							<div class="tabBox_content ">
+								<div class="tabBox_tit line1" :title="val.store_name">{{ val.store_name }}</div>
+								<div class="tabBox_pice">{{'¥' + val.pay_price}}</div>
+							</div>
 						</div>
 						<div class="tabBox_serve" v-if="val.project_user_id">
-							服务卡
+							服务卡<br />
+							ID:{{val.project_user_id}}
 						</div>
 					</div>
 				</template>
@@ -70,11 +74,25 @@
 					<span class="tabBox_pice">{{row.store.name}}</span>
 				</template>
 
-				<!-- <template slot-scope="{ row }" slot="status">
-					<Tag color="blue" size="medium" v-if="row.status == -1">退款</Tag>
-					<Tag color="blue" size="medium" v-if="row.status == 0">待服务</Tag>
-					<Tag color="blue" size="medium" v-if="row.status == 2">已完成</Tag>
-				</template> -->
+				<template slot-scope="{ row }" slot="pay_type">
+					<div class="tabBox" v-for="(val, i) in row.info" :key="i">
+						<div class="tabBox_serve" v-if="val.pay_type=='weixin'">
+							微信
+						</div>
+						<div class="tabBox_serve" v-if="val.pay_type=='yue'">
+							余额
+						</div>
+						<div class="tabBox_serve" v-if="val.pay_type=='offline'">
+							线下
+						</div>
+						<div class="tabBox_serve" v-if="val.pay_type=='alipay'">
+							支付宝
+						</div>
+						<div class="tabBox_serve" v-if="val.pay_type=='cash'">
+							现金
+						</div>
+					</div>
+				</template>
 
 				<template slot-scope="{ row }" slot="statusName">
 					<Tooltip theme="dark" max-width="300" :delay="600">
@@ -95,6 +113,18 @@
 				</template>
 				<template slot-scope="{ row }" slot="action">
 					<a @click="changeMenu(row)" v-if="row.status == 0">修改员工</a>
+					<Divider type="vertical" v-if="row.status >=0" />
+					<a @click="del(row)" v-if="row.status >=0">退单</a>
+				</template>
+				<template slot-scope="{ row }" slot="status">
+					<div class="tabBox" v-for="(val, i) in row.info" :key="i">
+						<div class="tabBox_serve" v-if="val.paid>0">
+							<Tag color="blue" size="medium">已付款</Tag>
+						</div>
+						<div class="tabBox_serve" v-else>
+							<Tag color="gold" size="medium">待付款</Tag>
+						</div>
+					</div>
 				</template>
 			</Table>
 			<div class="acea-row row-right page">
@@ -127,6 +157,17 @@
 				<Button @click="memberListShow=false">取消</Button>
 			</template>
 		</Modal>
+		<Modal v-model="delModel" scrollable title="退单" class="order_box" :closable="false">
+			<Form :label-width="80">
+				<FormItem label="备注:">
+					<Input v-model="delData.remarks" placeholder="请输入退单备注" />
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button type="primary" @click="delConfirm">提交</Button>
+				<Button @click="delModel=false">取消</Button>
+			</div>
+		</Modal>
 	</div>
 </template>
 
@@ -136,7 +177,8 @@
 	} from "vuex";
 	import {
 		getServeOrder,
-		member_update
+		member_update,
+		active_refund_order
 	} from "@/api/order";
 	import {
 		getYgList
@@ -146,8 +188,6 @@
 	} from "@/api/erp";
 	import userlist from "@/components/customerInfo/index";
 	import staffList from "@/components/staffList/index";
-
-
 	export default {
 		components: {
 			userlist,
@@ -155,6 +195,11 @@
 		},
 		data() {
 			return {
+				delModel: false,
+				delData: {
+					id: '',
+					remarks: ''
+				},
 				memberListShow: false,
 				// 显示用户列表
 				userListShow: false,
@@ -189,21 +234,23 @@
 						slot: "pay_price",
 						minWidth: 70,
 					},
+					{
+						title: "支付方式",
+						slot: "pay_type",
+						minWidth: 80,
+					},
+					{
+						title: "支付状态",
+						slot: "status",
+						minWidth: 80,
+					},
 					{
 						title: "预约时间",
 						slot: "reservation_time",
 						minWidth: 130,
 					},
-					// {
-					// 	title: "订单状态",
-					// 	slot: "status",
-					// 	minWidth: 80,
-					// },
-					// {
-					// 	title: "退款状态",
-					// 	slot: "refund_status",
-					// 	minWidth: 80,
-					// },
+
+
 					{
 						title: "预约门店",
 						slot: "store",
@@ -261,6 +308,32 @@
 			this.getOrderList();
 		},
 		methods: {
+			delConfirm() {
+				const that = this;
+				that.delModel = false;
+				that.$Modal.confirm({
+					title: "确认退单",
+					content: '<p>确定退单吗?</p><p>退单后将无法恢复,请谨慎操作!</p>',
+					onOk: () => {
+						console.log('进入');
+						setTimeout(function() {
+							that.$Modal.remove();
+							active_refund_order(that.delData).then((res) => {
+								console.log(res);
+								that.getOrderList()
+								that.$Message.success("退单成功");
+							}).catch((err) => {
+								that.$Message.error(err.msg);
+							})
+						}, 300);
+					}
+				});
+			},
+			del(row) {
+				const that = this;
+				that.delModel = true;
+				that.delData.id = row.id;
+			},
 			// 打开弹窗
 			openmid(e) {
 				this.memberListShow = true;
@@ -401,9 +474,25 @@
 		height: 100%;
 		display: flex;
 		align-items: center;
-		.tabBox_content{
+		justify-content: space-between;
+
+		.tabRow {
+			width: 0;
+			flex-grow: 1;
+			display: flex;
+		}
+
+		.tabBox_serve {
+			flex-shrink: 0;
+			padding-left: 5px;
+		}
+
+		.tabBox_content {
+			width: 0;
+			flex-grow: 1;
 			padding-left: 5px;
 		}
+
 		.tabBox_pice {
 			flex-shrink: 0;
 		}