小程序:
1.要求开始生产退出后,在进入不弹框 2.时间显示错误纠正 3.计算错误纠正
This commit is contained in:
parent
68c24314f5
commit
c2d538f532
@ -11,28 +11,30 @@ const dictInfo = userStore?.dictInfo || []
|
|||||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||||
const userId = userStore.userInfo.userId
|
const userId = userStore.userInfo.userId
|
||||||
|
|
||||||
const isShowStart = computed(() => {
|
const isShowStart = ref(false)
|
||||||
let flag = true
|
const isShowEnd = ref(false)
|
||||||
if (historyList.value.length) {
|
// const isShowStart = computed(() => {
|
||||||
const obj = historyList.value[0]
|
// let flag = true
|
||||||
if (!obj?.endTime) {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (!obj?.endTime) {
|
||||||
}
|
// flag = false
|
||||||
return flag
|
// }
|
||||||
})
|
// }
|
||||||
const isShowEnd = computed(() => {
|
// return flag
|
||||||
let flag = true
|
// })
|
||||||
if (historyList.value.length) {
|
// const isShowEnd = computed(() => {
|
||||||
const obj = historyList.value[0]
|
// let flag = true
|
||||||
if (obj?.endTime) {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (obj?.endTime) {
|
||||||
} else {
|
// flag = false
|
||||||
flag = false
|
// }
|
||||||
}
|
// } else {
|
||||||
return flag
|
// flag = false
|
||||||
})
|
// }
|
||||||
|
// return flag
|
||||||
|
// })
|
||||||
const amount = ref(null)
|
const amount = ref(null)
|
||||||
const workTime = ref(null)
|
const workTime = ref(null)
|
||||||
// 详情数据
|
// 详情数据
|
||||||
@ -56,28 +58,42 @@ const getData = async () => {
|
|||||||
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
||||||
// e.endTimeStr = '2025-01-13 00:00'
|
// e.endTimeStr = '2025-01-13 00:00'
|
||||||
})
|
})
|
||||||
// if (data.list[0]) {
|
if (data.list[0]) {
|
||||||
// formObj.value = data.list[0]
|
// 将字符串转换为Date对象
|
||||||
// const time = formObj.value.endTime - formObj.value.startTime //时间差秒
|
formObj.value = data.list[0]
|
||||||
// console.log(time)
|
const endTime= new Date(formObj.value.endTimeStr);
|
||||||
// const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
const startTime = new Date(formObj.value.startTimeStr);
|
||||||
// workTime.value = Math.floor(leave1 / (3600 * 1000))
|
// 计算两个日期之间的毫秒差
|
||||||
// }
|
const timeDifferenceInMs = endTime - startTime;
|
||||||
// if (data.list[0]) {
|
|
||||||
// // 将字符串转换为Date对象
|
|
||||||
// formObj.value = data.list[0]
|
|
||||||
// const endTime= new Date(formObj.value.endTimeStr);
|
|
||||||
// const startTime = new Date(formObj.value.startTimeStr);
|
|
||||||
|
|
||||||
// // 计算两个日期之间的毫秒差
|
// 将毫秒差转换为小时
|
||||||
// const timeDifferenceInMs = endTime - startTime;
|
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||||
|
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||||
|
if ("Y"==detailInfo.value.isOutsourcing){
|
||||||
|
|
||||||
// // 将毫秒差转换为小时
|
}else {
|
||||||
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
workTime.value = roundedTimeDifference;
|
||||||
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
}
|
||||||
// workTime.value = roundedTimeDifference;
|
|
||||||
// }
|
}
|
||||||
historyList.value = data.list
|
historyList.value = data.list
|
||||||
|
isShowEnd.value = true;
|
||||||
|
isShowStart.value = true
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
console.log('s')
|
||||||
|
if (!obj?.amount) {
|
||||||
|
isShowStart.value= false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
if (obj?.amount) {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
if(historyList.value!=null&&historyList.value.length>0){
|
if(historyList.value!=null&&historyList.value.length>0){
|
||||||
var totalAmount = detailInfo.value.amount;
|
var totalAmount = detailInfo.value.amount;
|
||||||
var beforeAmount = detailInfo.value.totalReportAmount
|
var beforeAmount = detailInfo.value.totalReportAmount
|
||||||
@ -89,6 +105,7 @@ const getData = async () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
// 详情
|
// 详情
|
||||||
@ -107,27 +124,28 @@ const getDetailData = async (id) => {
|
|||||||
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
||||||
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
||||||
|
|
||||||
const endTime = new Date(data.endTime);
|
// const endTime = new Date(data.endTime);
|
||||||
const startTime = new Date(data.startTime);
|
// const startTime = new Date(data.startTime);
|
||||||
// // 计算两个日期之间的毫秒差
|
// // // 计算两个日期之间的毫秒差
|
||||||
const timeDifferenceInMs = endTime - startTime;
|
// const timeDifferenceInMs = endTime - startTime;
|
||||||
// // 将毫秒差转换为小时
|
// // // 将毫秒差转换为小时
|
||||||
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||||
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||||
workTime.value = roundedTimeDifference;
|
// workTime.value = roundedTimeDifference;
|
||||||
// 单位枚举
|
// 单位枚举
|
||||||
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
||||||
data.unit = lineObj.label
|
data.unit = lineObj.label
|
||||||
detailInfo.value = data || {}
|
detailInfo.value = data || {}
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
|
const popupShow = ref(false)
|
||||||
onLoad(async (options: any) => {
|
onLoad(async (options: any) => {
|
||||||
await getDetailData(options.id)
|
await getDetailData(options.id)
|
||||||
await getData()
|
await getData()
|
||||||
const obj = historyList.value[0]
|
const obj = historyList.value[0]
|
||||||
// 最新的报工是否完成
|
// 最新的报工是否完成
|
||||||
if (obj && obj?.workTime == null && obj.endTime) {
|
if (obj && obj?.workTime == null && obj.endTime) {
|
||||||
popup.value?.open()
|
popupShow.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -151,6 +169,7 @@ const handleComplate = async () => {
|
|||||||
}
|
}
|
||||||
// 提交报工
|
// 提交报工
|
||||||
const handleOk = async (active) => {
|
const handleOk = async (active) => {
|
||||||
|
console.log(amount.value)
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
active: 'SUBMIT',
|
active: 'SUBMIT',
|
||||||
@ -182,10 +201,11 @@ const handleStop = async () => {
|
|||||||
active: 'END',
|
active: 'END',
|
||||||
}
|
}
|
||||||
const data = await postOperateAPI(params)
|
const data = await postOperateAPI(params)
|
||||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
await getData()
|
||||||
uni.redirectTo({
|
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||||
url,
|
// uni.redirectTo({
|
||||||
})
|
// url,
|
||||||
|
// })
|
||||||
popup.value?.open()
|
popup.value?.open()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -274,20 +294,20 @@ const handleStop = async () => {
|
|||||||
<view class="cont">
|
<view class="cont">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label">开始生产时间:</view>
|
<view class="label">开始生产时间:</view>
|
||||||
<view class="val">{{ detailInfo.startTime }}</view>
|
<view class="val">{{ formObj.startTimeStr }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label">结束生产时间:</view>
|
<view class="label">结束生产时间:</view>
|
||||||
<view class="val">{{ detailInfo.endTime }}</view>
|
<view class="val">{{ formObj.endTimeStr }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||||
<uni-easyinput class="val" type="digit" v-model="amount" placeholder="请输入本次报工工时"></uni-easyinput>
|
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
|
||||||
<view class="unit">时</view>
|
<view class="unit">时</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
||||||
<uni-easyinput class="val" type="number" v-model="workTime" placeholder="请输入本次报工数量"></uni-easyinput>
|
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
|
||||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -1,50 +1,52 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { toRaw, ref, computed } from 'vue'
|
import { toRaw, ref, computed } from 'vue'
|
||||||
import { formatDate } from '@/utils/index'
|
import { formatDate } from '@/utils/index'
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
import { useLoginStore } from '@/stores/modules/login'
|
import { useLoginStore } from '@/stores/modules/login'
|
||||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI,getListWxAPI } from '@/services/productionReport'
|
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI, getListWxAPI } from '@/services/productionReport'
|
||||||
const popup = ref<UniHelper.UniPopupInstance>()
|
const popup = ref<UniHelper.UniPopupInstance>()
|
||||||
const userStore = useLoginStore()
|
const userStore = useLoginStore()
|
||||||
const dictInfo = userStore?.dictInfo || []
|
const dictInfo = userStore?.dictInfo || []
|
||||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||||
const userId = userStore.userInfo.userId
|
const userId = userStore.userInfo.userId
|
||||||
|
|
||||||
const isShowStart = computed(() => {
|
const isShowStart = ref(false)
|
||||||
let flag = true
|
const isShowEnd = ref(false)
|
||||||
if (historyList.value.length) {
|
// const isShowStart = computed(() => {
|
||||||
const obj = historyList.value[0]
|
// let flag = true
|
||||||
if (!obj?.endTime) {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (!obj?.endTime) {
|
||||||
}
|
|
||||||
// // 派工数量和总报工数量相等了就不展示开始生产
|
|
||||||
// if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
|
||||||
// flag = false
|
// flag = false
|
||||||
// }
|
// }
|
||||||
return flag
|
// }
|
||||||
})
|
// // // 派工数量和总报工数量相等了就不展示开始生产
|
||||||
const isShowEnd = computed(() => {
|
// // if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
||||||
let flag = true
|
// // flag = false
|
||||||
if (historyList.value.length) {
|
// // }
|
||||||
const obj = historyList.value[0]
|
// return flag
|
||||||
if (obj?.endTime) {
|
// })
|
||||||
flag = false
|
// const isShowEnd = computed(() => {
|
||||||
}
|
// let flag = true
|
||||||
} else {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (obj?.endTime) {
|
||||||
return flag
|
// flag = false
|
||||||
})
|
// }
|
||||||
const amount = ref('')
|
// } else {
|
||||||
const workTime = ref('')
|
// flag = false
|
||||||
// 详情数据
|
// }
|
||||||
const detailInfo = ref({})
|
// return flag
|
||||||
let isLoading = ref(false)
|
// })
|
||||||
const historyList = ref([])
|
const amount = ref('')
|
||||||
const formObj = ref({})
|
const workTime = ref('')
|
||||||
// 历史明细
|
// 详情数据
|
||||||
const getData = async () => {
|
const detailInfo = ref({})
|
||||||
|
let isLoading = ref(false)
|
||||||
|
const historyList = ref([])
|
||||||
|
const formObj = ref({})
|
||||||
|
// 历史明细
|
||||||
|
const getData = async () => {
|
||||||
// 发送请求
|
// 发送请求
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
const params = {
|
const params = {
|
||||||
@ -59,17 +61,10 @@ const getData = async () => {
|
|||||||
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
||||||
// e.endTimeStr = '2025-01-13 00:00'
|
// e.endTimeStr = '2025-01-13 00:00'
|
||||||
})
|
})
|
||||||
// if (data.list[0]) {
|
|
||||||
// formObj.value = data.list[0]
|
|
||||||
// const time = formObj.value.endTime - formObj.value.startTime //时间差秒
|
|
||||||
// console.log(time)
|
|
||||||
// const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
|
||||||
// workTime.value = Math.floor(leave1 / (3600 * 1000))
|
|
||||||
// }
|
|
||||||
if (data.list[0]) {
|
if (data.list[0]) {
|
||||||
// 将字符串转换为Date对象
|
// 将字符串转换为Date对象
|
||||||
formObj.value = data.list[0]
|
formObj.value = data.list[0]
|
||||||
const endTime= new Date(formObj.value.endTimeStr);
|
const endTime = new Date(formObj.value.endTimeStr);
|
||||||
const startTime = new Date(formObj.value.startTimeStr);
|
const startTime = new Date(formObj.value.startTimeStr);
|
||||||
// 计算两个日期之间的毫秒差
|
// 计算两个日期之间的毫秒差
|
||||||
const timeDifferenceInMs = endTime - startTime;
|
const timeDifferenceInMs = endTime - startTime;
|
||||||
@ -77,36 +72,54 @@ const getData = async () => {
|
|||||||
// 将毫秒差转换为小时
|
// 将毫秒差转换为小时
|
||||||
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||||
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||||
if ("Y"==detailInfo.value.isOutsourcing){
|
if ("Y" == detailInfo.value.isOutsourcing) {
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
workTime.value = roundedTimeDifference;
|
workTime.value = roundedTimeDifference;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
historyList.value = data.list
|
historyList.value = data.list
|
||||||
if(historyList.value!=null&&historyList.value.length>0){
|
isShowEnd.value = true;
|
||||||
|
isShowStart.value = true
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
if (!obj?.amount) {
|
||||||
|
isShowStart.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
if (obj?.amount) {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
|
console.log(isShowEnd.value);
|
||||||
|
console.log(isShowStart.value)
|
||||||
|
if (historyList.value != null && historyList.value.length > 0) {
|
||||||
var totalAmount = detailInfo.value.amount;
|
var totalAmount = detailInfo.value.amount;
|
||||||
var beforeAmount = detailInfo.value.totalReportAmount
|
var beforeAmount = detailInfo.value.totalReportAmount
|
||||||
if(totalAmount >= beforeAmount){
|
if (totalAmount >= beforeAmount) {
|
||||||
amount.value = totalAmount - beforeAmount
|
amount.value = totalAmount - beforeAmount
|
||||||
}else{
|
} else {
|
||||||
amount.value = 0
|
amount.value = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
const isOverBeforeProcedure = ref(true)
|
const isOverBeforeProcedure = ref(true)
|
||||||
// 详情
|
// 详情
|
||||||
const getDetailData = async (id) => {
|
const getDetailData = async (id) => {
|
||||||
// 发送请求
|
// 发送请求
|
||||||
// isLoading.value = true
|
// isLoading.value = true
|
||||||
const params = {
|
const params = {
|
||||||
id,
|
id,
|
||||||
}
|
}
|
||||||
const data = await getTaskDetailAPI(params)
|
const data = await getTaskDetailAPI(params)
|
||||||
if(data.beforeProcedureStatus == 0){
|
if (data.beforeProcedureStatus == 0) {
|
||||||
//如果上一道工序没结束
|
//如果上一道工序没结束
|
||||||
isOverBeforeProcedure.value = true;
|
isOverBeforeProcedure.value = true;
|
||||||
}
|
}
|
||||||
@ -118,19 +131,19 @@ const getDetailData = async (id) => {
|
|||||||
|
|
||||||
detailInfo.value = data || {}
|
detailInfo.value = data || {}
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
onLoad(async (options: any) => {
|
onLoad(async (options : any) => {
|
||||||
await getDetailData(options.id)
|
await getDetailData(options.id)
|
||||||
await getData()
|
await getData()
|
||||||
const obj = historyList.value[0]
|
const obj = historyList.value[0]
|
||||||
// 最新的报工是否完成
|
// 最新的报工是否完成
|
||||||
if (obj && obj?.workTime == null && obj.endTime) {
|
if (obj && obj?.workTime == null && obj.endTime) {
|
||||||
popup.value?.open()
|
popupShow.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 生产完成
|
// 生产完成
|
||||||
const handleComplate = async () => {
|
const handleComplate = async () => {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
@ -146,9 +159,9 @@ const handleComplate = async () => {
|
|||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url,
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 提交报工
|
// 提交报工
|
||||||
const handleOk = async (active) => {
|
const handleOk = async (active) => {
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
active: 'SUBMIT',
|
active: 'SUBMIT',
|
||||||
@ -160,13 +173,13 @@ const handleOk = async (active) => {
|
|||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url,
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 开始生产
|
// 开始生产
|
||||||
const handleStart = async () => {
|
const handleStart = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value.id,
|
id: detailInfo.value.id,
|
||||||
active: 'START',
|
active: 'START',
|
||||||
ownerId:userId
|
ownerId: userId
|
||||||
}
|
}
|
||||||
productionTitle.value = '生产中';
|
productionTitle.value = '生产中';
|
||||||
console.log(detailInfo.value)
|
console.log(detailInfo.value)
|
||||||
@ -175,35 +188,39 @@ const handleStart = async () => {
|
|||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url,
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const productionTitle = ref('开始生产')
|
const popupShow = ref(false)
|
||||||
// 结束生产
|
const productionTitle = ref('开始生产')
|
||||||
const handleStop = async () => {
|
// 结束生产
|
||||||
|
const handleStop = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
active: 'END',
|
active: 'END',
|
||||||
}
|
}
|
||||||
console.log(detailInfo.value)
|
console.log(detailInfo.value)
|
||||||
const data = await postOperateAPI(params)
|
const data = await postOperateAPI(params)
|
||||||
|
await getData()
|
||||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||||
uni.redirectTo({
|
// uni.redirectTo({
|
||||||
url,
|
// url,
|
||||||
})
|
// })
|
||||||
popup.value?.open()
|
popup.value?.open()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view v-if="isOverBeforeProcedure==true" class="data-detail">
|
<view v-if="isOverBeforeProcedure==true" class="data-detail">
|
||||||
<template v-if="!isLoading">
|
<template v-if="!isLoading">
|
||||||
<view class="module">
|
<view class="module">
|
||||||
<view class="module-info">
|
<view class="module-info">
|
||||||
<view class="product-item product-name">项目:{{ detailInfo.projectCode }} {{ detailInfo.projectName }}</view>
|
<view class="product-item product-name">项目:{{ detailInfo.projectCode }}
|
||||||
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill"></image>
|
{{ detailInfo.projectName }}</view>
|
||||||
|
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill">
|
||||||
|
</image>
|
||||||
<view :class="[detailInfo.procedureStatus == 2 ? 'had' : 'unhad', 'product-status']">{{
|
<view :class="[detailInfo.procedureStatus == 2 ? 'had' : 'unhad', 'product-status']">{{
|
||||||
detailInfo.procedureStatus == 2 ? '已完成' : '未完成' }}</view>
|
detailInfo.procedureStatus == 2 ? '已完成' : '未完成' }}</view>
|
||||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }} {{' ' + detailInfo.projectSubName }}
|
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }}
|
||||||
|
{{' ' + detailInfo.projectSubName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="product-row">
|
<view class="product-row">
|
||||||
<view class="row-item">
|
<view class="row-item">
|
||||||
@ -234,9 +251,11 @@ const handleStop = async () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="product-item">预计生产日期:{{ detailInfo.startTime }} ~ {{ detailInfo.endTime }}</view>
|
<view class="product-item">预计生产日期:{{ detailInfo.startTime }} ~ {{ detailInfo.endTime }}</view>
|
||||||
<view class="finish" v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime"
|
<view class="finish"
|
||||||
@click="handleComplate" >
|
v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime"
|
||||||
<image class="complate-img" src="/static/images/productionReport-detail-complate.png" mode="scaleToFill" />
|
@click="handleComplate">
|
||||||
|
<image class="complate-img" src="/static/images/productionReport-detail-complate.png"
|
||||||
|
mode="scaleToFill" />
|
||||||
生产完成
|
生产完成
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -263,7 +282,8 @@ const handleStop = async () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tip-index">
|
<view class="tip-index">
|
||||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status" mode="scaleToFit">
|
<image src="/static/images/productionReport-detail-index.png" class="icon-status"
|
||||||
|
mode="scaleToFit">
|
||||||
</image>
|
</image>
|
||||||
<view class="text">{{historyList.length - index}}</view>
|
<view class="text">{{historyList.length - index}}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -273,7 +293,7 @@ const handleStop = async () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="action" v-if="detailInfo.procedureStatus !== 2">
|
<view class="action" v-if="detailInfo.procedureStatus !== 2">
|
||||||
<view class="action-item start" v-if="isShowStart" @click="handleStart">{{productionTitle}}</view>
|
<view class="action-item start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
||||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -294,12 +314,14 @@ const handleStop = async () => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||||
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
|
<uni-easyinput class="val" type="digit" v-model="workTime"
|
||||||
|
placeholder="请输入本次报工工时"></uni-easyinput>
|
||||||
<view class="unit">{{ detailInfo.isOutsourcing=='Y'?"元":"小时" }}</view>
|
<view class="unit">{{ detailInfo.isOutsourcing=='Y'?"元":"小时" }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
||||||
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
|
<uni-easyinput class="val" type="number" v-model="amount"
|
||||||
|
placeholder="请输入本次报工数量"></uni-easyinput>
|
||||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -309,12 +331,12 @@ const handleStop = async () => {
|
|||||||
<view v-if="isOverBeforeProcedure==false">
|
<view v-if="isOverBeforeProcedure==false">
|
||||||
<p>上一道工序尚未完工,请等待上一道工序完工后进行报工!</p>
|
<p>上一道工序尚未完工,请等待上一道工序完工后进行报工!</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// 订单列表
|
// 订单列表
|
||||||
.data-detail {
|
.data-detail {
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
padding-bottom: 200rpx;
|
padding-bottom: 200rpx;
|
||||||
|
|
||||||
@ -346,10 +368,12 @@ const handleStop = async () => {
|
|||||||
border-raduis: 10rpx;
|
border-raduis: 10rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 8rpx 12rpx;
|
padding: 8rpx 12rpx;
|
||||||
|
|
||||||
&.had {
|
&.had {
|
||||||
background: #E8FFEA;
|
background: #E8FFEA;
|
||||||
color: #00B42A;
|
color: #00B42A;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.unhad {
|
&.unhad {
|
||||||
background: #FFF7E8;
|
background: #FFF7E8;
|
||||||
color: #FF7D00;
|
color: #FF7D00;
|
||||||
@ -387,6 +411,7 @@ const handleStop = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.finish {
|
.finish {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 40rpx;
|
right: 40rpx;
|
||||||
@ -400,6 +425,7 @@ const handleStop = async () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.complate-img {
|
.complate-img {
|
||||||
width: 30rpx;
|
width: 30rpx;
|
||||||
height: 30rpx;
|
height: 30rpx;
|
||||||
@ -441,10 +467,12 @@ const handleStop = async () => {
|
|||||||
|
|
||||||
.product-item {
|
.product-item {
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
|
|
||||||
.hight-color {
|
.hight-color {
|
||||||
color: #00B42A;
|
color: #00B42A;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-row {
|
.product-row {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -456,8 +484,10 @@ const handleStop = async () => {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
&.high-color {
|
&.high-color {
|
||||||
color: #00B42A
|
color: #00B42A
|
||||||
}
|
}
|
||||||
@ -473,15 +503,18 @@ const handleStop = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tip-index {
|
.tip-index {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0rpx;
|
top: 0rpx;
|
||||||
right: 0rpx;
|
right: 0rpx;
|
||||||
|
|
||||||
.icon-status {
|
.icon-status {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
height: 72rpx;
|
height: 72rpx;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -590,6 +623,7 @@ const handleStop = async () => {
|
|||||||
.label {
|
.label {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
width: 260rpx;
|
width: 260rpx;
|
||||||
|
|
||||||
.star {
|
.star {
|
||||||
color: red
|
color: red
|
||||||
}
|
}
|
||||||
@ -599,6 +633,7 @@ const handleStop = async () => {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unit {
|
.unit {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
margin-left: 4rpx;
|
margin-left: 4rpx;
|
||||||
@ -618,5 +653,5 @@ const handleStop = async () => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user