Ver Fonte

2023-12-20

cmy há 1 ano atrás
pai
commit
a0f5b2cf39
2 ficheiros alterados com 111 adições e 375 exclusões
  1. 50 358
      src/pages/order/serveOrder/index.vue
  2. 61 17
      src/pages/user/components/userDetails2.vue

+ 50 - 358
src/pages/order/serveOrder/index.vue

@@ -1,12 +1,5 @@
 <template>
 <template>
 	<div>
 	<div>
-		<!-- <div class="i-layout-page-header"> -->
-		<!-- <PageHeader
-        class="product_tabs"
-        :title="$route.meta.title"
-        hidden-breadcrumb
-      ></PageHeader> -->
-		<!-- </div> -->
 		<Card :bordered="false" dis-hover class="ivu-mt mt15">
 		<Card :bordered="false" dis-hover class="ivu-mt mt15">
 			<Form ref="pagination" :model="pagination" :label-width="labelWidth" :label-position="labelPosition"
 			<Form ref="pagination" :model="pagination" :label-width="labelWidth" :label-position="labelPosition"
 				@submit.native.prevent>
 				@submit.native.prevent>
@@ -17,24 +10,24 @@
 							@on-change="selectChange2(pagination.status)">
 							@on-change="selectChange2(pagination.status)">
 							<Option v-for="item in num" :key="item.value" :value="item.value">{{ item.name }}</Option>
 							<Option v-for="item in num" :key="item.value" :value="item.value">{{ item.name }}</Option>
 						</Select>
 						</Select>
-						<!-- <RadioGroup
-              v-model="pagination.refund_type"
-              type="button"
-              @on-change="selectChange2(pagination.refund_type)"
-            >
-              <Radio v-for="(item, index) in num" :key="index" :label="index"
-                >{{ item.name }} {{ '(' + item.num + ')' }}</Radio
-              >
-            </RadioGroup> -->
 					</FormItem>
 					</FormItem>
 					</Col>
 					</Col>
-					<!-- <Col class="ml15">
-					<FormItem label="退款时间:">
-						<DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal" format="yyyy/MM/dd"
-							type="daterange" placement="bottom-start" placeholder="自定义时间" style="width: 250px"
-							:options="options"></DatePicker>
+					<Col class="ivu-text-left mr">
+					<FormItem label="员工:">
+						<Select v-model="pagination.work_member_id" style="width: 250px">
+							<Option value="">全部</Option>
+							<Option v-for="item in ygList" :key="item.id" :value="item.id">{{ item.name }}</Option>
+						</Select>
+					</FormItem>
+					</Col>
+					<Col class="ivu-text-left mr">
+					<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>
-					</Col> -->
+					</Col>
 					<Col class="ivu-text-left">
 					<Col class="ivu-text-left">
 					<FormItem label="订单搜索:" label-for="title">
 					<FormItem label="订单搜索:" label-for="title">
 						<Input enter-button v-model="pagination.order_id" placeholder="请输入订单号" style="width: 250px" />
 						<Input enter-button v-model="pagination.order_id" placeholder="请输入订单号" style="width: 250px" />
@@ -46,7 +39,6 @@
 			</Form>
 			</Form>
 		</Card>
 		</Card>
 		<Card :bordered="false" dis-hover class="ivu-mt mt15">
 		<Card :bordered="false" dis-hover class="ivu-mt mt15">
-
 			<Table :columns="thead" :data="tbody" ref="table" class="mt10" :loading="loading" highlight-row
 			<Table :columns="thead" :data="tbody" ref="table" class="mt10" :loading="loading" highlight-row
 				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 				no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
 				<template slot-scope="{ row, index }" slot="order_id">
 				<template slot-scope="{ row, index }" slot="order_id">
@@ -54,6 +46,10 @@
 					<span v-show="row.is_del === 1 && row.delete_time == null"
 					<span v-show="row.is_del === 1 && row.delete_time == null"
 						style="color: #ed4014; display: block">用户已删除</span>
 						style="color: #ed4014; display: block">用户已删除</span>
 				</template>
 				</template>
