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

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

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

Loading…
Cancel
Save