Browse Source

1、工序报工-填报页面删除人员后无法将选中状态同步到storage内存中

master
bjang03 7 months ago
parent
commit
231c9a2d72
  1. 15
      src/pages/mes/workScheduling/processReportForm.vue
  2. 1
      src/pages/mes/workScheduling/processReportPeopleCheck.vue

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

@ -55,7 +55,7 @@
<script setup lang="ts">
/* 初始化 */
import { onShow } from "@dcloudio/uni-app"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from "vue"
/* 引入API */
import * as workSchedulingApi from "@/api/mes/workScheduling"
@ -97,6 +97,7 @@ function openDetail(item: any) {
// proxy.$tab.navigateTo(`/pages/mes/orderDapPlan/detail?obj=${item}`)
}
function toCheckPeople(){
uni.setStorageSync("processReportList", tempList)
uni.redirectTo({
url: "./processReportPeopleCheck"
})
@ -104,15 +105,23 @@ function toCheckPeople(){
function remove(index: number){
if (list.value.length > 1) {
_confirm('确定要删除吗?',function(){
tempList.forEach(person=>{
if(person.personCode != list.value[index].personCode){
person.checked = false
}
})
list.value.splice(index, 1)
})
}else{
_toast("最少需要上报一项")
}
}
let tempList: any[] = []
/* 通用方法 */
onShow(() => {
uni.getStorageSync("processReportList").forEach(person=>{
onLoad(() => {
// storagechecked
tempList = uni.getStorageSync("processReportList")
tempList.forEach(person=>{
if(person.checked){
person.reportList.forEach(report=>{
list.value.push(report)

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

@ -65,7 +65,6 @@ onShow(() => {
})
function onSubmit() {
let checked = false
debugger
for(let i=0; i<list.value.length;i++){
if (list.value[i].checked){
checked = true

Loading…
Cancel
Save