shish hace 1 año
padre
commit
b2e12d9d5f
Se han modificado 2 ficheros con 148 adiciones y 32 borrados
  1. 4 1
      ghs/src/views/order/list.vue
  2. 144 31
      ghs/src/views/order/refund-list.vue

+ 4 - 1
ghs/src/views/order/list.vue

@@ -152,7 +152,7 @@
 				</el-select>
         <span style="margin-left:9px;font-size:18px;">付款:</span>
         <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" style="margin-right:8px;">
+          class="custom-date-picker" end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:8px;">
         </el-date-picker>
         <el-radio-group v-model="book" @change="changeBook" style="margin-right:20px;padding-top:6px;margin-left:4px;">
           <el-radio label="-1">全部</el-radio>
@@ -890,6 +890,9 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.custom-date-picker{
+  width:230px;
+}
 .book-wrap {
   @include disFlex(center, flex-start);
   & > div {

+ 144 - 31
ghs/src/views/order/refund-list.vue

@@ -28,6 +28,39 @@
 				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportOrder()">导出记录</el-button>
 			</template>
 
+			<template #table-column-addTime="{scope}">
+				<span>
+				{{ scope.row.addTime?scope.row.addTime.substr(5,11):'' }}
+				</span>
+			</template>
+
+			<template #table-column-updateTime="{scope}">
+				<span>
+				{{ scope.row.updateTime?scope.row.updateTime.substr(5,11):'' }}
+				</span>
+			</template>
+
+			<template #table-column-orderTime="{scope}">
+				<span>
+				{{ scope.row.orderTime?scope.row.orderTime.substr(5,11):'' }}
+				</span>
+			</template>
+
+			<template #slot-search-option="{scope}">
+        		<el-input v-model="customName" placeholder="客户名称" size="mini" style="width:130px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="name=''"></el-input>
+				<el-select size="mini" v-model="currentStaffName" placeholder="操作人" style="width:110px;margin-left:8px;" @change="getKdStaff" :clearable="true">
+					<el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+				</el-select>
+				<span style="margin-left:9px;font-size:18px;">订单日期:</span>
+				<el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
+					class="custom-date-picker" end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:8px;">
+				</el-date-picker>
+				<span style="margin-left:9px;font-size:18px;">售后日期:</span>
+				<el-date-picker v-model="currentRefundDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchRefundDate" value-format="yyyy-MM-dd"
+					class="custom-date-picker" end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:8px;">
+				</el-date-picker>
+			</template>
+
 		</x-crud>
 	</div>
 </template>
@@ -41,11 +74,11 @@ export default {
 	data() {
 		return {
 			app: null,
-			tabIndex: '0',
+			tabIndex: '-1',
 			tabsData: [
 				{
 					text: '全部',
-					key: '0',
+					key: '-1',
 					val: 0
 				},
 				{
@@ -70,6 +103,45 @@ export default {
 			mobile1:'',
 			confirmMobile1:'',
 			fileUrl:'',
+			currentStaffName:'',
+			currentStaffId:0,
+			staffList:[],
+			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]);
+					}
+				}]
+      		},
+			startTime:'',
+			endTime:'',
+			searchTime:'',
+			currentDateList:[],
+			refundStartTime:'',
+			refundEndTime:'',
+			refundSearchTime:'',
+			currentRefundDateList:[],
+			customName:''
 		};
 	},
 	computed: {
@@ -78,24 +150,65 @@ export default {
 	created() {
 	},
 	mounted() {
+		let that = this
+		that.$service.shopAdmin.getAllStaff().then(res => {
+			that.staffList = res.list
+		})
 	},
 	methods: {
+		changeSearch(){
+			let that = this
+			if(this.T != null){
+				clearTimeout(this.T)
+			}
+			this.T = setTimeout(function(){
+				that.refreshData()
+			},650)
+		},
+		getKdStaff(e){
+			this.currentStaffId = e
+      		this.refreshData()
+		},
+		getSearchDate(){
+			if (this.$util.isEmpty(this.currentDateList)) {
+				this.searchTime = ''
+				this.startTime = ''
+				this.endTime = ''
+			}else{
+				this.searchTime = 'custom'
+				this.startTime = this.currentDateList[0]
+				this.endTime = this.currentDateList[1]
+			}
+			this.refreshData()
+		},
+		getSearchRefundDate(){
+			if (this.$util.isEmpty(this.currentRefundDateList)) {
+				this.refundSearchTime = ''
+				this.refundStartTime = ''
+				this.refundEndTime = ''
+			}else{
+				this.refundSearchTime = 'custom'
+				this.refundStartTime = this.currentRefundDateList[0]
+				this.refundEndTime = this.currentRefundDateList[1]
+			}
+			this.refreshData()
+		},
+		refreshData(){
+      		this.app.refresh({status:this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,refundSearchTime:this.refundSearchTime,refundStartTime:this.refundStartTime,
+				refundEndTime:this.refundEndTime,customName:this.customName,shopAdminId:this.currentStaffId})
+    	},
 		exportOrder(){
-			this.$service.custom.shopListAll({ type: this.tabIndex,export:1}).then(res => {
+			this.$service.custom.shopListAll().then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
 			})
 		},
-		handleClick(tab, e) {
-			this.app.refresh({ type: this.tabIndex });
+		handleClick() {
+			this.refreshData()
 		},
 		onLoad({ ctx, app }) {
 			this.app = app;
-			//传入参数 shish 2020.5.9
-			if (this.$route.query.type) {
-				this.tabIndex = this.$route.query.type;
-			}
 			ctx.service(this.$service.refund)
 				.set('table', {
 					columns: [
@@ -103,17 +216,23 @@ export default {
 							prop: 'id',
 							label: 'ID',
 							align: 'center',
-							width: 90
+							width: 80
 						},
 						{
-							prop: 'orderSn',
-							label: '退款单号',
+							prop: 'relateOrderSn',
+							label: '单号',
 							align: 'center',
 							width: 140
 						},
 						{
-							prop: 'relateOrderSn',
-							label: '订单号',
+							prop: 'orderTime',
+							label: '订单日期',
+							align: 'center',
+							width: 100
+						},
+						{
+							prop: 'orderSn',
+							label: '退款单号',
 							align: 'center',
 							width: 140
 						},
@@ -145,7 +264,7 @@ export default {
 							prop: 'shopAdminName',
 							label: '操作人',
 							align: 'center',
-							width: 120
+							width: 110
 						},
 						{
 							prop: 'cause',
@@ -157,7 +276,7 @@ export default {
 							prop: 'rejectReason',
 							label: '驳回原因',
 							align: 'center',
-							width: 100
+							width: 90
 						},
 						{
 							prop: 'remark',
@@ -175,37 +294,29 @@ export default {
 							prop: 'addTime',
 							label: '申请日期',
 							align: 'center',
-							width: 150
+							width: 100
 						},
 						{
 							prop: 'updateTime',
 							label: '最近后变更',
 							align: 'center',
-							width: 150
+							width: 100
 						}
 					],
 					op: {
 						visible: true,
 						props: {
-							width: 150,
+							width: 90,
 							align: 'center',
 							fixed: 'right',
 							label: '操作'
 						},
-						layout: ['slot-column-option']
-					}
-				})
-				.set('dict', {
-					search: {
-						keyWord: 'name'
+						layout: []
 					}
 				})
-				.set('search', {
-					key: { placeholder: '这里搜索' }
-				})
 				.set('layout', [
 					['slot-tabs'],
-					['search-key','flex1','slot-export-order'],
+					['slot-search-option','flex1','slot-export-order'],
 					['data-table'],
 					['flex1', 'pagination']
 				])
@@ -213,11 +324,13 @@ export default {
 					let result = await next(params)
 				})
 				.done();
-                app.refresh({ type: this.tabIndex })
+                this.refreshData()
 		}
 	}
 };
 </script>
 <style lang="scss" scoped>
-
+.custom-date-picker{
+  width:230px;
+}
 </style>