lhl 2 роки тому
батько
коміт
9bbe526f77

+ 7 - 0
src/api/order.js

@@ -691,3 +691,10 @@ export function serveRefund(data) {
 	    data});
 }
 
+
+export function member_update(data) {
+	return request({
+	    url: `order/Subscribe/member_update`,
+	    method: 'post',
+	    data});
+}

+ 46 - 24
src/pages/check/components/addStaff.vue

@@ -23,22 +23,22 @@
 							</FormItem>
 							</Col>
 							<Col span="24">
-							<FormItem label="别名:" prop="name" label-for="alias">
+							<FormItem label="别名:" prop="alias" label-for="alias">
 								<Input v-model="formItem.alias" placeholder="请输入别名" />
 							</FormItem>
 							</Col>
 							<Col span="24">
-							<FormItem label="手机号:" label-for="mobile" prop="mobile">
+							<FormItem label="手机号:" prop="mobile" label-for="mobile">
 								<Input v-model="formItem.mobile" placeholder="请输入手机号" />
 							</FormItem>
 							</Col>
 							<Col span="24">
-							<FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio">
+							<FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio"  >
 								<Input v-model="formItem.sale_ratio" placeholder="请输入销售比例" />
 							</FormItem>
 							</Col>
 							<Col span="24">
-							<FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio">
+							<FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio" >
 								<Input v-model="formItem.craft_ratio" placeholder="请输入手工比例" />
 							</FormItem>
 							</Col>
@@ -95,6 +95,20 @@
 									@change="changeBm"></el-cascader>
 							</FormItem>
 							</Col>
+							<Col span="24" class="mt20">
+							<FormItem label="是否禁用:">
+								<RadioGroup v-model="formItem.enable">
+									<Radio :label="0">
+										<Icon type="social-apple"></Icon>
+										<span>禁用</span>
+									</Radio>
+									<Radio :label="1">
+										<Icon type="social-android"></Icon>
+										<span>启用</span>
+									</Radio>
+								</RadioGroup>
+							</FormItem>
+							</Col>
 						</Row>
 						<Row style="justify-content: space-around;">
 							<Col>
@@ -166,6 +180,7 @@
 				isTemplate: false,
 				title: '',
 				formItem: {
+					enable: 1,
 					is_reservation: 0,
 					uid: '',
 					name: '',
@@ -174,10 +189,10 @@
 					alias: '',
 					address: '',
 					main_department: '',
-					direct_leader: 'ZhouFengYu',
+					direct_leader: 'ChenBin',
 					position: '',
-					sale_ratio: 0,
-					craft_ratio: 0
+					sale_ratio: '',
+					craft_ratio: ''
 				},
 				spinShow: false,
 				addresData: [],
@@ -192,16 +207,6 @@
 						message: '请输入地址地址',
 						trigger: 'blur'
 					}],
