Browse Source

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

master
bjang03 6 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> <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> </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 searchList" :key="index" :name="item">{{ item.personName }}</u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</scroll-view> </scroll-view>
<u-button form-type="button" style="color:#ffffff;backgroundColor:#3C9CFF;position: fixed;bottom: 0px;width: 100%" @click="onSubmit">确认选择</u-button> <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" import { getCurrentInstance, ref } from "vue"
/* 引入API */ /* 引入API */
import tags from "@components/tags/index.vue" 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" import { _toast } from "@/utils/common"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -48,20 +46,17 @@ const data = ref({
const status = ref('loadmore') const status = ref('loadmore')
/* 列表数据集 */ /* 列表数据集 */
const list = ref([]) const list = ref([])
let checked: string | any[] = [] const searchList = ref([])
function checkChange(checkedArray: any[]) {
checked = checkedArray
}
/* 打开详情页 */ /* 打开详情页 */
function openDetail(item: any) { function openDetail(item: any) {
console.log(item) console.log(item)
// proxy.$tab.navigateTo(`/pages/mes/orderDapPlan/detail?obj=${item}`) // proxy.$tab.navigateTo(`/pages/mes/orderDapPlan/detail?obj=${item}`)
} }
function filterList(){ function filterList(){
list.value = [] searchList.value = []
uni.getStorageSync("processReportList").forEach(person=>{ list.value.forEach(person=>{
if (person.personName.includes(data.value.nickName)){ if (person.personName.includes(data.value.nickName)){
list.value.push(person) searchList.value.push(person)
} }
}) })
} }
@ -69,7 +64,15 @@ function filterList(){
onShow(() => { onShow(() => {
}) })
function onSubmit() { 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("请选择人员") _toast("请选择人员")
return return
}else{ }else{
@ -81,6 +84,7 @@ function onSubmit() {
} }
onLoad((option) => { onLoad((option) => {
list.value = uni.getStorageSync("processReportList") list.value = uni.getStorageSync("processReportList")
searchList.value = list.value //searchListstoragestoragecheck
}) })
</script> </script>

Loading…
Cancel
Save