|
@@ -58,19 +58,50 @@
|
|
|
<uni-table stripe emptyText="暂无更多数据">
|
|
<uni-table stripe emptyText="暂无更多数据">
|
|
|
<!-- 表头行 -->
|
|
<!-- 表头行 -->
|
|
|
<uni-tr>
|
|
<uni-tr>
|
|
|
- <uni-th width="50" align="center">姓名</uni-th>
|
|
|
|
|
|
|
+ <uni-th width="80" align="center">姓名</uni-th>
|
|
|
<uni-th width="50" align="center">工种</uni-th>
|
|
<uni-th width="50" align="center">工种</uni-th>
|
|
|
<uni-th width="80" align="center">状态</uni-th>
|
|
<uni-th width="80" align="center">状态</uni-th>
|
|
|
- <uni-th width="80" align="center">是否值班</uni-th>
|
|
|
|
|
|
|
+ <uni-th width="70" align="center">是否值班</uni-th>
|
|
|
</uni-tr>
|
|
</uni-tr>
|
|
|
<!-- 表格数据行 -->
|
|
<!-- 表格数据行 -->
|
|
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
|
|
|
|
+ <!-- 姓名区域 -->
|
|
|
<uni-td align="center">{{ item.name }}</uni-td>
|
|
<uni-td align="center">{{ item.name }}</uni-td>
|
|
|
|
|
+ <!-- 工种区域 -->
|
|
|
<uni-td align="center">{{ item.type }}</uni-td>
|
|
<uni-td align="center">{{ item.type }}</uni-td>
|
|
|
- <uni-td align="center">{{ item.status }}</uni-td>
|
|
|
|
|
- <uni-td align="center">{{ item.work }}</uni-td>
|
|
|
|
|
|
|
+ <!-- 状态区域 -->
|
|
|
|
|
+ <uni-td align="center">
|
|
|
|
|
+ <picker @change="bindPickerChange($event, item)" :range="typeArray">
|
|
|
|
|
+ <view class="watch_color" v-if="item.status == '0'">{{ typeArray[item.status] }}</view>
|
|
|
|
|
+ <view class="watch_color2" v-if="item.status == '1'">{{ typeArray[item.status] }}</view>
|
|
|
|
|
+ <view class="watch_color3" v-if="item.status == '2'">{{ typeArray[item.status] }}</view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ </uni-td>
|
|
|
|
|
+ <!-- 是否值班 -->
|
|
|
|
|
+ <uni-td align="center">
|
|
|
|
|
+ <view @click="handleChange(item, index)">{{ item.work.toString() }}</view>
|
|
|
|
|
+ </uni-td>
|
|
|
</uni-tr>
|
|
</uni-tr>
|
|
|
</uni-table>
|
|
</uni-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 是否值班弹窗区域 -->
|
|
|
|
|
+ <uni-popup ref="popup_work">
|
|
|
|
|
+ <view class="watch_pop">
|
|
|
|
|
+ <view class="poop_title">
|
|
|
|
|
+ <view class="cancel" @click="$refs.popup_work.close()">取消</view>
|
|
|
|
|
+ <view class="confirm" @click="handlePopConfirm">确定</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="poop_body">
|
|
|
|
|
+ <view class="body_item" v-for="(item, index_pop) in workArray" :key="index_pop" @click="handleChangeWork(item)">
|
|
|
|
|
+ <view class="body_item_info">
|
|
|
|
|
+ {{ item }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="body_item_icon" v-if="defaultIndex.includes(item)">✔</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 排行榜区域 -->
|
|
<!-- 排行榜区域 -->
|
|
@@ -81,6 +112,9 @@
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 排行榜柱状图 -->
|
|
<!-- 排行榜柱状图 -->
|
|
|
<view class="rank_charts">
|
|
<view class="rank_charts">
|
|
|
|
|
+ <!-- 加上canvas2d属性后 模拟器上图表显示异常,真机调试没有问题,开发时不添加canvas2d属性,发布时添加canvas2d属性 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- :canvas2d="true" -->
|
|
|
<qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
|
|
<qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -99,6 +133,10 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ defaultIndex: [],
|
|
|
|
|
+ changeIndex: 0,
|
|
|
|
|
+ typeArray: ['接单中', '订单饱和', '停止接单'],
|
|
|
|
|
+ workArray: ['正常班次', '值班班次'],
|
|
|
permission: true,
|
|
permission: true,
|
|
|
items: ['团队数据统计', '个人数据统计'],
|
|
items: ['团队数据统计', '个人数据统计'],
|
|
|
current: 0,
|
|
current: 0,
|
|
@@ -143,53 +181,105 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // status状态: 0 接单中 1 订单饱和 2 停止接单
|
|
|
|
|
+ // work状态: 0 正常班次 1 值班班次
|
|
|
tableData: [
|
|
tableData: [
|
|
|
{
|
|
{
|
|
|
name: '张三',
|
|
name: '张三',
|
|
|
type: '电工',
|
|
type: '电工',
|
|
|
status: 0,
|
|
status: 0,
|
|
|
- work: 0
|
|
|
|
|
|
|
+ work: ['正常班次', '值班班次']
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: '张三三',
|
|
name: '张三三',
|
|
|
type: '泥工',
|
|
type: '泥工',
|
|
|
- status: 0,
|
|
|
|
|
- work: 0
|
|
|
|
|
|
|
+ status: 1,
|
|
|
|
|
+ work: ['值班班次']
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: '张三',
|
|
name: '张三',
|
|
|
type: '电工',
|
|
type: '电工',
|
|
|
- status: 0,
|
|
|
|
|
- work: 0
|
|
|
|
|
|
|
+ status: 2,
|
|
|
|
|
+ work: ['正常班次']
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: '张三三',
|
|
name: '张三三',
|
|
|
type: '泥工',
|
|
type: '泥工',
|
|
|
status: 0,
|
|
status: 0,
|
|
|
- work: 0
|
|
|
|
|
|
|
+ work: ['值班班次']
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: '张三',
|
|
name: '张三',
|
|
|
type: '电工',
|
|
type: '电工',
|
|
|
- status: 0,
|
|
|
|
|
- work: 0
|
|
|
|
|
|
|
+ status: 1,
|
|
|
|
|
+ work: ['值班班次']
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: '张三三',
|
|
name: '张三三',
|
|
|
type: '泥工',
|
|
type: '泥工',
|
|
|
- status: 0,
|
|
|
|
|
- work: 0
|
|
|
|
|
|
|
+ status: 2,
|
|
|
|
|
+ work: ['正常班次']
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 是否值班弹窗确定按钮回调
|
|
|
|
|
+ handlePopConfirm() {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '确定修改是否值班状态吗?',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ this.tableData[this.changeIndex].work = this.defaultIndex
|
|
|
|
|
+ console.log('用户点击确定')
|
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
|
+ console.log('用户点击取消')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$refs.popup_work.close()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 点击值班状态回调
|
|
|
|
|
+ handleChange(item, index) {
|
|
|
|
|
+ this.$refs.popup_work.open('bottom')
|
|
|
|
|
+ this.changeIndex = index
|
|
|
|
|
+ this.defaultIndex = JSON.parse(JSON.stringify(item.work))
|
|
|
|
|
+ },
|
|
|
|
|
+ // 切换值班状态回调
|
|
|
|
|
+ handleChangeWork(item) {
|
|
|
|
|
+ if (this.defaultIndex.includes(item)) {
|
|
|
|
|
+ const temIndex = this.defaultIndex.indexOf(item)
|
|
|
|
|
+ this.defaultIndex.splice(temIndex, 1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.defaultIndex.push(item)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 切换排班状态回调
|
|
|
|
|
+ bindPickerChange(e, item) {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '确定修改状态吗?',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ item.status = e.detail.value
|
|
|
|
|
+ console.log('用户点击确定')
|
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
|
+ console.log('用户点击取消')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 点击悬浮按钮回调
|
|
|
handleGoMsg() {
|
|
handleGoMsg() {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pagesRepairs/message/message'
|
|
url: '/pagesRepairs/message/message'
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 顶部分段器切换回调
|
|
|
onClickItem(e) {
|
|
onClickItem(e) {
|
|
|
if (this.current != e.currentIndex) {
|
|
if (this.current != e.currentIndex) {
|
|
|
this.current = e.currentIndex
|
|
this.current = e.currentIndex
|
|
@@ -203,7 +293,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.container {
|
|
.container {
|
|
|
width: 100vw;
|
|
width: 100vw;
|
|
|
- height: calc(100vh - 102rpx);
|
|
|
|
|
|
|
+ height: calc(100vh - 152rpx);
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
.top_bg {
|
|
.top_bg {
|
|
@@ -299,6 +389,71 @@ export default {
|
|
|
height: 44rpx;
|
|
height: 44rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .watch_color {
|
|
|
|
|
+ color: #6fb6b8;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .watch_color2 {
|
|
|
|
|
+ color: #1e7dfb;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .watch_color3 {
|
|
|
|
|
+ color: #ff5733;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .watch_td {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .watch_pop {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 575rpx;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+
|
|
|
|
|
+ .poop_title {
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ padding: 0 30rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ font-size: 34rpx;
|
|
|
|
|
+ border-bottom: 1rpx solid #f5f5f5;
|
|
|
|
|
+
|
|
|
|
|
+ .cancel {
|
|
|
|
|
+ color: #888888;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .confirm {
|
|
|
|
|
+ color: #1e7dfb;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .poop_body {
|
|
|
|
|
+ margin-top: 50rpx;
|
|
|
|
|
+
|
|
|
|
|
+ .body_item {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ border-bottom: 1rpx solid #f5f5f5;
|
|
|
|
|
+
|
|
|
|
|
+ .body_item_info {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .body_item_icon {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 30rpx;
|
|
|
|
|
+ right: 85rpx;
|
|
|
|
|
+ color: #1e7dfb;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.rank {
|
|
.rank {
|