Browse Source

1、app前端调整
2、分选

ezhizao 1 year ago
parent
commit
3b1dd43ee2

+ 1 - 1
api/base/path.js

@@ -11,7 +11,7 @@ export const path = reactive({
 	furnaceNoURL: 'http://120.46.159.163:7002',
 
 	// 内网
-	innerURL: 'http://192.168.31.147:8099',
+	innerURL: 'http://192.168.31.216:8099',
 	// innerURL: 'http://120.46.159.163:401',
 	innerUpdateAppURL: 'http://120.46.159.163:401/ezhizao-dms-production',
 	innerFurnaceNoURL: 'http://120.46.159.163:7002',

+ 1 - 1
api/business/deptProcess.js

@@ -4,7 +4,7 @@ import req from '@/utils/request.js'
 export function getProcessList(data) {
 	return req.request({
 		url:'/business/deptProcess/list',
-		method: 'GET',
+		method: 'POST',
 		data: data
 	})
 }

+ 13 - 0
api/business/workshop.js

@@ -0,0 +1,13 @@
+import req from '@/utils/request.js'
+
+/**
+ * 车间外周转区
+ * @param {Object} data
+ */
+export function getTurnoverByWorkshop(data) {
+	return req.request({
+		url:'/business/workshop/turnover',
+		method: 'POST',
+		data: data
+	})
+}

+ 3 - 9
components/dialog-selectProduction/dialog-selectProduction.vue

@@ -50,16 +50,10 @@
 			planDetailId: store.planDetails.id
 		}).then(res => {
 			if (res.code == 200) {
-				//过滤出工序交集
-				console.log('1')
-				let filteredData = store.planDetails.processSequence.filter((item1) =>
-					res.data.some((item2) => item2.processCode === item1.processCode)
-				)
-				console.log('2')
-				for (let i = 0; i < filteredData.length; i++) {
+				for (let i = 0; i < res.data.length; i++) {
 					processList.value[i] = {
-						text: filteredData[i].processAlias,
-						value: filteredData[i].id
+						text: res.data[i].processAlias,
+						value: res.data[i].processId
 					}
 				}
 			}

+ 12 - 12
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -31,7 +31,7 @@
 			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '2'">
 				<view v-for="(item,index) in turnoverArea" class="btn">
 					<view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
-						@click="selectTurnoverDoorOutside(item)"><text class="label">{{item.dictLabel}}</text></view>
+						@click="selectTurnoverDoorOutside(item)"><text class="label">{{item.code}}</text></view>
 				</view>
 			</view>
 		</view>
@@ -52,6 +52,9 @@
 	import {
 		getDictInfoByType
 	} from '@/api/dict/dict.js'
+	import {
+		getTurnoverByWorkshop
+	} from '@/api/business/workshop.js'
 	import {
 		getDayWorkItemList,
 		saveDayWorkItem,
@@ -92,9 +95,8 @@
 	function open(data) {
 		resetPage();
 		dayworkInfo.value = data;
-		console.log(dayworkInfo.value)
-		baseDialog.value.open();
 		init();
+		baseDialog.value.open();
 	}
 
 	defineExpose({
@@ -123,7 +125,7 @@
 	function init() {
 		getDictInfoByType('daywork_turnover_type').then(res => {
 			turnoverType.value = res.data;
-			getDictInfoByType('workshop_turnover_area').then(res => {
+			getTurnoverByWorkshop({ deptId: store.curDeptDetails.deptId }).then(res => {
 				turnoverArea.value = res.data;
 			})
 		})
@@ -136,13 +138,11 @@
 				turnoverType: 1,
 				deptId: null
 			};
-			console.log(curDayworkItem.value)
 		})
 		getDeptList({
 			tenantId: store.tenantId,
 			productionPlanDetailId: store.planDetails.id
 		}).then(res => {
-			console.log(res.data)
 			for (let i = 0; i < res.data.length; i++) {
 				deptList.value = res.data;
 				if (store.curDeptDetails.workshopId == res.data[i].workshopId) {
@@ -159,8 +159,8 @@
 					})
 				}
 			}
-			console.log(insideDepts.value)
-			console.log(outsideDepts.value)
+			// console.log(insideDepts.value)
+			// console.log(outsideDepts.value)
 		})
 	}
 
@@ -198,7 +198,7 @@
 	}
 
 	function handleConfirm() {
-		console.log(dayworkInfo.value)
+		//console.log(dayworkInfo.value)
 		curDayworkItem.value.id = null;
 		curDayworkItem.value.status = curDayworkItem.value.turnoverType == '1' ? '7' : '4';
 		curDayworkItem.value.startTime = timestampToTime(new Date());
@@ -234,8 +234,8 @@
 				curDayworkItem.value.deptName = deptList.value[i].deptName;
 			}
 		}
-		console.log(curDayworkItem.value);
-		console.log(dayworkInfo.value)
+		// console.log(curDayworkItem.value);
+		// console.log(dayworkInfo.value)
 		if (!handleValidate(curDayworkItem.value)) {
 			uni.showToast({
 				icon: "none",
@@ -276,7 +276,7 @@
 	}
 	
 	function handleChangeOutside(){
-		console.log(curDayworkItem.value.deptId)
+		//console.log(curDayworkItem.value.deptId)
 	}
 	
 </script>

+ 17 - 0
pages/dashboard/index.vue

@@ -31,6 +31,9 @@
 		<view class="business-btn uni-row" v-if="showOther" @click="handleToProductionPlan">
 			<text class="label">报工</text>
 		</view>
+		<view class="business-btn uni-row" v-if="showOther" @click="handleToSorting">
+			<text class="label">分选报工</text>
+		</view>
 		<!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
 		<view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList">
 			<text class="label">周转</text>
@@ -197,6 +200,20 @@
 			})
 		}
 	}
