Browse Source

1、工序报工-人员报工表单页

master
bjang03 7 months ago
parent
commit
fafc63443f
  1. 8
      src/pages.json
  2. 87
      src/pages/mes/workScheduling/processReportForm.vue
  3. 28
      src/pages/mes/workScheduling/processReportPeopleCheck.vue

8
src/pages.json

@ -1951,11 +1951,17 @@
} }
},{ },{
"path": "pages/mes/workScheduling/processReportPeopleCheck", "path": "pages/mes/workScheduling/processReportPeopleCheck",
"style": {
"navigationBarTitleText": "工序报工-选择人员",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/processReportForm",
"style": { "style": {
"navigationBarTitleText": "工序报工", "navigationBarTitleText": "工序报工",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },,
{ {
"path": "pages/mes/productOffline/index", "path": "pages/mes/productOffline/index",
"style": { "style": {

87
src/pages/mes/workScheduling/processReportForm.vue

@ -1,50 +1,42 @@
<template> <template>
<view class="container"> <view class="container">
<view class="list"> <view>
<view> <form @submit="formSubmit">
<u-search :show-action="true" v-model="data.searchValue" action-text="搜索" input-align="left" height="65" border-color="#ff9900" @search="alert()"></u-search> <scroll-view scroll-y="true" class="scroll-Y">
</view> <view v-for="item in list" class="list">
<scroll-view scroll-y="true" class="scroll-Y"> <view class="item">
<u-checkbox-group class="item" @change="checkChange"> <view class="dec">
<u-checkbox class="dec" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.personName">{{ item.personName }}</u-checkbox> <view>&nbsp;员工姓名</view>
</u-checkbox-group> <view>&nbsp;&nbsp;&nbsp;{{ item.personName }}</view>
</scroll-view> </view>
<view class="dec">
<view><span style="color: red">*</span>报工数量</view>
<!-- <view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)">--> <view><input class="uni-input" placeholder="请输入报工数量" v-model="item.reportCount" /></view>
<!-- <view class="dec">--> </view>
<!-- <view>{{ item.workerName }}</view>--> </view>
<!-- <view>1</view>--> </view>
<!-- </view>--> </scroll-view>
<!-- </view>--> <u-button size="default" type="default" form-type="submit"
style="color:#3C9CFF;backgroundColor:#1AAD19;borderColor:#1AAD19"
hover-class="is-hover">提交
</u-button>
</form>
</view> </view>
</view> </view>
<u-alert-tips type="error" :title="系统提示" close-text="close" :description="请选择人员" :close-able="true" :show="show"></u-alert-tips>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
/* 初始化 */ /* 初始化 */
import { onShow } from '@dcloudio/uni-app' import { onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from 'vue' import { getCurrentInstance, ref } from "vue"
/* 引入API */ /* 引入API */
import tags from '@components/tags/index.vue' import * as workSchedulingApi from "@/api/mes/workScheduling"
import * as workSchedulingApi from '@/api/mes/workScheduling'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
tags.data = ref([
{
text: '1',
value: '2'
}
])
const data = ref({
searchValue: ''
})
let show = false let show = false
/* 是否显示"没有更多了" */ /* 是否显示"没有更多了" */
const status = ref('loadmore') const status = ref("loadmore")
/* 列表数据集 */ /* 列表数据集 */
const list = ref([]) const list = ref([])
function checkChange(checkedArray: string | any[]) { function checkChange(checkedArray: string | any[]) {
@ -53,27 +45,19 @@ function checkChange(checkedArray: string | any[]) {
} }
} }
/* 列表调用API方法 */ /* 列表调用API方法 */
async function getList() { async function formSubmit() {
if (status.value === 'nomore') return if (status.value === "nomore") return
status.value = 'loading' status.value = "loading"
proxy.$modal.loading('加载中') proxy.$modal.loading("提交中")
await workSchedulingApi await workSchedulingApi
.getConfigProcessWorker({ .reportWorkByProcess(list)
planDayCode: 'PO20240426-0022',
processCode: 'FF-CY-002',
teamCode: 'T01'
})
.then((res) => { .then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.length > 0) {
list.value = res.data
}
}) })
.catch(() => { .catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
}) })
} }
/* 打开详情页 */ /* 打开详情页 */
function openDetail(item: any) { function openDetail(item: any) {
console.log(item) console.log(item)
@ -82,8 +66,8 @@ function openDetail(item: any) {
/* 通用方法 */ /* 通用方法 */
onShow(() => { onShow(() => {
list.value = [] list.value = uni.getStorageSync("processReportList")
getList() debugger
}) })
</script> </script>
@ -155,7 +139,14 @@ onShow(() => {
} }
} }
} }
::v-deep .u-checkbox-group { ::v-deep .u-checkbox-group {
display: grid !important; display: grid !important;
} }
.is-hover {
color: rgba(255, 255, 255, 0.6);
background-color: #179b16;
border-color: #179b16;
}
</style> </style>

28
src/pages/mes/workScheduling/processReportPeopleCheck.vue

@ -57,17 +57,23 @@ async function getList() {
if (status.value === 'nomore') return if (status.value === 'nomore') return
status.value = 'loading' status.value = 'loading'
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
if (list.value.length == 0) { await workSchedulingApi.getConfigProcessWorker({
await workSchedulingApi.getConfigProcessWorker({ planDayCode: "PO20240426-0022",
planDayCode: "PO20240426-0022", processCode: "FF-CY-002",
processCode: "FF-CY-002", teamCode: "T01"
teamCode: "T01" }).then((res) => {
}).then((res) => { // if(res.data.leader){
if (res.data.length > 0) { // list.value = res.data.list
list.value = res.data // }else{
} uni.setNavigationBarTitle({
}) title: 'test'
} })
uni.setStorageSync('processReportList', res.data.list);
uni.redirectTo({
url: './processReportForm'
});
// }
})
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
} }

Loading…
Cancel
Save