parent
2f8e532c07
commit
3025da4686
@ -0,0 +1,202 @@ |
||||
<template> |
||||
<view> |
||||
<view class="username paddtop10"> |
||||
<view class="namecont">班组选择</view> |
||||
<picker mode="selector" style="width: 90%;" :range="classGroupList" range-key="name" @change="changeclass"> |
||||
<view class="date text1" style="padding: 0 50rpx;">{{className}}</view> |
||||
</picker> |
||||
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image> |
||||
</view> |
||||
|
||||
<view class="width80 height40 backcor008 border-r font14 fotct fcorfff" v-if="typeid == 1" |
||||
style="position: fixed;bottom: 40px;" @click="swapGroupTask()"> |
||||
交接班次 |
||||
</view> |
||||
<view class="width80 height40 backcor008 border-r font14 fotct fcorfff" v-if="typeid == 2" |
||||
style="position: fixed;bottom: 40px;" @click="startGroupTask()"> |
||||
开始班次 |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
startGroupTask, |
||||
getClassGroupList, |
||||
swapGroupTask |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
typeid: '', //入口类型 |
||||
classGroupList: '', //班组列表 |
||||
className: '', // 班组名称 |
||||
classId: '' ,//id |
||||
userinfo: '', //用户信息 |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.typeid = options.typeid; |
||||
this.userinfo = app.globalData.userInfo; |
||||
if (options.typeid == 1) { |
||||
uni.setNavigationBarTitle({ |
||||
title: '交换班次' |
||||
}) |
||||
} |
||||
if (options.typeid == 2) { |
||||
uni.setNavigationBarTitle({ |
||||
title: '开始班次' |
||||
}) |
||||
} |
||||
this.getClassGroupList(); |
||||
}, |
||||
methods: { |
||||
//查询班组 |
||||
getClassGroupList() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
let datas = { |
||||
pageNum: 1, |
||||
pageSize: 9999 |
||||
} |
||||
getClassGroupList(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.classGroupList = res.return_data.list; |
||||
this.classId = res.return_data.list[0].id; |
||||
this.className = res.return_data.list[0].name; |
||||
} |
||||
}) |
||||
}, |
||||
//选择班组 |
||||
changeclass(e) { |
||||
this.classId = this.classGroupList[e.target.value].id; |
||||
this.className = this.classGroupList[e.target.value].name; |
||||
}, |
||||
//开始班次 |
||||
startGroupTask() { |
||||
let that = this; |
||||
uni.showModal({ |
||||
title: '开始班次', |
||||
content: '是否开始当前班次?', |
||||
success: function(res) { |
||||
if (res.confirm) { |
||||
uni.showLoading({ |
||||
title: '操作中' |
||||
}) |
||||
let datas = { |
||||
gasId: that.userinfo.merchantStore.id, |
||||
gasClassGroupId: that.classId |
||||
} |
||||
startGroupTask(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '操作成功', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
uni.navigateBack({}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
//交换班次 |
||||
swapGroupTask() { |
||||
let that = this; |
||||
uni.showModal({ |
||||
title: '交换班次', |
||||
content: '是否交换当前班次?', |
||||
success: function(res) { |
||||
if (res.confirm) { |
||||
uni.showLoading({ |
||||
title: '操作中' |
||||
}) |
||||
let datas = { |
||||
gasId: that.userinfo.merchantStore.id, |
||||
gasClassGroupId: that.classId |
||||
} |
||||
swapGroupTask(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '操作成功', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
uni.navigateBack({}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.username { |
||||
width: calc(100% - 90upx); |
||||
height: 100upx; |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 8upx 45upx; |
||||
|
||||
input { |
||||
width: 50%; |
||||
height: 50upx; |
||||
font-size: 16px; |
||||
color: #333333; |
||||
font-weight: blod; |
||||
} |
||||
|
||||
.get-code { |
||||
position: absolute; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
right: 7px; |
||||
z-index: 3; |
||||
border: 1px solid #bfbfbf; |
||||
width: 25%; |
||||
padding: 3px 5px; |
||||
border-radius: 22px; |
||||
|
||||
&:after { |
||||
content: " "; |
||||
width: 1upx; |
||||
height: 50upx; |
||||
position: absolute; |
||||
z-index: 3; |
||||
margin-right: 100%; |
||||
left: 0; |
||||
top: 20upx; |
||||
} |
||||
} |
||||
|
||||
.namecont { |
||||
color: #666666; |
||||
width: 28%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,227 @@ |
||||
<template> |
||||
<view> |
||||
<view class="width94 mart20 height80"> |
||||
<view class="width46 fcor333 font16 flleft backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">当前班次</view> |
||||
<view class="width100 mart15 font14"> |
||||
<text class="font24" v-if="currentClassGroup.classNum">{{currentClassGroup.classNum}}</text> |
||||
<text class="font24" v-else>无</text>班次 |
||||
</view> |
||||
</view> |
||||
<view class="width46 fcor333 font16 flright backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">加油总金额</view> |
||||
<view class="width100 mart15 font14"><text class="font24">{{currentClassGroup.refuelPrice}}</text>元 |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="width94 mart20 height80"> |
||||
<view class="width46 fcor333 font16 flleft backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">加油总笔数</view> |
||||
<view class="width100 mart15 font14"><text class="font24">{{currentClassGroup.refuelNum}}</text>笔</view> |
||||
</view> |
||||
<view class="width46 fcor333 font16 flright backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">加油总升数</view> |
||||
<view class="width100 mart15 font14"><text class="font24">{{currentClassGroup.refuelLiters}}</text>升 |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="width94 mart20 height80"> |
||||
<view class="width46 fcor333 font16 flleft backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">退款总金额</view> |
||||
<view class="width100 mart15 font14"><text class="font24">{{currentClassGroup.refundPrice}}</text>元 |
||||
</view> |
||||
</view> |
||||
<view class="width46 fcor333 font16 flright backcor9 fotct paddtop10 paddbotm10"> |
||||
<view class="width100 fcor666">退款总笔数</view> |
||||
<view class="width100 mart15 font14"><text class="font24">{{currentClassGroup.refundNum}}</text>笔</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="width94 mart40 alijusstart marb20"> |
||||
<view class="width40 height40 backcor008 border-r font14 fotct fcorfff" style="margin-left: 5%;" |
||||
@click="startGroupTask(1)"> |
||||
交接班组 |
||||
</view> |
||||
<view class="width40 height40 backcor008 border-r font14 fotct fcorfff" v-if="currentClassGroup.status == 0" |
||||
style="margin-left: 10%;" @click="startGroupTask(2)"> |
||||
开始班次 |
||||
</view> |
||||
<view class="width40 height40 backcolor72 border-r font14 fotct fcorfff" |
||||
v-if="currentClassGroup.status == 1" style="margin-left: 10%;" @click="endGroupTask()"> |
||||
结束班次 |
||||
</view> |
||||
</view> |
||||
<!-- //历史班次 --> |
||||
<view class="fcor333 width94 fontwig6 font15 mart20">历史班次、共计{{listcount}}条数据</view> |
||||
|
||||
<view v-if="classGroupTaskList == '' " class="mart20 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
||||
</view> |
||||
<view class="width94 backcorfff headcont mart20 border-r" style="box-shadow: 0px 0px 6px #999999;" |
||||
v-for="(item,index) in classGroupTaskList" :key="index"> |
||||
<view class="alijusstart width94 height30 fcor333 paddtop5"> |
||||
<view class="width50 font14 fcor666 ">班次: <text class="font16 fcor333">{{item.classNum}}</text>班</view> |
||||
<view class="width50 font14 fcor666 fotrt">状态: |
||||
<text class="font16 fcor089" v-if="item.status == 1"> 进行中</text> |
||||
<text class="font16 fcoreb5" v-if="item.status == 2"> 已结束</text> |
||||
</view> |
||||
</view> |
||||
<view class="line1 width94"></view> |
||||
<view class="width94 mart5"> |
||||
<view class="width100 height25 font14 fcor666"> |
||||
班组名称: {{item.gasClassGroupName}} |
||||
</view> |
||||
<view class="width100 height25 font14 fcor666 "> |
||||
开始时间: {{item.startTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} |
||||
</view> |
||||
<view class="width100 height25 font14 fcor666 " v-if="item.endTime"> |
||||
结束时间: {{item.endTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} |
||||
</view> |
||||
<view class="width100 height25 font14 fcor666 " v-else> |
||||
结束时间: 未结束 |
||||
</view> |
||||
</view> |
||||
<view class="line1 width94 mart5"></view> |
||||
<view class="height30 backcor008 margle10 border-r font14 fotct fcorfff mart10 paddleft10 paddtright10" |
||||
style="width: 60px;" v-if="item.status == 2" @click="jumpSummary(item.classNum)"> |
||||
班次汇总 |
||||
</view> |
||||
<view class="height10" v-if="item.status == 2"></view> |
||||
</view> |
||||
<view class="height40p"></view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getCurrentClassGroupTask, |
||||
endGroupTask, |
||||
getClassGroupTaskList |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
userinfo: '', //用户信息 |
||||
currentClassGroup: '', //当前班次 |
||||
pageNum: 1, |
||||
pagesize: 10, |
||||
isLoadMore: false, //是否加载中 |
||||
classGroupTaskList: [], //历史数据 |
||||
listcount: '' ,//总条数 |
||||
imgadres: 'noorder.png', |
||||
imagewxUrl: app.globalData.imageWxImg, |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.userinfo = app.globalData.userInfo; |
||||
|
||||
}, |
||||
onShow() { |
||||
this.isLoadMore = true; |
||||
this.classGroupTaskList = []; |
||||
this.pageNum = 1; |
||||
this.getCurrentClassGroupTask(); |
||||
this.getClassGroupTaskList(); |
||||
}, |
||||
onReachBottom() { //上拉触底函数 |
||||
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求 |
||||
this.isLoadMore = true |
||||
this.pageNum += 1 |
||||
this.getClassGroupTaskList() |
||||
} |
||||
}, |
||||
methods: { |
||||
//查询当前班次 |
||||
getCurrentClassGroupTask() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
let datas = { |
||||
gasId: this.userinfo.merchantStore.id |
||||
} |
||||
getCurrentClassGroupTask(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.currentClassGroup = res.return_data; |
||||
} |
||||
}) |
||||
}, |
||||
//开启班次 |
||||
startGroupTask(item) { |
||||
uni.navigateTo({ |
||||
url: '../select-team/select-team?typeid=' + item |
||||
}) |
||||
}, |
||||
//结束班次 |
||||
endGroupTask() { |
||||
let that = this; |
||||
uni.showModal({ |
||||
title: '结束班次', |
||||
content: '是否结束当前班次?', |
||||
success: function(res) { |
||||
if (res.confirm) { |
||||
uni.showLoading({ |
||||
title: '操作中' |
||||
}) |
||||
let datas = { |
||||
gasId: that.userinfo.merchantStore.id |
||||
} |
||||
endGroupTask(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '操作成功', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
that.pageNum = 1; |
||||
that.isLoadMore = true |
||||
that.classGroupTaskList = []; |
||||
that.getCurrentClassGroupTask(); |
||||
that.getClassGroupTaskList(); |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
//历史班次 |
||||
getClassGroupTaskList() { |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
let datas = { |
||||
pageNum: this.pageNum, |
||||
pageSize: this.pagesize, |
||||
} |
||||
getClassGroupTaskList(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000' && res.return_data.list != '') { |
||||
this.listcount = res.return_data.total; |
||||
this.classGroupTaskList = this.classGroupTaskList.concat(res.return_data.list); |
||||
if (res.return_data.pages == this.pageNum) { |
||||
this.isLoadMore = true; |
||||
} else { |
||||
this.isLoadMore = false |
||||
} |
||||
} else { |
||||
this.listcount = 0; |
||||
this.classGroupTaskList = []; |
||||
this.isLoadMore = true |
||||
} |
||||
}); |
||||
}, |
||||
//跳转到汇总 |
||||
jumpSummary(item) { |
||||
uni.navigateTo({ |
||||
url: '../shift-summary/shift-summary?id=' + item |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
|
||||
</style> |
@ -0,0 +1,128 @@ |
||||
<template> |
||||
<view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">开始时间:</view> |
||||
<view class="width50">{{classGroupTaskDetails.startTime | timeFormat('yyyy-mm-dd hh:mm:ss')}}</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">结束时间:</view> |
||||
<view class="width50">{{classGroupTaskDetails.endTime | timeFormat('yyyy-mm-dd hh:mm:ss')}}</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">加油金额汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refuelPrice}} 元</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">加油笔数汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refuelNum}} 笔</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">加油升数汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refuelLiters}} 升</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">退款金额汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refundPrice }} 元</view> |
||||
</view> |
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">退款笔数汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refundNum }} 笔</view> |
||||
</view> |
||||
|
||||
<view class="width92 fcor666 font14 mart20 alijusstart"> |
||||
<view class="width30 fcor333">退款升数汇总:</view> |
||||
<view class="width50">{{classGroupTaskDetails.refundLiters}} 升</view> |
||||
</view> |
||||
|
||||
<view class="alijusstart fotct font14 height40p backcor9 mart30 fcor333"> |
||||
<view class="width25">油号</view> |
||||
<view class="width25">金额</view> |
||||
<view class="width25">升数</view> |
||||
<view class="width25">笔数</view> |
||||
</view> |
||||
|
||||
<view v-if="classGroupTaskDetails.groupTaskOilCountList == '' " class="mart60 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
||||
</view> |
||||
<view class="width100 alijusstart fotct font14 height45 fcor666 mart5 bor-botm1 marb5" :key="index" |
||||
v-for="(item,index) in classGroupTaskDetails.groupTaskOilCountList"> |
||||
<view class="width25">{{item.oilNo}}#</view> |
||||
<view class="width25">{{item.refuelPrice}}元</view> |
||||
<view class="width25">{{item.refuelLiters}}升</view> |
||||
<view class="width25">{{item.refuelNum}}笔</view> |
||||
</view> |
||||
<view class="height80"></view> |
||||
<view class="width40w height40 backcor008 border-r font14 fotct fcorfff" style="position: fixed;bottom: 15px;" |
||||
@click="print()"> |
||||
打印小票 |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getClassGroupTaskById, |
||||
print |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
taskId: '', //班次id |
||||
classGroupTaskDetails: '', //详情 |
||||
imgadres: 'noorder.png', |
||||
imagewxUrl: app.globalData.imageWxImg, |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.taskId = options.id; |
||||
this.getClassGroupTaskById(); |
||||
}, |
||||
methods: { |
||||
//查询详情 |
||||
getClassGroupTaskById() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
let datas = { |
||||
gasClassGroupTaskId: this.taskId |
||||
} |
||||
getClassGroupTaskById(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.classGroupTaskDetails = JSON.parse(res.return_data.dataCount); |
||||
} |
||||
}) |
||||
}, |
||||
//打印小票 |
||||
print() { |
||||
uni.showLoading({ |
||||
title: '打印小票' |
||||
}) |
||||
let datas = { |
||||
gasClassGroupTaskId: this.taskId |
||||
} |
||||
print(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '打印成功', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
|
||||
</style> |
After Width: | Height: | Size: 7.0 KiB |
Loading…
Reference in new issue