Просмотр исходного кода

售后计划替换为售后工单 维修工单查询bug修复

8521520123jsy 1 год назад
Родитель
Сommit
c9ff301e04

+ 3 - 3
api/salesServiceManagement/toDoList/index.js → api/salesServiceManagement/workOrder/index.js

@@ -8,9 +8,9 @@ import {
 import Vue from "vue";
 
 
-// 计划列表-------------------------------------------------------------------
-export async function getSalesPlan(params) {
-	const res = await get(Vue.prototype.apiUrl + `/eom/afterSalesPlan/page`, params);
+// 工单列表-------------------------------------------------------------------
+export async function getSalesWorkOrder(params) {
+	const res = await get(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/page`, params);
 	if (res.code == 0) {
 		return res.data;
 	}

+ 3 - 3
pages/index/index.vue

@@ -430,9 +430,9 @@
 						badge: 0
 					},
 					{
-						name: '售后计划',
-						url: `/pages/salesServiceManagement/toDoList/index`,
-						path: '/pages/salesServiceManagement/toDoList/index',
+						name: '售后工单',
+						url: `/pages/salesServiceManagement/workOrder/index`,
+						path: '/pages/salesServiceManagement/workOrder/index',
 						icon: 'icon-gongdanguanli',
 						badge: 0
 					},

+ 27 - 10
pages/maintenanceWorkorder/order/order.vue

@@ -36,7 +36,7 @@
 		post,
 		postJ
 	} from '@/utils/api.js'
-	let [page, size, isEnd] = [1, 10, true]
+	let [page, size, isEnd] = [1, 10, false]
 	export default {
 		components: {
 			OrderTask
@@ -165,12 +165,12 @@
 			},
 			getFirstList: function() {
 				page = 1
-				isEnd = true
+				isEnd = false
 				this.getList()
 			},
 			getMoreLists: function() {
 				//获取更多数据
-				page++
+				// page++
 				this.getList()
 			},
 			getList() {
@@ -185,8 +185,16 @@
 				}
 				getWorkOrderList(params)
 					.then(res => {
-						this.tabList[this.pickTabIndex].list = res.list
-						isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						// this.tabList[this.pickTabIndex].list = res.list
+						// this.tabList[this.pickTabIndex].list.push(res.list);
+						// isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						if (page === 1) {
+							this.tabList[this.pickTabIndex].list = res.list
+						} else {
+							this.tabList[this.pickTabIndex].list.push(...res.list)
+						}
+						page += 1
+						isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
 						uni.hideLoading()
 					})
 					.catch(() => {
@@ -194,11 +202,13 @@
 					})
 			},
 			changeChartsTab(index) {
-				this.pickTabIndex = index
+				this.pickTabIndex = index;
+				page = 1;
+				isEnd = false;
 				if (index == 4) {
-					this.getAList()
+					this.getAList();
 				} else {
-					this.getFirstList()
+					this.getFirstList();
 				}
 			},
 			async getAList() {
@@ -210,8 +220,15 @@
 						pageNum: page,
 						size
 					}).then(res => {
-						this.tabList[this.pickTabIndex].list = res.list
-						isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						// this.tabList[this.pickTabIndex].list = res.list
+						// isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						if (page === 1) {
+							this.tabList[this.pickTabIndex].list = res.list
+						} else {
+							this.tabList[this.pickTabIndex].list.push(...res.list)
+						}
+						page += 1
+						isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
 						uni.hideLoading()
 					})
 					.catch(() => {

+ 0 - 1
pages/salesServiceManagement/demandList/index.vue

@@ -94,7 +94,6 @@
 						btnType: 'primary',
 						type: '2',
 						pageUrl: '',
-
 					}, {
 						name: '修改',
 						apiName: 'edit',

+ 0 - 64
pages/salesServiceManagement/toDoList/components/schemeList.vue

@@ -1,64 +0,0 @@
-<template>
-	<view class="scheme">
-		<u-list class="listContent">
-			<view class="listBox-con">
-				<view class="listBox-bottom">
-					<view>项目:{{' '}}</view>
-					<view>编码:{{' '}}</view>
-					<view>名称:{{' '}}</view>
-					<view class="label-s">型号:{{' '}}</view>
-					<view class="label-s">规格:{{' '}}</view>
-					<view class="label-s">仓库:{{' '}}</view>
-					<view class="label-s">库存:{{' '}}</view>
-					<view class="label-s">数量:{{' '}}</view>
-					<view class="label-s">单位:{{' '}}</view>
-					<view class="label-s">单价(元):{{' '}}</view>
-					<view class="label-s">合计(元):{{' '}}</view>
-					<view>详细内容:{{' '}}</view>
-				</view>
-			</view>
-		</u-list> 
-		<view class="add" @click="add"> 
-			<u-icon name="plus" color="#fff"></u-icon>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		components:{},
-		data(){
-			return {}
-		},
-		computed:{},
-		onShow() {
-			
-		},
-		methods:{
-			add(){
-				uni.navigateTo({
-					url: `/pages/salesServiceManagement/toDoList/components/schemeAdd?obtain=仓库`
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
-	.scheme{
-		padding: 10rpx 20rpx;
-	}
-	.add {
-		width: 96rpx;
-		height: 96rpx;
-		border-radius: 48rpx;
-		background: #3c9cff;
-		position: fixed;
-		bottom: 100rpx;
-		right: 24rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-	}
-</style>

+ 1 - 1
pages/salesServiceManagement/toDoList/components/editPlan.vue → pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -136,7 +136,7 @@
 		onLoad(params) {
 			console.log(params, 'params')
 			this.type = params.type;
-			this.title = params.type == 'view' ? '计划详情' : '修改计划';
+			this.title = params.type == 'view' ? '工单详情' : '修改工单';
 			this.getDetails(params.id);
 		},
 		onUnload() {},

+ 0 - 0
pages/salesServiceManagement/toDoList/components/productScreen.vue → pages/salesServiceManagement/workOrder/components/productScreen.vue


+ 33 - 18
pages/salesServiceManagement/toDoList/components/schemeAdd.vue → pages/salesServiceManagement/workOrder/components/schemeAdd.vue

@@ -10,7 +10,6 @@
 				</uni-data-picker>
 			</u-cell>
 			<u-cell title="编码" arrow-direction="down">
-
 				<u--input v-if="form.typeId != '2'" slot="value" placeholder="请输入" border="surround"
 					v-model="form.code">
 				</u--input>
@@ -19,10 +18,10 @@
 				</view>
 			</u-cell>
 			<u-cell title="名称" arrow-direction="down">
-				<u--input @click.native="selectProduct" slot="value" placeholder="请选择" border="surround"
+				<u--input v-if="form.typeId == '2'" @click.native="selectProduct" slot="value" placeholder="请选择" border="surround"
 					v-model="form.name">
 				</u--input>
-				<!-- <u--input slot="value" placeholder="请输入" border="surround" v-model="form.name"></u--input> -->
+				<u--input slot="value" v-if="form.typeId != '2'" placeholder="请输入" border="surround" v-model="form.name"></u--input>
 			</u-cell>
 			<u-cell title="型号" arrow-direction="down">
 				<u--input slot="value" v-if="form.typeId != '2'" placeholder="请输入" border="surround"
@@ -40,10 +39,10 @@
 			</u-cell>
 			<u-cell title="仓库" arrow-direction="down">
 				<template>
-					<uni-data-picker v-model="form.warehouseId" slot="value" :clear-icon='false' placeholder="请选择"
+					<uni-data-picker v-if="form.typeId != '2'" v-model="form.warehouseId" slot="value" :clear-icon='false' placeholder="请选择"
 						:localdata="warehouseList" @change="warehouseOnchange">
 					</uni-data-picker>
-					<!-- <u--input slot="value" placeholder="请输入" border="surround" v-model="form.warehouseId"></u--input> -->
+					<u--input v-if="form.typeId == '2'" slot="value" placeholder="请输入" border="surround" v-model="form.warehouseName"></u--input>
 				</template>
 			</u-cell>
 			<u-cell title="库存" arrow-direction="down">
@@ -60,12 +59,12 @@
 				</view>
 			</u-cell>
 			<u-cell title="数量" arrow-direction="down">
-				<u--input slot="value" @input=" (val) =>inputChange(val,'totalCount')" placeholder="请输入" border="surround"
-					v-model="form.totalCount"></u--input>
+				<u--input slot="value" type="number" @input=" (val) =>inputChange(val,'totalCount')" placeholder="请输入"
+					border="surround" v-model="form.totalCount"></u--input>
 			</u-cell>
 			<u-cell title="单价" arrow-direction="down">
-				<u--input slot="value" @input="inputChange('singlePrice')" placeholder="请输入" border="surround"
-					v-model="form.singlePrice"></u--input>
+				<u--input type="number" slot="value" @input="(val) =>inputChange(val,'singlePrice')" placeholder="请输入"
+					border="surround" v-model="form.singlePrice"></u--input>
 			</u-cell>
 			<u-cell title="合计" arrow-direction="down">
 				<view class="labels" slot="value">
@@ -80,6 +79,7 @@
 				<u-button type="primary" @click="save" text="保存"></u-button>
 			</view>
 		</u-cell-group>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -120,6 +120,11 @@
 			}
 		},
 		onLoad(params) {
+			let data = JSON.parse(params.data);
+			if(data.code){
+				this.form = data;
+			}
+			console.log(data,'params')
 			this.obtain = params.obtain || '主数据'
 		},
 		created() {
@@ -129,7 +134,6 @@
 					...this.form,
 					...data
 				};
-				console.log(this.form, 'form 数据')
 				this.warehouseList = data.warehouseList.map((el) => {
 					el.text = el.warehouse_name;
 					el.value = el.warehouse_id;
@@ -158,8 +162,6 @@
 					singlePrice: '', // 单价
 					settlementPrice: '', // 合计
 				}
-				console.log(this.form, 'form -0-')
-				console.log(e, 'eee');
 			},
 			warehouseOnchange(e) {
 
@@ -170,13 +172,26 @@
 				})
 			},
 			save() {
-
+				if(!this.form.name){
+					this.$refs.uToast.show({
+						type: "warning",
+						message: "请填写名称",
+					})
+					return;
+				}
+				uni.$emit('updateInfo', this.form);
+				this.back();
+			},
+			inputChange(e, field) {
+				let value = e.replace(/[^\d]/g, '');
+				if (value.startsWith('0') && value.length > 1) {
+					value = value.replace(/^0+/, '');
+				}
+				this.form[field] = value;
+				let num1 = this.form.totalCount ? this.form.totalCount - 0 : 0;
+				let num2 = this.form.singlePrice ? this.form.singlePrice - 0 : 0;
+				this.form.settlementPrice = num1 * num2;
 			},
-			inputChange(val,field) {
-				console.log(val,'val')
-				this.form[field] = this.form[field].replace(/[^\d]/g, '').replace(/^0+/, '')
-				console.log(field, 'eeeee');
-			}
 		}
 	}
 </script>

+ 157 - 0
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -0,0 +1,157 @@
+<template>
+	<view class="scheme">
+		<u-list class="listContent">
+			<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
+				<myCard :item="item" @details="add('view',item)" @edit="add('edit',item,index)" :index="index+1"
+					:columns="columns" :btnList="btnList">
+				</myCard>
+			</view>
+		</u-list>
+		<view class="add" @click="add('add')">
+			<u-icon name="plus" color="#fff"></u-icon>
+		</view>
+	</view>
+</template>
+
+<script>
+	import myCard from '@/pages/saleManage/components/myCard.vue'
+	export default {
+		components: {
+			myCard
+		},
+		data() {
+			return {
+				columns: [
+					[{
+						label: '名称:',
+						prop: 'name',
+						type: 'title',
+						className: 'perce100',
+					}],
+					[{
+						label: '项目:',
+						prop: 'typeId',
+						formatter: (row) => {
+							let typeId = row.typeId;
+							return typeId == 1 ?
+								'工时' :
+								typeId == 2 ?
+								'零配件' :
+								typeId == 3 ?
+								'差旅费' : ''
+						}
+					}],
+					[{
+						label: '编码:',
+						prop: 'code'
+					}, ],
+					[{
+						label: '型号:',
+						prop: 'categoryModel'
+					}, {
+						label: '规格:',
+						prop: 'specification',
+					}],
+					[{
+						label: '仓库:',
+						prop: 'warehouseName'
+					}],
+					[{
+						label: '库存:',
+						prop: 'warehouseNum',
+					}, {
+						label: '单位:',
+						prop: 'measureUnit'
+					}],
+					[{
+						label: '数量:',
+						prop: 'totalCount',
+					}, {
+						label: '单价:',
+						prop: 'singlePrice'
+					}],
+					[{
+						label: '合计:',
+						prop: 'settlementPrice',
+					}],
+					[{
+						label: '详细内容:',
+						prop: 'content'
+					}],
+					[{
+						label: '操作:',
+						prop: 'action',
+						type: 'action',
+						className: 'perce100',
+					}],
+				],
+				btnList: [{
+						name: '详情',
+						apiName: 'details',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+					},
+					{
+						name: '修改',
+						apiName: 'edit',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+					}
+				],
+				tableList: []
+			}
+		},
+		computed: {},
+		created() {
+			uni.$off('updateInfo');
+			uni.$on('updateInfo', (data) => {
+				if(data.index || data.index == 0){
+					let index = data.index;
+					delete data.index;
+					this.$set(this.tableList,index,data);
+				}else{
+					this.tableList.push(data);
+				}
+				console.log(data, 'data 接收的数据')
+			})
+		},
+		onShow() {
+
+		},
+		methods: {
+			add(type, item = {}, index) {
+				if (type == 'edit') {
+					item.index = index;
+				}
+				let data = JSON.stringify(item);
+				uni.navigateTo({
+					url: `/pages/salesServiceManagement/toDoList/components/schemeAdd?obtain=仓库&type=${type}&data=${data}`
+				})
+			},
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
+
+	.scheme {
+		padding: 10rpx 20rpx;
+	}
+
+	.add {
+		width: 96rpx;
+		height: 96rpx;
+		border-radius: 48rpx;
+		background: #3c9cff;
+		position: fixed;
+		bottom: 100rpx;
+		right: 24rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+</style>

+ 0 - 1
pages/salesServiceManagement/toDoList/components/selectProduct.vue → pages/salesServiceManagement/workOrder/components/selectProduct.vue

@@ -230,7 +230,6 @@
 				// 	});
 				// }
 
-				console.log(list, 'list --')
 				// 单选
 				if (this.selectType == '1') {
 					uni.$emit('updateScheme', list[0]);

+ 68 - 8
pages/salesServiceManagement/toDoList/index.vue → pages/salesServiceManagement/workOrder/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="mainBox">
-		<uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="售后计划"
+		<uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="售后工单"
 			@clickLeft="back">
 		</uni-nav-bar>
 		<view class="top-wrapper">
@@ -11,6 +11,16 @@
 			<button class="search_btn" @click="doSearch">搜索</button>
 			<image class="menu_icon" src="~@/static/pda/menu.svg"></image>
 		</view>
+		<view class="">
+			<view class="tab_box rx-sc">
+				<view class="tab_item" v-for="(item,index) in tabList" :key="index"
+					:class="{active: pickTabIndex == item.value}">
+					<view @click="changeChartsTab(item.value)">
+						{{item.label}}
+					</view>
+				</view>
+			</view>
+		</view>
 		<view class="wrapper">
 			<u-list @scrolltolower="scrolltolower" class="listContent">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
@@ -20,16 +30,14 @@
 				</view>
 			</u-list>
 		</view>
-
 		<u-toast ref="uToast"></u-toast>
-
 	</view>
 </template>
 
 <script>
 	import {
-		getSalesPlan,
-	} from '@/api/salesServiceManagement/toDoList/index.js'
+		getSalesWorkOrder,
+	} from '@/api/salesServiceManagement/workOrder/index.js'
 	import myCard from '@/pages/saleManage/components/myCard.vue'
 	export default {
 		components: {
@@ -38,6 +46,29 @@
 
 		data() {
 			return {
+				tabList: [
+					{
+						value: 'all',
+						label: '全部',
+					},
+					{
+						value: '0',
+						label: '待执行',
+					},
+					{
+						value: '1',
+						label: '执行中',
+					},
+					{
+						value: '3',
+						label: '待验收',
+					},
+					{
+						value: '5',
+						label: '已完成',
+					},
+				],
+				pickTabIndex: 'all',
 				searchVal: '',
 				isEnd: false,
 				page: 1,
@@ -171,6 +202,10 @@
 		},
 
 		methods: {
+			changeChartsTab(value) {
+				this.pickTabIndex = value;
+				this.doSearch();
+			},
 			doSearch() {
 				this.isEnd = false
 				this.page = 1
@@ -187,9 +222,11 @@
 				let data = {
 					pageNum: this.page,
 					size: this.size,
-
 				}
-				getSalesPlan(data).then(res => {
+				if(this.pickTabIndex != 'all'){
+					data.orderStatus = this.pickTabIndex;
+				}
+				getSalesWorkOrder(data).then(res => {
 					if (this.page === 1) {
 						this.tableList = res.list
 					} else {
@@ -211,7 +248,7 @@
 			del(item) {
 
 			},
-			edit(type,id) {
+			edit(type, id) {
 				uni.navigateTo({
 					url: `/pages/salesServiceManagement/toDoList/components/editPlan?type=${type}&id=${id}`
 				})
@@ -257,4 +294,27 @@
 			margin-left: 14rpx;
 		}
 	}
+
+	.tab_box {
+		width: 100%;
+		height: 68rpx;
+		border-bottom: 1rpx solid #E1E1E1;
+
+		.tab_item {
+			height: 68rpx;
+			line-height: 68rpx;
+			padding: 0 20rpx;
+			font-size: 32rpx;
+			color: #979C9E;
+
+		}
+
+		.active {
+			box-sizing: border-box;
+			border-bottom: 6rpx solid $theme-color;
+			color: $theme-color;
+		}
+
+
+	}
 </style>