Browse Source

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

master
bjang03 7 months ago
parent
commit
06933b128c
  1. 28
      src/pages/mes/workScheduling/processReportPeopleCheck.vue

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

@ -5,8 +5,8 @@
<u-search :show-action="true" v-model="data.nickName" action-text="搜索" input-align="left" height="65" border-color="#ff9900" @search="filterList" @custom="filterList"></u-search>
</view>
<scroll-view scroll-y="true" class="scroll-Y" style="height: calc(100vh - 80rpx)">
<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">{{ item.personName }}</u-checkbox>
<u-checkbox-group class="item">
<u-checkbox class="dec" v-model="item.checked" v-for="(item, index) in searchList" :key="index" :name="item">{{ item.personName }}</u-checkbox>
</u-checkbox-group>
</scroll-view>
<u-button form-type="button" style="color:#ffffff;backgroundColor:#3C9CFF;position: fixed;bottom: 0px;width: 100%" @click="onSubmit">确认选择</u-button>
@ -27,8 +27,6 @@ import { onLoad, 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 workSchedulingListApi from "@/api/mes/workScheduling"
import { _toast } from "@/utils/common"
const { proxy } = getCurrentInstance()
@ -48,20 +46,17 @@ const data = ref({
const status = ref('loadmore')
/* 列表数据集 */
const list = ref([])
let checked: string | any[] = []
function checkChange(checkedArray: any[]) {
checked = checkedArray
}
const searchList = ref([])
/* 打开详情页 */
function openDetail(item: any) {
console.log(item)
// proxy.$tab.navigateTo(`/pages/mes/orderDapPlan/detail?obj=${item}`)
}
function filterList(){
list.value = []
uni.getStorageSync("processReportList").forEach(person=>{
searchList.value = []
list.value.forEach(person=>{
if (person.personName.includes(data.value.nickName)){
list.value.push(person)
searchList.value.push(person)
}
})
}
@ -69,7 +64,15 @@ function filterList(){
onShow(() => {
})
function onSubmit() {
if (checked.length == 0){
let checked = false
debugger
for(let i=0; i<list.value.length;i++){
if (list.value[i].checked){
checked = true
break
}
}
if (!checked){
_toast("请选择人员")
return
}else{
@ -81,6 +84,7 @@ function onSubmit() {
}
onLoad((option) => {
list.value = uni.getStorageSync("processReportList")
searchList.value = list.value //searchListstoragestoragecheck
})
</script>

Loading…
Cancel
Save