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

售后工单 转派 接收 售后需求 售后对象 故障增加拍照功能

jingshuyong 1 год назад
Родитель
Сommit
f8e634fb7c

+ 29 - 1
api/salesServiceManagement/workOrder/index.js

@@ -65,6 +65,17 @@ export async function getIdWarehouseList(params) {
 	return Promise.reject(new Error(res.message));
 }
 
+/**
+ * 查询机构列表
+ */
+export async function listOrganizations(params) {
+	const res = await get(Vue.prototype.apiUrl + `/main/group/getGroupList`, params);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+
 //申请备品备件
 export async function saveOrUpdateSalesWorkOrder(data) {
 	const res = await postJ(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/saveOrUpdate`, data);
@@ -106,4 +117,21 @@ export async function evaluateSave(data) {
 		return res.data;
 	}
 	return Promise.reject(new Error(res.message));
-}
+}
+
+//转派
+export async function reassignmentSalesWorkOrder(data) {
+	const res = await putJ(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/reassignment`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}
+//接收
+export async function receiveSalesWorkOrder(data) {
+	const res = await putJ(Vue.prototype.apiUrl + `/eom/afterSalesWorkOrder/receive`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}

+ 8 - 0
pages.json

@@ -2164,6 +2164,14 @@
 						"navigationStyle": "custom",
 						"navigationBarTextStyle": "white"
 					}
+				},
+				{
+					"path": "pages/salesServiceManagement/workOrder/components/forWork/transfer", 
+					"style": {
+						"navigationBarTitleText": "转派",
+						"navigationStyle": "custom",
+						"navigationBarTextStyle": "white"
+					}
 				}
 	],
 	"tabBar": {

+ 2 - 2
pages/maintenance/check/components/PreviewPhoto.vue

@@ -5,7 +5,7 @@
 			<view class="image-item" :style="{height:height || '180rpx'}" v-for="(item, index) in imageList"
 				:key="index">
 				<text class="imagedelete" @click="$emit('imagedelete',index)" v-if="type != 'view'">
-					x
+					<uni-icons type="closeempty" size="18" color="#ccc"></uni-icons>
 				</text>
 				<image :src="item" mode="aspectFill" lazy-load @click="previewImage(index)"></image>
 			</view>
@@ -79,7 +79,7 @@
 		font-size: 30rpx;
 		width: 44rpx;
 		height: 44rpx;
-		line-height: 40rpx;
+		line-height: 27rpx;
 		text-align: center;
 	}
 

+ 75 - 27
pages/salesServiceManagement/demandList/components/AfterSales.vue

@@ -18,20 +18,24 @@
 					class="delete" text="删除"></u-button>
 			</view>
 		</view>
-		<view v-for="(item, index) in faultDetails" :key="index" style="position: relative;">
+		<view v-for="(item, index) in faultDetails" :key="index" class="view_box" style="position: relative;">
 			<myCard @edit="goProblem('edit',index,item)" @del="delProblem(index)" :item="item" :index="index+1"
 				:columns="columns" :btnList="btnData">
+				<view class="images" slot="imageUrl">
+					<PreviewPhoto type="view" :imageList="imagesData(item)" />
+				</view>
 			</myCard>
 		</view>
 	</view>
-
 </template>
 
 <script>
+	import PreviewPhoto from "@/pages/maintenance/check/components/PreviewPhoto.vue"
 	import myCard from '@/pages/saleManage/components/myCard.vue'
 	export default {
 		components: {
-			myCard
+			myCard,
+			PreviewPhoto
 		},
 		props: {
 			itemList: {
@@ -88,6 +92,13 @@
 					}]
 				}
 				return this.btnList;
