Parcourir la source

保持path本地修改

zhuangdezheng il y a 1 an
Parent
commit
4b30a5cf78

+ 10 - 1
api/business/dayWork.js

@@ -8,7 +8,16 @@ export function getDayWorkList(data) {
 	return req.request({
 		url:'/business/daywork/list',
 		// header: reqHeader,
-		method: 'POST',
+		method: 'GET',
 		data: data
 	})
 }
+
+
+export function saveDayWork(data) {
+	return req.request({
+		url:'/business/daywork',
+		method: 'POST',
+		data: data
+	})
+}

+ 31 - 0
api/business/dayWorkItem.js

@@ -0,0 +1,31 @@
+import req from '../../utils/request.js'
+
+/**
+ * 获取生产子计划列表子表
+ * @param {Object} data
+ */
+export function getDayWorkItemList(data) {
+	return req.request({
+		url:'/business/dayworkItem/list',
+		// header: reqHeader,
+		method: 'GET',
+		data: data
+	})
+}
+
+
+export function updateDayWorkItem(data) {
+	return req.request({
+		url:'/business/dayworkItem',
+		method: 'PUT',
+		data: data
+	})
+}
+
+export function saveDayWorkItem(data) {
+	return req.request({
+		url:'/business/dayworkItem',
+		method: 'POST',
+		data: data
+	})
+}

+ 13 - 0
api/business/equipment.js

@@ -0,0 +1,13 @@
+import req from '../../utils/request.js'
+
+/**
+ * 查询批次列表
+ * @param {Object} data
+ */
+export function getEquipmentList(data) {
+	return req.request({
+		url:'/business/equipment',
+		method: 'GET',
+		data: data
+	})
+}

+ 13 - 0
api/business/lot.js

@@ -0,0 +1,13 @@
+import req from '../../utils/request.js'
+
+/**
+ * 查询批次列表
+ * @param {Object} data
+ */
+export function getLotList(data) {
+	return req.request({
+		url:'/business/lot/list',
+		method: 'GET',
+		data: data
+	})
+}

+ 85 - 7
components/dialog-end-work/dialog-end-work.vue

@@ -3,23 +3,34 @@
 		<view class="list-container">
 			<view class="list-title"><text class="label">合格量</text></view>
 			<view class="table-item">
-				<input class="input" placeholder="请输入合格量" />
+				<input class="input" v-model="workInfo.qualified" placeholder="请输入合格量" />
 			</view>
 			<view class="list-title">
 				<text class="label">废品量</text>
 			</view>
-
-			<view class="table-item"><input class="input" placeholder="请输入废品量" /></view>
+			<view class="table-item"><input class="input" v-model="workInfo.rejectNum" placeholder="请输入废品量" /></view>
 			<view class="list-title">
 				<text class="label">废品原因</text>
 			</view>
+			<view class="table-item"><input class="input" v-model="workInfo.remark" placeholder="请输入废品原因" /></view>
+			<view class="list-title uni-row">
+				<text class="label">当前序是否完成</text>
+				<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" style="transform:scale(0.7)" />
+			</view>
+			<view class="list-title"><text class="label">请选择设备:</text></view>
+			<!-- <scroll-view class="scroll-container" scroll-y> -->
+			<checkbox-group class="equipment-container uni-row" @change="checkboxChange">
+				<checkbox v-for="(item,index) in equiments" class="checkbox" style="transform:scale(0.8)" :key="index"
+					:value="item" :checked="item.checked">
+					{{item}}
+				</checkbox>
+			</checkbox-group>
 
-			<view class="table-item"><input class="input" placeholder="请输入废品原因" /></view>
 		</view>
 		<view class="add-btn-container uni-row">
-			<button type="default" class="btn">结束报工</button>
+			<button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
 		</view>
-</dialog-base>
+	</dialog-base>
 </template>
 
 
@@ -28,11 +39,56 @@
 		ref,
 		getCurrentInstance
 	} from 'vue'
