首页二级列表页面

This commit is contained in:
zzyuan 2024-10-18 16:54:10 +08:00
parent 34f4efcac9
commit 9f33e726c5
7 changed files with 537 additions and 211 deletions

View File

@ -27,6 +27,7 @@ module.exports = {
realFileUrl: 'http://192.168.0.14:1909/file/',
//实名制移动端
realBmwUrl: 'http://192.168.0.14:1911/bmw',
// 应用信息
appInfo: {
// 应用名称

View File

@ -260,6 +260,12 @@
"style": {
"navigationStyle": "custom"
}
},{
// --
"path": "pages/realName/index/pages/personDetail",
"style": {
"navigationStyle": "custom"
}
},
{
//

View File

@ -658,6 +658,12 @@ export default {
if(item.data_title=='在场人数'){
uni.navigateTo({ url: '/pages/realName/index/pages/personList' })
}
if(item.data_title=='日计划打卡数'){
uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0&isPlanWorker=1' })
}
if(item.data_title=='今日打卡'){
uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0' })
}
},
},

View File

@ -5,12 +5,15 @@
<view class="header-fixed">
<view class="search-content">
<view style="width: 90%;">
<view style="width: 25%;">
<uni-data-select v-model="selectType" :localdata="range" :clear="false"></uni-data-select>
</view>
<view style="width: 70%;">
<uni-easyinput
suffixIcon="search"
v-model="queryParams.params.proName"
placeholder="请输入人员名称"
@iconClick="getWorkPlantData"
v-model="keyWord"
placeholder="请输入名称"
@iconClick="getListData"
></uni-easyinput>
</view>
<view class="search-icon" @tap="onSearchFilter"></view>
@ -19,25 +22,71 @@
</view>
<view style="padding: 0 20rpx">
<scroll-view class="data-container" scroll-y="true">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="item.proId" @tap="onViewWorkDetails(item)">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="index" @tap="onViewWorkDetails(item)">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>
<text v-if="item.kjsfx > 0" style="color: #6ff6d5">可接受风险{{ item.kjsfx }}</text>
<text v-if="item.dfx > 0" style="color: #25c294">低风险{{ item.dfx }}</text>
<text v-if="item.zfx > 0" style="color: #f9971e">中风险{{ item.zfx }}</text>
<text v-if="item.gfx > 0" style="color: #f44d46">高风险{{ item.gfx }}</text>
</view>
</view>
<text>{{ item.name }}</text>(
<text v-if="item.workerType==0">临时用工</text>
<text v-if="item.workerType==1">固定用工</text>
<text v-if="item.workerType==2">分包管理人员</text>)
</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" style="position: absolute;right: 1%;"></uni-icons>
</view>
<view class="item-3">
<view>作业人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.personNum }}</view>
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view>工种</view>
<view style="font-weight: bold;margin-left: 40rpx;">{{item.postName}}</view>
</view>
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view>联系方式</view>
<view style="color: #3f9dfd; font-weight: bold;margin-left: 40rpx;">{{item.phone}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view>是否为作业打卡</view>
<view style="font-weight: bold;margin-left: 40rpx;">
<text style="color: green;" v-if="item.isPlanWorker==1"></text>
<text style="color: red;" v-if="item.isPlanWorker==0"></text>
</view>
</view>
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view>红绿灯状态</view>
<view style="font-weight: bold;margin-left: 40rpx;">
<text style="color: green;" v-if="item.lightStatus==2">绿灯</text>
<text style="color: yellow;" v-if="item.lightStatus==1">黄灯</text>
<text style="color: red;" v-if="item.lightStatus==0">红灯</text>
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在班组</view>
<view style="width: 83%;">
{{item.teamName}}
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在分包</view>
<view style="width: 83%;">
{{item.subName}}
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在工程</view>
<view style="width: 83%;">
{{item.proName}}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
@ -53,7 +102,7 @@
<view
v-for="(item, index) in companyList" :key="index"
:class="{ active: index === activeIndex }"
@tap="onSelectCompany(index, item.name)"
@tap="onSelectCompany(index, item.id)"
>
{{ item.name }}
</view>
@ -67,7 +116,7 @@
<view
v-for="(item, index) in lightList" :key="index"
:class="{ active: index === activeIndex2 }"
@tap="onSelectLight(index, item.name)"
@tap="onSelectLight(index, item.id)"
>
{{ item.name }}
</view>
@ -81,7 +130,7 @@
<view
v-for="(item, index) in workTypeList" :key="index"
:class="{ active: index === activeIndex3 }"
@tap="onSelectWorkType(index, item.name)"
@tap="onSelectWorkType(index, item.id)"
>
{{ item.name }}
</view>
@ -95,7 +144,7 @@
<view
v-for="(item, index) in ageTypeList" :key="index"
:class="{ active: index === activeIndex4 }"
@tap="onSelectageType(index, item.name)"
@tap="onSelectageType(index, item.id)"
>
{{ item.name }}
</view>
@ -109,7 +158,7 @@
<view
v-for="(item, index) in sexTypeList" :key="index"
:class="{ active: index === activeIndex5 }"
@tap="onSelectSexType(index, item.name)"
@tap="onSelectSexType(index, item.id)"
>
{{ item.name }}
</view>
@ -124,7 +173,7 @@
<view
v-for="(item, index) in attTypeList" :key="index"
:class="{ active: index === activeIndex6 }"
@tap="onSelectAttType(index, item.name)"
@tap="onSelectAttType(index, item.id)"
>
{{ item.name }}
</view>
@ -138,7 +187,7 @@
<view
v-for="(item, index) in dayAttTypeList" :key="index"
:class="{ active: index === activeIndex7 }"
@tap="onSelectDayAttType(index, item.name)"
@tap="onSelectDayAttType(index, item.id)"
>
{{ item.name }}
</view>
@ -169,34 +218,107 @@ export default {
activeIndex7: 0,
recordsTotal: 0,
token: uni.getStorageSync('tjToken'),
selectType:0,
keyWord:"",
range: [
{ value: 0, text: '姓名' },
{ value: 1, text: '分包' },
{ value: 2, text: '班组' },
{ value: 3, text: '工种' }
],
//
queryParams: {
offset: 0,
limit: 99999,
offset: "0",
limit: "99999",
params: {
proName: '',
subComName: ''
userId:uni.getStorageSync('realNameUser').userId+"",
workerName:"",//
subName:"",//
teamName:"",//
postName:"", //
proId:"", //
subId:"", //
teamId:"", //
lightStatus:"", //
workerType:"", //
sex:"", //
isAtt:"", //
subComId:"", //
isPlanWorker:"", //
startAge:"", //
endAge:"", //
}
},
companyList: [{ name: '全部', id: '' }],
lightList: [{name:'全部', id:'' },{name:'绿灯', id:'1' },{name:'黄灯', id:'2' },{name:'红灯', id:'3' }],
workTypeList: [{name:'全部', id:'' },{name:'固定用工', id:'1' },{name:'临时用工', id:'2' }],
ageTypeList: [{name:'全部', id:'' },{name:'<20', id:'1' },{name:'20-30', id:'2' },{name:'30-40', id:'3' },{name:'40-50', id:'4' },{name:'50-60', id:'5' }],
sexTypeList: [{name:'全部', id:'' },{name:'男', id:'1' },{name:'女', id:'2' }],
attTypeList: [{name:'全部', id:'' },{name:'已考勤', id:'1' },{name:'未考勤', id:'2' }],
dayAttTypeList: [{name:'全部', id:'' },{name:'日计划打卡', id:'1' },{name:'非日计划打卡', id:'2' }],
lightList: [{name:'全部', id:'-1' },{name:'绿灯', id:'2' },{name:'黄灯', id:'1' },{name:'红灯', id:'0' }],
workTypeList: [{name:'全部', id:'-1' },{name:'固定用工', id:'1,2' },{name:'临时用工', id:'0' }],
ageTypeList: [{name:'全部', id:'-1' },{name:'<20', id:'0' },{name:'20-30', id:'1' },{name:'30-40', id:'2' },{name:'40-50', id:'3' },{name:'50-60', id:'4' }],
sexTypeList: [{name:'全部', id:'-1' },{name:'男', id:'1' },{name:'女', id:'0' }],
attTypeList: [{name:'全部', id:'-1' },{name:'已考勤', id:'0' },{name:'未考勤', id:'1' }],
dayAttTypeList: [{name:'全部', id:'-1' },{name:'日计划打卡', id:'1' },{name:'非日计划打卡', id:'0' }],
companyInfoList: []
}
},
mounted() {
this.getWorkPlantData()
this.getHomePageSelectData()
},
onLoad(option) {
console.log(option)
this.queryParams.params.proId=option.proId||"";
this.queryParams.params.subId=option.subId||"";
this.queryParams.params.teamId=option.teamId||"";
if(option.isAtt&&option.isAtt==0&&option.isPlanWorker&&option.isPlanWorker==1){//
this.activeIndex6=1
this.activeIndex7=1
this.queryParams.params.isAtt = "0"
this.queryParams.params.isPlanWorker = "1"
this.getListData()
}else if(option.isAtt&&option.isAtt==0){//
this.activeIndex6=1
this.queryParams.params.isAtt = "0"
this.getListData()
}else if(option.workerType&&option.workerType==1){//
this.activeIndex3 = 1
this.queryParams.params.workerType = "1,2"
this.getListData()
}else if(option.workerType&&option.workerType==0){//
this.activeIndex3 = 2
this.queryParams.params.workerType = "0"
this.getListData()
}else if(option.lightStatus&&option.lightStatus==2){//绿
this.activeIndex2 = 1
this.queryParams.params.lightStatus = "2"
this.getListData()
}else if(option.lightStatus&&option.lightStatus==1){//
this.activeIndex2 = 2
this.queryParams.params.lightStatus = "1"
this.getListData()
}else if(option.lightStatus&&option.lightStatus==0){//
this.activeIndex2 = 3
this.queryParams.params.lightStatus = "0"
this.getListData()
} else {
this.getListData()
}
},
methods: {
/* 获取作业计划列表 */
async getWorkPlantData() {
/* 获取列表 */
async getListData() {
if(this.selectType==0){
this.workerName=this.keyWord
}else if(this.selectType==1){
this.subName=this.keyWord
}else if(this.selectType==2){
this.teamName=this.keyWord
}else if(this.selectType==3){
this.postName=this.keyWord
}
console.log(this.queryParams)
uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
url: config.loginBaseUrl + '/bmw//homeSubPage/getAppWorkerMsg',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
@ -205,7 +327,7 @@ export default {
},
success: res => {
console.log('res****', res)
this.recordsTotal = res.data.recordsTotal
this.recordsTotal = res.data.recordsTotal
this.companyInfoList = res.data.data
},
fail: err => {}
@ -224,90 +346,84 @@ export default {
this.$refs.popup.open()
},
/* 选择公司 */
onSelectCompany(index, name) {
onSelectCompany(index, Id) {
this.activeIndex = index
if (index === 0) {
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
} else {
this.queryParams.params.subComName = name
this.queryParams.params.subComId = Id
}
},
onSelectLight(index, name) {
onSelectLight(index, Id) {
this.activeIndex2 = index
if (index === 0) {
this.queryParams.params.light = ''
} else {
this.queryParams.params.light = name
}
this.queryParams.params.lightStatus = Id
},
onSelectWorkType(index, name) {
onSelectWorkType(index, Id) {
this.activeIndex3 = index
if (index === 0) {
this.queryParams.params.workType = ''
} else {
this.queryParams.params.workType = name
}
this.queryParams.params.workerType = Id
},
onSelectAgeType(index, name) {
onSelectAgeType(index, Id) {
this.activeIndex4 = index
if (index === 0) {
this.queryParams.params.ageType = ''
} else {
this.queryParams.params.ageType = name
if (Id == -1) {
this.queryParams.params.startAge = '0'
this.queryParams.params.endAge = '99'
} else if (Id == 0) {
this.queryParams.params.startAge = '0'
this.queryParams.params.endAge = '20'
} else if (Id == 1) {
this.queryParams.params.startAge = '20'
this.queryParams.params.endAge = '30'
} else if (Id == 2) {
this.queryParams.params.startAge = '30'
this.queryParams.params.endAge = '40'
} else if (Id == 3) {
this.queryParams.params.startAge = '40'
this.queryParams.params.endAge = '50'
} else if (Id == 3) {
this.queryParams.params.startAge = '50'
this.queryParams.params.endAge = '60'
}
},
onSelectSexType(index, name) {
onSelectSexType(index, Id) {
this.activeIndex5 = index
if (index === 0) {
this.queryParams.params.sexType = ''
} else {
this.queryParams.params.sexType = name
}
this.queryParams.params.sex = Id
},
onSelectAttType(index, name) {
onSelectAttType(index, Id) {
this.activeIndex6 = index
if (index === 0) {
this.queryParams.params.attType = ''
} else {
this.queryParams.params.attType = name
}
this.queryParams.params.isAtt = Id
},
onSelectDayAttType(index, name) {
onSelectDayAttType(index, Id) {
this.activeIndex7 = index
if (index === 0) {
this.queryParams.params.dayAttType = ''
} else {
this.queryParams.params.dayAttType = name
}
this.queryParams.params.isPlanWorker = Id
},
//light workType ageType sexType attType dayAttType
/* 重置 */
onReset() {
this.activeIndex = 0
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
this.activeIndex2 = 0
this.queryParams.params.light = ''
this.queryParams.params.lightStatus = ''
this.activeIndex3 = 0
this.queryParams.params.workType = ''
this.queryParams.params.workerType = ''
this.activeIndex4 = 0
this.queryParams.params.ageType = ''
this.activeIndex5 = 0
this.queryParams.params.sexType = ''
this.queryParams.params.sex = ''
this.activeIndex6 = 0
this.queryParams.params.attType = ''
this.queryParams.params.isAtt = ''
this.activeIndex7 = 0
this.queryParams.params.dayAttType = ''
this.queryParams.params.isPlanWorker = ''
this.onQuery()
},
/* 查询 */
onQuery() {
this.getWorkPlantData().then(() => {
this.getListData().then(() => {
this.$refs.popup.close()
})
},
/* 点击跳转作业计划详情 */
/* 点击跳转详情 */
onViewWorkDetails(row) {
uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` })
uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${row.idNumber}` })
},
/* 收藏与取消收藏 */
onCollection(e, row) {
@ -381,8 +497,7 @@ export default {
margin: 20rpx auto;
}
.item-1,
.item-2,
.item-1,
.item-3 {
width: 96%;
margin: 0 auto;
@ -390,6 +505,7 @@ export default {
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.item-1 view:first-child {
@ -404,9 +520,9 @@ export default {
font-weight: bold;
font-size: 28rpx;
}
.item-2,
.item-3 {
font-size: 24rpx;
justify-content: space-around;
}
}

View File

@ -10,7 +10,7 @@
suffixIcon="search"
v-model="queryParams.params.proName"
placeholder="请输入工程信息"
@iconClick="getWorkPlantData"
@iconClick="getListData"
></uni-easyinput>
</view>
<view class="search-icon" @tap="onSearchFilter"></view>
@ -19,25 +19,60 @@
</view>
<view style="padding: 0 20rpx">
<scroll-view class="data-container" scroll-y="true">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="item.proId" @tap="onViewWorkDetails(item)">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>
<text v-if="item.kjsfx > 0" style="color: #6ff6d5">可接受风险{{ item.kjsfx }}</text>
<text v-if="item.dfx > 0" style="color: #25c294">低风险{{ item.dfx }}</text>
<text v-if="item.zfx > 0" style="color: #f9971e">中风险{{ item.zfx }}</text>
<text v-if="item.gfx > 0" style="color: #f44d46">高风险{{ item.gfx }}</text>
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="index">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" style="position: absolute;right: 1%;"></uni-icons>
</view>
</view>
<view class="item-3">
<view>作业人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.personNum }}</view>
</view>
<view class="item-2">
<view>{{item.subComName}}</view>
<view>{{item.voltageLevel}}</view>
<view>{{item.proType}}</view>
<view>{{item.proStatus}}</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goSubListPage(item)">
<view>分包</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.subNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goTeamListPage(item)">
<view>班组</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.teamNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goAttPersonListPage(item)">
<view>考勤人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.attPersonNum}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goAllPersonListPage(item)">
<view>在场</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.einPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goWorkPersonListPage(item)">
<view>固定</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.formalPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goTempPersonListPage(item)">
<view>临时</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.temporaryPersonNum}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,2)">
<view>绿灯</view>
<view style="color: #3FB779; font-weight: bold">{{item.greenPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,1)">
<view>黄灯</view>
<view style="color: #E89C2D; font-weight: bold">{{item.yellowPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,0)">
<view>红灯</view>
<view style="color: #E8717F; font-weight: bold">{{item.redPersonNum}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
@ -53,7 +88,7 @@
<view
v-for="(item, index) in companyList" :key="index"
:class="{ active: index === activeIndex }"
@tap="onSelectCompany(index, item.name)"
@tap="onSelectCompany(index, item.id)"
>
{{ item.name }}
</view>
@ -128,47 +163,56 @@ export default {
token: uni.getStorageSync('tjToken'),
//
queryParams: {
offset: 0,
limit: 99999,
offset: "0",
limit: "999999",
params: {
proName: '',
subComName: ''
userId:uni.getStorageSync('realNameUser').userId+'',
proName:"",
subComId:"",
proStatus:"",
voltageLevel:"",
proType:"",
}
},
companyList: [{ name: '全部', id: '' }],
proStatusList: [{name:'全部', id:'' },{name:'在建', id:'1' },{name:'完工', id:'2' },{name:'筹建', id:'3' },{name:'停工', id:'4' },{name:'遗憾收尾', id:'5' }],
proStatusList: [{name:'全部', id:'' }],
levelList: [{name:'全部', id:'' },{name:'其他', id:'1' },{name:'110kV', id:'2' },{name:'220kV', id:'3' },{name:'500kV', id:'4' },{name:'±500kV', id:'5' },{name:'1000kV以上', id:'6' }],
proTypeList: [{name:'全部', id:'' },{name:'其他', id:'1' },{name:'变电改扩建', id:'2' },{name:'基建变电', id:'3' },{name:'基建线路', id:'4' },{name:'生产变电', id:'5' },{name:'生产线路', id:'6' }],
proTypeList: [{name:'全部', id:'' }],
companyInfoList: []
}
},
mounted() {
this.getWorkPlantData()
this.getListData()
this.getHomePageSelectData()
},
methods: {
/* 获取作业计划列表 */
async getWorkPlantData() {
async getListData() {
console.log('this.queryParams参数', this.queryParams)
uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
'Content-Type': 'application/json'
// token: this.token
},
success: res => {
console.log('res****', res)
this.recordsTotal = res.data.recordsTotal
this.companyInfoList = res.data.data
},
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppBuildPro',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
'Content-Type': 'application/json'
// token: this.token
},
success: res => {
console.log('res****', res)
this.recordsTotal = res.data.recordsTotal
this.companyInfoList = res.data.data
},
fail: err => {}
})
},
/* 获取公司数据 */
async getHomePageSelectData() {
const res = await getHomePageSelectApi()
console.log(res)
this.companyList = this.companyList.concat(res.subList)
this.proTypeList = this.proTypeList.concat(res.proType)
this.proStatusList = this.proStatusList.concat(res.proStatusList)
this.levelList = this.levelList.concat(res.levelList)
},
leftClick() {
uni.navigateTo({ url: `/pages/realName/index/index` })
@ -178,12 +222,12 @@ export default {
this.$refs.popup.open()
},
/* 选择公司 */
onSelectCompany(index, name) {
onSelectCompany(index, id) {
this.activeIndex = index
if (index === 0) {
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
} else {
this.queryParams.params.subComName = name
this.queryParams.params.subComId = id
}
},
onSelectStatus(index, name) {
@ -197,41 +241,66 @@ export default {
onSelectLevel(index, name) {
this.activeIndex3 = index
if (index === 0) {
this.queryParams.params.level = ''
this.queryParams.params.voltageLevel = ''
} else {
this.queryParams.params.level = name
this.queryParams.params.voltageLevel = name
}
},
onSelectType(index, name) {
this.activeIndex4 = index
if (index === 0) {
this.queryParams.params.type = ''
this.queryParams.params.proType = ''
} else {
this.queryParams.params.type = name
this.queryParams.params.proType = name
}
},
/* 重置 */
onReset() {
this.activeIndex = 0
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
this.activeIndex2 = 0
this.queryParams.params.proStatus = ''
this.activeIndex3 = 0
this.queryParams.params.level = ''
this.queryParams.params.voltageLevel = ''
this.activeIndex4 = 0
this.queryParams.params.type = ''
this.queryParams.params.proType = ''
this.onQuery()
},
/* 查询 */
onQuery() {
this.getWorkPlantData().then(() => {
this.getListData().then(() => {
this.$refs.popup.close()
})
},
/* 点击跳转作业计划详情 */
onViewWorkDetails(row) {
uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` })
/* 点击跳转分包 */
goSubListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/subList?proId=${row.proId}` })
},
/* 点击跳转班组 */
goTeamListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/teamList?proId=${row.proId}` })
},
/* 点击跳转人员-已考勤 */
goAttPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}&isAtt=0` })
},
/* 点击跳转人员-在场(全部) */
goAllPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}` })
},
/* 点击跳转人员-固定 */
goWorkPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}&workerType=1` })
},
/* 点击跳转人员-临时 */
goTempPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}&workerType=0` })
},
/* 点击跳转人员-灯 */
goLightPersonListPage(row,type) {//绿2 1 0
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}&lightStatus=${type}` })
},
/* 收藏与取消收藏 */
onCollection(e, row) {
e.stopPropagation()
@ -313,6 +382,7 @@ export default {
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.item-1 view:first-child {
@ -330,6 +400,7 @@ export default {
.item-2,
.item-3 {
font-size: 24rpx;
justify-content: space-around;
}
}

View File

@ -8,9 +8,9 @@
<view style="width: 98%;">
<uni-easyinput
suffixIcon="search"
v-model="queryParams.params.proName"
v-model="queryParams.params.subName"
placeholder="请输入分包名称"
@iconClick="getWorkPlantData"
@iconClick="getListData"
></uni-easyinput>
</view>
<!-- <view class="search-icon" @tap="onSearchFilter"></view> -->
@ -19,25 +19,60 @@
</view>
<view style="padding: 0 20rpx">
<scroll-view class="data-container" scroll-y="true">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="item.proId" @tap="onViewWorkDetails(item)">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="index">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>
<text v-if="item.kjsfx > 0" style="color: #6ff6d5">可接受风险{{ item.kjsfx }}</text>
<text v-if="item.dfx > 0" style="color: #25c294">低风险{{ item.dfx }}</text>
<text v-if="item.zfx > 0" style="color: #f9971e">中风险{{ item.zfx }}</text>
<text v-if="item.gfx > 0" style="color: #f44d46">高风险{{ item.gfx }}</text>
</view>
</view>
<view class="item-3">
<view>作业人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.personNum }}</view>
<view>{{ item.subName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" style="position: absolute;right: 1%;"></uni-icons>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goTeamListPage(item)">
<view>班组</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.teamNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goAttPersonListPage(item)">
<view>考勤人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.attPersonNum}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goAllPersonListPage(item)">
<view>在场</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.einPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goWorkPersonListPage(item)">
<view>固定</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.formalPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goTempPersonListPage(item)">
<view>临时</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.temporaryPersonNum}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,2)">
<view>绿灯</view>
<view style="color: #3FB779; font-weight: bold">{{item.greenPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,1)">
<view>黄灯</view>
<view style="color: #E89C2D; font-weight: bold">{{item.yellowPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,0)">
<view>红灯</view>
<view style="color: #E8717F; font-weight: bold">{{item.redPersonNum}}</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在工程</view>
<view style="width: 83%;">
<view v-for="(items,indexs) in item.proName.split('<br>')" :key="indexs">
{{items}}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
@ -128,11 +163,14 @@ export default {
token: uni.getStorageSync('tjToken'),
//
queryParams: {
offset: 0,
limit: 99999,
offset: "0",
limit: "999999",
params: {
proName: '',
subComName: ''
userId:uni.getStorageSync('realNameUser').userId+"",
proId:"",
subName:"",
proName:"",
subComName:""
}
},
companyList: [{ name: '全部', id: '' }],
@ -143,14 +181,19 @@ export default {
}
},
mounted() {
this.getWorkPlantData()
this.getHomePageSelectData()
// this.getHomePageSelectData()
},
onLoad(option) {
console.log(option)
this.queryParams.params.proId=option.proId||"";
this.getListData()
},
methods: {
/* 获取作业计划列表 */
async getWorkPlantData() {
/* 获取列表 */
async getListData() {
console.log(this.queryParams)
uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppActiveSub',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
@ -224,14 +267,38 @@ export default {
},
/* 查询 */
onQuery() {
this.getWorkPlantData().then(() => {
this.getListData().then(() => {
this.$refs.popup.close()
})
},
/* 点击跳转作业计划详情 */
onViewWorkDetails(row) {
uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` })
},
/* 点击跳转班组 */
goTeamListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/teamList?subId=${row.subId}` })
},
/* 点击跳转人员-已考勤 */
goAttPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?subId=${row.subId}&isAtt=0` })
},
/* 点击跳转人员-在场(全部) */
goAllPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?subId=${row.subId}` })
},
/* 点击跳转人员-固定 */
goWorkPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?subId=${row.subId}&workerType=1` })
},
/* 点击跳转人员-临时 */
goTempPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?subId=${row.subId}&workerType=0` })
},
/* 点击跳转人员-灯 */
goLightPersonListPage(row,type) {//绿2 1 0
uni.navigateTo({ url: `/pages/realName/index/pages/personList?subId=${row.subId}&lightStatus=${type}` })
},
/* 收藏与取消收藏 */
onCollection(e, row) {
e.stopPropagation()
@ -302,6 +369,7 @@ export default {
padding: 14rpx 0;
background-color: #fff;
margin: 20rpx auto;
}
.item-1,
@ -313,6 +381,7 @@ export default {
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.item-1 view:first-child {
@ -330,6 +399,7 @@ export default {
.item-2,
.item-3 {
font-size: 24rpx;
justify-content: space-around;
}
}

View File

@ -8,9 +8,9 @@
<view style="width: 90%;">
<uni-easyinput
suffixIcon="search"
v-model="queryParams.params.proName"
v-model="queryParams.params.teamName"
placeholder="请输入班组名称"
@iconClick="getWorkPlantData"
@iconClick="getListData"
></uni-easyinput>
</view>
<view class="search-icon" @tap="onSearchFilter"></view>
@ -19,25 +19,57 @@
</view>
<view style="padding: 0 20rpx">
<scroll-view class="data-container" scroll-y="true">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="item.proId" @tap="onViewWorkDetails(item)">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="index">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>
<text v-if="item.kjsfx > 0" style="color: #6ff6d5">可接受风险{{ item.kjsfx }}</text>
<text v-if="item.dfx > 0" style="color: #25c294">低风险{{ item.dfx }}</text>
<text v-if="item.zfx > 0" style="color: #f9971e">中风险{{ item.zfx }}</text>
<text v-if="item.gfx > 0" style="color: #f44d46">高风险{{ item.gfx }}</text>
</view>
<view>{{ item.teamName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @catchtap="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" style="position: absolute;right: 1%;"></uni-icons>
</view>
<view class="item-3">
<view>作业人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.personNum }}</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goAllPersonListPage(item)">
<view>在场</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.einPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goWorkPersonListPage(item)">
<view>固定</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.formalPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goTempPersonListPage(item)">
<view>临时</view>
<view style="color: #3f9dfd; font-weight: bold">{{item.temporaryPersonNum}}</view>
</view>
</view>
<view class="item-3">
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,2)">
<view>绿灯</view>
<view style="color: #3FB779; font-weight: bold">{{item.greenPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,1)">
<view>黄灯</view>
<view style="color: #E89C2D; font-weight: bold">{{item.yellowPersonNum}}</view>
</view>
<view style="width: 25%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;" @tap="goLightPersonListPage(item,0)">
<view>红灯</view>
<view style="color: #E8717F; font-weight: bold">{{item.redPersonNum}}</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在分包</view>
<view style="width: 83%;">
{{item.subName}}
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在工程</view>
<view style="width: 83%;">
{{item.proName}}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
@ -53,7 +85,7 @@
<view
v-for="(item, index) in companyList" :key="index"
:class="{ active: index === activeIndex }"
@tap="onSelectCompany(index, item.name)"
@tap="onSelectCompany(index, item.id)"
>
{{ item.name }}
</view>
@ -94,11 +126,16 @@ export default {
token: uni.getStorageSync('tjToken'),
//
queryParams: {
offset: 0,
limit: 99999,
offset: "0",
limit: "99999",
params: {
proName: '',
subComName: ''
userId:uni.getStorageSync('realNameUser').userId+"",
teamName:"",
proId:"",
subId:"",
proName:"",
subName:"",
subComId:""
}
},
companyList: [{ name: '全部', id: '' }],
@ -106,14 +143,19 @@ export default {
}
},
mounted() {
this.getWorkPlantData()
this.getHomePageSelectData()
},
onLoad(option) {
console.log(option)
this.queryParams.params.proId=option.proId||"";
this.queryParams.params.subId=option.subId||"";
this.getListData()
},
methods: {
/* 获取作业计划列表 */
async getWorkPlantData() {
/* 获取列表 */
async getListData() {
uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppActiveTeam',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
@ -144,28 +186,40 @@ export default {
onSelectCompany(index, name) {
this.activeIndex = index
if (index === 0) {
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
} else {
this.queryParams.params.subComName = name
this.queryParams.params.subComId = name
}
},
/* 重置 */
onReset() {
this.activeIndex = 0
this.queryParams.params.subComName = ''
this.queryParams.params.subComId = ''
this.onQuery()
},
/* 查询 */
onQuery() {
this.getWorkPlantData().then(() => {
this.getListData().then(() => {
this.$refs.popup.close()
})
},
/* 点击跳转作业计划详情 */
onViewWorkDetails(row) {
uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` })
},
/* 点击跳转人员-在场(全部) */
goAllPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?teamId=${row.teamId}` })
},
/* 点击跳转人员-固定 */
goWorkPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?teamId=${row.teamId}&workerType=1` })
},
/* 点击跳转人员-临时 */
goTempPersonListPage(row) {
uni.navigateTo({ url: `/pages/realName/index/pages/personList?teamId=${row.teamId}&workerType=0` })
},
/* 点击跳转人员-灯 */
goLightPersonListPage(row,type) {//绿2 1 0
uni.navigateTo({ url: `/pages/realName/index/pages/personList?teamId=${row.teamId}&lightStatus=${type}` })
},
/* 收藏与取消收藏 */
onCollection(e, row) {
e.stopPropagation()
@ -247,6 +301,7 @@ export default {
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.item-1 view:first-child {
@ -264,6 +319,7 @@ export default {
.item-2,
.item-3 {
font-size: 24rpx;
justify-content: space-around;
}
}