2213980799@qq.com 1 год назад
Родитель
Сommit
18b51b36b4

+ 11 - 0
api/repair/index.js

@@ -193,3 +193,14 @@ export async function getList (data) {
   }
   return Promise.reject(new Error(res.message));
 }
+
+// 详情
+export async function getWordOrderDetail(workOrderId) {
+  const res = await get(
+    Vue.prototype.apiUrl +`/eam/workordermaintenance/maintenanceDetail/${workOrderId}`
+  );
+  if (res.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.message));
+}

+ 8 - 16
pages/maintenance/detail/detail.vue

@@ -239,7 +239,8 @@
 	} from '@/api/myTicket/index.js'
 	import {
 		getSpareParts,
-		getSparePartsApply
+		getSparePartsApply,
+		getWordOrderDetail
 	} from '@/api/repair'
 	import {
 		get,
@@ -342,21 +343,12 @@
 		methods: {
 
 			// 跳转备品备件
-			handlbpbj() {
-				let data = {
-					repairCode: this.worksheetInfo.code,
-					repairName: this.worksheetInfo.planName,
-					repairId: this.worksheetInfo.id,
-					pageType: 'add'
-				}
-				data['sparePartsApplyList'] = this.euqiList.map(item => {
-					return {
-						text: item.name,
-						fixCode: item.fixCode,
-						deviceCode: item.code,
-						value: item.id,
-					}
-				})
+		async handlbpbj() {
+				let data = await getWordOrderDetail(this.worksheetInfo.id);
+				data.deviceList = data.deviceList.map((item) => {
+					return item.substance;
+				});
+				data['pageType'] = 'add'
 				uni.navigateTo({
 					url: `/pages/maintenanceWorkorder/sparepart/sparepart?data=${JSON.stringify(data)}`
 				})

+ 7 - 5
pages/maintenanceWorkorder/components/pickCard.vue

@@ -24,7 +24,7 @@
 			<view class="item_box rx-bc">
 				<view class="item_one  rx-sc">
 					<view class="lable">设备名称:</view>
-					<view>{{item.deviceName}}</view>
+					<view>{{item.deviceList.filter((val) => val.name).map((val) => val.name).toString()}}</view>
 				</view>
 
 			</view>
@@ -32,15 +32,17 @@
 
 				<view class="item_one rx-sc">
 					<view>固资编码:</view>
-					<view>{{item.fixCode}}</view>
+					<view>{{item.deviceList.filter((val) => val.fixCode).map((val) => val.fixCode).toString()}}
+					</view>
 				</view>
 			</view>
 
-	
+
 			<view class="item_box rx-bc">
 				<view class="item_one  rx-sc">
 					<view class="lable">设备编码:</view>
-					<view>{{item.deviceCode}}</view>
+					<view>{{item.deviceList.filter((val) => val.deviceCode).map((val) => val.deviceCode).toString()}}
+					</view>
 				</view>
 
 			</view>
@@ -138,7 +140,7 @@
 				statusOpt: {
 					0: '审核中',
 					1: '审核通过',
-				
+
 				}
 			}
 		},

+ 6 - 12
pages/maintenanceWorkorder/detail/detail.vue

@@ -514,7 +514,7 @@
 			//获取备品备件
 			async getSparePartsApply(id) {
 				const list = await getSparePartsApply(id)
-				this.sparePartsApply=list
+				this.sparePartsApply = list
 			},
 			getInfo() {
 				getWorkOrderDetail(this.workOrderCode).then(data => {
@@ -566,17 +566,11 @@
 			},
 			// 跳转备品备件
 			handlbpbj() {
-
-				let data = {
-					repairCode: this.worksheetInfo.code,
-					repairName: this.worksheetInfo.planName,
-					repairId: this.worksheetInfo.id,
-					deviceName: this.equipmentInfo.name,
-					fixCode: this.equipmentInfo.fixCode,
-					deviceCode: this.equipmentInfo.codeNumber,
-					pageType:'add'
-				}
-
+				this.equipmentInfo['category']['modelType'] = this.equipmentInfo.category && this.equipmentInfo.category
+					.category.modelType
+				let data = JSON.parse(JSON.stringify(this.worksheetInfo));
+				data['deviceList'] = [this.equipmentInfo];
+				data['pageType']='add'
 				uni.navigateTo({
 					url: `/pages/maintenanceWorkorder/sparepart/sparepart?data=${JSON.stringify(data)}`
 				})

+ 182 - 19
pages/maintenanceWorkorder/sparepart/sparepart.vue

@@ -2,7 +2,7 @@
 	<view class="main">
 		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" right-icon="scan" title="申请备品备件" @clickLeft="goHome"
 			></uni-nav-bar>
-		<KdTabs v-model="active" :list="['基本信息','备品备件信息']" />
+		<KdTabs v-model="active" :list="['基本信息','设备信息','备品备件信息']" />
 		<view v-show="active==0">
 			<Cell cellType="more" title="编号">
 				<view class="cell-tip-right" slot="more">
@@ -21,10 +21,9 @@
 					{{ addForm.repairName  }}
 				</view>
 			</Cell>
-			<Cell cellType="more" title="设备编号">
+	<!-- 		<Cell cellType="more" title="设备编号">
 				<view class="cell-tip-right" slot="more">
-					<!-- <input  type="text" placeholder="请输入" v-model="form.equiCode"
-						placeholder-style="color:#999" style="font-size: 28rpx; text-align: right" /> -->
+		
 					{{ addForm.deviceCode }}
 				</view>
 			</Cell>
@@ -42,7 +41,7 @@
 				<view class="cell-tip-right" slot="more">
 					{{ addForm.fixCode }}
 				</view>
-			</Cell>
+			</Cell> -->
 
 			<Cell cellType="more" title="领用部门">
 				<view class="cell-tip-right" slot="more">
@@ -71,8 +70,43 @@
 
 			</Cell>
 		</view>
+	<view v-show="active==1" class="kd-equipment">
 
-		<view v-show="active==1">
+	<!-- 		<u-button v-if="type=='add'" type="success" size="small" class="u-reset-button" @click="addDevice()"
+				text="添加物品"></u-button> -->
+			<view class="kd-list-container">
+				<u-list >
+					<u-list-item v-for="(item, index) in deviceList" :key="index">
+						<view class="kd-card">
+							<view class="kd-card-wrapper">
+								<uni-icons @click="del(item.id,1)" v-if="type=='add'" custom-prefix="iconfont"
+										type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
+								<view class="kd-cell">
+								
+									<text class="kd-label">设备编码</text>
+									{{ item.code }}
+								</view>
+								<view class="kd-cell">
+									<text class="kd-label">设备名称</text>
+									{{ item.name }}
+								</view>
+								<view class="kd-cell">
+									<text class="kd-label">设备型号</text>
+									{{  item.category&&item.category.modelType||item.model }}
+								</view>
+							<!-- 	<view class="kd-cell">
+									<text class="kd-label">设备位置</text>
+									{{ item.deviceLocationName.pathName }}
+								</view> -->
+						
+							</view>
+				
+						</view>
+					</u-list-item>
+				</u-list>
+			</view>
+		</view>
+		<view v-show="active==2">
 
 			<u-button v-if="type=='add'" type="success" size="small" class="u-reset-button" @click="addPicking()"
 				text="添加物品"></u-button>
@@ -187,7 +221,8 @@
 					deviceId:''
 				},
 				tableList: [],
-				sparePartsApplyList: [],
+				deviceList:[],
+				// sparePartsApplyList: [],
 				type: 'add',
 				showTime: '请选择时间',
 
@@ -204,25 +239,35 @@
 			const obj = JSON.parse(data.data)
 			this.type = obj.pageType
 			if (this.type == 'add') {
-				this.addForm.repairCode = obj.repairCode;
-				this.addForm.repairName = obj.repairName;
-				this.addForm.repairId = obj.repairId;
-				if (!obj.sparePartsApplyList) {
-					this.addForm.deviceName = obj.deviceName;
-					this.addForm.fixCode = obj.fixCode;
-					this.addForm.deviceCode = obj.deviceCode;
-				} else {
-					this.sparePartsApplyList = obj.sparePartsApplyList;
-				}
+				this.addForm.repairCode = obj.code;
+				this.addForm.repairName = obj.planName;
+				this.addForm.repairId = obj.id;
+				this.deviceList = obj.deviceList;
+	
+				// if (!obj.sparePartsApplyList) {
+				// 	this.addForm.deviceName = obj.deviceName;
+				// 	this.addForm.fixCode = obj.fixCode;
+				// 	this.addForm.deviceCode = obj.deviceCode;
+				// } else {
+				// 	this.sparePartsApplyList = obj.sparePartsApplyList;
+				// }
 
 			} else {
 				const form = await detailsId(obj.id)
 				this.tableList = form.detailList
+				this.deviceList = form.deviceList
 				this.addForm = form
 			}
 		},
 		methods: {
-			del(id) {
+			del(id,type) {
+				if(this.type!='add'){
+				return
+				}
+				if(type==1){
+					this.deviceList = this.deviceList.filter((item) => item.id != id);
+					return
+				}
 				this.tableList = this.tableList.filter((item) => item.id != id);
 			},
 			sparePartsApplyChange(value) {
@@ -252,7 +297,7 @@
 			},
 			// 提交新增
 			submitAdd() {
-				if (!this.addForm.deviceName) {
+				if (this.deviceList.length==0) {
 					uni.showToast({
 						title: '请选择设备!',
 						icon: 'none'
@@ -279,6 +324,7 @@
 				})
 
 				this.addForm.detailList = this.tableList
+				this.addForm.deviceList = this.deviceList
 				applySpareParts(this.addForm)
 					.then(res => {
 						uni.showToast({
@@ -404,4 +450,121 @@
 			}
 		}
 	}
+	.kd-equipment {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		overflow: hidden;
+	
+		.kd-type-box {
+			text-align: center;
+			padding: 26rpx 0;
+	
+			view {
+				position: relative;
+				display: inline-block;
+				width: 120rpx;
+				padding: 4rpx 0;
+				color: #747474;
+				margin: 0 20rpx;
+				background-color: rgba(215, 215, 215, 0.5);
+	
+				&.type—active {
+					background-color: #1e7f35;
+					color: #fff;
+				}
+	
+				.count {
+					position: absolute;
+					top: -9px;
+					right: -9px;
+					width: 18px;
+					height: 18px;
+					border-radius: 50%;
+					font-size: 12px;
+					background-color: red;
+					color: #fff;
+				}
+			}
+		}
+	
+		.kd-list-container {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			overflow: hidden;
+			padding: 12rpx 18rpx;
+			background-color: $page-bg;
+	
+			.u-list {
+				flex: 1;
+				height: 100% !important;
+			}
+		}
+	}
+	.kd-card {
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		padding: 8rpx 0;
+		font-size: 28rpx;
+		word-break: break-all;
+	
+		.kd-card-wrapper {
+			padding: 0 30rpx;
+			border-bottom: 1px solid #dadada;
+		}
+	
+		.kd-cell {
+			line-height: 60rpx;
+		}
+	
+		.kd-cell:last-of-type {
+			border-bottom: none;
+		}
+	
+		.status-box {
+			margin-right: 16rpx;
+		}
+	
+		.card-footer {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			padding: 8rpx 0 20rpx;
+	
+			button {
+				width: 180rpx;
+				height: 56rpx;
+				line-height: 56rpx;
+				font-size: 28rpx;
+				margin: 0 8rpx;
+			}
+	
+			.primary-btn {
+				background-color: $j-primary-border-green;
+			}
+		}
+	}
+	.kd-cell {
+		min-height: 90rpx;
+		border-bottom: 1px dashed #dadada;
+		display: flex;
+		align-items: center;
+	
+		.kd-label {
+			display: inline-block;
+			width: 7em;
+			font-weight: bold;
+		}
+	
+		.kd-content {
+			flex: 1;
+			word-break: break-all;
+		}
+	}
+	
+	.kd-baseInfo {
+		padding: 0 32rpx;
+		font-size: 28rpx;
+	}
 </style>

+ 8 - 16
pages/tour_tally/detail/detail.vue

@@ -216,7 +216,8 @@
 	} from '@/api/myTicket/index.js'
 	import {
 		getSpareParts,
-		getSparePartsApply
+		getSparePartsApply,
+		getWordOrderDetail
 	} from '@/api/repair'
 	import {
 		get,
@@ -352,21 +353,12 @@
 				this.$refs.PopSparePart.open(title, list)
 			},
 			// 跳转备品备件
-			handlbpbj() {
-				let data = {
-					repairCode: this.worksheetInfo.code,
-					repairName: this.worksheetInfo.planName,
-					repairId: this.worksheetInfo.id,
-					pageType: 'add'
-				}
-				data['sparePartsApplyList'] = this.euqiList.map(item => {
-					return {
-						text: item.name,
-						fixCode: item.fixCode,
-						deviceCode: item.code,
-						value: item.id,
-					}
-				})
+			async handlbpbj() {
+				let data = await getWordOrderDetail(this.worksheetInfo.id);
+				data.deviceList = data.deviceList.map((item) => {
+					return item.substance;
+				});
+				data['pageType']='add'
 				uni.navigateTo({
 					url: `/pages/maintenanceWorkorder/sparepart/sparepart?data=${JSON.stringify(data)}`
 				})