|
@@ -5,20 +5,19 @@
|
|
<!-- 列表数据 -->
|
|
<!-- 列表数据 -->
|
|
<view class="cell-item-con">
|
|
<view class="cell-item-con">
|
|
<view class="cell-item" v-for="(item, index) in listdata" :key="index">
|
|
<view class="cell-item" v-for="(item, index) in listdata" :key="index">
|
|
- <u-image class="cell-item-pic" src="/static/logo.jpg" width="140rpx" height="140rpx"></u-image>
|
|
|
|
<view class="cell-item-c" @tap="goPage(item)">
|
|
<view class="cell-item-c" @tap="goPage(item)">
|
|
<view class="cell-item-info">
|
|
<view class="cell-item-info">
|
|
<view class="cell-item-info-network">
|
|
<view class="cell-item-info-network">
|
|
- 咸阳市秦都区文彩舫东区
|
|
|
|
- <u-badge type="success" bgColor="#c90101" :count="8" :offset="[-10,-32]" size="mini"></u-badge>
|
|
|
|
|
|
+ {{item.stationName}}
|
|
|
|
+ <u-badge type="success" bgColor="#c90101" :count="item.unCleanNum" :offset="[-10,-32]" size="mini"></u-badge>
|
|
</view>
|
|
</view>
|
|
<view class="cell-item-info-weight">
|
|
<view class="cell-item-info-weight">
|
|
<view class="cell-item-weight-bar">
|
|
<view class="cell-item-weight-bar">
|
|
- 15.25kg
|
|
|
|
|
|
+ {{item.totalWeight}}kg
|
|
<u-badge class="badge" type="primary" bgColor="#01c9b2" count="总" :offset="[0,0]"></u-badge>
|
|
<u-badge class="badge" type="primary" bgColor="#01c9b2" count="总" :offset="[0,0]"></u-badge>
|
|
</view>
|
|
</view>
|
|
<view class="cell-item-weight-bar">
|
|
<view class="cell-item-weight-bar">
|
|
- 15.25kg
|
|
|
|
|
|
+ {{item.maxWeight}}kg
|
|
<u-badge class="badge" type="warning" bgColor="#05695d" count="最大" :offset="[0,0]"></u-badge>
|
|
<u-badge class="badge" type="warning" bgColor="#05695d" count="最大" :offset="[0,0]"></u-badge>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -29,7 +28,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
|
|
<u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
|
|
- <view class="loadmore">
|
|
|
|
|
|
+ <view class="loadmore" v-if="listdata.length!=0">
|
|
<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
|
|
<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -44,17 +43,39 @@
|
|
<text>增加清运网点</text>
|
|
<text>增加清运网点</text>
|
|
</u-button>
|
|
</u-button>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 确认清运 -->
|
|
|
|
+ <u-popup v-model="messagePop" mode="center" class="custom-pop" length="80%" border-radius="14" :mask-close-able="false">
|
|
|
|
+ <view class="custom-con">
|
|
|
|
+ <view class="pop-title">提示</view>
|
|
|
|
+ <view class="pop-con">
|
|
|
|
+ <view class="pop-item">确认清运以下网点-设备内的可回收物?</view>
|
|
|
|
+ <view class="pop-item">{{networkData.stationName || ''}}</view>
|
|
|
|
+ <view class="pop-item">{{networkData.srcDeviceCode || ''}}</view>
|
|
|
|
+ <view class="form-con">
|
|
|
|
+ <u-form :model="form" ref="uForm">
|
|
|
|
+ <u-form-item label="备注" :border-bottom="false">
|
|
|
|
+ <u-input v-model="form.remarks" type="textarea" border />
|
|
|
|
+ </u-form-item>
|
|
|
|
+ </u-form>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="btn-con">
|
|
|
|
+ <view class="handle-pop-btn cancel-btn" @click="cancelFun">取消</view>
|
|
|
|
+ <view class="handle-pop-btn submit-btn" @click="submitFun">确定</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </u-popup>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- // import { getGoldLogList, GoldLogCancel, GoldLogTotal } from '@/api/officialPartnerGoldLog.js'
|
|
|
|
- import { scanCode } from '@/libs/tools.js'
|
|
|
|
|
|
+ import { getSelfCleanTaskList, cleanDevice, cleanStationRemove, getDeviceMsg } from '@/api/unclear.js'
|
|
|
|
+ import { parseQueryString } from '@/libs/tools.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- listdata: [{},{}],
|
|
|
|
|
|
+ listdata: [],
|
|
pageNo: 1, // 当前页码
|
|
pageNo: 1, // 当前页码
|
|
- pageSize: 40, // 每页条数
|
|
|
|
|
|
+ pageSize: 10, // 每页条数
|
|
total: 0, // 数据总条数
|
|
total: 0, // 数据总条数
|
|
noDataText: '暂无数据', // 列表请求状态提示语
|
|
noDataText: '暂无数据', // 列表请求状态提示语
|
|
status: 'loadmore', // 加载中状态
|
|
status: 'loadmore', // 加载中状态
|
|
@@ -71,13 +92,21 @@
|
|
},
|
|
},
|
|
btnStyle: { // 自定义按钮样式
|
|
btnStyle: { // 自定义按钮样式
|
|
width: '100%'
|
|
width: '100%'
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ form: {
|
|
|
|
+ remarks: '' // 备注
|
|
|
|
+ },
|
|
|
|
+ boxData: null, // 箱体二维码数据
|
|
|
|
+ messagePop: false, // 确认清运
|
|
|
|
+ networkData: null // 网点详情
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- // this.refresh({})
|
|
|
|
|
|
+ this.pageNo = 1
|
|
|
|
+ this.refresh()
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ // 是否可清运
|
|
clearingOutlets(){
|
|
clearingOutlets(){
|
|
if(this.listdata.length==0){
|
|
if(this.listdata.length==0){
|
|
uni.showToast({ title: '请先选择待清运网点,再进行扫码清运', icon: 'none' })
|
|
uni.showToast({ title: '请先选择待清运网点,再进行扫码清运', icon: 'none' })
|
|
@@ -87,23 +116,53 @@
|
|
},
|
|
},
|
|
// 扫码清运
|
|
// 扫码清运
|
|
openScan(){
|
|
openScan(){
|
|
- // 调起微信扫码
|
|
|
|
- scanCode().then(res => {
|
|
|
|
- this.code = res.result
|
|
|
|
- // 请求接口
|
|
|
|
- // return verShow(res.result)
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.info = res.data
|
|
|
|
- this.showInfo = true
|
|
|
|
- this.carNum = ''
|
|
|
|
- } else {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: res.message,
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2500
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ uni.scanCode({
|
|
|
|
+ success(e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ // 普通二维码,用户扫箱体的二维码
|
|
|
|
+ if(e.scanType == 'QR_CODE'){
|
|
|
|
+ // 将箱体二维码数据转换为json
|
|
|
|
+ _this.boxData = parseQueryString(e.result)
|
|
|
|
+ _this.getNetworkInfo()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail(err) {
|
|
|
|
+ console.log(err)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 扫码获取网点信息
|
|
|
|
+ getNetworkInfo(){
|
|
|
|
+ const _this = this
|
|
|
|
+ getDeviceMsg(_this.boxData).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ _this.networkData = res.data
|
|
|
|
+ _this.messagePop = true
|
|
|
|
+ }else{
|
|
|
|
+ _this.messagePop = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 取消清运
|
|
|
|
+ cancelFun(){
|
|
|
|
+ this.messagePop = false
|
|
|
|
+ },
|
|
|
|
+ // 确定清运
|
|
|
|
+ submitFun(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ mask: true,
|
|
|
|
+ title: '加载中'
|
|
|
|
+ })
|
|
|
|
+ cleanDevice({ remarks: this.form.remarks }).then(res => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.refresh()
|
|
|
|
+ this.messagePop = false
|
|
|
|
+ uni.showToast({ icon:'none', title: res.message })
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({ icon:'none', title: res.message })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 增加清运网点
|
|
// 增加清运网点
|
|
@@ -113,7 +172,7 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取查询参数 刷新列表
|
|
// 获取查询参数 刷新列表
|
|
- refresh(params){
|
|
|
|
|
|
+ refresh(){
|
|
this.listdata = []
|
|
this.listdata = []
|
|
this.total = 0
|
|
this.total = 0
|
|
this.searchHandle(1)
|
|
this.searchHandle(1)
|
|
@@ -122,26 +181,26 @@
|
|
searchHandle (pageNo) {
|
|
searchHandle (pageNo) {
|
|
this.status = "loading"
|
|
this.status = "loading"
|
|
pageNo ? this.pageNo = pageNo : null
|
|
pageNo ? this.pageNo = pageNo : null
|
|
- // getGoldLogList({
|
|
|
|
- // pageNo: this.pageNo,
|
|
|
|
- // pageSize: this.pageSize
|
|
|
|
- // }).then(res => {
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // if(this.pageNo>1){
|
|
|
|
- // this.listdata = this.listdata.concat(res.data.list || [])
|
|
|
|
- // }else{
|
|
|
|
- // this.listdata = res.data.list || []
|
|
|
|
- // this.scrollTop = 0
|
|
|
|
- // }
|
|
|
|
- // this.total = res.data.count || 0
|
|
|
|
- // this.noDataText = '暂无数据'
|
|
|
|
- // } else {
|
|
|
|
- // this.noDataText = res.message
|
|
|
|
- // this.listdata = []
|
|
|
|
- // this.total = 0
|
|
|
|
- // }
|
|
|
|
- // this.status = "loadmore"
|
|
|
|
- // })
|
|
|
|
|
|
+ getSelfCleanTaskList({
|
|
|
|
+ pageNo: this.pageNo,
|
|
|
|
+ pageSize: this.pageSize
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ if(this.pageNo>1){
|
|
|
|
+ this.listdata = this.listdata.concat(res.data.list || [])
|
|
|
|
+ }else{
|
|
|
|
+ this.listdata = res.data.list || []
|
|
|
|
+ this.scrollTop = 0
|
|
|
|
+ }
|
|
|
|
+ this.total = res.data.count || 0
|
|
|
|
+ this.noDataText = '暂无数据'
|
|
|
|
+ } else {
|
|
|
|
+ this.noDataText = res.message
|
|
|
|
+ this.listdata = []
|
|
|
|
+ this.total = 0
|
|
|
|
+ }
|
|
|
|
+ this.status = "loadmore"
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 移除
|
|
// 移除
|
|
removeFun(row){
|
|
removeFun(row){
|
|
@@ -151,12 +210,12 @@
|
|
content: '确认移除该网点的清运单?',
|
|
content: '确认移除该网点的清运单?',
|
|
success(res) {
|
|
success(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- // GoldLogCancel({ id: row.id }).then(ret => {
|
|
|
|
- // if(ret.status == 200){
|
|
|
|
- // uni.showToast({ title: ret.message, icon: 'none' })
|
|
|
|
- // _this.searchHandle(1)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ cleanStationRemove({ stationNo: row.stationNo }).then(ret => {
|
|
|
|
+ if(ret.status == 200){
|
|
|
|
+ uni.showToast({ title: ret.message, icon: 'none' })
|
|
|
|
+ _this.searchHandle(1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -164,13 +223,13 @@
|
|
// 查看详情
|
|
// 查看详情
|
|
goPage(row){
|
|
goPage(row){
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/cleared/details'
|
|
|
|
|
|
+ url: '/pages/cleared/network?stationNo='+row.stationNo
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// scroll-view到底部加载更多
|
|
// scroll-view到底部加载更多
|
|
onreachBottom() {
|
|
onreachBottom() {
|
|
- if(this.listdata.length < this.total){
|
|
|
|
- this.pageNo += 1
|
|
|
|
|
|
+ if(this.listdata.length!=0 && this.listdata.length < this.total){
|
|
|
|
+ this.pageNo++
|
|
this.searchHandle()
|
|
this.searchHandle()
|
|
}else{
|
|
}else{
|
|
uni.showToast({ title: '已经到底了', icon: 'none' })
|
|
uni.showToast({ title: '已经到底了', icon: 'none' })
|
|
@@ -205,17 +264,9 @@
|
|
color: $uni-text-color;
|
|
color: $uni-text-color;
|
|
font-size: $uni-font-size-base;
|
|
font-size: $uni-font-size-base;
|
|
box-shadow: 3rpx 3rpx 5rpx #eee;
|
|
box-shadow: 3rpx 3rpx 5rpx #eee;
|
|
- display: flex;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- align-items: center;
|
|
|
|
- padding: $uni-spacing-col-base $uni-spacing-row-base;
|
|
|
|
|
|
+ padding: 30rpx 20rpx;
|
|
position: relative;
|
|
position: relative;
|
|
- .cell-item-pic{
|
|
|
|
- flex-shrink: 0;
|
|
|
|
- margin-right: 10rpx;
|
|
|
|
- }
|
|
|
|
.cell-item-c{
|
|
.cell-item-c{
|
|
- flex-grow: 1;
|
|
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -223,7 +274,7 @@
|
|
flex-grow: 1;
|
|
flex-grow: 1;
|
|
.cell-item-info-network{
|
|
.cell-item-info-network{
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
- margin-bottom: $uni-spacing-col-base;
|
|
|
|
|
|
+ margin-bottom: 26rpx;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
@@ -273,5 +324,47 @@
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 弹框样式
|
|
|
|
+ .custom-pop{
|
|
|
|
+ .custom-con{
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: url(/static/pop-bg.png) no-repeat;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ color: #5a5a5a;
|
|
|
|
+ line-height: 54rpx;
|
|
|
|
+ .pop-title{
|
|
|
|
+ padding: 20rpx 0;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+ .pop-con{
|
|
|
|
+ padding: 80rpx 0 40rpx;
|
|
|
|
+ .pop-item{
|
|
|
|
+ padding: 0 20rpx;
|
|
|
|
+ }
|
|
|
|
+ .form-con{
|
|
|
|
+ padding: 10rpx 30rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .btn-con{
|
|
|
|
+ border-top: 1rpx solid rgba(213,213,213,0.8);
|
|
|
|
+ .handle-pop-btn{
|
|
|
|
+ padding: 20rpx 0;
|
|
|
|
+ width: 50%;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ }
|
|
|
|
+ .cancel-btn{
|
|
|
|
+ border-right: 1rpx solid rgba(213,213,213,0.8);
|
|
|
|
+ }
|
|
|
|
+ .submit-btn{
|
|
|
|
+ color: #16d1bc;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .nodata{
|
|
|
|
+ padding-top: 400rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|