Browse Source

量具送检审批开发

jabin 2 years ago
parent
commit
eae5b19cd7

+ 28 - 1
api/wt/index.js

@@ -309,4 +309,31 @@ export async function purchaseOrderReturnGetByIdAPI(id) {
 //
 //
 //
-//
+//
+
+
+/**
+ * /量具送检
+ */
+//查询量具送检信息
+export async function processById(params) {
+  const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params );
+  if (res.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//
+// 个人日志列表
+export async function getList(params) {
+  const res = await get('/eom/planToolLog/list', params );
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//
+//
+//
+
+

+ 22 - 2
pages/home/myTicket/myTicket.vue

@@ -5,6 +5,7 @@
 			<view class="top-tabs">
 				<u-tabs
 					:list="tabList"
+					:current = 'tabsCurrent'
 					@change="handleTabChange"
 					lineWidth="0"
 					:activeStyle="{
@@ -52,6 +53,7 @@
 	import { getWorkOrderList, statistics } from '@/api/myTicket'
 	import KdCard from '../components/KdCard/index.vue'
 	import CardTime from '../components/CardTime.vue'
+import { nextTick } from "vue"
 	// import { postJ } from '@/utils/api'
 	let [isEnd] = [false]
 	export default {
@@ -62,6 +64,7 @@
 		data() {
 			return {
 				orderTitle: '',
+				tabsCurrent: 0,  // tabs初始位置
 				doneRange: [
 					{
 						value: 1,
@@ -99,6 +102,7 @@
 						name: '保养工单',
 						type: 'maintenance',
 						workOrderType: 2,
+						index: 0,
 						url: `/pages/maintenance/detail/detail?`,
 						badge: {
 							value: 0
@@ -108,6 +112,7 @@
 						name: '巡点检工单',
 						type: 'patrol',
 						workOrderType: 1,
+						index: 1,
 						url: `/pages/tour_tally/detail/detail?`,
 						badge: {
 							value: 0
@@ -117,6 +122,7 @@
 						name: '量具送检工单',
 						type: 'quantity',
 						workOrderType: 5,
+						index: 2,
 						url: `/pages/quantity/detail/detail?`,
 						badge: {
 							value: 0
@@ -253,10 +259,23 @@
 					code: '',
 					orderStatus: ''
 				},
-				page: 1
+				page: 1,
+				isInstall: true,  // 是否首次进入页面
 			}
 		},
-		onShow() {
+		onLoad(e) {
+			this.$nextTick(()=>{
+				this.isInstall = false
+				this.tabsCurrent = Number(e.index)?Number(e.index):0
+				this.$nextTick( async()=>{
+					await this.getCount()
+					this.handleTabChange(this.tabList[this.tabsCurrent])
+					// console.log(this.tabList[this.tabsCurrent],5656)
+				})
+			})
+		},
+		onShow(e) {
+			if(this.isInstall) return;
 			this.getList()
 			this.getCount()
 		},
@@ -295,6 +314,7 @@
 				this.getList()
 			},
 			handleTabChange(item) {
+				console.log(item)
 				this.activeType = item.type
 				this.activeIndex = item.index
 				this.page = 1

+ 281 - 70
pages/home/wt/components/measuringToolInspection/taskForm.vue

@@ -1,9 +1,163 @@
 <template>
-	<view class="">123</view>
+	<view class="">
+		<view class="basic_info">
+			<view class="info_header">
+				<view class="info_title">基本信息</view>
+				<u-gap height="4" bgColor="#1890FF"></u-gap>
+			</view>
+			<view class="info_content">
+				<u-row>
+					<u-col span="4">
+						<view class="label">计划单号:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{infoData.code}}121212</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">来源计划配置单:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{infoData.planConfigCode}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">完成时长:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value" v-if="infoData.duration">{{infoData.duration}}分钟</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">周期:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value" v-if="infoData.ruleInfo">
+							{{ infoData.ruleInfo.cycleValue}}
+							<!-- {{getDictValue('巡点检周期', infoData.ruleInfo.cycleType)}} -->
+						</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">规则名称:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{ infoData.name}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">创建人:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{ infoData.createUserName}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">创建时间:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{ infoData.createTime}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">
+						<view class="label">备注:</view>
+					</u-col>
+					<u-col span="8">
+						<view class="value">{{ infoData.remark}}</view>
+					</u-col>
+				</u-row>
+			</view>
+			<view class="info_header">
+				<view class="info_title">量具设备</view>
+				<u-gap height="4" bgColor="#1890FF"></u-gap>
+			</view>
+			<view class="card_box" v-for="(item,index) in infoData.planDeviceList">
+				<view class="card_title">设备{{index + 1}}</view>
+				<u-row>
+					<u-col span="3">
+						<view class="label">设备编码:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">{{item.substance.code}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="3">
+						<view class="label">设备编号:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">{{item.substance.codeNumber}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="3">
+						<view class="label">设备名称:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">{{item.substance.name}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="3">
+						<view class="label">设备型号:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">{{item.substance.model}}</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="3">
+						<view class="label">是否遗失:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">
+							<u-radio-group v-if="taskDefinitionKey === 'user_submit'" size="30" iconSize="20"
+								v-model="item.isLose" placement="row" @change="">
+								<u-radio :customStyle="{marginRight: '15px'}" v-for="(Item, Index) in option"
+									:key="Index" :label="Item.label" :name="Item.value">
+								</u-radio>
+							</u-radio-group>
+							<span
+								v-else>{{item.isLose != null? option.filter((i) => i.value == item.isLose)[0].label: ''}}</span>
+						</view>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="3">
+						<view class="label">质检:</view>
+					</u-col>
+					<u-col span="9">
+						<view class="value">
+							<u-radio-group
+								v-if="(taskDefinitionKey === 'leader_check' &&infoData.logList.length == 1) ||taskDefinitionKey === 'user_receive'"
+								size="30" iconSize="20" v-model="item.qualityStatus" placement="row"
+								@change="qualityChange">
+								<u-radio :customStyle="{marginRight: '15px'}" v-for="(Item, Index) in statusOption"
+									:key="Index" :label="Item.label" :name="Item.value">
+								</u-radio>
+							</u-radio-group>
+							<span
+								v-else>{{item.qualityStatus != null? statusOption.filter((i) => i.value == item.qualityStatus)[0].label: ''}}</span>
+						</view>
+					</u-col>
+				</u-row>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
-	import { getBusinessOpportunityDetailAPI, businessOpportunityUpdateAPI } from '@/api/wt/index.js'
+	import {
+		processById,
+		getList
+	} from '@/api/wt/index.js'
 	export default {
 		props: {
 			businessId: {
@@ -15,88 +169,145 @@
 		},
 		data() {
 			return {
-				form: {},
-				calendarShow: false,
-				tableField: [
-					{
-						label: '名称',
-						field: 'productName'
-					},
-					{
-						label: '编码',
-						field: 'productCode'
-					},
-					{
-						label: '类型',
-						field: 'productCategoryName'
-					},
-					{
-						label: '单价',
-						field: 'singlePrice'
-					},
-					{
-						label: '数量',
-						field: 'totalCount'
+				infoData: {}, // 量具送检信息
+				statusOption: [{
+						value: 0,
+						label: '正常'
 					},
 					{
-						label: '合计',
-						field: 'totalPrice'
+						value: 1,
+						label: '异常'
+					}
+				],
+				option: [{
+						value: 0,
+						label: '否'
 					},
 					{
-						label: '生产交付交期',
-						field: 'produceDeliveryDeadline',
-						type: 'date',
-						disabled: !['productionSupervisorApprove1', 'productionSupervisorApprove2'].includes(this.taskDefinitionKey)
+						value: 1,
+						label: '是'
 					}
 				],
-				list: ['基本信息', '产品清单'],
-				totalPrice: 0,
-				curNow: 0,
-				curIndex: null,
-				rules: {
-					produceDeliveryDeadline: {
-						type: 'string',
-						required: true,
-						message: '请选择生产交付日期',
-						trigger: ['blur', 'change']
-					}
-				}
 			}
 		},
+		created() {
+			this.getData()
+		},
 		methods: {
-			sectionChange(index) {
-				this.curNow = index
+			qualityChange(e) { // 质检切换
+				// console.log(e,6666666666666666666)
 			},
-			async getDetailData(id) {
-				const data = await getBusinessOpportunityDetailAPI(id)
-				if (data) {
-					this.form = data
-					console.log(this.form.productList)
-					this.totalPrice = this.form.productList.reduce((num, row) => (num += row.totalPrice), 0)
+			getData() {
+				let type = '';
+				switch (this.taskDefinitionKey) {
+					case 'user_submit':
+						type = 1;
+						break;
+					case 'team_leader_submit':
+						type = 2;
+						break;
+					case 'leader_approve':
+						type = 3;
+						break;
+					case 'leader_check':
+						type = 3;
+						break;
+					case 'team_leader_receive_send':
+						type = 2;
+						break;
+					case 'user_receive':
+						type = 1;
+						break;
 				}
+				processById({
+					id: this.businessId,
+					type
+				}).then(async (data) => {
+					this.infoData = data;
+					if (this.taskDefinitionKey == 'leader_check') {
+						this.infoData.planDeviceList = this.infoData.planDeviceList.map(
+							(item) => {
+								return {
+									...item,
+									qualityStatus: 0
+								};
+							}
+						);
+					}
+				});
 			},
-			openCalendar(e, index) {
-				this.calendarShow = true
-				this.curIndex = index
-			},
-			confirm(e) {
-				this.$set(this.form.productList[this.curIndex], 'produceDeliveryDeadline', ...e)
-				this.calendarShow = false
-			},
-			//
-			getTableValue() {
-				let validField = ['produceDeliveryDeadline']
-				let valid = false
-				for (var i = 0; i < validField.length; i++) {
-					valid = this.form.productList.some(item => !!item[validField[i]] == false)
-					if (valid) break
-				}
-				return new Promise(async (resolve, reject) => {
-					valid ? reject(uni.$u.toast('请完善产品清单信息')) : resolve(this.form)
-				})
+			async getTableValue() {
+				return this.infoData;
 			}
 		}
 	}
 </script>
 
-<style></style>
+<style lang="scss">
+	.basic_info {
+		box-sizing: border-box;
+		padding: 0 20rpx;
+	}
+
+	.info_title {
+		position: relative;
+		padding: 16rpx 50rpx;
+		font-size: 36rpx;
+		color: #606266;
+	}
+
+	.info_title::after {
+		content: '';
+		position: absolute;
+		top: 16rpx;
+		left: 0px;
+		width: 16rpx;
+		height: 50rpx;
+		background: #1890FF;
+	}
+
+	.info_content {
+		.label {
+			padding: 20rpx 0;
+			text-align: right;
+			font-size: 28rpx;
+			font-weight: 700;
+			color: #6e6e6e;
+		}
+
+		.value {
+			padding: 20rpx 0;
+			font-size: 28rpx;
+			color: #606266;
+		}
+	}
+
+	.card_box {
+		box-sizing: border-box;
+		padding: 20rpx;
+		margin: 20rpx;
+		width: calc(100% - 20rpx);
+		border-radius: 20rpx;
+		box-shadow: 0 0 12rpx -6rpx #000;
+
+		.card_title {
+			font-size: 32rpx;
+			font-weight: 700;
+			color: #666;
+		}
+
+		.label {
+			padding: 18rpx 0;
+			text-align: right;
+			font-size: 28rpx;
+			font-weight: 700;
+			color: #6e6e6e;
+		}
+
+		.value {
+			padding: 18rpx 0;
+			font-size: 28rpx;
+			color: #606266;
+		}
+	}
+</style>

+ 10 - 5
pages/home/wt/components/measuringToolInspection/taskSubmit.vue

@@ -8,8 +8,8 @@
 					@click.native="showTechnicianPicker"></u--input>
 			</u-form-item>
 
-			<u-form-item label="审批建议" prop="reason" required>
-				<u--textarea style="width: 100%;" height='120' border='surround' placeholder="请输入审批建议"
+			<u-form-item label="审批建议" prop="reason" required style="margin: 20rpx 0;">
+				<u--textarea height='120' placeholder="请输入审批建议"
 					v-model="form.reason"></u--textarea>
 			</u-form-item>
 		</u--form>
@@ -17,8 +17,8 @@
 			<u-button style="width: 100%;margin-bottom: 10rpx;" icon="edit-pen" :loading='loading' type="success"
 				text="通过" @click="handleAudit(1)">
 			</u-button>
-			<u-button style="width: 100%;" :loading='loading' type="error" icon="close" text="驳回"
-				@click="handleAudit(0)" v-if="!['starter'].includes(taskDefinitionKey)"></u-button>
+			<!-- <u-button style="width: 100%;" :loading='loading' type="error" icon="close" text="驳回"
+				@click="handleAudit(0)" v-if="!['starter'].includes(taskDefinitionKey)"></u-button> -->
 		</view>
 		<u-picker itemHeight='60' :show="technicianShow" visibleItemCount='10' :columns="userOptions" keyName="name"
 			@confirm='selectTechnicianInfo' @cancel='technicianShow = false' title='选择技术员'></u-picker>
@@ -176,5 +176,10 @@
 	}
 </script>
 
-<style>
+<style lang="scss">
+::v-deep .u-textarea{
+	// margin: 20rpx 0;
+	padding: 0;
+	border: 1rpx solid #666;
+}
 </style>

+ 1 - 0
pages/home/wt/components/processTask.vue

@@ -67,6 +67,7 @@
 					});
 					Vue.component('async-sub-form-component', (resolve) => {
 						require(['pages/home' + this.listData.miniViewRouter], resolve);
+						console.log('pages/home' + this.listData.miniHandleRouter,56565656)
 					});
 	console.log(getCurrentPages())
 					// 取消加载中

+ 35 - 5
pages/index/index.vue

@@ -33,10 +33,10 @@
 			<CellTip title="运维管理" v-if="operationsList.length > 0"></CellTip>
 			<view class="nav">
 				<view class="nav-content">
-					<view class="nav-item" v-for="(item, index) in operationsList" @click="toNav(item.path)">
+					<view class="nav-item" v-for="(item, index) in operationsList" @click="toNav(item.url)">
 						<span :class="'iconfont ' + item.icon"></span>
-						<label>{{ item.title }}</label>
-						<label>{{ item.num }}</label>
+						<label>{{ item.name }}</label>
+						<!-- <label>{{ item.num }}</label> -->
 					</view>
 				</view>
 			</view>
@@ -245,6 +245,36 @@
 
 				//运维类
 				operationsList: [
+					{
+						name: '保养工单',
+						type: 'maintenance',
+						workOrderType: 2,
+						url: `/pages/home/myTicket/myTicket?index=0`,
+						icon: "icon-gongdanguanli",
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '巡点检工单',
+						type: 'patrol',
+						workOrderType: 1,
+						url: `/pages/home/myTicket/myTicket?index=1`,
+						icon: "icon-gongdanguanli",
+						badge: {
+							value: 0
+						}
+					},
+					{
+						name: '量具送检工单',
+						type: 'quantity',
+						workOrderType: 5,
+						url: `/pages/home/myTicket/myTicket?index=2`,
+						icon: "icon-gongdanguanli",
+						badge: {
+							value: 0
+						}
+					}
 					/*	{
 							class: "iconfont icon-xundianjian",
 							title: "巡点检",
@@ -306,8 +336,8 @@
 						if (f.path == 'productionManage') {
 							this.productionList = f.children
 						} else if (f.path == 'operationsList') {
-							this.operationsList = f.children
-							console.log(this.operationsList)
+							// this.operationsList = f.children
+							// console.log(this.operationsList)
 						}
 					})
 				}