shish 1 жил өмнө
parent
commit
3169211c34

+ 10 - 0
ghs/src/views/custom/yj.vue

@@ -14,6 +14,8 @@
 				</el-radio-group>
 			</template>
 
+			
+
             <template #slot-total-amount>
 				<span style="font-size:15px;font-weight:bold;">订单数:{{ totalNum }}</span>
 				<span style="font-size:15px;font-weight:bold;margin-left:15px;">订单金额:{{ totalOrderPrice }}</span>
@@ -33,6 +35,10 @@
 				<el-button size="small" type="primary" @click="goChange(scope.row)">查看明细</el-button>
 			</template>
 
+			<template #table-column-tkPrice="{scope}">
+				<div style="cursor: pointer;" @click.stop="getTkDetail(scope.row)">{{ scope.row.tkPrice?parseFloat(scope.row.tkPrice):0 }}</div>
+			</template>
+
 		</x-crud>
 	</div>
 </template>
@@ -96,6 +102,10 @@ export default {
 			query.searchTime = this.searchTime
 			this.$router.push({ path: '/order/list', query });
 		},
+		getTkDetail(info){
+			let query = {customId:info.id,customName:info.name,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime};
+			this.$router.push({ path: '/order/refund-list', query });
+		},
 		exportDue(){
 			this.$service.order.getYj({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
 				if(res.file){

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

@@ -146,7 +146,7 @@
       </template>
 
       <template #slot-search-option="{scope}">
-        <el-input v-model="name" placeholder="客户名称 / 订单号" size="mini" style="width:130px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="name=''"></el-input>
+        <el-input v-model="name" placeholder="客户名称 / 订单号" size="mini" style="width:140px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="name=''"></el-input>
 				<el-select size="mini" v-model="currentKdStaffName" 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>

+ 48 - 9
ghs/src/views/order/refund-list.vue

@@ -47,7 +47,12 @@
 			</template>
 
 			<template #slot-search-option="{scope}">
-        		<el-input v-model="customName" placeholder="客户名称" size="mini" style="width:110px;" :clearable="true" ref="customSearchRef" @input="changeSearch()" @focus="name=''"></el-input>
+
+				<el-select @change="getCurrentCustom" v-model="currentCustomName" filterable remote reserve-keyword placeholder="搜索客户" clearable 
+				:remote-method="searchCustom" :loading="loading" style="width:160px;margin-right:10px;" size="mini">
+    				<el-option v-for="item in customList" :key="item.id" :label="`${item.name}`" :value="item.id"></el-option>
+  				</el-select>
+
 				<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>
@@ -70,6 +75,10 @@
 
 			</template>
 
+            <template #slot-total-amount>
+				<span style="font-size:15px;font-weight:bold;margin-left:15px;">售后总金额:{{ totalRefundPrice }}</span>
+			</template>
+
 		</x-crud>
 	</div>
 </template>
@@ -150,8 +159,12 @@ export default {
 			refundEndTime:'',
 			refundSearchTime:'',
 			currentRefundDateList:[],
-			customName:'',
-			status:'-1'
+			status:'-1',
+			totalRefundPrice:0,
+			currentCustomName:'',
+			currentCustomId:0,
+			customList:[],
+			loading:false
 		};
 	},
 	computed: {
@@ -164,11 +177,24 @@ export default {
 		that.$service.shopAdmin.getAllStaff().then(res => {
 			that.staffList = res.list
 		})
-		this.$nextTick(() => {
-      		this.$refs.customSearchRef.focus()
-    	})
 	},
 	methods: {
+		getCurrentCustom(e){
+			this.currentCustomId = e
+			this.refreshData()
+		},
+		searchCustom(query) {
+			let that = this
+			if (query !== '') {
+				this.loading = true;
+				this.$service.custom.list({name:query}).then(res=>{
+					that.loading = false
+					that.customList = res.list	
+				})
+			} else {
+				this.customList = []
+			}
+		},
 		changeStatus(e){
 			this.status = e
 			this.refreshData()
@@ -212,11 +238,11 @@ export default {
 		},
 		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,status:this.status})
+				refundEndTime:this.refundEndTime,shopAdminId:this.currentStaffId,status:this.status,customId:this.currentCustomId})
     	},
 		exportData(){
 			this.$service.refund.getRefundList({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,status:this.status,pageSize:9999999,export:1}).then(res => {
+				refundEndTime:this.refundEndTime,shopAdminId:this.currentStaffId,status:this.status,pageSize:9999999,export:1,customId:this.currentCustomId}).then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
@@ -227,6 +253,18 @@ export default {
 		},
 		onLoad({ ctx, app }) {
 			this.app = app;
+
+			if(this.$route.query.customId){
+				this.currentCustomId = this.$route.query.customId
+				this.currentCustomName = this.$route.query.customName?this.$route.query.customName:''
+				this.searchTime = this.$route.query.searchTime?this.$route.query.searchTime:''
+				this.startTime = this.$route.query.startTime?this.$route.query.startTime:''
+				this.endTime = this.$route.query.endTime?this.$route.query.endTime:''
+				if(this.startTime!='' && this.endTime !=''){
+					this.currentDateList =[this.startTime,this.endTime]
+				}
+			}
+
 			ctx.service(this.$service.refund)
 				.set('table', {
 					columns: [
@@ -336,10 +374,11 @@ export default {
 					['slot-tabs'],
 					['slot-search-option','flex1','slot-export-order'],
 					['data-table'],
-					['flex1', 'pagination']
+					['slot-total-amount','flex1', 'pagination']
 				])
 				.on('refresh', async (params, { next }) => {
 					let result = await next(params)
+					this.totalRefundPrice = result.totalRefundPrice ? parseFloat(result.totalRefundPrice) : 0
 				})
 				.done();
                 this.refreshData()