+	import {
+		updateDayWorkItem,
+		saveDayWorkItem
+	} from "@/api/business/dayWorkItem.js"
 	const baseDialog = ref(null)
+	const equiments = ref(['009-21', '009-22', '009-23', '009-24', '009-25', '009-26', '009-27', '009-28', '009-29',
+		'009-26', '009-27'
+	])
+	const workInfo = ref({})
 	const open = (data) => {
 		// console.log(dialog.value)
+		workInfo.value.dayworkId = data.dayworkId;
+		workInfo.value.id = data.id;
 		baseDialog.value.open()
 	}
+
+	function switchChange(event) {
+		if (event.detail.value) {
+			workInfo.value.status = "2"
+		}
+	}
+
+	function checkboxChange(event) {
+		console.log(event.detail.value)
+		workInfo.value.equiments = event.detail.value
+	}
+
+	function handleFinishReporting() {
+		console.log(workInfo.value)
+		if(workInfo.value.status != 2) {
+			workInfo.value.status = '1';
+		}
+		saveDayWorkItem(workInfo.value).then(res => {
+			if(res.code === 200){
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功',
+					duration: 2000
+				});
+				baseDialog.value.close();
+			}else{
+				uni.showToast({
+					icon: 'error',
+					title: '操作失败',
+					duration: 2000
+				});
+			}
+		})
+	}
+
 	defineExpose({
 		open
 	})
@@ -54,8 +110,30 @@
 				}
 			}
 