+				<template slot-scope="{ row }" slot="real_name">
+					<div>用户名:{{ row.real_name }}()</div>
+					<div>手机号:{{ row.user_phone }}</div>
+				</template>
 				<template slot-scope="{ row, index }" slot="refund_status">
 				<template slot-scope="{ row, index }" slot="refund_status">
 					<div v-if="row.refund_status == 1">待审核</div>
 					<div v-if="row.refund_status == 1">待审核</div>
 					<div v-else-if="row.refund_status == 2">第一次审核通过</div>
 					<div v-else-if="row.refund_status == 2">第一次审核通过</div>
@@ -83,27 +79,8 @@
 				<template slot-scope="{ row, index }" slot="kf">
 				<template slot-scope="{ row, index }" slot="kf">
 					<span class="tabBox_pice">{{showName(row.work_member_id)}}</span>
 					<span class="tabBox_pice">{{showName(row.work_member_id)}}</span>
 				</template>
 				</template>
-				<template slot-scope="{ row, index }" slot="statusName">
-					<div v-html="row.refund_reason" class="pt5"></div>
-					<div v-html="row.refund_explain" class="pt5"></div>
-					<div class="pictrue-box">
-						<div v-viewer v-if="row.refund_img" v-for="(item, index) in row.refund_img || []" :key="index">
-							<img class="pictrue mr10" v-lazy="item" :src="item" />
-						</div>
-					</div>
-				</template>
-				<template slot-scope="{ row, index }" slot="statusGoodName">
-					<div v-html="row.refund_goods_explain" class="pt5"></div>
-					<div class="pictrue-box">
-						<div v-viewer v-if="row.refund_goods_img" v-for="(item, index) in row.refund_goods_img || []"
-							:key="index">
-							<img class="pictrue mr10" v-lazy="item" :src="item" />
-						</div>
-					</div>
-				</template>
 				<template slot-scope="{ row, index }" slot="action">
 				<template slot-scope="{ row, index }" slot="action">
-					
-					<a @click="changeMenu(row, 0)" v-if="row.status == 0">修改服务员工</a>
+					<a @click="changeMenu(row, 0)" v-if="row.status == 0">修改员工</a>
 				</template>
 				</template>
 			</Table>
 			</Table>
 			<div class="acea-row row-right page">
 			<div class="acea-row row-right page">
@@ -111,15 +88,6 @@
 					:page-size="pagination.limit" />
 					:page-size="pagination.limit" />
 			</div>
 			</div>
 		</Card>
 		</Card>
-		<!-- 编辑 退款 退积分 不退款-->
-		<edit-from ref="edits" :FromData="FromData" @submitFail="submitFail"></edit-from>
-		<!-- 详情 -->
-		<details-from ref="detailss" :orderDatalist="orderDatalist" :orderId="orderId"
-			:rowActive="rowActive"></details-from>
-		<!-- 备注 -->
-		<order-remark ref="remarks" remarkType="refund" :orderId="orderId" @submitFail="submitFail"></order-remark>
-		<!-- 记录 -->
-		<order-record ref="record"></order-record>
 		<Modal
 		<Modal
 		  v-model="modals"
 		  v-model="modals"
 		  scrollable
 		  scrollable
@@ -141,6 +109,12 @@
 		    <Button @click="cancal">取消</Button>
 		    <Button @click="cancal">取消</Button>
 		  </div>
 		  </div>
 		</Modal>
 		</Modal>
+		<Modal v-model="userListShow" width='80' mask title="用户选择">
+			<userlist @getUserId='checkUser'></userlist>
+			<template #footer>
+				<Button @click="userListShow=false">取消</Button>
+			</template>
+		</Modal>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -152,62 +126,37 @@
 		getYgList
 		getYgList
 	} from "@/api/check";
 	} from "@/api/check";
 	import {
 	import {
-		orderRefundList,
-		getDataInfo,
-		getRefundDataInfo,
-		getRefundFrom,
-		getnoRefund,
-		refundIntegral,
-		getDistribution,
-		getRefundOrderFrom,
 		getServeOrder,
 		getServeOrder,
 		member_update
 		member_update
 	} from '@/api/order'
 	} from '@/api/order'
