Răsfoiți Sursa

feat(售后配件管理): 添加配件申请流程功能及优化仓库选择逻辑

yusheng 6 luni în urmă
părinte
comite
d6101b6ea6

+ 15 - 9
App.vue

@@ -47,7 +47,7 @@
 						confirmText: '立即更新',
 						success: (val) => {
 							if (val.confirm) {
-					
+
 								const downloadTask = uni.downloadFile({
 									url: `${Vue.prototype.webviewUrl}/kd-aiot/${res.fileStorePath}`,
 									success: (data) => {
@@ -89,30 +89,32 @@
 										}
 									}
 								});
-								
+
 								// 先显示初始的loading提示
 								uni.showLoading({
 									title: "正在下载安装包: 0%",
 									mask: true,
 								});
-								
+
 								// 记录上次显示的进度,避免频繁更新
 								let lastProgress = 0;
 								let loadingVisible = true;
-								
+
 								downloadTask.onProgressUpdate((ress) => {
 									console.log('下载进度:', ress)
-									
+
 									// 只在进度有明显变化(每10%)或者达到100%时更新提示
-									if ((ress.progress > lastProgress && ress.progress % 10 === 0) || ress.progress === 100) {
+									if ((ress.progress > lastProgress && ress.progress %
+											10 === 0) || ress.progress === 100) {
 										// 先隐藏再显示以更新内容
 										if (loadingVisible) {
 											uni.hideLoading();
 										}
-										
+
 										if (ress.progress < 100) {
 											uni.showLoading({
-												title: "正在下载安装包: " + ress.progress + "%",
+												title: "正在下载安装包: " + ress
+													.progress + "%",
 												mask: true,
 											});
 											loadingVisible = true;
@@ -122,7 +124,7 @@
 										lastProgress = ress.progress;
 									}
 								})
-								
+
 								// 确保任务完成时隐藏loading
 								downloadTask.onStop(() => {
 									if (loadingVisible) {
@@ -195,6 +197,10 @@
 		-moz-osx-font-smoothing: grayscale;
 	}
 
+	.footerButton {
+		background: #fff
+	}
+
 	.icon-chanpinchuku:before {
 		content: '\e6a1';
 	}

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.26",
+    "versionName" : "V1.0.3.27",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {

+ 31 - 27
pages/saleManage/components/myCard.vue

@@ -4,41 +4,45 @@
 
 
 		<view class="item_box rx-bc" v-for="(_item,i) in columns" :key="i">
-			<view class="perce50" :class="val.className" :style="val.style" v-for="(val) in _item" :key="val.prop">
-				<view class="item_box rx-sc" v-if="val.type=='title'">
-					<view class="round" v-if='index'>{{index}}</view>
-					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-if="val.slot">
-						<slot :name="val.slot"> </slot>
+			<template v-for="(val) in _item">
 
-					</view>
-					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-else>
+				<view class="perce50" :class="val.className" :style="val.style" :key="val.prop" v-if="!val.isNone">
+					<view class="item_box rx-sc" v-if="val.type=='title'">
+						<view class="round" v-if='index'>{{index}}</view>
+						<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-if="val.slot">
+							<slot :name="val.slot"> </slot>
+
+						</view>
+						<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-else>
+
+							{{item[val.prop]||''}}
+						</view>
 
-						{{item[val.prop]||''}}
 					</view>
 
-				</view>
+					<view class="item_one rx-sc" v-else-if="val.type=='action'">
+						<view class="lable">{{val.label}}</view>
+						<view class="text" style="flex-wrap: wrap;">
+							<template v-for="(btn,bI) in btnList">
+								<u-button :plain="true" :hairline="true" size='mini' :type="btn.btnType"
+									v-if="judge(btn)" :text="btn.name" @click="action(btn)" :key="bI"></u-button>
+							</template>
 
-				<view class="item_one rx-sc" v-else-if="val.type=='action'">
-					<view class="lable">{{val.label}}</view>
-					<view class="text" style="flex-wrap: wrap;">
-						<template v-for="(btn,bI) in btnList">
-							<u-button :plain="true" :hairline="true" size='mini' :type="btn.btnType" v-if="judge(btn)"
-								:text="btn.name" @click="action(btn)" :key="bI"></u-button>
-						</template>
+						</view>
 
 					</view>
-
-				</view>
-				<view class="item_one rx-sc kk" v-else>
-					<view class="lable">{{val.label}}</view>
-					<view class="text" v-if="val.formatter">{{val.formatter(item)||''}}</view>
-					<view class="text" v-else-if="val.slot">
-						<slot :name="val.slot"> </slot>
+					<view class="item_one rx-sc kk" v-else>
+						<view class="lable">{{val.label}}</view>
+						<view class="text" v-if="val.formatter">{{val.formatter(item)||''}}</view>
+						<view class="text" v-else-if="val.slot">
+							<slot :name="val.slot"> </slot>
+						</view>
+						<view class="text" v-else>{{item[val.prop]||''}}</view>
 					</view>
-					<view class="text" v-else>{{item[val.prop]||''}}</view>
+
 				</view>
+			</template>
 
-			</view>
 		</view>
 
 	</view>
@@ -82,8 +86,8 @@
 							if (value && !value.includes(this.item[key])) {
 								is = false
 							}
-							if(fn){
-								is=fn(this.item) 
+							if (fn) {
+								is = fn(this.item)
 							}
 						})
 						return is

+ 1 - 1
pages/salesServiceManagement/accessory/accessoryAdd.vue

@@ -50,7 +50,7 @@
 			</u-cell>
 			<u-cell title="用途" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
-					<u--textarea style="flex:1; min-height: 160rpx;" border="surround" placeholder="请输入内容"
+					<u--textarea :disabled="!isDisable" style="flex:1; min-height: 160rpx;" border="surround" placeholder="请输入内容"
 						v-model="form.purpose"></u--textarea>
 				</view>
 			</u-cell>

+ 115 - 33
pages/salesServiceManagement/accessory/index.vue

@@ -18,7 +18,7 @@
 			<u-list @scrolltolower="scrolltolower" class="listContent" style="height: auto;">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
 					<myCard :columns="columns" :btnList="btnList" :item="item" @details="add(item,'view')"
-						@edit="add(item,'edit')" @delete="deleteRow(item)">
+						@listSubmit="listSubmit(item)" @edit="add(item,'edit')" @delete="deleteRow(item)">
 					</myCard>
 				</view>
 
@@ -42,6 +42,10 @@
 		accessoryDelete
 	} from '@/api/salesServiceManagement/accessory/index.js';
 	import myCard from '@/pages/saleManage/components/myCard.vue';
+	import {
+		processInstanceCreateAPI,
+		processInstancePage
+	} from '@/api/wt/index.js'
 	export default {
 		components: {
 			myCard
@@ -181,6 +185,20 @@
 							return str;
 						}
 					}],
+					[{
+						label: '状态:',
+						prop: 'approvalStatus',
+						formatter: (row) => {
+							const reviewStatus = {
+								0: '未提交',
+								1: '审核中',
+								2: '已审核',
+								3: '审核不通过'
+							}
+							return reviewStatus[row.approvalStatus];
+						}
+					}],
+
 					[{
 						label: '创建时间:',
 						prop: 'createTime'
@@ -196,44 +214,69 @@
 					}],
 				],
 				btnList: [{
-					name: '详情',
-					apiName: 'details',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
+						name: '详情',
+						apiName: 'details',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
 
-				}, {
-					name: '修改',
-					apiName: 'edit',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
-					judge: [{
-						authorities: '',
-					}, {
-						key: 'source',
-						value: [0],
-					}],
-				}, {
-					name: '删除',
-					apiName: 'delete',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
-					judge: [{
-						authorities: '',
 					}, {
-						key: 'source',
-						value: [0],
+						name: '修改',
+						apiName: 'edit',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'source',
+							value: [0],
+						}, {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					},
+					{
+						name: '发起流程',
+						apiName: 'listSubmit',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'source',
+							value: [0],
+						}, {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					},
 
-					}],
-				}],
+					{
+						name: '删除',
+						apiName: 'delete',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'source',
+							value: [0],
+
+						}, {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					}
+				],
 				page: 1,
 				size: 10,
 				isEnd: false,
 				tableList: [],
 				searchVal: '',
