1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
<!-- 订单调仓弹窗 -->
<view class="cu-modal" :class="transferModal ? 'show' : ''" style="z-index: 900;">
<view class="cu-dialog">
<view class="transferModal_title">
{{title}}
</view>
<view class="cu-form-group">
<view class="title">{{$t('到仓时间')}}:</view>
<picker mode="date" :value="arrival_date" @change="selectArrivalDate">
<view class="picker">{{ arrival_date ? arrival_date : $t('选择时间') }}</view>
</picker>
</view>
<view class="cu-bar bg-white justify-end top-line">
<view class="action">
<button class="cu-btn bg-green" @tap="submitTransfer">{{$t('确认')}}</button>
<button class="cu-btn bg-grey margin-left" @tap="cancelTransfer">{{$t('取消')}}</button>
</view>
</view>
</view>
</view>
</template>
<script>
import * as types from '../../../store/mutations-types.js';
import {
transferWarehouses
} from '../../../api/api.js';
import mixins from '../../../mixins/mixin.js';
import {
uniIcons
} from '@dcloudio/uni-ui';
export default {
mixins: [mixins],
props: ['loadId'],
components: {
uniIcons
},
data() {
return {
transfer_order:'',
arrival_date:'',
transferModal:false,
title:'',
callbackData:false
}
},
filters: {
},
computed: {
},
methods: {
show(show, transfer_order,title,callbackData) {
if(!!show){
this.transfer_order = transfer_order;
this.title = title||'';
this.arrival_date = '';
this.transferModal = !!show;
this.callbackData = callbackData;
}else{
this.transferModal = !!show;
}
},
submitTransfer() {
if(!this.arrival_date){
this.$store.dispatch(types.SHOW_ALERT, {
msg: this.$t('请选择到仓时间')
});
return false
}
transferWarehouses(this.arrival_date,this.transfer_order).then(data=>{
this.$store.dispatch(types.SHOW_TOAST, {
msg: data
});
setTimeout(() => {
this.show(false);
this.$emit('submit',this.callbackData);
}, 1000);
})
},
// 取消
cancelTransfer(){
this.show(false);
// this.$emit('cancel');
},
selectArrivalDate(e){
this.arrival_date = e.detail.value;
},
}
}
</script>
<style>
.transferModal_title{
background-color: #ffffff;
padding: 30upx;
color: #e54d42;
border-bottom: #ddd solid 1px;
font-size: 28upx;
}
</style>