-	import editFrom from '@/components/from/from'
-	import detailsFrom from '../orderList/components/orderDetails'
-	import orderRemark from '../orderList/components/orderRemark'
-	import orderRecord from '../orderList/components/orderRecord'
+	import userlist from "@/components/userList/index";
 	export default {
 	export default {
 		components: {
 		components: {
-			editFrom,
-			detailsFrom,
-			orderRemark,
-			orderRecord
+			userlist
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				// 显示用户列表
+				userListShow: false,
 				order_id: '',
 				order_id: '',
 				ygList: [],
 				ygList: [],
 				chooseId: 0,
 				chooseId: 0,
-				remark: '',
 				modals:false,
 				modals:false,
-				grid: {
-					xl: 7,
-					lg: 7,
-					md: 12,
-					sm: 24,
-					xs: 24,
-				},
 				thead: [{
 				thead: [{
 						title: '订单号',
 						title: '订单号',
 						align: 'center',
 						align: 'center',
 						slot: 'order_id',
 						slot: 'order_id',
-						minWidth: 150,
-					},
-					{
-						title: '用户昵称',
-						key: 'real_name',
-						minWidth: 130,
+						minWidth: 160,
 					},
 					},
 					{
 					{
-						title: '用户联系方式',
-						key: 'user_phone',
-						minWidth: 130,
+						title: '用户信息',
+						slot: 'real_name',
+						minWidth: 150,
 					},
 					},
 					{
 					{
 						title: '预约员工',
 						title: '预约员工',
 						slot: 'kf',
 						slot: 'kf',
-						minWidth: 130,
+						minWidth: 80,
 					},
 					},
 					{
 					{
 						title: '商品信息',
 						title: '商品信息',
@@ -222,12 +171,12 @@
 					{
 					{
 						title: '下单时间',
 						title: '下单时间',
 						slot: 'add_time',
 						slot: 'add_time',
-						minWidth: 100,
+						minWidth: 130,
 					},
 					},
 					{
 					{
 						title: '操作',
 						title: '操作',
 						slot: 'action',
 						slot: 'action',
-						// fixed: "right",
+						fixed: "right",
 						minWidth: 150,
 						minWidth: 150,
 						align: 'center',
 						align: 'center',
 					},
 					},
@@ -245,152 +194,19 @@
 						value: -1
 						value: -1
 					},
 					},
 				],
 				],
-				orderDatalist: null,
 				loading: false,
 				loading: false,
-				FromData: null,
 				total: 0,
 				total: 0,
-				orderId: 0,
-				animal: 1,
 				pagination: {
 				pagination: {
 					page: 1,
 					page: 1,
 					limit: 15,
 					limit: 15,
-					refund_status: 1,
-					order_id: '',
-					time: '',
-					refund_type: 0,
-				},
-				options: {
-					shortcuts: [{
-							text: '今天',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									new Date(
-										new Date().getFullYear(),
-										new Date().getMonth(),
-										new Date().getDate()
-									)
-								)
-								return [start, end]
-							},
-						},
-						{
-							text: '昨天',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									start.setTime(
-										new Date(
-											new Date().getFullYear(),
-											new Date().getMonth(),
-											new Date().getDate() - 1
-										)
-									)
-								)
-								end.setTime(
-									end.setTime(
-										new Date(
-											new Date().getFullYear(),
-											new Date().getMonth(),
-											new Date().getDate() - 1
-										)
-									)
-								)
-								return [start, end]
-							},
-						},
-						{
-							text: '最近7天',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									start.setTime(
-										new Date(
-											new Date().getFullYear(),
-											new Date().getMonth(),
-											new Date().getDate() - 6
-										)
-									)
-								)
-								return [start, end]
-							},
-						},
-						{
-							text: '最近30天',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									start.setTime(
-										new Date(
-											new Date().getFullYear(),
-											new Date().getMonth(),
-											new Date().getDate() - 29
-										)
-									)
-								)
-								return [start, end]
-							},
-						},
-						{
-							text: "上月",
-							value() {
-								const end = new Date();
-								const start = new Date();
-								const day = new Date(start.getFullYear(), start.getMonth(), 0).getDate();
-								start.setTime(
-									start.setTime(
-										new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1)
-									)
-								);
-								end.setTime(
-									end.setTime(
-										new Date(new Date().getFullYear(), new Date().getMonth() - 1, day)
-									)
-								);
-								return [start, end];
-							},
-						},
-						{
-							text: '本月',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									start.setTime(
-										new Date(new Date().getFullYear(), new Date().getMonth(), 1)
-									)
-								)
-								return [start, end]
-							},
-						},
-						{
-							text: '本年',
-							value() {
-								const end = new Date()
-								const start = new Date()
-								start.setTime(
-									start.setTime(new Date(new Date().getFullYear(), 0, 1))
-								)
-								return [start, end]
-							},
-						},
-					],
+					work_member_id:'',
+					order_id:'',
+					uid: '',
+					status: 0,
 				},
 				},