-				
+
 			}
 		},
 		onShow() {
@@ -243,6 +286,47 @@
 			this.getList()
 		},
 		methods: {
+
+			async listSubmit(data) {
+				try {
+					//后台不提供接口
+					let list = await processInstancePage({
+						pageNo: 1,
+						pageSize: 1,
+						reset: true,
+						key: 'eom_sh_bpbj'
+					})
+					let params = {
+						businessId: data.id,
+						businessKey: 'eom_sh_bpbj',
+						formCreateUserId: data.createUserId,
+						processDefinitionId: list?.list[0]?.processDefinition.id,
+						variables: {
+							businessCode: data.code,
+							businessName: data.name,
+							businessType: '申请备品备件',
+						},
+					}
+
+					await processInstanceCreateAPI(params)
+					uni.showModal({
+						title: `提交成功`,
+						content: '',
+						confirmText: '确认',
+						showCancel: false, // 是否显示取消按钮,默认为 true
+						success: () => {
+							this.doSearch()
+						}
+
+					})
+
+
+				} catch {
+
+				}
+
+			},
+
 			doSearch() {
 				this.isEnd = false;
 				this.page = 1;
@@ -343,8 +427,6 @@
 </script>
 
 <style scoped lang="scss">
-	
-
 	.top-wrapper {
 		background-color: #fff;
 		display: flex;

+ 29 - 15
pages/salesServiceManagement/demandList/add.vue

@@ -119,13 +119,16 @@
 					v-model="form.involveDeptName" @click.native="salesDeptShow"></u--input>
 			</u-cell>
 			<u-cell title="备注说明" arrow-direction="down">
-				<u--textarea border="surround" :disabled="!isDisable" placeholder=" " slot="value" v-model="form.remark" autoHeight ></u--textarea>
+				<u--textarea border="surround" :disabled="!isDisable" placeholder=" " slot="value" v-model="form.remark"
+					autoHeight></u--textarea>
 			</u-cell>
 		</u-cell-group>
 		<AfterSales ref="salesRef" :type="type" v-show="current == 1" :afterSalesType="form.afterSalesType"
 			:itemList="form.productDetail" />
+		<!-- 方案列表 -->
+		<SchemeList ref="schemeRef" v-show="current == 2" :type='type' :itemList="costListVOS" />
 		<!-- 联系人 -->
-		<ContactList ref="contactRef" :type="type" v-show="current == 2" :itemList="form.contactInfoVOS" />
+		<ContactList ref="contactRef" :type="type" v-show="current == 3" :itemList="form.contactInfoVOS" />
 		<view class="footerButton" v-if="isDisable">
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
@@ -153,6 +156,7 @@
 	} from '@/api/salesServiceManagement/demandList/index.js'
 	import AfterSales from './components/AfterSales.vue'
 	import ContactList from './components/contactList.vue'
+	import SchemeList from '@/pages/salesServiceManagement/workOrder/components/schemeList.vue';
 	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
 	import {
 		listOrganizations,
@@ -160,7 +164,8 @@
 	export default {
 		components: {
 			AfterSales,
-			ContactList
+			ContactList,
+			SchemeList
 		},
 		computed: {
 			isDisable() {
@@ -199,6 +204,7 @@
 					remark: '',
 					processInstanceId: '' // 新增流程实例ID字段
 				},
+				costListVOS: [],
 				associationTypeList: [{
 						value: '1',
 						text: '发货单'
@@ -213,7 +219,7 @@
 					}
 				],
 				createUserName: '',
-				list: ['基本信息', '售后对象', '联系人'],
+				list: ['基本信息', '售后对象', '方案', '联系人'],
 				current: 0,
 				fault_level: [],
 				after_sales_type: [],
@@ -255,6 +261,7 @@
 		},
 		onLoad(params) {
 			this.type = params.type;
+			console.log(params.type, 'params.type')
 			if (params.id) {
 				this.title = params.type == 'view' ? '需求详情' : '修改需求'
 				this.getDetails(params.id);
@@ -350,7 +357,7 @@
 						res[key].toString()
 					);
 				})
-
+				this.costListVOS = this.form.costListVOS
 
 
 				this.createUserName = data.createUserName;
@@ -453,6 +460,7 @@
 			confirm(data, name) {
 				this.form.involveDeptName = name || ''
 				this.form.involveDeptId = data[0] || ''
+				console.log(this.form, 'this.form')
 			},
 			getByCode() {
 				const codeS = ['fault_level', 'after_sales_type', 'pie_car_type']
@@ -515,6 +523,14 @@
 						})
 						return
 					}
+					if (!data.involveDeptName) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择涉及事业部门",
+						})
+						return
+					}
+
 					let isMessage = [];
 					[{
 						name: '请选择是否收费',
@@ -531,9 +547,6 @@
 					}, {
 						name: '请选择是否生成采购订单',
 						key: 'isCreatePurchaseOrder'
-					}, {
-						name: '请选择涉及事业部门',
-						key: 'involveDeptName'
 					}].forEach(item => {
 						if (data[item.key] != 1 && data[item.key] !== 0 && !isMessage.length) {
 							console.log(item, 'item')
@@ -559,17 +572,18 @@
 						this.current = 2
 						return
 					}
-					data.contactInfoVOS = contactInfoVOS;
+					data.contactInfoVOS = this.$refs.contactRef.getTabData();
 					// 售后对象数据
 					let productDetail = this.$refs.salesRef.getTabData();
 					data.productDetail = productDetail.map((item) => {
-							item['produceTime'] = item['produceTime'] || null;
-							return item;
-						}),
+						item['produceTime'] = item['produceTime'] || null;
+						return item;
+					})
+					data.costListVOS = this.$refs.schemeRef.getTabData()
 
