|
@ -1,8 +1,26 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="container"> |
|
|
<view class="container"> |
|
|
|
|
|
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' |
|
|
|
|
|
title="工序报工"> |
|
|
|
|
|
<!-- <template v-slot:right v-if="isEngineer"> --> |
|
|
|
|
|
<template v-slot:right v-if="isLeader"> |
|
|
|
|
|
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;"></u-icon> |
|
|
|
|
|
</template> |
|
|
|
|
|
</u-navbar> |
|
|
<view> |
|
|
<view> |
|
|
<form @submit="formSubmit"> |
|
|
<form @submit="formSubmit"> |
|
|
<scroll-view scroll-y="true" class="scroll-Y"> |
|
|
<scroll-view scroll-y="true" class="scroll-Y" style="height: calc(100vh - 80rpx)"> |
|
|
|
|
|
<view class="list"> |
|
|
|
|
|
<view class="item"> |
|
|
|
|
|
<view class="dec"> |
|
|
|
|
|
<view><span style="color: red">*</span>报工日期:</view> |
|
|
|
|
|
<view > |
|
|
|
|
|
<u-input v-model="dataInput" @click="show = true" style="width:100%;margin-left: 12px" placeholder="请选择时间" /> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view v-for="item in list" class="list"> |
|
|
<view v-for="item in list" class="list"> |
|
|
<view class="item"> |
|
|
<view class="item"> |
|
|
<view class="dec"> |
|
|
<view class="dec"> |
|
@ -11,18 +29,21 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="dec"> |
|
|
<view class="dec"> |
|
|
<view><span style="color: red">*</span>报工数量:</view> |
|
|
<view><span style="color: red">*</span>报工数量:</view> |
|
|
<view><input class="uni-input" placeholder="请输入报工数量" v-model="item.reportCount" /></view> |
|
|
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工数量" v-model="item.reportCount" /></view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="dec"> |
|
|
|
|
|
<view><span style="color: red">*</span>报工工时:</view> |
|
|
|
|
|
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工工时" v-model="item.workTerm" /></view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
<u-button size="default" type="default" form-type="submit" |
|
|
|
|
|
style="color:#3C9CFF;backgroundColor:#1AAD19;borderColor:#1AAD19" |
|
|
<u-button form-type="submit" style="color:#ffffff;backgroundColor:#3C9CFF;position: fixed;bottom: 0px;width: 100%">提交</u-button> |
|
|
hover-class="is-hover">提交 |
|
|
|
|
|
</u-button> |
|
|
|
|
|
</form> |
|
|
</form> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<u-picker mode="time" v-model="show" :params="params" @confirm="selectReworkTime"></u-picker> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -33,30 +54,33 @@ import { getCurrentInstance, ref } from "vue" |
|
|
import * as workSchedulingApi from "@/api/mes/workScheduling" |
|
|
import * as workSchedulingApi from "@/api/mes/workScheduling" |
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
let show = false |
|
|
let show = ref(false) |
|
|
|
|
|
let dataInput = ref() |
|
|
/* 是否显示"没有更多了" */ |
|
|
function selectReworkTime(datetime){ |
|
|
const status = ref("loadmore") |
|
|
dataInput.value = `${datetime.year}-${datetime.month}-${datetime.day} ${datetime.hour}:${datetime.minute}:${datetime.second}` |
|
|
|
|
|
show.value = false |
|
|
|
|
|
} |
|
|
|
|
|
const isLeader = uni.getStorageSync("isLeader") |
|
|
|
|
|
let params = { |
|
|
|
|
|
year: true, |
|
|
|
|
|
month: true, |
|
|
|
|
|
day: true, |
|
|
|
|
|
hour: true, |
|
|
|
|
|
minute: true, |
|
|
|
|
|
second: true |
|
|
|
|
|
} |
|
|
/* 列表数据集 */ |
|
|
/* 列表数据集 */ |
|
|
const list = ref([]) |
|
|
const list = ref([]) |
|
|
function checkChange(checkedArray: string | any[]) { |
|
|
|
|
|
if (checkedArray.length == 0){ |
|
|
|
|
|
show = true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
/* 列表调用API方法 */ |
|
|
/* 列表调用API方法 */ |
|
|
async function formSubmit() { |
|
|
async function formSubmit() { |
|
|
if (status.value === "nomore") return |
|
|
|
|
|
status.value = "loading" |
|
|
|
|
|
proxy.$modal.loading("提交中") |
|
|
proxy.$modal.loading("提交中") |
|
|
await workSchedulingApi |
|
|
await workSchedulingApi.reportWorkByProcess({ |
|
|
.reportWorkByProcess(list) |
|
|
reportDate : dataInput.value, |
|
|
.then((res) => { |
|
|
schedulingCode : list.value[0].schedulingCode, |
|
|
proxy.$modal.closeLoading() |
|
|
processCode: list.value[0].processCode, |
|
|
}) |
|
|
list : list.value |
|
|
.catch(() => { |
|
|
}) |
|
|
proxy.$modal.closeLoading() |
|
|
proxy.$modal.closeLoading() |
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
/* 打开详情页 */ |
|
|
/* 打开详情页 */ |
|
|
function openDetail(item: any) { |
|
|
function openDetail(item: any) { |
|
@ -67,8 +91,33 @@ function openDetail(item: any) { |
|
|
/* 通用方法 */ |
|
|
/* 通用方法 */ |
|
|
onShow(() => { |
|
|
onShow(() => { |
|
|
list.value = uni.getStorageSync("processReportList") |
|
|
list.value = uni.getStorageSync("processReportList") |
|
|
debugger |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
function getDate(type) { |
|
|
|
|
|
const date = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
let year = date.getFullYear(); |
|
|
|
|
|
let month = date.getMonth() + 1; |
|
|
|
|
|
let day = date.getDate(); |
|
|
|
|
|
let hour = date.getHours() |
|
|
|
|
|
let minute = date.getMinutes() |
|
|
|
|
|
let second = date.getSeconds() |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'start') { |
|
|
|
|
|
year = year - 10; |
|
|
|
|
|
} else if (type === 'end') { |
|
|
|
|
|
year = year + 10; |
|
|
|
|
|
} |
|
|
|
|
|
month = month > 9 ? month : '0' + month; |
|
|
|
|
|
day = day > 9 ? day : '0' + day; |
|
|
|
|
|
|
|
|
|
|
|
return `${year}-${month}-${day} ${hour}:${minute}:${second}`; |
|
|
|
|
|
} |
|
|
|
|
|
let date = getDate({ |
|
|
|
|
|
format: true |
|
|
|
|
|
}) |
|
|
|
|
|
function bindDateChange(e){ |
|
|
|
|
|
date = e.detail.value |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
@ -110,7 +159,6 @@ onShow(() => { |
|
|
padding-bottom: 20rpx; |
|
|
padding-bottom: 20rpx; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
|
|
|
view { |
|
|
view { |
|
|
&:nth-child(1) { |
|
|
&:nth-child(1) { |
|
|
width: 160rpx; |
|
|
width: 160rpx; |
|
|