-				timeVal: [],
-				modal: false,
-				qrcode: null,
-				name: '',
-				spin: false,
-				rowActive: {},
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
-			...mapState('order', ['orderChartType']),
-			// ...mapState("admin/layout", ["isMobile"]),
 			labelWidth() {
 			labelWidth() {
 				return this.isMobile ? undefined : 75
 				return this.isMobile ? undefined : 75
 			},
 			},
@@ -401,14 +217,21 @@
 		created() {
 		created() {
 			this.getOrderList()
 			this.getOrderList()
 			this.getygList()
 			this.getygList()
-			// this.getYgList()
 		},
 		},
 		methods: {
 		methods: {
+			// 选中用户
+			checkUser(res) {
+				this.userListShow = false;
+				this.pagination.uid = res.uid;
+			},
+			// 打开弹窗
+			openuid(e) {
+				this.userListShow = true;
+			},
 			showName( id) {
 			showName( id) {
 				let yg = this.ygList.find(item => {
 				let yg = this.ygList.find(item => {
 					return item.id == id
 					return item.id == id
 				})
 				})
-				console.log(yg,'ygygygyg')
 				return yg? yg.name: ''
 				return yg? yg.name: ''
 			},
 			},
 			getygList() {
 			getygList() {
@@ -422,9 +245,7 @@
 			},
 			},
 			cancal() {
 			cancal() {
 				this.modals = false
 				this.modals = false
-				this.remark = ''
 			},
 			},
-			//goCancal
 			goCancal() {
 			goCancal() {
 				if(this.chooseId == '' ) {
 				if(this.chooseId == '' ) {
 					return this.$Message.error('请选择员工')
 					return this.$Message.error('请选择员工')
@@ -459,125 +280,17 @@
 				})
 				})
 				return price.toFixed(2)
 				return price.toFixed(2)
 			},
 			},
-			onchangeCode(e) {
-				this.animal = e
-				this.qrcodeShow()
-			},
-			// 具体日期搜索();
-			onchangeTime(e) {
-				this.pagination.page = 1
-				this.timeVal = e
-				this.pagination.time = this.timeVal[0] ? this.timeVal.join('-') : ''
-				this.getOrderList()
-			},
 			// 操作
 			// 操作
 			changeMenu(row, name) {
 			changeMenu(row, name) {
 				this.modals = true
 				this.modals = true
 				this.order_id = row.id
 				this.order_id = row.id
 			},
 			},