-					sale_ratio: [{
-						required: true,
-						message: '请输入销售比例',
-						trigger: 'blur'
-					}],
-					craft_ratio: [{
-						required: true,
-						message: '请输入手工比例',
-						trigger: 'blur'
-					}],
 					mobile: [{
 						required: true,
 						validator: validatePhone,
@@ -250,20 +255,25 @@
 			}
 			if (this.isEdit == 0) {
 				this.formItem = {
+					is_reservation: 0,
+					enable: 1,
 					name: '',
 					avatar: '',
 					mobile: '',
 					alias: '',
 					address: '',
 					main_department: '',
-					direct_leader: 'ZhouFengYu',
+					direct_leader: 'ChenBin',
 					position: '',
-					sale_ratio: 0,
-					craft_ratio: 0
+					sale_ratio: '',
+					craft_ratio: ''
 				}
 			}
+			// console.log(this.info,'infoinfoinfoinfo')
+			
 		},
 		computed: {
+			...mapState('store/user',['info']),
 			labelWidth() {
 				return this.isMobile ? undefined : 120;
 			},
@@ -297,13 +307,14 @@
 			clearFrom() {
 				this.goodsList = [];
 				this.formItem = {
+					enable: 1,
 					name: '',
 					avatar: '',
 					mobile: '',
 					alias: '',
 					address: '',
 					main_department: '',
-					direct_leader: 'ZhouFengYu',
+					direct_leader: 'ChenBin',
 					sale_ratio: 0,
 					is_reservation: 0,
 					craft_ratio: 0
@@ -330,6 +341,12 @@
 				console.log(this.formItem)
 				this.$refs[name].validate((valid) => {
 					if (valid) {
+						if(!this.formItem.sale_ratio) {
+							return this.$Message.error('请输入销售比例');
+						}
+						if(!this.formItem.craft_ratio) {
+							return this.$Message.error('请输入手工比例');
+						}
 						if(this.formItem.id) {
 							editYg({
 								id: this.formItem.id,
@@ -339,11 +356,16 @@
 								alias:  this.formItem.alias,
 								address:  this.formItem.address,
 								main_department:  this.formItem.main_department,
-								department: this.formItem.department,
+								department: this.formItem.department || [this.formItem.main_department],
 								uid: this.formItem.uid,
 								userid: this.formItem.userid,
-								direct_leader: 'ZhouFengYu',
-								position: this.formItem.position
+								direct_leader: 'ChenBin',
+								position: this.formItem.position,
+								sale_ratio: this.formItem.sale_ratio,
+								craft_ratio: this.formItem.craft_ratio,
+								is_reservation: this.formItem.is_reservation,
+								enable: this.formItem.enable,
+								
 							}).then(async res => {
 								this.$Message.success(res.msg);
 								this.isTemplate = false;

+ 26 - 6
src/pages/check/staff/index.vue

@@ -9,8 +9,15 @@
 					<template slot-scope="{ row }" slot="avatar">
 						<img :src="row.avatar" />
 					</template>
-					<template slot-scope="{ row }" slot="department_list">
-						<div>{{row.department_list[0].name.name || ''}}</div>
+					<template slot-scope="{ row }" slot="department_list" >
+						<div>{{row.department_list ? row.department_list[0].name : ''}}</div>
+					</template>
+					<template slot-scope="{ row }" slot="bind" >
+						<div>用户昵称: {{row.user.nickname}}</div>
+						<div>手机号: {{row.user.phone}}</div>
+					</template>
+					<template slot-scope="{ row }" slot="serve" >
+						<div> {{row.is_reservation ? '是': '否'}}</div>
 					</template>
 					<template slot-scope="{ row, index }" slot="action">
 						<a @click="edit(row)">编辑</a>
@@ -32,6 +39,7 @@
 	import util from "@/libs/util";
 	import Setting from "@/setting";
 	import addStaff from "../components/addStaff";
+		// import { staffInfoApi} from "@/api/user"
 	import {
 		getYgList
 	} from "@/api/check";
@@ -42,6 +50,7 @@
 		},
 		data() {
 			return {
+				store_id: 0,
 				isMobile: false,
 				staffInfo: {},
 				total: 0,
@@ -71,7 +80,16 @@
 						key: "alias",
 						minWidth: 80,
 					},
-					
+					{
+						title: "绑定用户",
+						slot: "bind",
+						minWidth: 80,
+					},
+					{
+						title: "是否服务员工",
+						slot: "serve",
+						minWidth: 80,
+					},
 					{
 						title: "部门",
 						slot: "department_list",
@@ -129,17 +147,19 @@
 				});
 			},
 			add() {
+				
 				this.$refs.template.isEdit = 0;
 				this.$refs.template.title = "添加店员";
 				this.$refs.template.add = 1;
 				this.$refs.template.isTemplate = true;
-				this.$refs.template.cityInfo({
-					pid: 0
-				});
+				// this.$refs.template.cityInfo({
+				// 	pid: 0
+				// });
 			},
 			edit(row) {
 				this.$refs.template.title = "编辑店员";
 				this.$refs.template.isTemplate = true;
+				this.$refs.template.checkUser = row.user
 				// this.$refs.template.getInfo(row.id);
 				let editData = row
 				console.log(row);

+ 68 - 62
src/pages/order/serveOrder/index.vue

@@ -13,8 +13,8 @@
 				<Row type="flex" class="mt10">
 					<Col class="ivu-text-left mr">
 					<FormItem label="订单状态:">
-						<Select v-model="pagination.refund_status" style="width: 250px"
-							@on-change="selectChange2(pagination.refund_status)">
+						<Select v-model="pagination.status" style="width: 250px"
+							@on-change="selectChange2(pagination.status)">
 							<Option v-for="item in num" :key="item.value" :value="item.value">{{ item.name }}</Option>
 						</Select>
 						<!-- <RadioGroup
@@ -28,13 +28,13 @@
             </RadioGroup> -->
 					</FormItem>
 					</Col>
-					<Col class="ml15">
+					<!-- <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>
 					</FormItem>
-					</Col>
+					</Col> -->
 					<Col class="ivu-text-left">
 					<FormItem label="订单搜索:" label-for="title">
 						<Input enter-button v-model="pagination.order_id" placeholder="请输入订单号" style="width: 250px" />
@@ -54,10 +54,6 @@
 					<span v-show="row.is_del === 1 && row.delete_time == null"
 						style="color: #ed4014; display: block">用户已删除</span>
 				</template>
-				<template slot-scope="{ row, index }" slot="user">
-					<div>用户名:{{ row.nickname }}</div>
-					<div>用户ID:{{ row.uid }}</div>
-				</template>
 				<template slot-scope="{ row, index }" slot="refund_status">
 					<div v-if="row.refund_status == 1">待审核</div>
 					<div v-else-if="row.refund_status == 2">第一次审核通过</div>
@@ -84,6 +80,9 @@
 				<template slot-scope="{ row, index }" slot="add_time">
 					<span class="tabBox_pice">{{showTime(row.add_time)}}</span>
 				</template>
+				<template slot-scope="{ row, index }" slot="kf">
+					<span class="tabBox_pice">{{showName(row.work_member_id)}}</span>
+				</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>
@@ -124,22 +123,17 @@
 		<Modal
 		  v-model="modals"
 		  scrollable
-		  title="订单备注"
+		  title="选择员工"
 		  class="order_box"
 		  :closable="false"
 		>
 		  <Form
 		    :label-width="80"
 		  >
-		    <FormItem label="备注:" prop="remark">
-		      <Input
-		        v-model="remark"
-		        maxlength="200"
-		        show-word-limit
-		        type="textarea"
-		        placeholder="订单备注"
-		        style="width: 100%"
-		      />
+		    <FormItem label="员工:" prop="chooseId">
+		      <Select v-model="chooseId" style="width: 250px">
+		      	<Option v-for="item in ygList" :key="item.id" :value="item.id">{{ item.name }}</Option>
+		      </Select>
 		    </FormItem>
 		  </Form>
 		  <div slot="footer">
@@ -154,6 +148,9 @@
 	import {
 		mapState
 	} from 'vuex'
+	import {
+		getYgList
+	} from "@/api/check";
 	import {
 		orderRefundList,
 		getDataInfo,
@@ -163,7 +160,8 @@
 		refundIntegral,
 		getDistribution,
 		getRefundOrderFrom,
-		getServeOrder
+		getServeOrder,
+		member_update
 	} from '@/api/order'
 	import editFrom from '@/components/from/from'
 	import detailsFrom from '../orderList/components/orderDetails'
@@ -178,6 +176,9 @@
 		},
 		data() {
 			return {
+				order_id: '',
+				ygList: [],
+				chooseId: 0,
 				remark: '',
 				modals:false,
 				grid: {
@@ -203,6 +204,11 @@
 						key: 'user_phone',
 						minWidth: 130,
 					},
+					{
+						title: '预约员工',
+						slot: 'kf',
+						minWidth: 130,
+					},
 					{
 						title: '商品信息',
 						slot: 'info',
@@ -228,17 +234,17 @@
 				],
 				tbody: [],
 				num: [{
-					name: '待审核',
-					value: 1,
-				},
-				{
-					name: '第一次审核完成',
-					value: 2,
-				},
-				{
-					name: '已拒绝',
-					value: -1,
-				}],
+						name: '待服务',
+						value: 0
+					},
+					{
+						name: '已完成',
+						value: 2
+					}, {
+						name: '退款',
+						value: -1
+					},
+				],
 				orderDatalist: null,
 				loading: false,
 				FromData: null,
@@ -394,22 +400,46 @@
 		},
 		created() {
 			this.getOrderList()
+			this.getygList()
 			// this.getYgList()
 		},
 		methods: {
-			
+			showName( id) {
+				let yg = this.ygList.find(item => {
+					return item.id == id
+				})
+				console.log(yg,'ygygygyg')
+				return yg? yg.name: ''
+			},
+			getygList() {
+				getYgList({
+					page: 1,
+					limit: 1000
+				}).then(res => {
+					console.log(res)
+					this.ygList = res.data.list
+				})
+			},
 			cancal() {
 				this.modals = false
 				this.remark = ''
 			},
 			//goCancal
 			goCancal() {
-				if(this.remark == '' ) {
-					return this.$Message.error('请输入退款理由')
+				if(this.chooseId == '' ) {
+					return this.$Message.error('请选择员工')
 				}
-				
-				
 				this.modals = false
+				member_update({
+					id: this.order_id,
+					work_member_id: this.chooseId
+				}).then(res => {
+					this.$Message.success(res.msg)
+					this.getOrderList()
+				}).catch(err => {
+					this.$Message.error(err.msg)
+				})
+				
 			},
 			showTime(time) {
 				var date = new Date(time * 1000);
@@ -427,7 +457,7 @@
 				list.forEach(item => {
 					price += item.pay_price * 1
 				})
-				return price
+				return price.toFixed(2)
 			},
 			onchangeCode(e) {
 				this.animal = e
@@ -442,32 +472,8 @@
 			},
 			// 操作
 			changeMenu(row, name) {
-				let titile;
-				if(name == 1) {
-					titile = '通过该退款审核?'
-					this.delfromData = {
-						title: titile,
-						url: `/refund/agree/${id}`,
-						method: 'get',
-						ids: {
-							id: row.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 {
-					titile = '拒绝该退款审核?'
-					this.modals = true
-				}
-				
+				this.modals = true
+				this.order_id = row.id
 			},
 			// 获取退款表单数据
 			getRefundData(id, refund_type) {