Parcourir la source

售后工单 报工 申请配件 功能开发

jingshuyong il y a 1 an
Parent
commit
6da4f5fb2a

+ 16 - 0
api/salesServiceManagement/workOrder/index.js

@@ -65,3 +65,19 @@ export async function saveOrUpdateSalesWorkOrder(data) {
 	}
 	return Promise.reject(new Error(res.message));
 }
+
+
+/**
+ * 查询仓库列表
+ */
+export async function getWarehouseList(data) {
+	const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/select/warehouseList`, {
+		params: {
+			status: 1
+		}
+	});
+	if (res.code == 0) {
+		return res.data;
+	}
+	return Promise.reject(new Error(res.message));
+}

+ 8 - 1
pages.json

@@ -2156,8 +2156,15 @@
 						"navigationStyle": "custom",
 						"navigationBarTextStyle": "white"
 					}
+				},
+				{
+					"path": "pages/salesServiceManagement/workOrder/components/accessoryAdd", 
+					"style": {
+						"navigationBarTitleText": "添加配件",
+						"navigationStyle": "custom",
+						"navigationBarTextStyle": "white"
+					}
 				}
-	
 	],
 	"tabBar": {
 		"color": "#908f8f",

+ 0 - 2
pages/salesServiceManagement/demandList/add.vue

@@ -316,12 +316,10 @@
 							message: "操作成功",
 						})
 					}).catch((e) => {
-						console.log(e, '报错了')
 						uni.hideLoading()
 					})
 				} catch (error) {
 					uni.hideLoading();
-					console.log(error, 'error');
 				}
 			}
 		},

+ 0 - 1
pages/salesServiceManagement/demandList/components/Invoice.vue

@@ -117,7 +117,6 @@
 				this.current = index;
 			},
 			handleSearch() {
-				console.log(this.$refs.screen, 'ref');
 				this.$refs.screen.open();
 			},
 			cabScreen(params) {

+ 1 - 1
pages/salesServiceManagement/demandList/components/screen.vue

@@ -39,7 +39,7 @@
 <script>
 	export default {
 		components: {},
-		props: [],
+		props: {},
 		data() {
 			return {
 				form: {

+ 132 - 0
pages/salesServiceManagement/workOrder/components/accessory.scss

@@ -0,0 +1,132 @@
+.mainBox {
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.wrapper {
+			// flex: 1;
+			height: calc(100vh - 250rpx);
+			overflow: hidden;
+		}
+
+		//底部按钮
+		.footer {
+			height: 45px;
+			position: relative;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			bottom: 0;
+			width: 100%;
+			height: 50px;
+			border-top: 1px solid #eeecec;
+			background-color: #ffffff;
+			z-index: 999;
+
+			.bottom {
+				margin-left: 10rpx;
+			}
+
+			.u-reset-button {
+				position: absolute;
+				right: 10rpx;
+				top: 20rpx;
+				width: 150rpx;
+			}
+		}
+
+		.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;
+			}
+		}
+
+		.dimension {
+			width: calc(100% - 270rpx);
+		}
+
+		.nav_box {
+			padding: 6rpx 32rpx;
+			position: relative;
+
+			.btn {
+				width: 68rpx;
+				text-align: center;
+				background: #1890ff;
+				color: #fff;
+				border: 2rpx solid;
+				border-color: #1890ff;
+				height: 40rpx;
+				line-height: 40rpx;
+				font-size: 26rpx;
+				margin-right: 10rpx;
+			}
+
+			.remove {
+				color: #606266;
+				border-color: #dddddd;
+				background: #fff;
+			}
+
+			.nav_item {
+				font-size: 28rpx;
+				font-weight: 400;
+				color: $theme-color;
+				background: #F0F8F2;
+				margin-right: 16rpx;
+				padding: 4rpx 16rpx;
+				border-radius: 8rpx;
+				border: 2rpx solid #ACD4B5;
+
+			}
+
+			.menu_box {
+				position: absolute;
+				right: 20rpx;
+				top: 10rpx;
+
+				.menu_icon {
+					width: 44rpx;
+					height: 44rpx;
+				}
+
+			}
+
+			.active {
+				background: $theme-color;
+				border: 2rpx solid $theme-color;
+				color: #FFF;
+			}
+		}
+	}

+ 42 - 20
pages/salesServiceManagement/workOrder/components/accessory.vue

@@ -37,23 +37,24 @@
 			<u-cell title="部门" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input style="flex:1" placeholder="请选择" border="surround" @click.native="selectDepartment"
-						v-model="form.executeGroupName">
+						v-model="form.useDeptName">
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell title="执行人" arrow-direction="down">
+			<u-cell title="使用人" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
-					<zxz-uni-data-select class="executor_user" :localdata="userList" v-model="form.executeUserId"
+					<zxz-uni-data-select class="executor_user" :localdata="userList" v-model="form.userId"
 						@change="handleUserChange" :multiple="Usertype==2"></zxz-uni-data-select>
 				</view>
 			</u-cell>
 			<u-cell title="用途" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
-					<u--textarea style="flex:1" border="surround" placeholder="请输入内容" v-model="form.purpose"></u--textarea>
+					<u--textarea style="flex:1" border="surround" placeholder="请输入内容"
+						v-model="form.purpose"></u--textarea>
 				</view>
 			</u-cell>
 		</u-cell-group>
-		<accessoryList :itemList="tableList" v-show="current == 1" />
+		<accessoryList ref="accessoryRef" :itemList="tableList" v-show="current == 1" />
 		<view class="footerButton">
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
@@ -95,10 +96,10 @@
 					recipientName: '',
 					recipientId: '',
 					purpose: '',
-					executeGroupId: '',
-					executeGroupName: '',
-					executeUserName: '',
-					executeUserId: '',
+					useDeptId: '',
+					useDeptName: '',
+					userName: '',
+					userId: '',
 					usageTime: ''
 				},
 				Usertype: '',
@@ -132,7 +133,6 @@
 				this.form.recipientId = data.executeUserId;
 				this.form.name = data.name;
 				this.form.id = data.id;
-				console.log(this.tableList, 'data ---- 1 + 1')
 				this.getDept();
 			},
 			getDept() {
@@ -141,10 +141,10 @@
 				})
 			},
 			confirm(data, name) {
-				this.form.executeGroupName = name
-				this.form.executeGroupId = data[0]
-				this.form.executeUserName = ''
-				this.form.executeUserId = ''
+				this.form.useDeptName = name
+				this.form.useDeptId = data[0]
+				this.form.userName = ''
+				this.form.userId = ''
 				this.getUser(data[0])
 			},
 			getUser(deptCode) {
@@ -169,31 +169,53 @@
 			},
 			// 选择人
 			handleUserChange(obj) {
-				this.form.executeUserName = obj.name;
+				this.form.userName = obj.name;
 			},
-			save(){
-				if(!this.form.usageTime){
+			save() {
+				if (!this.form.usageTime) {
 					this.$refs.uToast.show({
 						type: "warning",
 						message: "请选择使用时间",
 					})
 					return;
 				}
-				if(!this.form.executeGroupName){
+				if (!this.form.useDeptName) {
 					this.$refs.uToast.show({
 						type: "warning",
 						message: "请选择部门",
 					})
 					return;
 				}
-				if(!this.form.executeUserName){
+				if (!this.form.userName) {
 					this.$refs.uToast.show({
 						type: "warning",
 						message: "请选择执行人",
 					})
 					return;
 				}
-				console.log(this.form,'form --- ===')
+				let list = this.$refs.accessoryRef.getTabData();
+				let form = JSON.parse(JSON.stringify(this.form));
+				let arr = form.usageTime.split(' ');
+				if (!arr[1]) {
+					form.usageTime = form.usageTime + ' 00:00:00'
+				}
+				const data = {
+					...form,
+					details: list
+				}
+				uni.showLoading({
+					title: '加载中'
+				})
+				saveOrUpdateSalesWorkOrder(data).then((res) => {
+					this.$refs.uToast.show({
+						type: "success",
+						message: "操作成功",
+					})
+					uni.hideLoading();
+					this.back();
+				}).catch((e) => {
+					uni.hideLoading();
+				})
 			}
 		}
 	}

+ 416 - 0
pages/salesServiceManagement/workOrder/components/accessoryAdd.vue

@@ -0,0 +1,416 @@
+<template>
+	<view class="mainBox">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back">
+			<template slot="right">
+				<u-button type="success" size="small" class="u-reset-button" @click="classification"
+					text="选择分类"></u-button>
+			</template>
+		</uni-nav-bar>
+		<view class="top-wrapper">
+			<uni-section class="dimension" v-if="dataSources == '0'">
+				<uni-data-select @change="(e)=>onchange(e)" v-model="dimension" :clear="false"
+					:localdata="dimensionList">
+				</uni-data-select>
+			</uni-section>
+			<uni-section v-if="dataSources == '1'">
+				<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>
+		</view>
+		<!-- 		<view class="nav_box rx-sc">
+			<view class="nav_item " :class="{active: current == 0}" @click="handNav(0)">
+				库存台账</view>
+			<view class="nav_item" :class="{active: current == 1}" @click="handNav(1)">
+				主数据</view>
+			<view class="add btn" v-show="current == 0" @click="add">
+				添加
+			</view>
+			<view class="remove btn" v-show="current == 1" @click="remove">
+				移除
+			</view>
+		</view> -->
+		<view class="wrapper">
+			<!-- v-show="current == 0" -->
+			<u-list @scrolltolower="scrolltolower" class="listContent">
+				<checkbox-group v-for="(item, index) in accessoriesList" :key="index"
+					@change="e => selectVal(e, item, index)">
+					<label>
+						<view class="listBox">
+							<view class="listBox-sel">
+								<checkbox :value="item.id" color="#fff" :disabled="item.disabled"
+									:checked="item.checked" />
+							</view>
+							<view class="listBox-con">
+								<view class="listBox-bottom">
+									<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 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 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>
+					</label>
+				</checkbox-group>
+				<u-empty class="noDate" style="margin-top: 20vh" v-if="!accessoriesList.length"></u-empty>
+			</u-list>
+			<!-- 	<u-list class="listContent" v-show="current == 1">
+				<checkbox-group v-for="(item, index) in addList" :key="index"
+					@change="e => selectAddVal(e, item, index)">
+					<label>
+						<view class="listBox">
+							<view class="listBox-sel">
+								<checkbox :value="item.id" color="#fff" :checked="item.checked" />
+							</view>
+							<view class="listBox-con">
+								<view class="listBox-bottom">
+									<view>{{!fieldShow ? '编码' : '物品编码'}}:{{ item.categoryCode }}</view>
+									<view>{{!fieldShow ? '名称' : '物品名称'}}:{{ item.categoryName }}</view>
+									<view>型号:{{ item.categoryModel }}</view>
+									<view>规格:{{ item.specification }}</view>
+									<view class="label-s">级别:{{ item.level }}</view>
+									<view class="label-s">库存:{{ item.measureQuantity }}</view>
+									<view v-if="dataSources == '0'">计量单位:{{ item.measureUnit }}</view>
+									<view>仓库:{{ item.warehouseName }}</view>
+								</view>
+							</view>
+						</view>
+					</label>
+				</checkbox-group>
+				<u-empty class="noDate" style="margin-top: 20vh" v-if="!addList.length"></u-empty>
+			</u-list> -->
+		</view>
+		<view class="footer">
+			<u-button type="success" size="small" class="u-reset-button" @click="jumpAdd">
+				<view class="selBtn">选择({{ addList.length }})</view>
+			</u-button>
+		</view>
+		<screenAccess :dataSources="dataSources" ref="screen" @succeed="getData" />
+		<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 screenAccess from './screenAccess.vue'
+	import {
+		getProductList,
+		getBatchDetails,
+		getInventoryDetails,
+		getMaterielDetails,
+	} from '@/api/repair';
+	import {
+		treeByPid
+	} from '@/api/pda/workOrder.js';
+	import {
+		getList
+	} from '@/api/classifyManage/itemInformation.js'
+	export default {
+		components: {
+			screenAccess
+		},
+		data() {
+			return {
+				title: '新增配件',
+				dataSources: '0', // 0 仓库 1 主数据
+				accessoriesList: [], // 配件列表
+				addList: [], // 添加列表
+				classificationList: [],
+				categoryLevelId: 1, // 分类id(默认6 查询备品备件)
+				selectedData: ['1'],
+				isEnd: false,
+				pageNum: 1,
+				dimensionList: [{
+						value: '4',
+						text: '物料维度'
+					},
+					{
+						value: '3',
+						text: '包装维度'
+					},
+					{
+						value: '2',
+						text: '批次维度'
+					},
+					{
+						value: '1',
+						text: '物品维度'
+					},
+				],
+				dimension: '1', // 列表维度
+				current: 0,
+				searchKey: ''
+			}
+		},
+		onLoad(params) {
+			this.dataSources = params.dataSources || '0';
+		},
+		computed: {
+			// 物品字段
+			fieldShow() {
+				return this.dataSources == '0';
+			},
+		},
+		onShow() {
+			this.getTreeList();
+		},
+		methods: {
+			handleSearch() {
+				this.$refs.screen.open();
+			},
+			confirm(id, name) {
+				this.categoryLevelId = id;
+				this.accessoriesList = [];
+				this.getData();
+			},
+			onchange(e) {
+				this.dimension = e;
+				this.getData({});
+			},
+			// 获取页面数据
+			getData(parameter = {}) {
+				let data = parameter;
+				if (!data.scroll) {
+					this.isEnd = false;
+					this.pageNum = 1;
+					this.accessoriesList = [];
+				} else {
+					delete data.scroll;
+				}
+				if (this.dataSources == '0') {
+					this.changeDimension(this.dimension, data);
+				} else {
+					// 查询主数据
+					this.warehouseData(data);
+				}
+			},
+			// 主数据
+			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.accessoriesList = list;
+					} else {
+						this.accessoriesList.push(...list);
+					}
+					this.pageNum += 1
+					this.isEnd = this.accessoriesList.length >= res.count;
+					uni.hideLoading();
+				}).then((e) => {
+					uni.hideLoading();
+				})
+
+			},
+			// 仓库数据
+			changeDimension(dimension, parameter = {}) {
+				if (this.isEnd) {
+					return
+				}
+				uni.showLoading({
+					title: '加载中'
+				})
+				return new Promise(async (resolve, reject) => {
+					try {
+						let params = {
+							// assetName: this.assetName,
+							// dimension: this.dimension,
+							...parameter,
+							pageNum: this.pageNum,
+							size: 15,
+							categoryLevelId: this.categoryLevelId
+						}
+						const api = dimension == 1 ? getProductList : dimension == 2 ?
+							getBatchDetails : dimension == 3 ? getInventoryDetails : getMaterielDetails;
+						let res = await api(params);
+						let list = res.list.map((el) => {
+							el.modelType = el.categoryModel;
+							el.name = el.categoryName;
+							el.code = el.categoryCode;
+							return el;
+						});
+
+						if (this.pageNum == 1) {
+							this.accessoriesList = list;
+						} else {
+							this.accessoriesList.push(...list);
+						}
+						this.pageNum += 1
+						this.isEnd = this.accessoriesList.length >= res.count;
+						uni.hideLoading();
+						resolve();
+					} catch (error) {
+						uni.hideLoading();
+						reject();
+					}
+				})
+			},
+			scrolltolower() {
+				if (this.isEnd) {
+					return;
+				}
+				this.getData({
+					scroll: true
+				});
+			},
+			classification() {
+				this.$refs.treePicker._show();
+			},
+			// 查部门
+			getTreeList() {
+				treeByPid({
+					ids: [1]
+				}).then(res => {
+					this.classificationList = res;
+					this.confirm(res[0].id, res[0].name);
+				})
+			},
+			handNav(index) {
+				this.current = index;
+			},
+			// remove() {
+			// 	this.addList = this.addList.filter(item => !item.checked);
+			// },
+			// add() {
+			// 	let checkedList = this.accessoriesList.filter(item => item.checked);
+			// 	if (checkedList.length == 0) {
+			// 		this.$refs.uToast.show({
+			// 			type: "warning",
+			// 			message: "请至少选择一条配件数据",
+			// 		})
+			// 	}
+			// 	let obj = {};
+			// 	this.addList.map(el => {
+			// 		obj[el.id] = true;
+			// 	})
+			// 	checkedList.map((el) => {
+			// 		if (!obj[el.id]) {
+			// 			let data = JSON.parse(JSON.stringify(el));
+			// 			delete data.checked;
+			// 			this.addList.push(data);
+			// 		}
+			// 	})
+			// 	this.current = 1;
+			// },
+			// 选择配件列表
+			selectVal(e, val, index) {
+				this.$set(this.accessoriesList[index], 'checked', !this.accessoriesList[index].checked);
+				this.addList = this.accessoriesList.filter(item => item.checked)
+			},
+			// selectAddVal(e, val, index) {
+			// 	this.$set(this.addList[index], 'checked', !this.addList[index].checked);
+			// },
+			jumpAdd() {
+				let list = JSON.parse(JSON.stringify(this.addList));
+				if (list.length == 0) {
+					this.$refs.uToast.show({
+						type: "warning",
+						message: "请至少添加一条物品数据",
+					})
+					return;
+				}
+				list.forEach((el) => delete el.checked);
+				uni.$emit('updateAddessory', list);
+				this.back();
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
+	@import './accessory.scss';
+</style>

+ 21 - 24
pages/salesServiceManagement/workOrder/components/accessoryList.vue

@@ -20,7 +20,7 @@
 </template>
 
 <script>
-	import myCard from '@/pages/saleManage/components/myCard.vue'
+	import myCard from '@/pages/saleManage/components/myCard.vue';
 	import {
 		getWarehouseOutStock,
 		getIdWarehouseList
@@ -38,12 +38,15 @@
 				type: Array,
 				default: () => []
 			},
+			title: {
+				type: String,
+				default: ''
+			}
 		},
 		watch: {
 			itemList: {
 				handler(newVal) {
 					let list = JSON.parse(JSON.stringify(newVal));
-					console.log(list, 'list------- 子组件')
 					this.tableList = list;
 				},
 				deep: true,
@@ -109,33 +112,32 @@
 					btnType: 'primary',
 					type: '2',
 					pageUrl: '',
-				}, ],
+				}],
 				tableList: []
 			}
 		},
 		computed: {},
 		created() {
-			// uni.$off('updateInfo');
-			// uni.$on('updateInfo', (data) => {
-			// 	data.customize = '5';
-			// 	if (data.index || data.index == 0) {
-			// 		let index = data.index;
-			// 		delete data.index;
-			// 		this.$set(this.tableList, index, data);
-			// 		return
-			// 	}
-			// 	this.tableList.push(data);
-			// })
+			uni.$off('updateAddessory');
+			uni.$on('updateAddessory', (data) => {
+				let obj = {}
+				this.tableList.map((el) => obj[el] = true);
+				data.map((el) => {
+					if (!obj[el.id]) {
+						this.tableList.push(el);
+					}
+				})
+			})
 		},
 		onShow() {
 
 		},
 		methods: {
 			add() {
-				console.log(12345)
-				// uni.navigateTo({
-				// 	url: `/pages/salesServiceManagement/workOrder/components/accessoryList`
-				// })
+				let dataSources = this.title == '配件回收清单' ? '1' : '0';
+				uni.navigateTo({
+					url: `/pages/salesServiceManagement/workOrder/components/accessoryAdd?dataSources=${dataSources}`
+				})
 			},
 			del(index) {
 				uni.showModal({
@@ -170,17 +172,12 @@
 						value = value.replace(/^0+/, '');
 					}
 				}
-				console.log(value, 'value')
 				let obj = this.tableList[index];
 				obj[field] = value;
 				let num1 = obj.totalCount ? obj.totalCount - 0 : 0;
 				let num2 = obj.singlePrice ? obj.singlePrice - 0 : 0;
 				let total = (num1 * num2).toFixed(1);
 				obj.totalPrice = total;
-				console.log(obj, 'obj')
-				console.log(this.tableList, 'tab')
-				// this.$set(this.tableList,index,)
-				// obj.settlementPrice = num1 * num2;
 			},
 			getTabData() {
 				return this.tableList || [];
@@ -193,7 +190,7 @@
 	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
 
 	.scheme {
-		padding: 10rpx 20rpx;
+		padding: 10rpx 20rpx 88rpx;
 	}
 
 	.add {

+ 11 - 4
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -6,7 +6,7 @@
 		<view class="scrollable-tabs" ref="tabsContainer">
 			<u-subsection :list="tabs" :current="currentIndex" @change="(e)=>sectionChange(e)"></u-subsection>
 		</view>
-
+		<accessoryList title="配件回收清单" ref="accessoryRef" :itemList="accessList" v-show="currentValue == 2" />
 		<DemandInfo :demandForm="demandForm" v-show="currentValue == 3" :itemList="productDetail" />
 		<PlanInfo :planForm="planForm" v-show="currentValue == 4" />
 		<AfterSales ref="salesRef" v-show="currentValue == 5" :itemList="productDetail" :type="type"
@@ -34,6 +34,7 @@
 	import {
 		contactDetail
 	} from '@/api/saleManage/contact/index.js';
+	import accessoryList from './accessoryList.vue';
 	import ReportInfo from './reportInfo.vue';
 	import AfterSales from '@/pages/salesServiceManagement/demandList/components/AfterSales.vue';
 	import ContactList from '@/pages/salesServiceManagement/demandList/components/contactList.vue';
@@ -56,7 +57,8 @@
 			DemandInfo,
 			AfterSales,
 			ContactList,
-			ReportInfo
+			ReportInfo,
+			accessoryList
 		},
 		computed: {
 			isDisable() {
@@ -84,7 +86,7 @@
 						id: 6
 					},
 					{
-						name: '联系人',
+						name: '方案',
 						id: 7
 					}, {
 						name: '需求信息',
@@ -101,7 +103,8 @@
 				productDetail: [], // 售后对象
 				contactInfoVOS: [], // 联系人
 				costListVOS: [], // 方案
-				currentValue: 5
+				currentValue: 5,
+				accessList: [], // 配件回收
 			}
 		},
 		onLoad(params) {
@@ -126,6 +129,8 @@
 				// await this.getByData();
 				// this.getDept();
 				const res = await getSalesWorkOrderById(id);
+				console.log(res, 'res ----')
+				this.accessList = res.accessoryApply?.detailList || []
 				this.contactData(res.afterSalesDemandVO.contactId, 'init');
 				resData = res;
 				this.costListVOS = res.costListVOS;
@@ -285,9 +290,11 @@
 		position: fixed;
 		bottom: 0;
 		z-index: 10;
+		justify-content: space-between;
 
 		/deep/.u-button {
 			height: 100%;
+			width: 30%;
 		}
 
 		>view {

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

@@ -67,7 +67,6 @@
 				this.calculateTimeDifference();
 			},
 			calculateTimeDifference() {
-				console.log('123', this.reportForm)
 				if (!this.reportForm.startTime || !this.reportForm.endTime) {
 					this.days = '';
 					this.hours = '';

+ 1 - 3
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -37,7 +37,6 @@
 			itemList: {
 				handler(newVal) {
 					let list = JSON.parse(JSON.stringify(newVal));
-					console.log(list, 'list-------')
 					this.tableList = list;
 					this.setTabData()
 				},
@@ -154,7 +153,6 @@
 		created() {
 			uni.$off('updateInfo');
 			uni.$on('updateInfo', (data) => {
-				console.log(data, 'data ----')
 				data.customize = '5';
 				if (data.index || data.index == 0) {
 					let index = data.index;
@@ -234,7 +232,7 @@
 	@import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
 
 	.scheme {
-		padding: 10rpx 20rpx;
+		padding: 10rpx 20rpx 84rpx;
 	}
 
 	.add {

+ 194 - 0
pages/salesServiceManagement/workOrder/components/screenAccess.vue

@@ -0,0 +1,194 @@
+<template>
+	<view>
+		<u-popup :show="show" closeOnClickOverlay mode="top" @close="closePopup">
+			<view class="search_list">
+				<u-form labelPosition="left" :model="form" labelWidth="140" labelAlign="left" class="baseForm"
+					v-if="dataSources == 0">
+					<u-form-item label="仓库名称:" class="item-form" borderBottom prop="assetType">
+						<uni-data-select v-model="form.warehouseId" :clear="false" :localdata="warehouseList">
+						</uni-data-select>
+					</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.categoryName"
+							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.batchNo"
+							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.engrave"
+							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.barcodes"
+							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.brandNum"
+							placeholder="请输入">
+						</uni-easyinput>
+					</u-form-item>
+				</u-form>
+				<u-form labelPosition="left" :model="mainForm" labelWidth="140" labelAlign="left" class="baseForm"
+					v-if="dataSources == 1">
+					<u-form-item label="编码:" class="item-form" borderBottom prop="assetType">
+						<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.code"
+							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="mainForm.name"
+							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="mainForm.modelType"
+							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="mainForm.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="mainForm.specification"
+							placeholder="请输入">
+						</uni-easyinput>
+					</u-form-item>
+				</u-form>
+			</view>
+			<view class="operate_box rx-bc">
+				<u-button size="small" class="u-reset-button" @click="show = false">
+					取消
+				</u-button>
+				<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>
+	import {
+		getWarehouseList
+	} from '@/api/salesServiceManagement/workOrder/index.js'
+	export default {
+		components: {},
+		props: {
+			dataSources: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				form: {
+					warehouseId: "",
+					categoryCode: "",
+					categoryName: "",
+					batchNo: '',
+					engrave: '',
+					barcodes: '',
+					brandNum: ''
+				},
+				mainForm: {
+					code: '',
+					name: '',
+					modelType: '',
+					brandNum: '',
+					specification: ''
+				},
+				show: false,
+				warehouseList: []
+			}
+		},
+		created() {
+			this.getSearchData();
+		},
+		methods: {
+			getSearchData() {
+				console.log(this.dataSources, 'dataSources ---')
+				if (this.dataSources == '1') return
+				getWarehouseList({}).then((res) => {
+					this.warehouseList = res.map(item => {
+						item.text = item.name
+						item.value = item.id
+						return item
+					})
+				});
+			},
+			open() {
+				this.show = true;
+			},
+			closePopup() {
+
+			},
+			reset() {
+				if (this.dataSources == '1') {
+					this.mainForm = {
+						code: '',
+						name: '',
+						modelType: '',
+						brandNum: '',
+						specification: ''
+					}
+				} else {
+					this.form = {
+						warehouseId: "",
+						categoryCode: "",
+						categoryName: "",
+						batchNo: '',
+						engrave: '',
+						barcodes: '',
+						brandNum: ''
+					}
+				}
+				this.submit();
+			},
+			submit() {
+				if (this.dataSources == '1') {
+					this.$emit('succeed', this.mainForm);
+				} else {
+					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: 30%;
+		}
+	}
+
+	.item-form {
+		/deep/ .u-form-item__body__left__content__label {
+			font-size: 28rpx;
+		}
+	}
+</style>

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

@@ -11,7 +11,7 @@
 			<uni-section class="dimension">
 				<uni-data-select v-model="dimension" :clear="false" :localdata="dimensionList"></uni-data-select>
 			</uni-section>
-			<button class="search_btn" @click="getData">搜索</button>
+			<button class="search_btn" @click="getData({})">搜索</button>
 			<image class="menu_icon" @click="handleSearch" src="~@/static/pda/menu.svg"></image>
 		</view>
 		<view class="wrapper">
@@ -73,7 +73,6 @@
 	export default {
 		data() {
 			return {
-				isEnd: false,
 				tableList: [],
 				obtain: '主数据',
 				dimension: '1', // 列表维度
@@ -114,7 +113,6 @@
 			},
 		},
 		onLoad(params) {
-			console.log(params, '参数')
 			this.obtain = params.obtain || '主数据';
 			this.selectType = params.selectType || '1'
 		},
@@ -124,9 +122,17 @@
 		},
 		methods: {
 			// 获取页面数据
-			getData(parameter) {
-				this.isEnd = false
-				this.pageNum = 1
+			getData(parameter = {}) {
+				// this.isEnd = false
+				// this.pageNum = 1
+				let data = parameter;
+				if (!data.scroll) {
+					this.isEnd = false;
+					this.pageNum = 1;
+					this.accessoriesList = [];
+				} else {
+					delete data.scroll;
+				}
 				if (this.obtain == '仓库') {
 					this.changeDimension(this.dimension, parameter);
 				} else {
@@ -161,12 +167,17 @@
 						const api = dimension == 1 ? getProductList : dimension == 2 ?
 							getBatchDetails : dimension == 3 ? getInventoryDetails : getMaterielDetails;
 						let res = await api(params);
-						this.tableList = res.list.map((el) => {
+						let list = res.list.map((el) => {
 							el.modelType = el.categoryModel;
 							el.name = el.categoryName;
 							el.code = el.categoryCode;
 							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();
@@ -184,7 +195,9 @@
 				if (this.isEnd) {
 					return
 				}
-				this.getData();
+				this.getData({
+					scroll: true
+				});
 			},
 			// 选择
 			selectVal(e, val, index) {

+ 1 - 1
pages/salesServiceManagement/workOrder/index.vue

@@ -22,7 +22,7 @@
 			</view>
 		</view>
 		<view class="wrapper">
-			<u-list @scrolltolower="scrolltolower" class="listContent">
+			<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)" :item="item" :index="index+1" :columns="columns"