-						uni.showLoading({
-							title: '加载中'
-						})
+					uni.showLoading({
+						title: '加载中'
+					})
 
 					let requestname =
 						this.type === 'add' ? saveSalesDemand : updateSalesDemand;

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

@@ -345,7 +345,7 @@
 							businessCode: res.code,
 							businessName: res.recycleDeptName,
 							businessType: '售后配件回收入库',
-							storemanIds
+							storemanIds:storemanIds.toString()
 						},
 					}
 

+ 4 - 2
pages/salesServiceManagement/recycle/recycleAdd.vue

@@ -77,7 +77,7 @@
 				</view>
 			</u-cell>
 		</u-cell-group>
-		<accessoryList :itemList="itemList" ref="accessoryRef" :type="type" v-show="current == 1" />
+		<accessoryList :itemList="itemList" ref="accessoryRef" :type="type" v-show="current == 1" title='配件回收清单' />
 		<view class="footerButton" v-if="isDisable">
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
@@ -226,12 +226,14 @@
 						type: "warning",
 						message: "请选择工单",
 					})
+					return
 				};
 				if (!this.form.demandDetailId) {
 					this.$refs.uToast.show({
 						type: "warning",
 						message: "请选择设备",
 					})
+					return
 				};
 				console.log(this.form, 'this.form 123456')
 				let detailList = this.$refs.accessoryRef.getTabData() || [];