-			// 获取退款表单数据
-			getRefundData(id, refund_type) {
-				if (refund_type == 2) {
-					this.delfromData = {
-						title: '立即退货',
-						url: `/service/refund_order_examine`,
-						method: 'post',
-						ids: {
-							id
-						}
-					}
-					this.$modalSure(this.delfromData)
-						.then((res) => {
-							this.$Message.success(res.msg)
-							this.getOrderList()
-							// this.getData(this.orderId, 1)
-						})
-						.catch((res) => {
-							this.$Message.error(res.msg)
-						})
-				} else {
-					this.$modalForm(getRefundOrderFrom(id)).then(() => {
-						this.getOrderList()
-						this.getData(this.orderId, 1)
-						this.$emit('changeGetTabs')
-					})
-				}
-			},
-			// 获取退积分表单数据
-			getRefundIntegral(id) {
-				refundIntegral(id)
-					.then(async (res) => {
-						this.FromData = res.data
-						this.$refs.edits.modals = true
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg)
-					})
-			},
-
-			// 获取详情表单数据
-			getData(id, type) {
-				getRefundDataInfo(id)
-					.then(async (res) => {
-						if (!type) {
-							this.$refs.detailss.modals = true
-						}
-						this.$refs.detailss.activeName = 'detail'
-						this.orderDatalist = res.data
-						// if (this.orderDatalist.orderInfo.refund_reason_wap_img) {
-						//   try {
-						//     this.orderDatalist.orderInfo.refund_reason_wap_img = JSON.parse(
-						//       this.orderDatalist.orderInfo.refund_reason_wap_img
-						//     );
-						//   } catch (e) {
-						//     this.orderDatalist.orderInfo.refund_reason_wap_img = [];
-						//   }
-						// }
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg)
-					})
-			},
-			// 删除单条订单
-			delOrder(row, data) {
-				if (row.is_del === 1) {
-					this.$modalSure(data)
-						.then((res) => {
-							this.$Message.success(res.msg)
-							this.getOrderList()
-						})
-						.catch((res) => {
-							this.$Message.error(res.msg)
-						})
-				} else {
-					const title = '错误!'
-					const content =
-						'<p>您选择的的订单存在用户未删除的订单,无法删除用户未删除的订单!</p>'
-					this.$Modal.error({
-						title: title,
-						content: content,
-					})
-				}
-			},
-			// 修改成功
-			submitFail() {
-				this.getOrderList()
-				this.getData(this.orderId, 1)
-			},
 			// 订单选择状态
 			// 订单选择状态
 			selectChange2(tab) {
 			selectChange2(tab) {
 				this.pagination.page = 1
 				this.pagination.page = 1
 				this.pagination.refund_status = tab
 				this.pagination.refund_status = tab
 				this.getOrderList(tab)
 				this.getOrderList(tab)
 			},
 			},
-			// 不退款表单数据
-			getNoRefundData(id) {
-				this.$modalForm(getnoRefund(id)).then(() => {
-					this.getOrderList()
-					this.getData(this.orderId, 1)
-					this.$emit('changeGetTabs')
-				})
-			},
 			// 订单列表
 			// 订单列表
 			getOrderList() {
 			getOrderList() {
 				this.loading = true
 				this.loading = true
@@ -598,11 +311,6 @@
 
 
 						})
 						})
 						this.num = num
 						this.num = num
-						list.forEach((item) => {
-							if (item.id == this.orderId) {
-								this.rowActive = item
-							}
-						})
 					})
 					})
 					.catch((err) => {
 					.catch((err) => {
 						this.loading = false
 						this.loading = false
@@ -614,27 +322,11 @@
 				this.pagination.page = index
 				this.pagination.page = index
 				this.getOrderList()
 				this.getOrderList()
 			},
 			},
-			nameSearch() {
-				this.pagination.page = 1
-				this.getOrderList()
-			},
 			// 订单搜索
 			// 订单搜索
 			orderSearch() {
 			orderSearch() {
 				this.pagination.page = 1
 				this.pagination.page = 1
-				console.log(111)
 				this.getOrderList()
 				this.getOrderList()
 			},
 			},
-			// 配送信息表单数据
-			delivery(row) {
-				getDistribution(row.id)
-					.then(async (res) => {
-						this.FromData = res.data
-						this.$refs.edits.modals = true
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg)
-					})
-			},
 		},
 		},
 	}
 	}
 </script>
 </script>

