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",
"style": {
"navigationBarTitleText": "工序报工-选择人员",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/processReportForm",
"style": {
"navigationBarTitleText": "工序报工",
"enablePullDownRefresh": true
}
},
},,
{
"path": "pages/mes/productOffline/index",
"style": {

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

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

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

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

Loading…
Cancel
Save