+			},
+			imagesData() {
+				return (item) => {
+					console.log(item, 'item')
+					let list = item.imageUrl || [];
+					return list;
+				}
 			}
 		},
 		data() {
@@ -126,7 +137,13 @@
 					[{
 						label: '维修过程:',
 						prop: 'maintenanceProcess',
-						className: 'perce100'
+					}],
+					[{
+						label: '图片:',
+						prop: 'maintenanceProcess',
+						slot: 'imageUrl',
+						className: 'perce100 image_url',
+
 					}],
 					[{
 						label: '操作:',
@@ -162,6 +179,7 @@
 				data,
 				index
 			}) => {
+				console.log(data, 'datadatadatadatadatadata')
 				if (type == 'add' || type == 'report') {
 					if (this.isReport) {
 						data.customize = '5'
@@ -208,11 +226,18 @@
 				});
 			},
 			// 现在只针对做 一 对 多 的 故障数据
-			goProblem(type, index, obj) {
+			goProblem(type, index, obj = {}) {
 				let str = this.type == 'report' ? 'report' : '';
-				let data = obj ? JSON.stringify(obj) : '';
+				let resD = JSON.parse(JSON.stringify(obj));
+				let arr = [];
+				if (resD.imageUrl && resD.imageUrl.length > 0) {
+					arr = JSON.stringify(resD.imageUrl);
+					delete resD.imageUrl;
+				}
+				console.log(arr,'arr ----')
+				let data = JSON.stringify(resD);
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&index=${index}&data=${data}&str=${str}`
+					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&index=${index}&data=${data}&str=${str}&arr=${encodeURIComponent(arr)}`
 				})
 			},
 			addFault() {
@@ -234,30 +259,53 @@
 </script>
 
 <style lang="scss" scoped>
-	.sales_info {
-		padding: 8px 16px;
-		font-size: 13px;
-		font-style: normal;
-		font-weight: 400;
-		line-height: 22px;
-		word-wrap: break-word;
-		border-bottom: 6rpx solid #E1E1E1;
-
-		.action {
-			display: flex;
+	.after_sales {
+		.sales_info {
+			padding: 8px 16px;
+			font-size: 13px;
+			font-style: normal;
+			font-weight: 400;
 			line-height: 22px;
+			word-wrap: break-word;
+			border-bottom: 6rpx solid #E1E1E1;
 
-			.text {
-				margin-right: 12rpx;
+			.action {
+				display: flex;
+				line-height: 22px;
+
+				.text {
+					margin-right: 12rpx;
+				}
+
+				/deep/ .u-button {
+					width: 100rpx;
+					font-size: 26rpx;
+					margin-left: 10rpx;
+					margin-right: 0rpx;
+					background: #157a2c;
+					color: #fff !important;
+				}
 			}
+		}
 
-			/deep/ .u-button {
-				width: 100rpx;
-				font-size: 26rpx;
-				margin-left: 10rpx;
-				margin-right: 0rpx;
-				background: #157a2c;
-				color: #fff !important;
+		.view_box {
+			/deep/ .card_box {
+				.image_url {
+					width: 110%;
+					.item_one {
+						.text {
+							display: block;
+						}
+					}
+				}
+			}
+		}
+	}
+
+	.card_box {
+		.item_box {
+			.text {
+				display: block !important;
 			}
 		}
 	}

+ 33 - 11
pages/salesServiceManagement/demandList/components/faultAdd.vue

@@ -19,7 +19,9 @@
 			<u-cell title="维修过程" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="form.maintenanceProcess"></u--input>
 			</u-cell>
-
+			<view class="photo">
+				<PhotoBtn :imageUrl="form.imageUrl" ref="photoRef" />
+			</view>
 			<view class="footerButton">
 				<u-button type="default" text="返回" @click="back"></u-button>
 				<u-button type="primary" @click="save" text="保存"></u-button>
@@ -30,8 +32,11 @@
 </template>
 
 <script>
+	import PhotoBtn from '@/pages/salesServiceManagement/workOrder/components/forWork/PhotoBtn.vue';
 	export default {
-		components: {},
+		components: {
+			PhotoBtn
+		},
 		data() {
 			return {
 				form: {
@@ -39,10 +44,11 @@
 					faultPhenomenon: '',
 					faultReason: '',
 					maintenanceProcess: '',
+					imageUrl: []
 				},
 				type: '',
-				infoIdx:'',
-				str:"",
+				infoIdx: '',
+				str: "",
 				typeOptions: [{
 						text: '维修',
 						value: '1'
@@ -62,10 +68,17 @@
 		async onLoad(data) {
 			this.infoIdx = data.index;
 			this.str = data.str;
-			this.type = data.type
+			this.type = data.type;
+
 			if (data.data) {
-				this.form = JSON.parse(data.data)
+				this.form = JSON.parse(data.data);
 			}
+			console.log(data.arr,'123')
+			if(data.arr){
+				const arr = JSON.parse(decodeURIComponent(data.arr));
+				this.form.imageUrl = arr
+			}
+			
 		},
 		methods: {
 			save() {
@@ -83,7 +96,7 @@
 					})
 					return;
 				}
-				if(this.str == 'report'){
+				if (this.str == 'report') {
 					if (!this.form.faultReason) {
 						this.$refs.uToast.show({
 							type: "warning",
@@ -99,14 +112,16 @@
 						return
 					}
 				}
+				let data = JSON.parse(JSON.stringify(this.form));
+				data.imageUrl = this.$refs.photoRef.getImageData();
 				uni.$emit('updateFaultList', {
-				data: this.form,
-				type: this.type,
-				index:this.infoIdx
+					data: data,
+					type: this.type,
+					index: this.infoIdx
 				})
 				this.back()
 			},
-			sourceCodeOnchange(e){
+			sourceCodeOnchange(e) {
 				console.log(e);
 			}
 
@@ -122,6 +137,13 @@
 
 	.mainBox {
 		padding-bottom: 84rpx;
+
+		.photo {
+			box-sizing: border-box;
+			width: calc(100% - 28rpx);
+			padding: 20rpx 16rpx 10rpx 0;
+			margin-left: 28rpx;
+		}
 	}
 
 	.footerButton {

+ 3 - 3
pages/salesServiceManagement/workOrder/components/accessory.vue

@@ -154,9 +154,9 @@
 					groupId: deptCode
 				}).then(data => {
 					this.userList = data.list.map(item => {
-						item.text = item.name
-						item.value = item.id
-						return item
+						item.text = item.name;
+						item.value = item.id;
+						return item;
 					})
 				})
 			},

+ 2 - 2
pages/salesServiceManagement/workOrder/components/accessoryList.vue

@@ -122,10 +122,10 @@
 			uni.$on('updateAddessory', (data) => {
 				let obj = {}
 				this.tableList.map((el) => {
-					obj[el.id] = true
+					obj[el.categoryCode] = true
 				});
 				data.map((el) => {
-					if (!obj[el.id]) {
+					if (!obj[el.categoryCode]) {
 						this.tableList.push(el);
 					}
 				})

+ 22 - 15
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="">
 		<uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back"
-			:title="title" @clickLeft="back">
+			:title="title" @clickLeft="backAdd">
 		</uni-nav-bar>
 		<view class="scrollable-tabs" ref="tabsContainer">
 			<u-subsection :list="tabs" :current="currentIndex" @change="(e)=>sectionChange(e)"></u-subsection>
@@ -16,7 +16,7 @@
 		<SchemeList ref="schemeRef" v-show="currentValue == 7" :type='type' :itemList="costListVOS" />
 		<ReportInfo ref="reportInfoRef" :form="reportForm" v-show="currentValue == 1" />
 		<view :class=" type == 'report' ? 'footerButton footer_button':'footerButton'" v-if="isDisable">
-			<u-button type="default" text="返回" @click="back"></u-button>
+			<u-button type="default" text="返回" @click="backAdd"></u-button>
 			<u-button type="primary" text="报工" v-if="type == 'report'" @click="save('report')"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
 		</view>
@@ -274,19 +274,22 @@
 				data.salesDemandUpdatePO.contractInfo = contractInfo;
 				data.salesDemandUpdatePO.contactInfoVOS = contactInfoVOS;
 				// 处理报工信息的数据
-				let reportForm = this.$refs.reportInfoRef.getReportForm();
-				if (!reportForm.acceptTime || !reportForm.finishTime) {
-					this.currentValue = 1;
-					this.$refs.uToast.show({
-						type: "warning",
-						message: "请选择开始时间跟结束时间",
-					})
-					return false;
-				}
-				data = {
-					...data,
-					...reportForm
+				if (this.type == 'report') {
+					let reportForm = this.$refs.reportInfoRef.getReportForm();
+					if (!reportForm.acceptTime || !reportForm.finishTime) {
+						this.currentValue = 1;
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择开始时间跟结束时间",
+						})
+						return false;
+					}
+					data = {
+						...data,
+						...reportForm
+					}
 				}
+
 				// 报工进来 保存或者报工 数据
 				if (this.type == 'report' && productDetail[0].faultDetails.length > 0) {
 					let list = this.$refs.accessoryRef.getTabData() || [];
@@ -324,11 +327,15 @@
 						message: "操作成功",
 					})
 					uni.hideLoading();
-					this.back();
+					this.backAdd();
 				}).catch(e => {
 					uni.hideLoading();
 				})
 			},
+			//返回添加页
+			backAdd() {
+				uni.navigateBack();
+			},
 			// confirm(data, name) {
 			// 	this.form.executeGroupName = name
 			// 	this.form.executeGroupId = data[0]

+ 136 - 0
pages/salesServiceManagement/workOrder/components/forWork/PhotoBtn.vue

@@ -0,0 +1,136 @@
+<template>
+	<view class="gzms-wrap">
+		<view class="photo_btn" @click="chooseImage">拍照</view>
+		<view class="photo_list">
+			<PreviewPhoto type="add" @imagedelete="imagedelete" :imageList="imageList" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import PreviewPhoto from '@/pages/maintenance/check/components/PreviewPhoto.vue'
+	export default {
+		components: {
+			PreviewPhoto
+		},
+		props: {
+			imageUrl: {
+				type: Array,
+				default: () => []
+			}
+		},
+		watch: {
+			imageUrl: {
+				handler(newVal) {
+					let arr = JSON.parse(JSON.stringify(newVal));
+					this.imageList = arr;
+				},
+				deep: true,
+				immediate: true
+			}
+		},
+		data() {
+			return {
+				imageList: [],
+			}
+		},
+		methods: {
+			imagedelete(index) {
+				this.imageList.splice(index, 1);
+			},
+			getImageData() {
+				return this.imageList || [];
+			},
+			// *** 新增拍照
+			chooseImage() {
+				const _this = this
+				if (_this.imageList.length >= 9) {
+					_this.$refs.uToast.show({
+						type: "warning",
+						message: "最多上传9张照片",
+					})
+					return
+				}
+				uni.chooseImage({
+					count: 9, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera'], //从相册选择
+					success: function(res) {
+						uni.showLoading({
+							title: '上传中'
+						})
+
+						_this.uploadFile(res.tempFilePaths).then(res => {
+							res.forEach(item => {
+								let fileNames = item.storePath.split('/')
+								let url = _this.apiUrl +
+									'/main/file/getFile?objectName=' + item.storePath +
+									'&fullfilename=' + fileNames[fileNames.length -
+										1]
+								let images = _this.imageList;
+								// 不能存储超过 9 张
+								if (images.length < 9) {
+									_this.imageList.push(url);
+								}
+							})
+							uni.hideLoading();
+						}).catch((error) => {
+							console.log(error, 'errorerrorerror')
+							uni.hideLoading();
+						})
+					}
+				});
+			},
+			uploadFile(list) {
+				let PromiseAll = []
+				const apiUrl = this.apiUrl
+				const token = uni.getStorageSync("token"); //取存本地的token
+				list.forEach(item => {
+					PromiseAll.push(
+						new Promise((resolve, reject) => {
+							uni.uploadFile({
+								url: apiUrl + '/main/file/upload',
+								filePath: item,
+								name: 'multiPartFile',
+								header: {
+									authorization: token
+								},
+								success: (uploadFileRes) => {
+									if (uploadFileRes.statusCode == 500) {
+										uni.hideLoading();
+										return;
+									}
+
+									let data = JSON.parse(uploadFileRes.data)
+									resolve(data.data)
+								},
+								fail: (err) => {
+									console.log(err, '123456');
+									// 上传请求本身失败(如网络问题等),直接 reject
+									uni.hideLoading();
+									reject(err)
+								}
+							});
+						}),
+					)
+				})
+				return Promise.all(PromiseAll)
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.photo_btn {
+		background-color: #157a2c;
+		width: 140rpx;
+		height: 60rpx;
+		line-height: 60rpx;
+		font-size: 24rpx;
+		color: #fff;
+		text-align: center;
+		border-radius: 8rpx;
+		margin-bottom: 12rpx;
+		display: inline-block;
+	}
+</style>

+ 14 - 4
pages/salesServiceManagement/workOrder/components/forWork/checkAndAccept.vue

@@ -19,6 +19,7 @@
 					<uni-forms-item label="验收意见" name="accepterRemark">
 						<textarea class="textarea" type="text" v-model="formData.accepterRemark" placeholder="验收意见" />
 					</uni-forms-item>
+					<PhotoBtn ref="photoRef" />
 				</uni-forms>
 			</view>
 			<u-toast ref="uToast"></u-toast>
@@ -27,11 +28,15 @@
 </template>
 
 <script>
+	import PhotoBtn from './PhotoBtn.vue';
 	import {
 		getSalesWorkOrderById,
 		checkAndAccept
 	} from '@/api/salesServiceManagement/workOrder/index.js'
 	export default {
+		components: {
+			PhotoBtn
+		},
 		data() {
 			return {
 				acceptShow: false,
@@ -57,7 +62,7 @@
 		methods: {
 			open(id) {
 				this.acceptShow = true;
-				this.$refs.popup.open()
+				this.$refs.popup.open();
 				this.formData = {
 					accepterUserId: '',
 					accepterUserName: '',
@@ -97,10 +102,15 @@
 					})
 					return;
 				}
+				let accepterImageUrl = this.$refs.photoRef.getImageData();
+				let data = {
+					...this.formData,
+					accepterImageUrl
+				}
 				uni.showLoading({
 					title: '加载中'
 				})
-				checkAndAccept(this.formData).then((res) => {
+				checkAndAccept(data).then((res) => {
 					this.$emit('getList');
 					this.close();
 					uni.hideLoading();
@@ -109,7 +119,7 @@
 				})
 			},
 			close() {
-				this.$refs.popup.close()
+				this.$refs.popup.close();
 			}
 		}
 	}
@@ -117,7 +127,7 @@
 
 <style scoped lang="scss">
 	.select-container {
-		min-height: 50vh;
+		min-height: 60vh;
 
 		.title {
 			display: flex;

+ 239 - 15
pages/salesServiceManagement/workOrder/components/forWork/transfer.vue

@@ -1,35 +1,153 @@
 <template>
 	<view class="mainBox">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="转派" @clickLeft="backAdd">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="转派工单" @clickLeft="backAdd">
 			<template slot="right">
 				<u-button type="success" size="small" class="u-reset-button" @click="classification"
-					text="选择分类"></u-button>
+					text="选择部门"></u-button>
 			</template>
 		</uni-nav-bar>
 		<view class="top-wrapper">
+			<uni-section>
+				<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="搜索名称">
+				</uni-easyinput>
+			</uni-section>
 			<button class="search_btn" @click="getData()">搜索</button>
 			<image class="menu_icon" src="~@/static/pda/menu.svg"></image>
 		</view>
-
+		<view class="wrapper">
+			<u-list @scrolltolower="scrolltolower" class="listContent">
+				<checkbox-group v-for="(item, index) in tableList" :key="index"
+					@change="e => selectVal(e, item, index)">
+					<label>
+						<view class="listBox">
+							<view class="listBox-sel">
+								<checkbox :value="item.id" color="#fff" :checked="item.checked" />
+							</view>
+							<myCard :columns="columns" :item="item" :index="index+1">
+							</myCard>
+						</view>
+					</label>
+				</checkbox-group>
+				<u-empty class="noDate" style="margin-top: 20vh" v-if="!tableList.length"></u-empty>
+			</u-list>
+		</view>
+		<view class="footerButton">
+			<u-button type="default" text="返回" @click="backAdd"></u-button>
+			<u-button type="primary" @click="save" text="保存"></u-button>
+		</view>
 		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
 			:selectedData="selectedData" :localdata="classificationList" valueKey="id" textKey="name"
 			childrenKey="children" />
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	import myCard from '@/pages/saleManage/components/myCard.vue'
+	import {
+		treeByPid
+	} from '@/api/pda/workOrder.js'
+	import {
+		listOrganizations,
+		reassignmentSalesWorkOrder
+	} from '@/api/salesServiceManagement/workOrder/index.js'
+	import {
+		toTreeData
+	} from '@/utils/utils.js'
+	import {
+		getUserPage
+	} from '@/api/common.js'
 	export default {
+		components: {
+			myCard,
+		},
 		data() {
 			return {
 				selectedData: ['1'],
+				classificationList: [],
+				searchVal: '',
+				isEnd: false,
+				pageNum: 1,
+				categoryLevelId: '',
+				tableList: [],
+				columns: [
+					[{
+						label: '姓名:',
+						prop: 'name',
+						type: 'title',
+						className: 'perce100',
+					}],
+					[{
+						label: '工号:',
+						prop: 'jobNumber'
+					}],
+					[{
+						label: '电话:',
+						prop: 'phone'
+					}],
+					[{
+						label: '部门:',
+						prop: 'groupName'
+					}],
+				],
+				checkData: {},
+				id: ''
 			}
 		},
 		onLoad(params) {
-
+			this.id = params.id;
+		},
+		created() {
+			this.getTreeList();
 		},
 		methods: {
 			getData() {
-
+				this.isEnd = false;
+				this.pageNum = 1;
+				this.tableList = [];
+				this.getList();
+			},
+			async getList() {
+				if (this.isEnd) {
+					return
+				}
+				uni.showLoading({
+					title: '加载中'
+				})
+				try {
+					let params = {
+						groupId: this.categoryLevelId,
+						name: this.searchVal,
+						pageNum: this.pageNum,
+						size: 15
+					}
+					let res = await getUserPage(params);
+					if (this.pageNum == 1) {
+						this.tableList = res.list;
+					} else {
+						this.tableList.push(...res.list);
+					}
+					this.pageNum += 1;
+					this.isEnd = this.tableList.length >= res.count;
+					uni.hideLoading();
+				} catch (error) {
+					uni.hideLoading();
+				}
+			},
+			selectVal(e, val, index) {
+				this.$set(this.tableList[index], 'checked', !this.tableList[index].checked);
+				this.tableList.forEach((item, i) => {
+					if (item.id != val.id) {
+						this.$set(this.tableList[i], 'checked', false)
+					}
+				});
+				this.checkData = val.checked ? val : {};
+			},
+			scrolltolower() {
+				if (this.isEnd) {
+					return;
+				}
+				this.getList();
 			},
 			//返回添加页
 			backAdd() {
@@ -38,22 +156,128 @@
 			classification() {
 				this.$refs.treePicker._show();
 			},
-			confirm(id, name, rootCategoryLevelId) {
+			confirm(id) {
 				this.categoryLevelId = id;
-				this.tableList = [];
 				this.getData();
 			},
-			getTreeList() {
-				treeByPid({
-					ids: [1]
-				}).then(res => {
-					this.classificationList = res;
-					this.confirm(res[0].id, res[0].name)
-				})
+			async getTreeList() {
+				const data = await listOrganizations({});
+				let treeList = toTreeData({
+					data: data || [],
+					idField: 'id',
+					parentIdField: 'parentId'
+				});
+				this.classificationList = treeList;
+				this.confirm(treeList[0].id);
 			},
+			async save() {
+				if (!this.checkData.id) {
+					this.$refs.uToast.show({
+						type: "warning",
+						message: "请选择转派人员",
+					})
+					return;
+				}
+				try {
+					uni.showLoading({
+						title: '加载中'
+					})
+					let data = {
+						id: this.id,
+						executeGroupId: this.checkData.groupId,
+						executeGroupName: this.checkData.groupName,
+						executeUserId: this.checkData.id,
+						executeUserName: this.checkData.name,
+					}
+					const res = await reassignmentSalesWorkOrder(data);
+					if (!res) return;
+					this.$refs.uToast.show({
+						type: "success",
+						message: "操作成功",
+					})
+					this.backAdd();
+					uni.hideLoading();
+
+				} catch (error) {
+					uni.hideLoading();
+				}
+			}
 		}
 	}
 </script>
 
-<style>
+<style scoped lang="scss">
+	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
+
+	.mainBox {
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.wrapper {
+			// flex: 1;
+			height: calc(100vh - 250rpx);
+			overflow: hidden;
+		}
+
+		.footerButton {
+			width: 100%;
+			height: 84rpx;
+			display: flex;
+			position: fixed;
+			bottom: 0;
+			z-index: 10;
+
+			/deep/.u-button {
+				height: 100%;
+			}
+
+			>view {
+				flex: 1;
+
+			}
+		}
+
+		.top-wrapper {
+			background-color: #fff;
+			display: flex;
+			width: 750rpx;
+			height: 88rpx;
+			padding: 16rpx 32rpx;
+			align-items: center;
+			gap: 16rpx;
+
+			/deep/.uni-section {
+				margin-top: 0px;
+			}
+
+			/deep/.uni-section-header {
+				padding: 0px;
+
+			}
+
+			.search_btn {
+				width: 120rpx;
+				height: 70rpx;
+				line-height: 70rpx;
+				padding: 0 24rpx;
+				background: $theme-color;
+				font-size: 32rpx;
+				color: #fff;
+				margin: 0;
+				margin-left: 26rpx;
+			}
+
+			.menu_icon {
+				width: 44rpx;
+				height: 44rpx;
+				margin-left: 14rpx;
+			}
+		}
+
+		.card_box {
+			padding: 0;
+			border-bottom: none;
+		}
+	}
 </style>

+ 0 - 89
pages/salesServiceManagement/workOrder/components/productScreen.vue

@@ -1,89 +0,0 @@
-<template>
-	<view>
-		<u-popup :show="show" closeOnClickOverlay mode="top" @close="closePopup">
-			<view class="search_list">
-				<u-form labelPosition="left" :model="form" labelWidth="180" labelAlign="left" class="baseForm">
-					<u-form-item label="牌号:" class="item-form" borderBottom prop="assetType">
-						<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.brandNum" placeholder="请输入">
-						</uni-easyinput>
-					</u-form-item>
-					<u-form-item label="物品编码:" class="item-form" borderBottom prop="assetType">
-						<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.categoryCode"
-							placeholder="请输入">
-						</uni-easyinput>
-					</u-form-item>
-					<u-form-item label="物品名称:" class="item-form" borderBottom prop="assetType">
-						<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.contactName"
-							placeholder="请输入">
-						</uni-easyinput>
-					</u-form-item>
-				</u-form>
-			</view>
-			<view class="operate_box rx-bc">
-				<u-button size="small" class="u-reset-button" @click="reset">
-					重置
-				</u-button>
-				<u-button type="success" size="small" class="u-reset-button" @click="submit">
-					确定
-				</u-button>
-			</view>
-		</u-popup>
-	</view>
-</template>
-
-<script>
-	export default {
-		components: {},
-		props: [],
-		data() {
-			return {
-				form: {
-					brandNum: "",
-					categoryCode: "",
-					categoryName: ""
-				},
-				show: false,
-			}
-		},
-		methods: {
-			open() {
-				this.show = true;
-			},
-			closePopup() {
-
-			},
-			reset() {
-				this.form = {
-					brandNum: "",
-					categoryCode: "",
-					contactName: ""
-				}
-				this.submit();
-			},
-			submit() {
-				this.$emit('succeed',this.form);
-				this.show = false;
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.search_list {
-		padding: 0 20rpx;
-	}
-	
-	.operate_box {
-		padding: 10rpx 32rpx;
-	
-		/deep/ .u-button {
-			width: 40%;
-		}
-	}
-	
-	.item-form{
-		/deep/ .u-form-item__body__left__content__label{
-			font-size: 28rpx;
-		}
-	}
-</style>

+ 4 - 0
pages/salesServiceManagement/workOrder/components/reportInfo.vue

@@ -67,7 +67,11 @@
 		},
 		methods: {
 			getReportForm() {
+				
 				let data = JSON.parse(JSON.stringify(this.reportForm));
+				if(!data.acceptTime || !data.finishTime){
+					return data;
+				}
 				let arr1 = data.acceptTime.split(' ')
 				let arr2 = data.finishTime.split(' ')
 				if (arr1.length == 2 && !arr1[1]) {

+ 1 - 0
pages/salesServiceManagement/workOrder/components/schemeAdd.vue

@@ -86,6 +86,7 @@
 </template>
 
 <script>
+	import { getIdWarehouseList } from '@/api/salesServiceManagement/workOrder/index.js'
 	export default {
 		data() {
 			return {

+ 145 - 21
pages/salesServiceManagement/workOrder/components/selectProduct.vue

@@ -8,8 +8,13 @@
 			</template>
 		</uni-nav-bar>
 		<view class="top-wrapper">
-			<uni-section class="dimension">
-				<uni-data-select v-model="dimension" :clear="false" :localdata="dimensionList"></uni-data-select>
+			<uni-section class="dimension" v-if="obtain == '仓库'">
+				<uni-data-select @change="(e)=>onchange(e)" v-model="dimension" :clear="false"
+					:localdata="dimensionList"></uni-data-select>
+			</uni-section>
+			<uni-section v-else>
+				<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchKey" placeholder="关键字">
+				</uni-easyinput>
 			</uni-section>
 			<button class="search_btn" @click="getData({})">搜索</button>
 			<image class="menu_icon" @click="handleSearch" src="~@/static/pda/menu.svg"></image>
@@ -26,15 +31,91 @@
 							</view>
 							<view class="listBox-con">
 								<view class="listBox-bottom">
-									<view> <text>编码:</text> <text class="value">{{ item.code }}</text> </view>
-									<view> <text>名称:</text> <text class="value">{{ item.name }}</text> </view>
-									<view> <text>型号:</text> <text class="value">{{ item.modelType }}</text> </view>
-									<view> <text>规格:</text> <text class="value">{{ item.specification }}</text> </view>
-									<view> <text>计量单位:</text> <text class="value">{{ item.measuringUnit }}</text>
+									<view>
+										<text>{{!fieldShow?'编码':'物品编码'}}:</text>
+										<text class="value">{{ item.code }}</text>
+									</view>
+									<view>
+										<text>{{!fieldShow?'名称':'物品名称'}}:</text>
+										<text class="value">{{ item.name }}</text>
+									</view>
+									<view class="label-s">
+										<text>牌号:</text>
+										<text class="value">{{ item.brandNum }}</text>
+									</view>
+									<view class="label-s">
+										<text>型号:</text>
+										<text class="value">{{ item.categoryModel }}</text>
+									</view>
+									<view>
+										<text>规格:</text>
+										<text class="value">{{ item.specification }}</text>
+									</view>
+									<view class="label-s" v-if="dimension == 3">
+										<text>批次号:</text>
+										<text class="value">{{ item.batchNo }}</text>
+									</view>
+									<view class="label-s">
+										<text>级别:</text>
+										<text class="value">{{ item.level }}</text>
+									</view>
+									<view class="label-s" v-if="fieldShow">
+										<text>计量数量:</text>
+										<text class="value">{{ item.measureQuantity }}</text>
+									</view>
+									<view class="label-s" v-if="fieldShow">
+										<text>计量单位:</text>
+										<text class="value">{{ item.measureUnit }}</text>
+									</view>
+									<view class="label-s">
+										<text>重量:</text>
+										<text class="value">{{ item.weight }}</text>
+									</view>
+									<view class="label-s">
+										<text>重量单位:</text>
+										<text class="value">{{ item.weightUnit }}</text>
+									</view>
+									<view class="label-s">
+										<text>分类:</text>
+										<text class="value">{{ item.categoryLevelPath }}</text>
+									</view>
+									<view v-if="dimension == 3">
+										<text>包装编码:</text>
+										<text class="value">{{ item.packageNo }}</text>
+									</view>
+									<view class="label-s" v-if="dimension == 3">
+										<text>包装数量:</text>
+										<text class="value">{{ item.packingQuantity }}</text>
+									</view>
+									<view class="label-s" v-if="dimension == 3">
+										<text>包装单位:</text>
+										<text class="value">{{ item.packingUnit }}</text>
+									</view>
+									<view v-if="dimension == 3 || dimension == 4">
+										<text>发货条码:</text>
+										<text class="value">{{ item.barcodes }}</text>
+									</view>
+									<view v-if="dimension == 4">
+										<text>物料编码:</text>
+										<text class="value">{{ item.no }}</text>
+									</view>
+									<view v-if="dimension == 3 || dimension == 4">
+										<text>物料代号:</text>
+										<text class="value">{{ item.materielDesignation }}</text>
+									</view>
+									<view v-if="dimension == 3 || dimension == 4">
+										<text>客户代号:</text>
+										<text class="value">{{ item.clientCode }}</text>
 									</view>
-									<view> <text>重量单位:</text> <text class="value">{{ item.weightUnit }}</text> </view>
-									<view> <text>分类:</text> <text class="value">{{ item.categoryLevelPath }}</text>
+									<view v-if="dimension == 3 || dimension == 4">
+										<text>刻码:</text>
+										<text class="value">{{ item.engrave }}</text>
 									</view>
+									<view v-if="dimension == 3 || dimension == 4">
+										<text>仓库:</text>
+										<text class="value">{{ item.warehouseName }}</text>
+									</view>
+
 								</view>
 							</view>
 						</view>
@@ -51,13 +132,13 @@
 				<view class="selBtn">选择( {{ checkListLen }} )</view>
 			</u-button>
 		</view>
-		<prodctScreen ref="screen" @succeed="getData" />
+		<screenAccess :dataSources="obtain =='主数据'?'1':'0'" ref="screen" @succeed="getData" />
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
-	import prodctScreen from './productScreen.vue'
+	import screenAccess from './screenAccess.vue'
 	import {
 		getInventoryTotalAPI
 	} from '@/api/wms/index.js'
@@ -70,7 +151,13 @@
 		getInventoryDetails,
 		getMaterielDetails,
 	} from '@/api/repair'
+	import {
+		getList
+	} from '@/api/classifyManage/itemInformation.js'
 	export default {
+		components: {
+			screenAccess
+		},
 		data() {
 			return {
 				tableList: [],
@@ -83,7 +170,7 @@
 				isEnd: false,
 				detailsData: {},
 				checkedkList: [],
-				searchVal: '',
+				searchKey: '',
 				selectType: '1', // 1 单选 2 多选
 				dimensionList: [{
 						value: '4',
@@ -104,17 +191,18 @@
 				]
 			}
 		},
-		components: {
-			prodctScreen
-		},
 		computed: {
 			checkListLen() {
 				return this.checkedkList.length;
 			},
+			// 物品字段
+			fieldShow() {
+				return this.obtain == '仓库';
+			},
 		},
 		onLoad(params) {
 			this.obtain = params.obtain || '主数据';
-			this.selectType = params.selectType || '1'
+			this.selectType = params.selectType || '1';
 		},
 		onShow() {
 			this.getTreeList();
@@ -123,22 +211,26 @@
 		methods: {
 			// 获取页面数据
 			getData(parameter = {}) {
-				// this.isEnd = false
-				// this.pageNum = 1
 				let data = parameter;
 				if (!data.scroll) {
 					this.isEnd = false;
 					this.pageNum = 1;
-					this.accessoriesList = [];
+					this.tableList = [];
 				} else {
 					delete data.scroll;
 				}
 				if (this.obtain == '仓库') {
 					this.changeDimension(this.dimension, parameter);
 				} else {
-
+					let obj = this.$refs.screen.mainForm || {};
+					// 查询主数据
+					this.warehouseData(obj);
 				}
 			},
+			onchange(e) {
+				this.dimension = e;
+				this.getData({});
+			},
 			handleSearch() {
 				this.$refs.screen.open();
 			},
@@ -146,6 +238,38 @@
 			backAdd() {
 				uni.navigateBack();
 			},
+			// 主数据
+			warehouseData(data = {}) {
+				let form = {
+					...data,
+					searchKey: this.searchKey,
+					pageNum: this.pageNum,
+					size: 15,
+					categoryLevelId: this.categoryLevelId
+				}
+				uni.showLoading({
+					title: '加载中'
+				})
+				getList(form).then((res) => {
+					let list = res.list.map((el) => {
+						el.categoryModel = el.modelType;
+						el.categoryName = el.name;
+						el.categoryCode = el.code;
+						return el;
+					});
+					if (this.pageNum == 1) {
+						this.tableList = list;
+					} else {
+						this.tableList.push(...list);
+					}
+					this.pageNum += 1
+					this.isEnd = this.tableList.length >= res.count;
+					uni.hideLoading();
+				}).then((e) => {
+					uni.hideLoading();
+				})
+
+			},
 			// 仓库数据
 			changeDimension(dimension, parameter = {}) {
 				if (this.isEnd) {
@@ -178,7 +302,7 @@
 						} else {
 							this.tableList.push(...list);
 						}
-						this.pageNum += 1
+						this.pageNum += 1;
 						this.isEnd = this.tableList.length >= res.count;
 						uni.hideLoading();
 						resolve();

+ 48 - 12
pages/salesServiceManagement/workOrder/index.vue

@@ -25,15 +25,15 @@
 			<u-list @scrolltolower="scrolltolower" class="listContent" style="height: auto;">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
 					<myCard @addSpareItems="addSpareItems(item.id)" @report="edit('report',item.id)"
-						@edit="edit('edit',item.id)" @details="edit('view',item.id)" 
-						@checkAndAccept="checkAndAccept(item)" @evaluate="evaluate(item)"
-						:item="item" :index="index+1" :columns="columns" :btnList="btnList">
+						@edit="edit('edit',item.id)" @details="edit('view',item.id)" @handleAudit="handleAudit(item)"
+						@checkAndAccept="checkAndAccept(item)" @evaluate="evaluate(item)" :item="item" :index="index+1"
+						@receive="receive(item)" :columns="columns" :btnList="btnList">
 					</myCard>
 				</view>
 			</u-list>
 		</view>
 		<CheckAndAccept ref="acceptRef" @getList='doSearch' />
-		<Evaluate ref="evaluateRef"  @getList='doSearch' />
+		<Evaluate ref="evaluateRef" @getList='doSearch' />
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -41,6 +41,7 @@
 <script>
 	import {
 		getSalesWorkOrder,
+		receiveSalesWorkOrder
 	} from '@/api/salesServiceManagement/workOrder/index.js'
 	import myCard from '@/pages/saleManage/components/myCard.vue'
 	import CheckAndAccept from './components/forWork/checkAndAccept.vue'
@@ -122,7 +123,7 @@
 					[{
 						label: '计划单号:',
 						prop: 'planCode'
-					}, ],
+					}],
 					[{
 						label: '计划名称:',
 						prop: 'planName',
@@ -229,6 +230,18 @@
 							key: 'orderStatus',
 							value: [1, 6],
 						}],
+					}, {
+						name: '接收',
+						apiName: 'receive',
+						btnType: 'error ',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'orderStatus',
+							value: [0],
+						}],
 					}, {
 						name: '转派',
 						apiName: 'handleAudit',
@@ -285,10 +298,8 @@
 			}
 		},
 		computed: {},
-		onShow() {
-			this.isEnd = false
-			this.page = 1
-			this.getList()
+		onLaunch() {
+			this.doSearch();
 		},
 		methods: {
 			changeChartsTab(value) {
@@ -341,18 +352,43 @@
 				})
 			},
 			// 验收
-			checkAndAccept(item){
+			checkAndAccept(item) {
 				this.$refs.acceptRef.open(item.id);
 			},
 			// 评价
-			evaluate(item){
+			evaluate(item) {
 				this.$refs.evaluateRef.open(item.id);
 			},
+			// 转派
+			handleAudit(item) {
+				console.log(item, 'item ---')
+				uni.navigateTo({
+					url: `/pages/salesServiceManagement/workOrder/components/forWork/transfer?id=${item.id}`
+				})
+			},
+			// 报工
 			edit(type, id) {
-				console.log(type, 'type');
 				uni.navigateTo({
 					url: `/pages/salesServiceManagement/workOrder/components/editPlan?type=${type}&id=${id}`
 				})
+			},
+			// 接收
+			async receive(item) {
+				const data = await uni.showModal({
+					title: '确认接收',
+					content: '确定要接收这条数据吗?',
+					confirmText: '接收',
+					confirmColor: '#157a2c',
+				});
+				if (data[1].confirm) {
+					const res = await receiveSalesWorkOrder(item);
+					if (!res) return;
+					this.$refs.uToast.show({
+						type: "success",
+						message: "操作成功",
+					})
+					this.doSearch();
+				}
 			}
 		}
 	}