+ 61 - 17
src/pages/user/components/userDetails2.vue

@@ -100,6 +100,21 @@
                 <div class="title">{{ row.store_name }}</div>
                 <div class="title">{{ row.store_name }}</div>
               </div>
               </div>
             </template>
             </template>
+			<template slot-scope="{ row }" slot="card_name">
+				<div>
+					<div class="title">{{ row.card_name }}</div>
+					<div class="title" v-if="row.order">价格:{{ row.order.pay_price }}</div>
+					<div class="title" v-if="row.servicecard">折扣:{{ row.servicecard
+.discount }}%</div>
+				</div>
+			</template>
+			<template slot-scope="{ row }" slot="add_time">
+				<div>
+					<div class="title" v-if="row.order">
+						{{row.add_time}}</div>
+					<div class="title" v-else>已失效</div>
+				</div>
+			</template>
 			<template slot-scope="{ row }" slot="item">
 			<template slot-scope="{ row }" slot="item">
 				<div class="product" v-for="item in row.card">
 				<div class="product" v-for="item in row.card">
 					<div class="image" v-viewer>
 					<div class="image" v-viewer>
@@ -172,6 +187,9 @@
 import { detailsApi, infoApi} from '@/api/user'
 import { detailsApi, infoApi} from '@/api/user'
 import userForm from './userForm'
 import userForm from './userForm'
 import userInfo from './userInfo'
 import userInfo from './userInfo'
+import {
+		formatDate
+	} from '@/utils/validate';
 
 
 export default {
 export default {
   name: 'userDetails',
   name: 'userDetails',
@@ -241,6 +259,7 @@ export default {
   },
   },
   created() {},
   created() {},
   methods: {
   methods: {
+	  formatDate,
     changeMenu(value) {
     changeMenu(value) {
       if (value === '99') {
       if (value === '99') {
         this.getDetails(this.userId)
         this.getDetails(this.userId)
@@ -317,8 +336,18 @@ export default {
         .then(async (res) => {
         .then(async (res) => {
           if (res.status === 200) {
           if (res.status === 200) {
             let data = res.data
             let data = res.data
-            this.userLists = data.list
             this.total = data.count
             this.total = data.count
+			if (this.userFrom.type == 'service_card') {
+				this.userLists = data.list.map((res) => {
+					if (res.order) {
+						const date = new Date(res.order.add_time * 1000);
+						res.add_time = this.formatDate(date ,'yyyy-MM-dd hh:mm:ss');
+					}
+					return res
+				});
+			} else {
+				this.userLists = data.list;
+			}
             switch (this.userFrom.type) {
             switch (this.userFrom.type) {
               case 'order':
               case 'order':
                 this.columns = [
                 this.columns = [
@@ -409,22 +438,37 @@ export default {
                 break
                 break
 				case 'service_card':
 				case 'service_card':
 					this.columns = [
 					this.columns = [
-					{
-						title: '服务卡名称',
-						key: 'card_name',
-						minWidth: 120
-					},
-					{
-						title: '绑定项目',
-						slot: 'item',
-						minWidth: 240
-					},
-					{
-						title: '最近使用',
-						key: 'update_time',
-						minWidth: 120
-					}
-				]
+									// {
+									//     title: '动作',
+									//     key: 'title',
+									//     minWidth: 120
+									// },
+									{
+										title: '服务卡',
+										slot: 'card_name',
+										minWidth: 150
+									},
+									{
+										title: '绑定项目',
+										slot: 'item',
+										minWidth: 200
+									},
+									{
+										title: '购买时间',
+										slot: 'add_time',
+										minWidth: 120
+									},
+									{
+										title: '最近使用',
+										key: 'update_time',
+										minWidth: 120
+									},
+									// {
+									// 	title: '操作',
+									// 	slot: 'pos',
+									// 	minWidth: 50
+									// }
+								]
 				break;
 				break;
               case 'coupon':
               case 'coupon':
                 this.columns = [
                 this.columns = [