123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <template>
- <!-- 调拨详情 -->
- <view>
- <u-navbar :title="transferTitle" autoBack placeholder></u-navbar>
- <view style="padding: 0rpx 30rpx;">
- <view class="card_transfer_details" v-if="type == 0">
- <view class="step_title">接收人信息</view>
- <view class="card_avatar" style="margin-top: 10rpx;">
- <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">{{userList.acceptUser.nickName || '接收人姓名'}}</view>
- <view class="mine_phone">{{userList.acceptCompany.name || '接收人所属门店'}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="card_transfer_details" v-else>
- <view class="step_title">调拨人信息</view>
- <view class="card_avatar" style="margin-top: 10rpx;">
- <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">{{userList.allotUser.nickName || '调拨人姓名'}}</view>
- <view class="mine_phone">{{userList.allotCompany.name || '调拨人所属门店'}}</view>
- </view>
- </view>
- </view>
- </view>
- <view style="margin-top: 20rpx;padding-bottom: 20rpx;" class="space_between frame">
- <view class="title_code_a">钢瓶编号</view>
- <view class="num_code">总数: {{userList.innerCodeList.length}}</view>
- </view>
- <u-checkbox-group v-model="checkedList" @change="checkboxChange">
- <view style="display: flex;flex-direction: column;width: 100%;">
- <view class="item_card_tran frame" v-for="(item,index) in innerCodeData">
- <view style="display: flex;align-items: center;">
- <u-checkbox :name="item.inner_code" :checked="item.checked"
- v-if="type == 1 && userList.status == 1"></u-checkbox>
- <view style="width: 60rpx;margin-right: 10rpx;text-align: center;">{{index + 1}}</view>
- <span style="font-weight: 600;">{{item.inner_code}}</span>
- </view>
- <view style="display: flex;align-items: center;" v-if="userList.status != 1">
- <span class="blue_title" v-if="item.flag">已接收</span>
- <span class="red_title" v-else>未接收</span>
- </view>
- </view>
- </view>
- </u-checkbox-group>
- </view>
- <view style="width: 100%;height: 120rpx;"></view>
- <view class="btn_transfer_details" v-if="type == 1 && userList.status == 1">
- <view style="flex: 1;">
- <u-button style="width: 90%;" type="primary" @click="submit">确定</u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- flowStep
- } from '@/static/js/blockSort.js'
- export default {
- data() {
- return {
- userList: {},
- type: null,
- transferTitle: '',
- checkedList: [],
- innerCodeData: [],
- }
- },
- onLoad(value) {
- this.type = Number(value.type)
- const data = uni.getStorageSync('transferData');
- if (data) {
- const userArr = JSON.parse(data)
- let array = flowStep()
- const filteredArray = array.filter(item => item.value === userArr.optType)
- if (filteredArray.length > 0) {
- this.transferTitle = filteredArray[0].label
- } else {
- this.transferTitle = '调拨详情'
- }
- this.checkedList = userArr.innerCodeList
- this.innerCodeData = []
- userArr.innerCodeList.forEach(item => {
- let arr = {
- inner_code: '',
- checked: true,
- }
- arr.inner_code = item
- if (userArr.acceptInnerCodeList == null) {
- userArr.acceptInnerCodeList = []
- }
- if (userArr.acceptInnerCodeList.indexOf(item) > -1) {
- arr.flag = true;
- } else {
- arr.flag = false;
- }
- this.innerCodeData.push(arr)
- })
- console.log(this.innerCodeData, userArr, 6767)
- this.userList = userArr
- }
- },
- methods: {
- cancelAllocation() {
- this.$api.post('/api/gas-cylinder-allot/cancel', {
- id: this.userList.id,
- }).then(res => {
- if (res.code == 200) {
- uni.navigateBack({
- delta: 1
- });
- } else {
- uni.$u.toast(res.data.msg)
- }
- })
- },
- submit() {
- this.$api.post('/api/gas-cylinder-allot/submit', {
- id: this.userList.id,
- optType: this.userList.optType,
- allotUserId: this.userList.allotUserId,
- acceptUserId: this.userList.acceptUserId,
- allotCompanyId: this.userList.allotCompanyId,
- acceptCompanyId: this.userList.acceptCompanyId,
- innerCodeList: this.checkedList,
- }).then(res => {
- if (res.code == 200) {
- uni.navigateBack({
- delta: 1
- });
- } else {
- uni.$u.toast(res.data.msg)
- }
- })
- },
- // 选择钢瓶
- checkboxChange(value) {
- for (let i = 0; i < this.innerCodeData.length; i++) {
- let flag = value.includes(this.innerCodeData[i].inner_code);
- if (flag) {
- this.innerCodeData[i].checked = true
- } else {
- this.innerCodeData[i].checked = false
- }
- }
- this.checkedList = this.checkedList.concat(value);
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .step_title {
- font-size: 30rpx;
- font-weight: 600;
- }
- .card_avatar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .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_transfer_details {
- border: 1rpx dashed #d7d7d7;
- margin-top: 20rpx;
- padding: 20rpx;
- background-color: #f4f4f5;
- }
- .item_card_tran {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 30rpx 30rpx 30rpx 0rpx;
- }
- .title_code_a {
- font-size: 32rpx;
- font-weight: 600;
- }
- .num_code {
- color: #2979ff;
- font-size: 28rpx;
- }
- .btn_transfer_details {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- display: flex;
- align-items: center;
- padding: 20rpx 0rpx;
- border-top: 1rpx solid #f4f4f5;
- }
- .blue_title {
- color: #53c21d;
- font-size: 28rpx;
- }
- .red_title {
- color: red;
- font-size: 28rpx;
- }
- </style>
|