Browse Source

1、工序报工-表单页重复显示

master
bjang03 6 months ago
parent
commit
7cced1cf2b
  1. 8
      src/pages/mes/workScheduling/processReportForm.vue
  2. 49
      src/pages/mes/workScheduling/processReportPeopleCheck.vue
  3. 46
      src/pages/mes/workScheduling/workScheduling.vue

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

@ -112,7 +112,13 @@ function remove(index: number){
} }
/* 通用方法 */ /* 通用方法 */
onShow(() => { onShow(() => {
list.value = uni.getStorageSync("processReportList") uni.getStorageSync("processReportList").forEach(person=>{
if(person.checked){
person.reportList.forEach(report=>{
list.value.push(report)
})
}
})
}) })
</script> </script>

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

@ -2,10 +2,10 @@
<view class="container"> <view class="container">
<view class="list"> <view class="list">
<view> <view>
<u-search :show-action="true" v-model="data.nickName" action-text="搜索" input-align="left" height="65" border-color="#ff9900" @search="getList" @custom="getList"></u-search> <u-search :show-action="true" v-model="data.nickName" action-text="搜索" input-align="left" height="65" border-color="#ff9900"></u-search>
</view> </view>
<scroll-view scroll-y="true" class="scroll-Y" style="height: calc(100vh - 80rpx)"> <scroll-view scroll-y="true" class="scroll-Y" style="height: calc(100vh - 80rpx)">
<u-checkbox-group class="item" @change="checkChange"> <u-checkbox-group class="item">
<u-checkbox class="dec" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item">{{ item.personName }}</u-checkbox> <u-checkbox class="dec" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item">{{ item.personName }}</u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</scroll-view> </scroll-view>
@ -44,38 +44,11 @@ const data = ref({
processCode: '', processCode: '',
nickName: '' nickName: ''
}) })
let checked: string | any[] = []
/* 是否显示"没有更多了" */ /* 是否显示"没有更多了" */
const status = ref('loadmore') const status = ref('loadmore')
/* 列表数据集 */ /* 列表数据集 */
const list = ref([]) const list = ref([])
/* 列表调用API方法 */
async function getList() {
if (status.value === 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
await workSchedulingApi.getConfigProcessWorker(data.value).then((res) => {
uni.setStorageSync("isLeader", res.data.leader)
if (res.data.leader) {
list.value = res.data.list
} else {
if (res.data.list.length == 0){
_toast("没有可以报工项")
return
}
uni.setStorageSync("processReportList", res.data.list)
uni.redirectTo({
url: "./processReportForm"
})
}
})
proxy.$modal.closeLoading()
}
function checkChange(checkedArray: any[]) {
checked = checkedArray
}
/* 打开详情页 */ /* 打开详情页 */
function openDetail(item: any) { function openDetail(item: any) {
console.log(item) console.log(item)
@ -84,23 +57,21 @@ function openDetail(item: any) {
/* 通用方法 */ /* 通用方法 */
onShow(() => { onShow(() => {
list.value = []
getList()
}) })
function onSubmit() { function onSubmit() {
if (checked.length == 0){ list.value.forEach(item=>{
_toast("请选择人员") if (item.checked){
return uni.setStorageSync("processReportList", list.value)
}
uni.setStorageSync("processReportList", checked)
uni.redirectTo({ uni.redirectTo({
url: "./processReportForm" url: "./processReportForm"
}) })
return
}
})
_toast("请选择人员")
} }
onLoad((option) => { onLoad((option) => {
// "{"status":"1","remark":null,"planMasterCode":"PO20240429-0015","schedulingCode":"9bb4ab0cfcc14e3284833506b5041571","productCode":"015.886-117","productName":null,"workroomCode":"work1","lineCode":"work1-line1","prouteCode":"015.886-117","planCount":25,"finishCount":0,"qualifiedCount":null,"unqualifiedCount":null,"flagDo":"0","planSubCode":null,"workingNode":"QD_HJ_01","workingTaskSort":1,"formType":"BATCH","workSort":0,"currentWorkstation":null,"planStartTime":null,"planEndTime":1714388234000,"realStartTime":null,"realFinishedTime":null,"qualityFormNo":null,"reason":null,"planNoDay":null,"batchCode":"M015.886-117-001","id":61,"createTime":1714370517000,"creator":"1"}" list.value = uni.getStorageSync("processReportList")
data.value.planDayCode = uni.getStorageSync("processReportListParams").planMasterCode
data.value.processCode = uni.getStorageSync("processReportListParams").workingNode
}) })
</script> </script>

46
src/pages/mes/workScheduling/workScheduling.vue

@ -80,27 +80,22 @@
<script setup lang="ts"> <script setup lang="ts">
import { import { onReachBottom, onShow } from "@dcloudio/uni-app"
onLoad, import { getCurrentInstance, ref } from "vue"
onShow,
onReachBottom
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import * as workSchedulingListApi from '@/api/mes/workScheduling/index.ts' import * as workSchedulingListApi from "@/api/mes/workScheduling/index.ts"
import * as workSchedulingApi from "@/api/mes/workScheduling"
import { _toast } from "@/utils/common"
const list1 = ref([ const list1 = ref([
{ {
name: '全部', name: "全部"
}, },
{ {
name: '待齐套', name: "待齐套"
}, },
{ {
name: '待开工', name: "待开工"
}, },
{ {
name: '生产中', name: '生产中',
@ -297,7 +292,7 @@ async function searchTable() {
// //
function completeHandle(item) { function completeHandle(item) {
console.log(item) console.log(item)
proxy.$modal.loading('点击了完工按钮') proxy.$modal.loading("点击了完工按钮")
setTimeout(() => { setTimeout(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
}, 1000) }, 1000)
@ -313,17 +308,34 @@ function completeHandle(item) {
// proxy.$modal.closeLoading() // proxy.$modal.closeLoading()
// }) // })
} }
function reportHandle(item) {
uni.setStorageSync("processReportListParams", item) async function reportHandle(item) {
proxy.$modal.loading("加载中")
await workSchedulingApi.getConfigProcessWorker({
planDayCode: item.planMasterCode,
processCode: item.workingNode,
schedulingCode: item.schedulingCode
}).then((res) => {
uni.setStorageSync("isLeader", res.data.leader)
if (res.data.persons.length == 0) {
_toast("没有可以报工项")
return
}
uni.setStorageSync("processReportList", res.data.persons)
uni.redirectTo({ uni.redirectTo({
url: "/pages/mes/workScheduling/processReportPeopleCheck" url: res.data.leader ? "/pages/mes/workScheduling/processReportPeopleCheck" : "/pages/mes/workScheduling/processReportForm"
})
}).finally(() => {
proxy.$modal.closeLoading()
}) })
} }
// //
function callBasicItem(item) { function callBasicItem(item) {
console.log(item) console.log(item)
proxy.$tab.navigateTo(`/pages/mes/workScheduling/callMaterial?obj=${JSON.stringify(item)}`) proxy.$tab.navigateTo(`/pages/mes/workScheduling/callMaterial?obj=${JSON.stringify(item)}`)
} }
// //
function receiveBasicItem(item) { function receiveBasicItem(item) {
console.log(item) console.log(item)

Loading…
Cancel
Save