@@ -261,7 +263,7 @@
 			},
 			selectWorkOrder() {
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/accessory/components/selectWork?orderStatusList='3,4'`
+					url: `/pages/salesServiceManagement/accessory/components/selectWork?orderStatusList=3,4`
 				})
 			}
 		}

+ 148 - 147
pages/salesServiceManagement/workOrder/components/accessoryAdd.vue

@@ -164,7 +164,7 @@
 		</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"
+		 :localdata="classificationList" valueKey="id" textKey="name"
 			childrenKey="children" />
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -179,8 +179,9 @@
 		getMaterielDetails,
 	} from '@/api/repair';
 	import {
-		treeByPid
-	} from '@/api/pda/workOrder.js';
+		getProduceTreeByPid,
+
+	} from '@/api/warehouseManagement'
 	import {
 		getList
 	} from '@/api/classifyManage/itemInformation.js'
@@ -195,8 +196,8 @@
 				accessoriesList: [], // 配件列表
 				addList: [], // 添加列表
 				classificationList: [],
-				categoryLevelId: 6, // 分类id(默认6 查询备品备件)
-				selectedData: ['6'],
+				categoryLevelId: '', // 分类id(默认6 查询备品备件)
+				// selectedData: ['6'],
 				isEnd: false,
 				pageNum: 1,
 				dimensionList: [{
@@ -352,8 +353,8 @@
 			},
 			// 查部门
 			getTreeList() {
-				treeByPid({
-					ids: [6]
+				getProduceTreeByPid({
+					type: 5
 				}).then(res => {
 					this.classificationList = res;
 					this.confirm(res[0].id, res[0].name);
@@ -413,30 +414,30 @@
 
 <style scoped lang="scss">
 	// @import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
-	
-	
-	
+
+
+
 	.listContent {
 		height: 100% !important;
-	
+
 		.listBox {
 			display: flex;
 			// height: 180rpx;
 			padding: 20rpx 0;
 			border-bottom: 2rpx solid #e5e5e5;
-	
+
 			.listBox-sel {
 				height: 90rpx;
 				width: 80rpx;
 				// line-height: 90rpx;
 				text-align: center;
-	
+
 				checkbox {
 					transform: scale(1.2);
 				}
 			}
 		}
-		
+
 		.listBox-con {
 			width: 100%;
 			// display: flex;
@@ -444,13 +445,13 @@
 			// justify-content: space-between;
 			align-items: center;
 			padding: 0 18rpx 0 0;
-		
+
 			.listBox-top {
 				width: 100%;
 				display: flex;
 				justify-content: space-between;
 				padding-bottom: 10rpx;
-		
+
 				.listBox-name,
 				.listBox-code {
 					display: inline-block;
@@ -458,171 +459,171 @@
 					font-weight: bold;
 				}
 			}
-		
+
 			.listBox-bottom {
 				width: 100%;
 				display: flex;
 				justify-content: space-between;
 				font-size: $uni-font-size-sm;
 				flex-wrap: wrap;
-		
+
 				>view {
 					width: 100%;
 					overflow: hidden;
 					white-space: nowrap;
 					text-overflow: ellipsis;
 				}
-		
+
 				.half {
 					width: 50%;
 				}
-				
-				.label-s{
+
+				.label-s {
 					width: 50%;
 					display: inline-block !important;
 				}
 			}
 		}
-	
+
 		.noDate {
 			height: 100%;
 		}
 	}
-	
-	
-	
+
+
+
 	.mainBox {
-			height: 100vh;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.wrapper {
+			// flex: 1;
+			height: calc(100vh - 250rpx);
+			overflow: hidden;
+		}
+
+		//底部按钮
+		.footer {
+			height: 45px;
+			position: relative;
 			display: flex;
-			flex-direction: column;
-	
-			.wrapper {
-				// flex: 1;
-				height: calc(100vh - 250rpx);
-				overflow: hidden;
+			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;
 			}
-	
-			//底部按钮
-			.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;
-				}
+
+			.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;
-				}
-	
+		}
+
+		.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;
-					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;
-				}
+
+			.active {
+				background: $theme-color;
+				border: 2rpx solid $theme-color;
+				color: #FFF;
 			}
 		}
-	
+	}
+
 	// @import './accessory.scss';
 </style>

+ 52 - 7
pages/salesServiceManagement/workOrder/components/accessoryList.vue

@@ -8,9 +8,18 @@
 						@input="(val) =>inputChange(val,'totalCount',index)" slot="totalCount"
 						v-model="item.totalCount">
 					</u--input>
-					<u--input  :disabled="isDisable"  placeholder="请输入" type="number" @input="(val) =>inputChange(val,'singlePrice',index)"
-						slot="singlePrice" v-model="item.singlePrice">
+					<u--input :disabled="isDisable" placeholder="请输入" type="number"
+						@input="(val) =>inputChange(val,'singlePrice',index)" slot="singlePrice"
+						v-model="item.singlePrice">
 					</u--input>
+
+					<uni-data-picker style="width:100%" v-if="title == '配件回收清单'&&!isDisable"
+						@change="handleLastChange(index)" :map="{text:'name',value:'id'}" v-model="item.warehouseId"
+						slot="warehouseId" placeholder="请选择" :localdata="warehouseList">
+					</uni-data-picker>
+					<span v-else slot="warehouseId">
+						{{item.warehouseName}}
+					</span>
 				</myCard>
 			</view>
 		</u-list>
@@ -22,10 +31,10 @@
 
 <script>
 	import myCard from '@/pages/saleManage/components/myCard.vue';
+
 	import {
-		getWarehouseOutStock,
-		getIdWarehouseList
-	} from '@/api/salesServiceManagement/workOrder/index.js';
+		getWarehouseList,
+	} from "@/api/pda/workOrder.js";
 	export default {
 		components: {
 			myCard
@@ -98,7 +107,8 @@
 					}],
 					[{
 						label: '仓库:',
-						prop: 'warehouseName'
+						prop: 'warehouseName',
+						slot: 'warehouseId'
 					}],
 					[{
 						label: '操作:',
@@ -114,7 +124,8 @@
 					type: '2',
 					pageUrl: '',
 				}],
-				tableList: []
+				tableList: [],
+				warehouseList: []
 			}
 		},
 		computed: {
@@ -142,11 +153,22 @@
 					}
 				})
 			})
+			this.getWarehouseFn()
 		},
 		onShow() {
 
 		},
 		methods: {
+			handleLastChange(index) {
+				let data = this.warehouseList.find(item => item.id == this.tableList[index].warehouseId)
+				this.$set(this.tableList[index], 'warehouseName', data?.name)
+			},
+			// 仓库
+			getWarehouseFn() {
+				getWarehouseList().then((res) => {
+					this.warehouseList = res
+				});
+			},
 			add() {
 				let dataSources = this.title == '配件回收清单' ? '1' : '0';
 				uni.navigateTo({
@@ -194,6 +216,29 @@
 				obj.totalPrice = total;
 			},
 			getTabData() {
+				let is = true;
+				if (this.title == '配件回收清单') {
+					let warehouseIdS = this.tableList.filter((item) => item.warehouseId);
+					if (warehouseIdS.length != this.tableList.length) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择仓库",
+						})
+						return
+					}
+				}
+				this.tableList.forEach((item) => {
+					if (!item.totalCount) {
+						is = false;
+					}
+				});
+				if (!is) {
+					this.$refs.uToast.show({
+						type: "warning",
+						message: "请填写数量",
+					})
+					return
+				}
 				return this.tableList || [];
 			}
 		}

+ 7 - 7
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -18,7 +18,7 @@
 		<ContactList ref="contactRef" :type="type" v-show="currentValue == 6" :itemList="contactInfoVOS"
 			:isReport="isReport" />
 		<!-- 方案列表 -->
-		<SchemeList ref="schemeRef" v-show="currentValue == 7" :type='type' :itemList="costListVOS" />
+		<SchemeList ref="schemeRef" v-show="currentValue == 7" :type='type' :itemList="costListVOS" pageName="workOrder" />
 		<!-- 报工信息 -->
 		<ReportInfo ref="reportInfoRef" :form="reportForm" v-show="currentValue == 1" />
 		<view :class=" type == 'report' ? 'footerButton footer_button':'footerButton'" v-if="isDisable">
@@ -237,7 +237,7 @@
 				// 点击报工 逻辑
 				if (type == 'report') {
 					let flag = true;
-					productDetail[0].faultDetails.forEach((el) => {
+					productDetail[0]?.faultDetails?.forEach((el) => {
 						if (!el.faultReason || !el.maintenanceProcess) {
 							this.$refs.uToast.show({
 								type: "warning",
@@ -274,7 +274,7 @@
 						id: obj.id,
 					}
 				}
-				productDetail.map((el) => {
+				productDetail?.map((el) => {
 					delete el.produceTime;
 				})
 				data.salesDemandUpdatePO.productDetail = productDetail;
@@ -298,16 +298,16 @@
 				}
 
 				// 报工进来 保存或者报工 数据
-				if (this.type == 'report' && productDetail[0].faultDetails.length > 0) {
+				if (this.type == 'report' && productDetail[0]?.faultDetails?.length > 0) {
 					let list = this.$refs.accessoryRef.getTabData() || [];
 					if (list.length > 0) {
 						let detailList = this.clistData(list);
 						// 指定绑定第一条设备信息
 						let item = data.salesDemandUpdatePO.productDetail[0];
 						let accessoryApply = {
-							demandDetailId: item.id,
-							categoryCode: item.categoryCode,
-							categoryName: item.categoryName,
+							demandDetailId: item?.id,
+							categoryCode: item?.categoryCode,
+							categoryName: item?.categoryName,
 							contactName: data.salesDemandUpdatePO.contractInfo.name,
 							contactCode: data.salesDemandUpdatePO.contractInfo.code,
 							detailList

+ 3 - 3
pages/salesServiceManagement/workOrder/components/forWork/checkAndAccept.vue

@@ -7,7 +7,7 @@
 					验收
 					<text class="btn confirm" @tap="submit">确定</text>
 				</view>
-				<uni-forms :modelValue="formData" class="form" label-width='75px'>
+				<uni-forms :modelValue="formData" class="form" label-width='80px'>
 					<uni-forms-item label="验收人" name="accepterUserId">
 						<uni-data-select v-model="formData.accepterUserId" @change="handleChange" :clear="false"
 							:localdata="contactInfoVOS"></uni-data-select>
@@ -144,8 +144,8 @@
 			color: #fff;
 
 			.btn {
-				width: 80rpx;
-				height: 32rpx;
+				// width: 80rpx;
+				// height: 32rpx;
 				display: inline-block;
 				font-size: 30rpx;
 				border: 1px solid #fff;

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

@@ -124,7 +124,7 @@
 		},
 		onLoad(params) {
 			let data = JSON.parse(params.data);
-			if (data.code) {
+			if (data.name) {
 				this.form = data;
 			}
 			console.log(data, 'params')
@@ -178,7 +178,7 @@
 				}
 				this.oldTypeId = this.form.typeId;
 				this.form = {
-					typeId: e.detail.value[0].text,
+					typeId: this.form.typeId,
 					code: '',
 					name: '',
 					categoryModel: '', // 型号

+ 44 - 13
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -35,6 +35,7 @@
 				type: Array,
 				default: () => []
 			},
+			pageName: ''
 		},
 		watch: {
 			itemList: {
@@ -59,8 +60,11 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'customize',
-							value: ['5'],
+							fn: (row) => {
+								return (this.type != 'view' &&
+									row.isApply != 1
+								);
+							}
 
 						}]
 					},
@@ -73,9 +77,11 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'customize',
-							value: ['5'],
-
+							fn: (row) => {
+								return (this.type != 'view' &&
+									row.isApply != 1
+								);
+							},
 						}]
 					},
 				],
@@ -142,6 +148,37 @@
 						label: '详细内容:',
 						prop: 'content'
 					}],
+					[{
+							prop: 'sparePartsApplyApprovalStatus',
+							label: '审核状态:',
+							isNone: this.pageName != 'workOrder',
+							formatter: (row) => {
+								if (row.typeId == 2) {
+									const reviewStatus = {
+										0: '未提交',
+										1: '审核中',
+										2: '已审核',
+										3: '审核不通过'
+									}
+									return !row.sparePartsApplyApprovalStatus ?
+										'未提交' :
+										reviewStatus[row.sparePartsApplyApprovalStatus];
+								}
+							},
+						},
+						{
+							prop: 'sparePartsApplyApprovalStatus',
+							isNone: this.pageName != 'workOrder',
+							label: '出库状态:',
+							formatter: (row) => {
+								if (row.typeId == 2) {
+									return row.sparePartsApplyApprovalStatus == 2 ?
+										'已出库' :
+										'未出库';
+								}
+							},
+						}
+					],
 					[{
 						label: '操作:',
 						prop: 'action',
@@ -155,7 +192,6 @@
 			this.getLevelCode('after_sales_project')
 			uni.$off('updateInfo');
 			uni.$on('updateInfo', (data) => {
-				data.customize = '5';
 				if (data.index || data.index == 0) {
 					let index = data.index;
 					delete data.index;
@@ -169,6 +205,7 @@
 
 		},
 		methods: {
+
 			async getLevelCode(code) {
 				try {
 					const res = await getByCode(code);
@@ -237,13 +274,7 @@
 				});
 			},
 			getTabData() {
-				let list = this.tableList.map((el) => {
-					if (el.customize) {
-						delete el.customize;
-					}
-					return el;
-				})
-				return list || [];
+				return this.tableList || []
 			}
 		}
 	}