|
@@ -1,9 +1,36 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<u-navbar :title="headTile" autoBack placeholder></u-navbar>
|
|
|
- <view class="card_erweima_af">
|
|
|
- <canvas id="qrcode" canvas-id="qrcode" style="width: 140px;height:140px;" />
|
|
|
- <view class="title_balize">调拨码</view>
|
|
|
+ <view class="card_cannibalize">
|
|
|
+ <view class="card_erweima_af">
|
|
|
+ <canvas id="qrcode" canvas-id="qrcode" style="width: 140px;height:140px;" />
|
|
|
+ <view class="title_balize">调拨码</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="transferFlag">
|
|
|
+ <view class="subheading_title">调拨人</view>
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <image class="mine_image" src="../../static/portrait.png" mode=""></image>
|
|
|
+ <view class="card_user_title">
|
|
|
+ <view class="mine_phone" v-if="transferList.allotUser">{{transferList.allotUser.nickName}}
|
|
|
+ </view>
|
|
|
+ <view class="mine_phone" v-if="transferList.allotCompany">{{transferList.allotCompany.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="subheading_title1">钢瓶编号</view>
|
|
|
+ <view class="card_innercode" v-for="(item1,index1) in transferList.innerCodeList" :key="index1">
|
|
|
+ <view style="color: #82848a;">{{ index1 + 1 }}</view>
|
|
|
+ <view class="title_innerCode">{{ item1 }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btn_cannibalize" v-if="transferFlag">
|
|
|
+ <view style="flex: 1;">
|
|
|
+ <u-button style="width: 80%;" type="error" @click="cancelAllocation">取消</u-button>
|
|
|
+ </view>
|
|
|
+ <view style="flex: 1;">
|
|
|
+ <u-button style="width: 80%;" type="primary" @click="submit">确定</u-button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -15,6 +42,8 @@
|
|
|
return {
|
|
|
orderId: '',
|
|
|
headTile: '',
|
|
|
+ transferList: {},
|
|
|
+ transferFlag: false,
|
|
|
}
|
|
|
},
|
|
|
onLoad(value) {
|
|
@@ -34,9 +63,57 @@
|
|
|
const ctx = uni.createCanvasContext('qrcode', this);
|
|
|
qr.canvasContext = ctx;
|
|
|
qr.drawCanvas();
|
|
|
+
|
|
|
+ this.getallot()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ getallot() {
|
|
|
+ this.$api.get('/api/gas-cylinder-allot/opt-type/' + this.orderId).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.transferFlag = true
|
|
|
+ this.transferList = res.data
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getallot()
|
|
|
+ }, 60000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 取消调拨
|
|
|
+ cancelAllocation() {
|
|
|
+ this.$api.post('/api/gas-cylinder-allot/cancel', {
|
|
|
+ id: this.transferList.id,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.transferFlag = false
|
|
|
+ this.transferList = {}
|
|
|
+ uni.$u.toast(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 确定调拨钢瓶
|
|
|
+ submit() {
|
|
|
+ this.$api.post('/api/gas-cylinder-allot/submit', {
|
|
|
+ id: this.transferList.id,
|
|
|
+ optType: this.transferList.optType,
|
|
|
+ allotUserId: this.transferList.allotUserId,
|
|
|
+ acceptUserId: this.transferList.acceptUserId,
|
|
|
+ allotCompanyId: this.transferList.allotCompanyId,
|
|
|
+ acceptCompanyId: this.transferList.acceptCompanyId,
|
|
|
+ innerCodeList: this.transferList.innerCodeList,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.transferFlag = false
|
|
|
+ this.transferList = {}
|
|
|
+ uni.$u.toast(res.msg)
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/indexRouter?page=1'
|
|
|
+ });
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -46,20 +123,78 @@
|
|
|
background-color: #f4f4f5;
|
|
|
}
|
|
|
|
|
|
- .card_erweima_af {
|
|
|
+ .card_cannibalize {
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin: 30rpx;
|
|
|
flex-direction: column;
|
|
|
background-color: #fff;
|
|
|
+ margin: 30rpx;
|
|
|
padding: 30rpx;
|
|
|
border-radius: 10rpx;
|
|
|
}
|
|
|
|
|
|
+ .card_erweima_af {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
.title_balize {
|
|
|
font-size: 40rpx;
|
|
|
margin-top: 10rpx;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
+
|
|
|
+ .mine_image {
|
|
|
+ width: 100rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_user_title {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mine_phone {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_innercode {
|
|
|
+ display: flex;
|
|
|
+ padding: 20rpx;
|
|
|
+ border-bottom: 1rpx solid #d7d7d7;
|
|
|
+ }
|
|
|
+
|
|
|
+ .subheading_title {
|
|
|
+ font-size: 34rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ margin: 20rpx 0rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .subheading_title1 {
|
|
|
+ font-size: 34rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ padding-bottom: 20rpx;
|
|
|
+ border-bottom: 1rpx solid #d7d7d7;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_innerCode {
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn_cannibalize {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20rpx 0rpx;
|
|
|
+ }
|
|
|
</style>
|