parent
d4032ee24a
commit
1bc3529a1a
17 changed files with 1798 additions and 788 deletions
@ -1,359 +0,0 @@ |
||||
<template> |
||||
<view class="page-css"> |
||||
<view class="page-search-top"> |
||||
<betone-new-input v-model="searchInfo.requirementCode" placeholder='搜索巡检单位名称' icon="search" |
||||
style="margin-bottom: 32rpx" @changevalue="searchData()" /> |
||||
<!-- <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="changeTab" |
||||
bg-color="rgba(248, 248, 248, 1)"></u-tabs> --> |
||||
</view> |
||||
<view class="order-box"> |
||||
<!-- @click="goPage(item, 'details')" --> |
||||
<view class="order-item" v-for="(item, index) in orderData" :key="index"> |
||||
<view class="item-top"> |
||||
|
||||
<view class="item-left"> |
||||
<text class="item-orderNo">单位</text> |
||||
<text class="item-time"> {{ item.deptName }}</text> |
||||
</view> |
||||
<view class="item-right"> |
||||
<u-tag :text="statusName(item.status)" type="success" mode="dark" shape="circle" |
||||
:bg-color="tagColor[statusName(item.status)]" /> |
||||
</view> |
||||
</view> |
||||
<view class="item-con"> |
||||
<view class="con-right"> |
||||
<text class="con-title">巡检标题:{{ item.planContent }}</text> |
||||
<text class="con-title">创建时间:{{ item.createTime }}</text> |
||||
|
||||
<view class="con-btn"> |
||||
<u-button size="mini" plain style="margin-right: 32rpx" |
||||
@click="details(item)">查看</u-button> |
||||
<block v-if="item.status == 0 && dataTypes == 3"> |
||||
<u-button size="mini" plain style="margin-right: 32rpx" |
||||
@click="assign(item)">指派</u-button> |
||||
</block> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<u-loadmore margin-top="10" margin-bottom="40" :status="loadingState" /> |
||||
|
||||
<!-- 分派人员--> |
||||
<u-select v-model="sendOrdersShow" :list="sendOrdersList" @confirm="sendOrdersConfirm" :isShowsearch="true" |
||||
value-name="id" title="选择维修人员"></u-select> |
||||
|
||||
<betone-loading ref="BetLoading" /> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
props: { |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
searchInfo: { |
||||
requirementCode: "", |
||||
type: '',//状态 |
||||
}, |
||||
tabList: [ |
||||
{ |
||||
name: "全部", |
||||
key: "9999", |
||||
}, |
||||
{ |
||||
name: "启用", |
||||
key: "1", |
||||
}, |
||||
{ |
||||
name: "停用", |
||||
key: "0", |
||||
}, |
||||
], |
||||
tagColor: { |
||||
停用: "#909399", |
||||
启用: "#67c23a", |
||||
}, |
||||
|
||||
current: 0, |
||||
loadingState: "loadmore", |
||||
isNomore: false, |
||||
noDataFlag: false, |
||||
page: { |
||||
currentPage: 1, |
||||
pageSize: 10, |
||||
}, |
||||
orderData: [], |
||||
|
||||
sendOrder: { |
||||
repairPerson: '',//维修人员 id |
||||
name: '',//维修人员名字 |
||||
}, |
||||
sendOrdersShow: false,//派单弹框 |
||||
sendOrdersList: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
noData() { |
||||
return this.orderData && this.orderData.length == 0; |
||||
}, |
||||
dataTypes() { |
||||
return this.$store.state.dataType |
||||
}, |
||||
}, |
||||
|
||||
mounted() { |
||||
this.$nextTick(() => { |
||||
this.getRecordsList() |
||||
this.getRepairPersons() |
||||
// 触底触发 |
||||
uni.$on('onReachBottom', () => { |
||||
if (this.isNomore) { |
||||
return; |
||||
} |
||||
this.page.currentPage++; |
||||
this.getRecordsList(); |
||||
}) |
||||
// 下拉刷新 |
||||
uni.$on('onPullDownRefresh', () => { |
||||
this.isNomore = false |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList(); |
||||
uni.stopPullDownRefresh(); |
||||
}); |
||||
}); |
||||
}, |
||||
methods: { |
||||
// 获取列表 |
||||
getRecordsList() { |
||||
|
||||
this.BetLoading.show(); |
||||
|
||||
this.$u.api.getDictionaryList().then(res => { |
||||
var totalPage = res.data.total; |
||||
var newOrders = res.data.records; |
||||
if (this.page.currentPage == 1) { |
||||
this.orderData = []; |
||||
} |
||||
|
||||
this.orderData = [...this.orderData, ...(res.data.records || [])]; |
||||
if (newOrders.length == 0) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
if (totalPage == this.orderData.length) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
this.BetLoading.hide(); |
||||
}).catch(err => { |
||||
|
||||
}) |
||||
|
||||
}, |
||||
// 搜索 单号 |
||||
searchData() { |
||||
if (this.dataTypes != 1) { |
||||
// 非管理员和客户 不传提报单位 |
||||
this.searchInfo.reportUnit = this.searchInfo.requirementCode |
||||
} else { |
||||
this.searchInfo.reportUnit = '' |
||||
} |
||||
this.isNomore = false |
||||
// this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// tab切换 |
||||
changeTab(index) { |
||||
this.current = index; |
||||
this.searchInfo.type = this.tabList[index].key == '9999' ? '' : this.tabList[index].key |
||||
this.isNomore = false |
||||
// this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// 获取状态信息 |
||||
statusName(item) { |
||||
if (item == 1) { |
||||
return '停用' |
||||
} |
||||
if (item == 0) { |
||||
return '启用' |
||||
} |
||||
|
||||
}, |
||||
|
||||
// 指派 |
||||
assign(item) { |
||||
this.rowInfo = item |
||||
this.sendOrdersShow = true |
||||
}, |
||||
// 维修人员 |
||||
getRepairPersons() { |
||||
this.$u.api.getRepairPersons().then(res => { |
||||
if (res.code == 200) { |
||||
let data_ = res.data |
||||
data_.forEach(i => { |
||||
this.sendOrdersList.push({ ...i, label: i.name }) |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
// 确认指派人员 |
||||
sendOrdersConfirm(e) { |
||||
let query = { |
||||
servicemanId: e[0].value, |
||||
id: this.rowInfo.id |
||||
} |
||||
this.$u.api.taskSupervisorconfirm(query).then(res => { |
||||
if (res.code == 200) { |
||||
uni.showToast({ title: "指派成功", icon: "none" }); |
||||
this.sendOrdersShow = false |
||||
// 指派成功 刷新列表 |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
details(item) { |
||||
let param = { |
||||
id: item.id, |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/inspection/planDetails${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
|
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.page-css { |
||||
padding: 0 !important; |
||||
|
||||
.page-search-top { |
||||
max-height: 210rpx; |
||||
background-color: rgba(248, 248, 248, 1); |
||||
padding: 0 40rpx 0; |
||||
} |
||||
|
||||
.order-box { |
||||
margin-top: 20rpx; |
||||
|
||||
.order-item { |
||||
min-height: 214rpx; |
||||
margin: 0 24rpx 20rpx; |
||||
border-radius: 20rpx; |
||||
background: #fff; |
||||
display: flex; |
||||
flex-direction: column; |
||||
|
||||
.item-top { |
||||
height: 114rpx; |
||||
border-bottom: 1px solid rgba(239, 239, 239, 1); |
||||
display: flex; |
||||
flex-direction: row; |
||||
width: 100%; |
||||
|
||||
.item-left { |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.item-orderNo { |
||||
color: rgba(51, 51, 51, 1); |
||||
font-size: 28rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
|
||||
.item-time { |
||||
color: rgba(190, 190, 190, 1); |
||||
font-size: 24rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
} |
||||
|
||||
.item-right { |
||||
width: 132rpx; |
||||
height: 48rpx; |
||||
margin: 36rpx 24rpx 0 0; |
||||
} |
||||
} |
||||
|
||||
.item-con { |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: row; |
||||
margin-bottom: 32rpx; |
||||
|
||||
.con-left { |
||||
width: 150rpx; |
||||
height: 150rpx; |
||||
margin: 24rpx 28rpx 0 28rpx; |
||||
|
||||
image { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
|
||||
.con-right { |
||||
flex: 1; |
||||
margin-right: 24rpx; |
||||
display: flex; |
||||
flex-direction: column; |
||||
margin-left: 32rpx; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.con-title { |
||||
margin-top: 12rpx; |
||||
line-height: 60rpx; |
||||
color: rgba(0, 0, 0, 1); |
||||
font-size: 28rpx; |
||||
} |
||||
|
||||
.con-content { |
||||
|
||||
color: rgba(108, 108, 108, 1); |
||||
font-size: 24rpx; |
||||
// line-height: 36rpx; |
||||
margin-top: 14rpx; |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: -webkit-box; |
||||
-webkit-box-orient: vertical; |
||||
-webkit-line-clamp: 2; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
line-height: 1.5em; |
||||
/* 这个值根据你的需求调整,这里假设为1.5倍行高 */ |
||||
max-height: 3em; |
||||
/* 3行的高度 */ |
||||
width: 100%; |
||||
/* 根据需要设置宽度 */ |
||||
word-wrap: break-word; |
||||
/* 允许在单词内换行 */ |
||||
word-break: break-all; |
||||
/* 允许在任意字符处换行 */ |
||||
} |
||||
} |
||||
|
||||
.con-btn { |
||||
margin-top: 56rpx; |
||||
// margin-bottom: 32rpx; |
||||
display: inline-block; |
||||
text-align: right; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
@ -1,48 +1,327 @@ |
||||
<template> |
||||
<view class=""> |
||||
<view class="page-header-txt">科研医疗建筑运维平台</view> |
||||
<planList></planList> |
||||
<betone-tabbar ref="tabbarRef" /> |
||||
<view class="page-css"> |
||||
<!-- <view class="page-header-txt">科研医疗建筑运维平台</view> --> |
||||
<view class="page-search-top"> |
||||
|
||||
<betone-new-input v-model="searchInfo.requirementCode" placeholder='搜索巡检单位名称' icon="search" |
||||
style="margin-bottom: 32rpx" @changevalue="searchData()" /> |
||||
<!-- <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="changeTab" |
||||
bg-color="rgba(248, 248, 248, 1)"></u-tabs> --> |
||||
</view> |
||||
<view class="order-box"> |
||||
<!-- @click="goPage(item, 'details')" --> |
||||
<view class="order-item" v-for="(item, index) in orderData" :key="index"> |
||||
<view class="item-top"> |
||||
|
||||
<view class="item-left"> |
||||
<text class="item-orderNo">单位</text> |
||||
<text class="item-time"> {{ item.deptName }}</text> |
||||
</view> |
||||
<view class="item-right"> |
||||
<u-tag :text="statusName(item.isOpen)" type="success" mode="dark" shape="circle" |
||||
:bg-color="tagColor[statusName(item.isOpen)]" /> |
||||
</view> |
||||
</view> |
||||
<view class="item-con"> |
||||
<view class="con-right"> |
||||
<text class="con-title">巡检标题:{{ item.planContent }}</text> |
||||
<text class="con-title">创建时间:{{ item.createTime }}</text> |
||||
|
||||
<view class="con-btn"> |
||||
<u-button size="mini" plain style="margin-right: 32rpx" @click="details(item)">查看</u-button> |
||||
<u-button size="mini" plain type="primary" style="margin-right: 32rpx" @click="openTaskPage(item)">巡检任务</u-button> |
||||
|
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<u-loadmore margin-top="10" margin-bottom="40" :status="loadingState" /> |
||||
|
||||
|
||||
|
||||
<betone-loading ref="BetLoading" /> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import planList from './components/plan-list.vue' |
||||
export default { |
||||
components: { |
||||
planList, |
||||
}, |
||||
props: { |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
searchInfo: { |
||||
requirementCode: "", |
||||
type: '',//状态 |
||||
}, |
||||
tabList: [ |
||||
{ |
||||
name: "全部", |
||||
key: "9999", |
||||
}, |
||||
{ |
||||
name: "启用", |
||||
key: "1", |
||||
}, |
||||
{ |
||||
name: "停用", |
||||
key: "0", |
||||
}, |
||||
], |
||||
tagColor: { |
||||
停用: "#909399", |
||||
启用: "#67c23a", |
||||
}, |
||||
|
||||
current: 0, |
||||
loadingState: "loadmore", |
||||
isNomore: false, |
||||
noDataFlag: false, |
||||
page: { |
||||
currentPage: 1, |
||||
pageSize: 10, |
||||
}, |
||||
orderData: [], |
||||
|
||||
sendOrder: { |
||||
repairPerson: '',//维修人员 id |
||||
name: '',//维修人员名字 |
||||
}, |
||||
|
||||
}; |
||||
}, |
||||
computed: { |
||||
|
||||
noData() { |
||||
return this.orderData && this.orderData.length == 0; |
||||
}, |
||||
dataTypes() { |
||||
return this.$store.state.dataType |
||||
}, |
||||
}, |
||||
onReachBottom() { |
||||
uni.$emit('onReachBottom'); |
||||
|
||||
onPullDownRefresh() { |
||||
if (this.isNomore) { |
||||
return; |
||||
} |
||||
this.page.currentPage++; |
||||
this.getRecordsList(); |
||||
}, |
||||
onPullDownRefresh() { |
||||
uni.$emit('onPullDownRefresh'); |
||||
this.isNomore = false |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList(); |
||||
uni.stopPullDownRefresh(); |
||||
}, |
||||
onShow() { |
||||
this.$nextTick(() => { |
||||
this.$refs.tabbarRef.getPermission(); |
||||
this.getRecordsList() |
||||
|
||||
}); |
||||
}, |
||||
|
||||
methods: { |
||||
// 获取列表 |
||||
getRecordsList() { |
||||
|
||||
this.BetLoading.show(); |
||||
|
||||
this.$u.api.getDictionaryList().then(res => { |
||||
var totalPage = res.data.total; |
||||
var newOrders = res.data.records; |
||||
if (this.page.currentPage == 1) { |
||||
this.orderData = []; |
||||
} |
||||
|
||||
this.orderData = [...this.orderData, ...(res.data.records || [])]; |
||||
if (newOrders.length == 0) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
if (totalPage == this.orderData.length) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
this.BetLoading.hide(); |
||||
}).catch(err => { |
||||
|
||||
}) |
||||
|
||||
}, |
||||
// 搜索 单号 |
||||
searchData() { |
||||
if (this.dataTypes != 1) { |
||||
// 非管理员和客户 不传提报单位 |
||||
this.searchInfo.reportUnit = this.searchInfo.requirementCode |
||||
} else { |
||||
this.searchInfo.reportUnit = '' |
||||
} |
||||
this.isNomore = false |
||||
// this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// tab切换 |
||||
changeTab(index) { |
||||
this.current = index; |
||||
this.searchInfo.type = this.tabList[index].key == '9999' ? '' : this.tabList[index].key |
||||
this.isNomore = false |
||||
// this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// 获取状态信息 |
||||
statusName(item) { |
||||
if (item == 0) { |
||||
return '停用' |
||||
} |
||||
if (item == 1) { |
||||
return '启用' |
||||
} |
||||
|
||||
}, |
||||
|
||||
// 跳转详情 |
||||
details(item) { |
||||
let param = { |
||||
id: item.id, |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/inspection/planDetails${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
// 跳转巡检任务页面 |
||||
openTaskPage(item){ |
||||
let param = { |
||||
id: item.id, |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/inspection/quest${this.$u.queryParams(param)}`, |
||||
}); |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.page-css { |
||||
padding: 0 !important; |
||||
|
||||
.page-search-top { |
||||
max-height: 210rpx; |
||||
background-color: #F8F8F8; |
||||
padding: 30rpx 40rpx 20rpx; |
||||
} |
||||
|
||||
.order-box { |
||||
margin-top: 20rpx; |
||||
|
||||
.order-item { |
||||
min-height: 214rpx; |
||||
margin: 0 24rpx 20rpx; |
||||
border-radius: 20rpx; |
||||
background: #fff; |
||||
display: flex; |
||||
flex-direction: column; |
||||
|
||||
.item-top { |
||||
height: 114rpx; |
||||
border-bottom: 1px solid rgba(239, 239, 239, 1); |
||||
display: flex; |
||||
flex-direction: row; |
||||
width: 100%; |
||||
|
||||
.item-left { |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.item-orderNo { |
||||
color: rgba(51, 51, 51, 1); |
||||
font-size: 28rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
|
||||
.item-time { |
||||
color: rgba(190, 190, 190, 1); |
||||
font-size: 24rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
} |
||||
|
||||
.item-right { |
||||
width: 132rpx; |
||||
height: 48rpx; |
||||
margin: 36rpx 24rpx 0 0; |
||||
} |
||||
} |
||||
|
||||
.item-con { |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: row; |
||||
margin-bottom: 32rpx; |
||||
|
||||
.con-left { |
||||
width: 150rpx; |
||||
height: 150rpx; |
||||
margin: 24rpx 28rpx 0 28rpx; |
||||
|
||||
image { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
|
||||
.con-right { |
||||
flex: 1; |
||||
margin-right: 24rpx; |
||||
display: flex; |
||||
flex-direction: column; |
||||
margin-left: 32rpx; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.con-title { |
||||
margin-top: 12rpx; |
||||
line-height: 60rpx; |
||||
color: rgba(0, 0, 0, 1); |
||||
font-size: 28rpx; |
||||
} |
||||
|
||||
.con-content { |
||||
|
||||
color: rgba(108, 108, 108, 1); |
||||
font-size: 24rpx; |
||||
// line-height: 36rpx; |
||||
margin-top: 14rpx; |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: -webkit-box; |
||||
-webkit-box-orient: vertical; |
||||
-webkit-line-clamp: 2; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
line-height: 1.5em; |
||||
/* 这个值根据你的需求调整,这里假设为1.5倍行高 */ |
||||
max-height: 3em; |
||||
/* 3行的高度 */ |
||||
width: 100%; |
||||
/* 根据需要设置宽度 */ |
||||
word-wrap: break-word; |
||||
/* 允许在单词内换行 */ |
||||
word-break: break-all; |
||||
/* 允许在任意字符处换行 */ |
||||
} |
||||
} |
||||
|
||||
.con-btn { |
||||
margin-top: 56rpx; |
||||
// margin-bottom: 32rpx; |
||||
display: inline-block; |
||||
text-align: right; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
@ -1,45 +0,0 @@ |
||||
<template> |
||||
<view class=""> |
||||
<planList></planList> |
||||
|
||||
<betone-loading ref="BetLoading" /> |
||||
|
||||
|
||||
|
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import planList from './components/plan-list.vue' |
||||
export default { |
||||
components: { |
||||
planList, |
||||
}, |
||||
props: { |
||||
|
||||
}, |
||||
data() { |
||||
return { |
||||
|
||||
|
||||
|
||||
|
||||
}; |
||||
}, |
||||
computed: { |
||||
|
||||
}, |
||||
|
||||
mounted() { |
||||
|
||||
}, |
||||
methods: { |
||||
|
||||
|
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
||||
Loading…
Reference in new issue