+			.switch {
+				margin-top: -8rpx;
+				align-items: center;
+			}
+
+			.equipment-container {
+				width: 100%;
+				height: 120rpx;
+				flex-wrap: wrap;
+				justify-content: flex-start;
+				overflow: auto;
+
+				.checkbox {
+
+					padding: 12rpx 0;
+					justify-content: center;
+					align-items: center;
+				}
+
+			}
+
 			.table-item {
 				margin-top: 24rpx;
+
 				.input {
 					height: 60rpx;
 					border: 1px solid #808080;
@@ -69,7 +147,7 @@
 
 			.btn {
 				flex: 1;
-				background-color: rgb(255, 121, 1);
+				background-color: rgba(255, 85, 85, 1);
 				color: #FFFFFF;
 
 			}

+ 0 - 1
components/dialog-login/dialog-login.vue

@@ -74,7 +74,6 @@
 						if (res.code == 200) {
 							userInfo.value = res.data;
 							user.value.push(userInfo.value);
-							console.log(userInfo.value.nickName, 999);
 							uni.redirectTo({
 								url: '/pages/dashboard/index?userName=' + userInfo.value
 									.userName + '&userId=' + userInfo.value.userId

+ 18 - 8
components/dialog-lot/dialog-lot.vue

@@ -19,14 +19,16 @@
 				<text class="label value">{{form['qualifiedQuantity']}}</text>
 			</view>
 		</view>
-		<view class="list-title"><text class="label">请选择设备:</text></view>
-		<!-- <scroll-view class="scroll-container" scroll-y> -->
+<!-- 		<view class="list-title"><text class="label">请选择设备:</text></view>
 		<view class="equipment-container uni-row ">
 			<view v-for="(item, index) in equiments" :class="{'item':true,'selected': selectedButton === item}" :key="index" @click="selectButton(item)"><text class="label" >{{item}}</text></view>
-		</view>
+		</view> -->
 		<!-- </scroll-view> -->
 		<view class="add-btn-container uni-row">
-			<button type="primary" class="btn" style="flex: 1;">添加</button>
+			<button type="primary" class="btn" style="flex: 1;">确认</button>
+		</view>
+		<view class="add-btn-container uni-row">
+			<button type="primary" class="btn" style="flex: 1;" @click="handleScanCode">扫码</button>
 		</view>
 	</dialog-base>
 </template>
@@ -49,10 +51,10 @@
 		NextProcess: "清洗",
 		status: 0
 	})
-	const equiments = ref(['009-21','009-22','009-23','009-24','009-25','009-26','009-27','009-28','009-29'])
-    const selectButton = (data) => {
-		 selectedButton.value = data;
-	}
+	// const equiments = ref(['009-21','009-22','009-23','009-24','009-25','009-26','009-27','009-28','009-29'])
+ //    const selectButton = (data) => {
+	// 	 selectedButton.value = data;
+	// }
 	const open = (data) => {
 		// console.log(dialog.value)
 		baseDialog.value.open()
@@ -60,6 +62,14 @@
 	defineExpose({
 		open
 	})
+	
+	function handleScanCode(){
+		uni.scanCode({
+			onlyFromCamera: true,
+			success: function (res) {
+			}
+		});
+	}
 </script>
 
 <style lang="scss">

+ 2 - 2
pages.json

@@ -41,8 +41,8 @@
 		{
 			"path": "pages/productionPlan/index",
 			"style": {
-				"navigationBarTitleText": "生产计划单"
-				// "enablePullDownRefresh":true
+				"navigationBarTitleText": "生产计划单",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 77 - 21
pages/addNewBatch/index.vue

@@ -21,7 +21,7 @@
 				<text class='title'>绑定载具</text>
 				<view class="vehicleList uni-row">
 					<view class="vehicleNo uni-row" v-for="(item,index) in vehicleList">
-						<text>{{item}}</text>
+						<text>{{item.carrierCode}}</text>
 						<text @click="handleDelVehicleNo(index)">×</text>
 					</view>
 				</view>
@@ -40,23 +40,26 @@
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<view class="uni-row info">
 					<label for="HeatNo">炉号</label>
-					<input id="HeatNo" class="uni-input" v-model="basicInfo.HeatNo" placeholder="请填写" />
+					<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
+					<text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text>
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class="uni-row info">
 					<label for="manufacturer">厂家</label>
-					<input id="manufacturer" class="uni-input" v-model="basicInfo.manufacturer" placeholder="请填写" />
+					<!-- <input id="manufacturer" class="uni-input" v-model="basicInfo.manufacturer" placeholder="请填写" /> -->
+					<text id="manufacturer" class="uni-input">{{basicInfo.manufacturer}}</text>
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class="uni-row info">
-					<label for="incomingInfo">来料信息</label>
-					<input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" />
+					<label for="incomingInfo">来料信息</label> 
+					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
+					<text id="incomingInfo" class="uni-input">{{basicInfo.incomingInfo}}</text>
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 			</view>
 		</view>
 		<view class='bottom uni-row'>
-			<button class='add' type=primary @click='addHandle()'>添加</button>
+			<button class='add' type=primary @click='addHandle'>添加</button>
 		</view>
 	</view>
 </template>
@@ -68,20 +71,55 @@
 		onLoad,
 		onReady
 	} from '@dcloudio/uni-app'
-
-
-	onLoad(() => {
-
+	import {
+		getLotList
+	} from "@/api/business/lot.js"
+	import {
+		saveDayWork
+	} from '@/api/business/dayWork.js'
+	
+	onReady(() => {
+		init();
 	})
+
 	const batchNoCheck = ref(false)
-	const batchNoList = ref(['DC123', 'DC234', 'DC345', 'DC456', 'DC567', 'DC678', 'DC789', 'DC890', 'DC901'])
-	const vehicleList = ref(['DX123', 'DX124', 'DX456', 'DX234', 'DX523'])
-	const basicInfo = ref({})
+	const batchNoList = ref([])
+	const vehicleList = ref([{
+		carrierId: '1731475038666575873',
+		carrierCode: '0001'
+	},
+	{
+		carrierId: '1731467623237767169',
+		carrierCode: '0002'
+	}])
+	const basicInfo = ref({
+		heatNo: 'cs222',
+		manufacturer: 'DMS',
+		incomingInfo: 'L123456'
+	})
 	const selected = ref(null)
 	const boxNo = ref(null)
+	const productPlanId = ref('0') 
+	const dayWork = ref({})
+
+	function init() {
+		let obj = {}
+		obj.productionPlanId = productPlanId.value;
+		getLotList(obj).then(res => {
+			for (var i = 0; i < res.rows.length; i++) {
+				batchNoList.value.push(res.rows[i].lotCode)
+			}
+			console.log(batchNoList.value)
+		})
+		// getSubPlanDetailsList().then(res => {
+		// 	console.log(res)
+		// })
+	}
 
 	function handleCheckBatchNo(item) {
 		selected.value = item;
+		dayWork.value.lotId = item.id;
+		dayWork.value.lotCode = item.lotCode;
 	}
 
 	function handleDelVehicleNo(index) {
@@ -91,16 +129,34 @@
 	function scanCodeHandle() {
 		uni.scanCode({
 			scanType: ['barCode'], // 条形码扫描
-			onlyFromCamera: true,  // 只允许相机扫码
+			onlyFromCamera: true, // 只允许相机扫码
 			success: function(res) {
 				vehicleList.value.push(res.result);
 			}
 		});
 	}
-	
-	function addHandle(){
-		
-	}
+
+	function addHandle() {
+		dayWork.value.dayworkCarriers = vehicleList.value;
+		saveDayWork(dayWork.value).then(res => {
+			if(res.code === 200){
+				uni.showToast({
+					icon: 'success',
+					title: '添加成功',
+					duration: 2000
+				});
+				uni.navigateTo({
+					url:'/pages/batchReporting/index'
+				})
+			}else{
+				uni.showToast({
+					icon: 'error',
+					title: '添加失败',
+					duration: 2000
+				});
+			}
+		})
+	} 
 </script>
 
 <style lang="scss">
@@ -134,7 +190,7 @@
 		padding-bottom: 50rpx;
 		padding-top: 20rpx;
 		border-radius: 12rpx;
-		
+
 		.title {
 			margin: 10rpx 39%;
 			width: 30%;
@@ -208,13 +264,13 @@
 		justify-content: space-around;
 
 		label {
-			flex: 1;
+			flex: 3;
 			text-combine-upright: all;
 			margin: 0 30rpx;
 
 		}
 
-		input {
+		text {
 			flex: 3;
 			width: 80%;
 		}

+ 12 - 12
pages/batchReporting/index.vue

@@ -8,16 +8,16 @@
 						<text class="label code">{{ item['productionPlanNo'] }}</text>
 					</view>
 					<view class=" uni-row" style="margin-left: 16rpx;">
-						<view v-if="item['status'] == 0" class="tag"><text class="label">进行中</text></view>
-						<view v-else-if="item['status'] == 1" class="tag turnover "><text class="label">周转中</text>
-						</view>
+						<view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
+						<view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">周转中</text></view>
+						<view v-else-if="item['status'] == 0" class="tag turnover "><text class="label">未开始</text></view>
 						<view v-else type="default" class="tag finished"><text class="label">已完成</text></view>
 					</view>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">箱号</text>
 					<text class="label right">{{ item['caseNumber'] }}</text>
-				</view>
+				</view> 
 				<view class="item-info uni-row">
 					<text class="label">总工时</text>
 					<text class="label right">{{ item['totalWorkingHours']}}h</text>
@@ -39,11 +39,11 @@
 					<text class="label right">{{ item['NextProcess'] }}</text>
 				</view>
 				<view class="status-btn uni-row">
-					<view v-if="item['status'] == 0" class=" uni-row">
-						<button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button>
-						<button class="reporting-tag" size="mini">去报工</button>
+					<view v-if="item['status'] == 1" class=" uni-row">
+						<!-- <button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button> -->
+						<button class="reporting-tag" size="mini" @click="handleToreportingForWork" >去报工</button> 
 					</view>
-					<view v-else-if="item['status'] == 1" class=" uni-row">
+					<view v-else-if="item['status'] == 2" class=" uni-row">
 						<button class="turnover-tag" size="mini">取消周转</button>
 					</view>
 				</view>
@@ -77,13 +77,13 @@
 		turnoverApplicationDialog.value.open(_data)
 	}
 	const handleShowLotDialog = (data) => {
-		if(data.length > 0){
-			lotDialog.value.open(data)
-		}else{
+		// if(data){
+		// 	lotDialog.value.open(data)
+		// }else{
 			uni.navigateTo({
 				url:"/pages/addNewBatch/index"
 			})
-		}
+		// }
 		// let _data = data ?? {} 
 		// 调用子组件中的方法
 	}

+ 169 - 149
pages/productionPlan/index.vue

@@ -1,162 +1,182 @@
 <template>
-  <view class="uni-column" style="padding: 24rpx">
-    <view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
-      <view class="title-container uni-row">
-        <view class="title uni-row">
-          <text class="label">生产计划单号</text>
-          <text class="label code">{{ item['productionPlanNo'] }}</text>
-        </view>
-        <view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
-        <view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
-      </view>
-      <!-- 			<view class="item-info uni-row">
+	<view class="uni-column" style="padding: 24rpx">
+		<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
+			<view class="title-container uni-row">
+				<view class="title uni-row">
+					<text class="label">生产计划单号</text>
+					<text class="label code">{{ item['productionPlanNo'] }}</text>
+				</view>
+				<view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
+				<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
+			</view>
+			<!-- 			<view class="item-info uni-row">
 				<text class="label">当前工序</text>
 				<text class="label right">{{ item['process'] }}</text>
 			</view> -->
-      <view class="item-info uni-row">
-        <text class="label">产品描述</text>
-        <text class="label right">{{ item['productDescription'] }}</text>
-      </view>
-      <view class="item-info uni-row">
-        <text class="label">总批数</text>
-        <text class="label right">{{ item['lotNumber'] }}</text>
-      </view>
-      <view class="item-info uni-row">
-        <text class="label">完成批数</text>
-        <text class="label right">{{ item['equiment'] }}</text>
-      </view>
-      <view class="item-info uni-row">
-        <text class="label">投产数/合格数</text>
-        <text class="label right">{{ item['productionQuantity'] }}/{{ item['invest'] }}</text>
-      </view>
-      <view class="item-info uni-row">
-        <text class="label">设备</text>
-        <text class="label right">{{ item['equipmentName'] }}</text>
-      </view>
-      <!-- 			<view class="item-info uni-row">
+			<view class="item-info uni-row">
+				<text class="label">产品描述</text>
+				<text class="label right">{{ item['productDescription'] }}</text>
+			</view>
+			<view class="item-info uni-row">
+				<text class="label">总批数</text>
+				<text class="label right">{{ item['lotNumber'] }}</text>
+			</view>
+			<view class="item-info uni-row">
+				<text class="label">完成批数</text>
+				<text class="label right">{{ item['equiment'] }}</text>
+			</view>
+			<view class="item-info uni-row">
+				<text class="label">投产数/合格数</text>
+				<text class="label right">{{ item['productionQuantity'] }}/{{ item['invest'] }}</text>
+			</view>
+			<view class="item-info uni-row">
+				<text class="label">设备</text>
+				<text class="label right">{{ item['equipmentName'] }}</text>
+			</view>
+			<!-- 			<view class="item-info uni-row">
 				<text class="label">操作人</text>
 				<text class="label right">{{ item['operator'] }}</text>
 			</view> -->
-    </view>
-  </view>
+		</view>
+	</view>
 </template>
 
 <script setup>
-import { getSubPlanDetailsList } from '../../api/business/subPlanDetails'
-import { ref } from 'vue'
-import { onReady, onLoad } from '@dcloudio/uni-app'
-import { getToken } from '@/utils/auth'
-
-const listData = ref([])
-
-onLoad(() => {
-  init()
-})
-
-function init() {
-	uni.showLoading({
-		title: '加载中'
-	});
-  getSubPlanDetailsList({}).then((res) => {
-    console.log(res)
-    if (res.code === 200) {
-      listData.value = res.rows;
-	  uni.hideLoading()
-    } else if (res.code === 401) {
-      uni.showToast({
-        icon: 'none',
-        title: '未登录或登录状态已超时',
-        duration: 1500
-      })
-    } else if (res.code === 500) {
-      uni.showToast({
-        icon: 'none',
-        title: '系统错误,请联系管理员',
-        duration: 1500
-      })
-    } else {
-      uni.showToast({
-        icon: 'none',
-        title: res.msg,
-        duration: 1500
-      })
-    }
-  })
-}
-
-function handleToBatchReporting(item) {
-  uni.navigateTo({
-    url: '/pages/batchReporting/index?id=' + item.id
-  })
-}
+	import {
+		getSubPlanDetailsList
+	} from '../../api/business/subPlanDetails'
+	import {
+		ref
+	} from 'vue'
+	import {
+		onReady,
+		onLoad,
+		onPullDownRefresh
+	} from '@dcloudio/uni-app'
+	import {
+		getToken
+	} from '@/utils/auth'
+
+	const listData = ref([])
+
+	onLoad(() => {
+		init()
+	})
+	
+	/**
+	 * 监听下拉刷新
+	 */
+	onPullDownRefresh(() => {
+		init();
+		setTimeout(function() {
+			uni.stopPullDownRefresh();
+		}, 3000);
+	})
+
+	function init() {
+		uni.showLoading({
+			title: '加载中'
+		});
+		getSubPlanDetailsList({}).then((res) => {
+			console.log(res)
+			if (res.code === 200) {
+				listData.value = res.rows;
+				uni.hideLoading()
+			} else if (res.code === 401) {
+				uni.showToast({
+					icon: 'none',
+					title: '未登录或登录状态已超时',
+					duration: 1500
+				})
+			} else if (res.code === 500) {
+				uni.showToast({
+					icon: 'none',
+					title: '系统错误,请联系管理员',
+					duration: 1500
+				})
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 1500
+				})
+			}
+		})
+	}
+
+	function handleToBatchReporting(item) {
+		uni.navigateTo({
+			url: '/pages/batchReporting/index?id=' + item.id
+		})
+	}
 </script>
 
 <style lang="scss">
-.uni-column {
-  background-color: rgba(245, 245, 245, 1);
-}
-
-.list-item {
-  background-color: #fff;
-  position: relative;
-  padding: 16rpx;
-  padding-bottom: 24rpx;
-  margin-bottom: 24rpx;
-
-  .title-container {
-    justify-content: space-between;
-    margin-top: 8rpx;
-    margin-bottom: 16rpx;
-
-    .title {
-      height: 48rpx;
-      align-items: center;
-
-      .label {
-        font-size: 32rpx;
-        font-weight: bold;
-
-        &.code {
-          margin-left: 8rpx;
-        }
-      }
-    }
-
-    .tag {
-      border: 1px solid #1ce5b0;
-      background-color: #f6fffd;
-      padding: 8rpx;
-      border-radius: 8rpx;
-
-      .label {
-        color: #1ce5b0;
-        font-size: 24rpx;
-      }
-
-      &.not-start {
-        border: 1px solid #bbbbbb;
-        background-color: #f5f5f5;
-
-        .label {
-          color: #bbbbbb;
-        }
-      }
-    }
-  }
-
-  .item-info {
-    margin-bottom: 8rpx;
-
-    .label {
-      font-size: 28rpx;
-      width: 220rpx;
-      color: #808080;
-
-      &.right {
-        flex: 1;
-        color: #000000;
-      }
-    }
-  }
-}
-</style>
+	.uni-column {
+		background-color: rgba(245, 245, 245, 1);
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin-bottom: 24rpx;
+
+		.title-container {
+			justify-content: space-between;
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1ce5b0;
+				background-color: #f6fffd;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1ce5b0;
+					font-size: 24rpx;
+				}
+
+				&.not-start {
+					border: 1px solid #bbbbbb;
+					background-color: #f5f5f5;
+
+					.label {
+						color: #bbbbbb;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+	}
+</style>

+ 51 - 9
pages/reportingForWork/index.vue

@@ -1,12 +1,12 @@
 <template>
-	<view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
+	<view class="uni-column container" >
 		<scroll-view class="scroll-container" scroll-y>
 			<view v-for="(item, index) in listData" :key="index"
 				:class="{'list-item':true,'selected':isSelected(index)}" @click="handleSelection(item,index)">
 				<view class="title-container uni-row">
 					<view class="title uni-row">
-						<text class="label">设备:</text>
-						<text class="label code">{{ item['equipment'] }}</text>
+						<text class="label">批次号:</text>
+						<text class="label code">{{ item['lotCode'] }}</text>
 					</view>
 					<view class="right-info uni-row">
 						<view class="right-info uni-row"> <text class="label ">工时</text>
@@ -19,7 +19,7 @@
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">操作者</text>
-					<text class="label right">{{ item['operator'] }}</text>
+					<text class="label right">{{ item['nickName'] }}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">开始时间</text>
@@ -31,22 +31,22 @@
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">废品数</text>
-					<text class="label right">{{ item['rejectNumber']}}</text>
+					<text class="label right">{{ item['rejectNum']}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">废品原因</text>
-					<text class="label right">{{ (item['refectReason'] != "")?item['refectReason']:'-'}}</text>
+					<text class="label right">{{ (item['remark'] != "")?item['remark']:'-'}}</text>
 				</view>
 
 				<view v-if="item['status'] == 0" class="status-btn uni-row ">
 					<button class="finished-turnover-tag" size="mini"
-						@click="handleShowEndWorkDialog(null)">结束报工</button>
+						@click="handleShowEndWorkDialog(item)">结束报工</button>
 				</view>
 			</view>
 		</scroll-view>
 		<view class="bottom uni-row">
 			<button class="bottom-btn left-btn" @click="HandleChangevehicle"><text class="label">更换载具</text></button>
-			<button class="bottom-btn right-btn"><text class="label">开始加工</text></button>
+			<button class="bottom-btn right-btn" @click="handleAddItem"><text class="label">开始加工</text></button>
 		</view>
 		<dialog-end-work ref="endWorkDialog" />
 	</view>
@@ -62,6 +62,8 @@
 		onLoad,
 		onReady
 	} from '@dcloudio/uni-app'
+	import { getDayWorkItemList,saveDayWorkItem } from "@/api/business/dayWorkItem.js"
+
 	const listData = ref([{
 			equipment: "051-7",
 			taskTime: 2.8,
@@ -126,6 +128,18 @@
 	])
 	const selection = ref([])
 	const endWorkDialog = ref(null)
+	
+	onReady(() => {
+		init();
+	})
+	
+	function init(){
+		getDayWorkItemList().then(res => {
+			listData.value = res.rows;
+			console.log(listData)
+		})
+	}
+	
 	const isSelected = (index) => {
 		return selection.value.includes(index)
 	}
@@ -148,9 +162,37 @@
 			url:"/pages/changeBox/index"
 		})
 	}
+	
+	function handleAddItem(){
+		console.log("111111111111111111111111")
+		let date = new Date()
+		saveDayWorkItem({
+			dayworkId: '1',
+			startTime: date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate()
+		}).then(res => {
+			if(res.code === 200){
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功',
+					duration: 2000
+				});
+			}else{
+				uni.showToast({
+					icon: 'error',
+					title: '操作失败',
+					duration: 2000
+				});
+			}
+		})
+	}
 </script>
 
 <style lang="scss">
+	.container {
+		height: 2000rpx; 
+		background-color: #f5f5f5;
+		overflow: auto;
+	}
 	.scroll-container {
 		position: absolute;
 		top: 24rpx;
@@ -232,7 +274,7 @@
 	}
 
 	.bottom {
-		position: absolute;
+		position: fixed;
 		right: 0;
 		bottom: 0;
 		left: 0;