+	
+	// 分选
+	function handleToSorting() {
+		if (curSelectedDeptId.value) {
+			uni.navigateTo({
+				url: '/pages/sorting/form'
+			})
+		} else {
+			uni.showToast({
+				icon: "none",
+				title: "请选择工段"
+			})
+		}
+	}
 
 	function handleToHandlingList() {
 		console.log(store)

+ 148 - 0
pages/sorting/consultation.vue

@@ -0,0 +1,148 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="title uni-row">咨询</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const keywords = ref('')
+	const optionList = ref([])
+	// 检查指导书
+	const optionList1 = ref([])
+	// 分选标准
+	const optionList2 = ref([])
+	
+	// 页面生命周期函数
+	onLoad(() => {
+		optionList1.value = [
+			{
+				title: '001 台阶径',
+				standard: '角偏 < 0.05'
+			},
+			{
+				title: '002 台阶径',
+				standard: '角偏 < 0.04'
+			}
+		]
+		
+		optionList2.value = [
+			{
+				title: '划痕',
+				standard: '划痕描述'
+			},
+			{
+				title: '划伤',
+				standard: '划伤描述'
+			}
+		]
+		
+		optionList.value = optionList1.value
+	})
+	
+	// tabbar切换
+	const handleTabBarClick = (val) => {
+		switch (val) {
+			case 1:
+				optionList.value = optionList1.value
+				break
+			case 2:
+				optionList.value = optionList2.value
+		}
+		currentTabName.value = val
+	}
+	
+	const handleOptionChecked = (data) => {
+		uni.$emit('addUnfitInfoEvent', {
+			title: data.title,
+			standard: data.standard
+		})
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+	.option-container {
+		background-color: #ffffff;
+		padding: 24rpx;
+		border-radius: 12rpx;
+	}
+	.tab-bars {
+		height: 56rpx;
+		
+		> view {
+			flex: 1;
+			text-align: center;
+			
+			.line {
+				width: 50%;
+				height: 2px;
+				margin:8rpx auto 0 auto;
+				background-color: #FFFFFF;
+			}
+			&.active {
+				.line {
+					background-color: #1684FC;
+				}
+			}
+		}
+	}
+	.search-container {
+		margin-top: 16rpx;
+		align-items: center;
+		
+		input {
+			flex: 1;
+			height: 72rpx;
+			border: 1px solid #bbbbbb;
+			padding: 0 8rpx;
+			box-sizing: border-box;
+		}
+		.btn {
+			display: flex;
+			flex-direction: row;
+			width: 112rpx;
+			height: 72rpx;
+			align-items: center;
+			justify-content: center;
+			background-color: #1684FC;
+			color: #ffffff;
+		}
+	}
+	.option-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		border-bottom: 1px solid #BBBBBB;
+		
+		.uni-row {
+			padding-bottom: 16rpx;
+			
+			.label {
+				width: 144rpx;
+			}
+			.value {
+				flex: 1;
+			}
+		}
+		.uni-row:first-child {
+			font-size: 32rpx;
+			font-weight: 700;
+		}
+		
+		.arrow-right {
+			position: absolute;
+			top: 24rpx;
+			right: 24rpx;
+		}
+	}
+</style>

+ 321 - 0
pages/sorting/form.vue

@@ -0,0 +1,321 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="lot-info uni-column">
+			<view class="lot-code uni-row">
+				<text>批次号</text>
+				<text style="margin-left: 24rpx;">D2423156000691</text>
+			</view>
+			<view class="product-info">
+				产品描述
+			</view>
+		</view>
+		
+		<!-- 不合格信息 -->
+		<view class="title unfit-title uni-row">
+			<text>不合格信息</text>
+			<view class="add-btn" @click="handleAddUnfit">添加</view>
+		</view>
+		<view class="unfit-container">
+			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
+				<view class="title uni-row">
+					<text>检查项-{{ item.title }}</text>
+					<uni-icons type="trash" size="24" color="#fc6565" @click="handleDelUnfit(index)" />
+				</view>
+				<view class="standard">检查标准:{{ item.standard }}</view>
+				<view class="result uni-row">
+					<view class="label">检查结果</view>
+					<input v-model="item.result" placeholder="请输入检查结果" />
+					<view class="label" style="text-align: right; padding-right: 16rpx;">数量</view>
+					<input class="number" type="number" v-model="item.number" placeholder="" />
+				</view>
+			</view>
+		</view>
+		
+		<!-- 咨询部分 -->
+		<view class="title">咨询</view>
+		<view class="consultation-container uni-column">
+			<view class="consultation-item-container" v-for="(item, index) in consultations" :key="index">
+				<view class="question uni-column">
+					<view class="label uni-row">
+						<text>问题描述</text>
+						<text style="color: #fcab53">{{ item.answer === '' ? '待回复' : '已回复' }}</text>
+					</view>
+					<view class="content">{{ item.question }}</view>
+				</view>
+				<view class="answer">
+					<view class="label">回复</view>
+					<view class="content">{{ item.answer }}</view>
+				</view>
+			</view>
+		</view>
+		
+		<!-- 报工部分 -->
+		<view class="daywork-container">
+			<view class="result uni-row">
+				<view class="label">合格量</view>
+				<input type="number" placeholder="请输入合格量" />
+				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
+				<input type="number" placeholder="请输入废品量" />
+			</view>
+			<view class="remark uni-row">
+				<view class="label">备注</view>
+				<textarea />
+			</view>
+			
+			<view class="btns-container uni-row">
+				<view class="finished-btn">结束报工</view>
+				<view class="question-btn uni-column" @click.stop="handleAddConsultation">
+					<uni-icons type="headphones" size="24" />
+					<text>咨询</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const unfitInfos = ref([])
+	const consultations = ref([])
+	
+	onShow(() => {
+		
+	})
+	/***************************** 定义了一些方法 *****************************/
+	const addUnfitInfo = (data) => {
+		const info = {
+			title: data.title,
+			standard: data.standard,
+			result: '',
+			number: 1
+		}
+		unfitInfos.value.push(info)
+	}
+	const addConsultation = (data) => {
+		const info = {
+			question: data.title,
+			answer: ''
+		}
+		unfitInfos.value.push(info)
+	}
+	
+	/***************************** 定义了一些事件 *****************************/
+	// 添加不合格信息
+	const handleAddUnfit = () => {
+		// 监听事件
+		uni.$once('addUnfitInfoEvent',(data)=>{  
+			addUnfitInfo(data)
+		})
+		uni.navigateTo({
+			url: "/pages/sorting/options"
+		})
+	}
+	// 删除不合格信息
+	const handleDelUnfit = (index) => {
+		uni.showModal({
+			title: '提示',
+			content: '确定删除该项?',
+			success: function (res) {
+				if (res.confirm) {
+					unfitInfos.value.splice(index, 1)
+				} else if (res.cancel) {
+					return
+				}
+			}
+		})
+	}
+	
+	// 添加不合格信息
+	const handleAddConsultation = () => {
+		// 监听事件
+		uni.$once('addConsulttationEvent',(data)=>{  
+			addConsultation(data)
+		})
+		uni.navigateTo({
+			url: "/pages/sorting/consultation"
+		})
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		
+		> .title {
+			font-weight: 700;
+			margin: 24rpx 16rpx;
+		}
+	}
+	.lot-info {
+		margin: 32rpx 16rpx 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+		
+		.lot-code {
+			font-size: 32rpx;
+			font-weight: 700;
+			margin-bottom: 16rpx;
+		}
+		.product-info {
+			font-size: 28rpx;
+			color: #9f9f9f;
+		}
+	}
+	.unfit-title {
+		margin-bottom: 24rpx;
+		justify-content: space-between;
+		align-items: center;
+		
+		text {
+			font-size: 28rpx;
+			font-weight: 700;
+		}
+		.add-btn {
+			padding: 12rpx 32rpx;
+			background-color: #a4adb3;
+			color: #ffffff;
+			border-radius: 12rpx;
+			font-size: 24rpx;
+		}
+	}
+	.unfit-container {
+		padding: 24rpx;
+		margin: 0 16rpx;
+		background-color: #ffffff;
+		border-radius: 12rpx;
+		
+		.unfit-item-container {
+			position: relative;
+			
+			> * {
+				margin-bottom: 24rpx;
+			}
+			
+			.title {
+				font-weight: 700;
+				justify-content: space-between;
+				align-items: center;
+				
+				image {
+					width: 40rpx;
+					height: 40rpx;
+				}
+			}
+			.standard {
+			}
+			.result {
+				align-items: center;
+				border-bottom: 1px solid #9f9f9f;
+				padding-bottom: 32rpx;
+				
+				.label {
+					flex: 1;
+				}
+				input {
+					width: 280rpx;
+					height: 56rpx;
+					border: 1px solid #9f9f9f;
+					font-size: 28rpx;
+					
+					&.number {
+						width: 104rpx;
+						text-align: center;
+					}
+				}
+			}
+		}
+		.unfit-item-container:last-child {
+			.result {
+				border-bottom: none;
+				padding-bottom: 0;
+			}
+		}
+	}
+	.consultation-container {
+		margin: 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+		
+		.question, .answer {
+			.label {
+				justify-content: space-between;
+				margin-bottom: 16rpx;
+				font-weight: 700;
+			}
+			.content {
+				line-height: 40rpx;
+			}
+		}
+		.answer {
+			margin-top: 24rpx;
+		}
+	}
+	
+	.daywork-container {
+		margin-top: 24rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border: 1px solid #bcbcbc;
+		
+		.result {
+			align-items: center;
+			
+			.label {
+				width: 112rpx;
+			}
+			input {
+				flex: 1;
+				height: 56rpx;
+				border: 1px solid #9f9f9f;
+				font-size: 28rpx;
+				text-align: center;
+			}
+		}
+		
+		.remark {
+			margin-top: 24rpx;
+			.label {
+				width: 112rpx;
+			}
+			textarea {
+				flex: 1;
+				border: 1px solid #9f9f9f;
+				height: 168rpx;
+			}
+		}
+		
+		.btns-container {
+			margin-top: 24rpx;
+			
+			.finished-btn {
+				display: flex;
+				flex: 1;
+				height: 80rpx;
+				background-color: #fc6565;
+				color: #ffffff;
+				text-align: center;
+				justify-content: center;
+				align-items: center;
+				border-radius: 8rpx;
+			}
+			.question-btn {
+				width: 80rpx;
+				align-items: flex-end;
+				
+				image {
+					width: 48rpx;
+					height: 48rpx;
+				}
+				text {
+					font-size: 24rpx;
+				}
+			}
+		}
+	}
+</style>

+ 178 - 0
pages/sorting/options.vue

@@ -0,0 +1,178 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="option-container uni-column">
+			<!-- tab-bar -->
+			<view class="tab-bars uni-row">
+				<view :class="currentTabName === 1 ? 'active' : ''" @click.stop="handleTabBarClick(1)">
+					<text>检查指导书</text>
+					<view class="line"></view>
+				</view>
+				<view :class="currentTabName === 2 ? 'active' : ''" @click.stop="handleTabBarClick(2)">
+					<text>分选标准</text>
+					<view class="line"></view>
+				</view>
+			</view>
+			<!-- 搜索框 -->
+			<view class="search-container uni-row">
+				<input type="text" v-model="keywords" placeholder="请输入编号/关键字" />
+				<view class="btn">搜索</view>
+			</view>
+			<!-- 选项 -->
+			<view class="option-item" v-for="(item, index) in optionList" :key="index" @click="handleOptionChecked(item)">
+				<view class="uni-row">
+					<view class="label">检查项</view>
+					<view class="value">{{ item.title }}</view>
+				</view>
+				<view class="uni-row">
+					<view class="label">检查标准</view>
+					<view class="value">{{ item.standard }}</view>
+				</view>
+				<uni-icons class="arrow-right" type="right" size="24" />
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const currentTabName = ref(1)
+	const keywords = ref('')
+	const optionList = ref([])
+	// 检查指导书
+	const optionList1 = ref([])
+	// 分选标准
+	const optionList2 = ref([])
+	
+	// 页面生命周期函数
+	onLoad(() => {
+		optionList1.value = [
+			{
+				title: '001 台阶径',
+				standard: '角偏 < 0.05'
+			},
+			{
+				title: '002 台阶径',
+				standard: '角偏 < 0.04'
+			}
+		]
+		
+		optionList2.value = [
+			{
+				title: '划痕',
+				standard: '划痕描述'
+			},
+			{
+				title: '划伤',
+				standard: '划伤描述'
+			}
+		]
+		
+		optionList.value = optionList1.value
+	})
+	
+	// tabbar切换
+	const handleTabBarClick = (val) => {
+		switch (val) {
+			case 1:
+				optionList.value = optionList1.value
+				break
+			case 2:
+				optionList.value = optionList2.value
+		}
+		currentTabName.value = val
+	}
+	
+	const handleOptionChecked = (data) => {
+		uni.$emit('addUnfitInfoEvent', {
+			title: data.title,
+			standard: data.standard
+		})
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+	.option-container {
+		background-color: #ffffff;
+		padding: 24rpx;
+		border-radius: 12rpx;
+	}
+	.tab-bars {
+		height: 56rpx;
+		
+		> view {
+			flex: 1;
+			text-align: center;
+			
+			.line {
+				width: 50%;
+				height: 2px;
+				margin:8rpx auto 0 auto;
+				background-color: #FFFFFF;
+			}
+			&.active {
+				.line {
+					background-color: #1684FC;
+				}
+			}
+		}
+	}
+	.search-container {
+		margin-top: 16rpx;
+		align-items: center;
+		
+		input {
+			flex: 1;
+			height: 72rpx;
+			border: 1px solid #bbbbbb;
+			padding: 0 8rpx;
+			box-sizing: border-box;
+		}
+		.btn {
+			display: flex;
+			flex-direction: row;
+			width: 112rpx;
+			height: 72rpx;
+			align-items: center;
+			justify-content: center;
+			background-color: #1684FC;
+			color: #ffffff;
+		}
+	}
+	.option-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		border-bottom: 1px solid #BBBBBB;
+		
+		.uni-row {
+			padding-bottom: 16rpx;
+			
+			.label {
+				width: 144rpx;
+			}
+			.value {
+				flex: 1;
+			}
+		}
+		.uni-row:first-child {
+			font-size: 32rpx;
+			font-weight: 700;
+		}
+		
+		.arrow-right {
+			position: absolute;
+			top: 24rpx;
+			right: 24rpx;
+		}
+	}
+</style>