This commit is contained in:
zzyuan 2024-10-18 09:04:56 +08:00
commit a585b87456
3 changed files with 82 additions and 47 deletions

View File

@ -8,18 +8,7 @@ export function getHomePageListApi(data) {
data: data data: data
}) })
} }
// 首页二级页面--作业计划列表 // 首页二级页面--获取公司信息
export function getWorkPlantApi(data) {
return request({
url: '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'post',
header: {
'Content-Type': 'application/json'
},
data: data
})
}
// 首页二级页面--作业计划列表
export function getHomePageSelectApi() { export function getHomePageSelectApi() {
return request({ return request({
url: '/bmw/homePageSelect/getProCondition', url: '/bmw/homePageSelect/getProCondition',
@ -27,3 +16,19 @@ export function getHomePageSelectApi() {
data: {} data: {}
}) })
} }
// 首页二级页面--作业计划详情-作业计划列表
export function getWorkPlanDetailsApi(data) {
return request({
url: '/ynPlan/home/getjhxxq',
method: 'post',
data
})
}
// 首页二级页面--作业计划详情-作业计划列表
export function getWorkPersonnelApi(data) {
return request({
url: '/ynPlan/home/getDayUser',
method: 'post',
data
})
}

View File

@ -26,25 +26,25 @@
<uni-section title="今日作业计划" type="line"> <uni-section title="今日作业计划" type="line">
<template v-slot:right>全部人员</template> <template v-slot:right>全部人员</template>
<uni-card :is-shadow="true" margin="6"> <uni-card :is-shadow="true" margin="6">
<view> <view v-for="item in todayWorkList" :key="item.contentId">
<view class="row-1"> <view class="row-1">
<view>现场负责人</view> <view>现场负责人</view>
<view> <view>
<text>燕双鹰</text> <text>{{ item.xcfzr.split('')[0] }}</text>
<text>13556235623</text> <text>{{ item.xcfzr.split('')[1] }}</text>
</view> </view>
<view>作业人员</view> <view>作业人员</view>
<view>7</view> <view>{{ item.rys }}</view>
</view> </view>
<view class="row-2"> <view class="row-2">
<view>风险等级</view> <view>风险等级</view>
<view>低风险</view> <view>{{ item.fxdj }}</view>
<view>执行情况</view> <view>执行情况</view>
<view>已执行</view> <view>{{ item.state }}</view>
</view> </view>
<view class="row-3"> <view class="row-3">
<view style="padding: 8rpx 0">作业内容</view> <view style="padding: 8rpx 0">作业内容</view>
<view style="color: #000">135kv配电室35kv配电室35kv配电室35kv配电室35kv配电室</view> <view style="color: #000">{{ item.zynr }}</view>
</view> </view>
</view> </view>
</uni-card> </uni-card>
@ -86,21 +86,51 @@
</template> </template>
<script> <script>
import { getWorkPlanDetailsApi, getWorkPersonnelApi } from '../../../api/phaseTwo/homePage'
export default { export default {
data() { data() {
return { return {
queryInfo: {} queryInfo: {},
todayWorkList: []
} }
}, },
methods: { methods: {
leftClick() { leftClick() {
uni.navigateTo({ url: '/pages/realName/workPlan/index' }) uni.navigateTo({ url: '/pages/realName/workPlan/index' })
},
/* 获取今日作业计划 */
async getTodayWorkPlan() {
const { proName } = this.queryInfo
const params = {
proName,
day: this.$moment().format('YYYY-MM-DD')
}
const res = await getWorkPlanDetailsApi(params)
this.todayWorkList = res.data
console.log('今日计划数据', res)
},
/* 获取人员信息 */
async getWorkPersonnelData() {
const params = {
proName: this.queryInfo.proName,
day: this.$moment().format('YYYY-MM-DD'),
contentId: this.todayWorkList[0].contentId
}
const res = await getWorkPersonnelApi(params)
console.log('res---持证信息', res)
} }
}, },
onLoad(options) { onLoad(options) {
const query = JSON.parse(options.query) const query = JSON.parse(options.query)
this.queryInfo = query this.queryInfo = query
// console.log('queryquery', query) // console.log('queryquery', query)
// this.getTodayWorkPlan()
this.getTodayWorkPlan().then(() => {
this.getWorkPersonnelData()
})
} }
} }
</script> </script>

View File

@ -38,7 +38,7 @@
<uni-icons <uni-icons
:type="item.isCollect == 1 ? 'star-filled' : 'star'" :type="item.isCollect == 1 ? 'star-filled' : 'star'"
size="20" size="20"
@catchtap="onCollection($event, item)" @tap="onCollection(item)"
:style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"
></uni-icons> ></uni-icons>
</view> </view>
@ -102,6 +102,7 @@ export default {
offset: 0, offset: 0,
limit: 99999, limit: 99999,
params: { params: {
userId: uni.getStorageSync('realNameUser').userId + '',
proName: '', proName: '',
subComName: '' subComName: ''
} }
@ -117,6 +118,7 @@ export default {
methods: { methods: {
/* 获取作业计划列表 */ /* 获取作业计划列表 */
async getWorkPlantData() { async getWorkPlantData() {
console.log('this.queryParams参数', this.queryParams)
uni.request({ uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg', url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'POST', method: 'POST',
@ -171,32 +173,30 @@ export default {
uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` }) uni.navigateTo({ url: `/pages/realName/workPlan-details/index?query=${JSON.stringify(row)}` })
}, },
/* 收藏与取消收藏 */ /* 收藏与取消收藏 */
onCollection(e, row) { onCollection(row) {
e.stopPropagation() const params = {
// const params = { id: row.collectId,
// id: row.collectId, userId: uni.getStorageSync('realNameUser').userId,
// userId: uni.getStorageSync('realNameUser').userId, foreignId: row.proId,
// foreignId: row.proId, type: 1
// type: 1 }
// } uni.request({
url: `${config.loginBaseUrl}${
// // console.log('params', params) row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect'
}`,
// uni.request({ method: 'POST',
// url: `${config.loginBaseUrl}${ data: JSON.stringify(params),
// row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect' header: {
// }`, 'Content-Type': 'application/json',
// method: 'POST', token: this.token
// data: JSON.stringify(params), },
// header: { success: res => {
// 'Content-Type': 'application/json', if (res.data.code === 200) {
// token: this.token uni.showToast({ icon: 'none', title: ` ${row.isCollect == 0 ? '收藏成功' : '已取消收藏'}` })
// }, }
// success: res => { },
// console.log('res', res) fail: err => {}
// }, })
// fail: err => {}
// })
} }
} }
} }