exception.vue 8.12 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<template>
	<view>
		<dHeader :title="$lang.lang.exception.see"></dHeader>
		<view class="start-bar"></view>
		<view class="order-info">
			<view class="order-info-v">
				<view class="order-info-title">
					<image src=".../../static/img/corder-1.png" mode=""></image>
					<text>{{$lang.lang.exception.info}}</text>
				</view>
				<view class="order-info-line">
					<view class="order-info-line-v">
						<view class="">{{$lang.lang.exception.marks}}{{orderData.marks}}</view>
						<view class="">{{$lang.lang.exception.sum}}{{orderData.sumNum}}/{{orderData.costVO?orderData.costVO.totalNum:0}}</view>
						<view class="">{{$lang.lang.exception.orderStatus}}{{getStatusName(orderData.status)}}</view>
Smile's avatar
Smile committed
16
						<view class="">{{$lang.lang.exception.consignor}}{{orderData.consignorVO?orderData.consignorVO.name:''}}</view>
lanbaoming's avatar
lanbaoming committed
17 18 19
					</view>
					<view class="order-info-line-v">
						<view class="" >{{$lang.lang.exception.transport}}{{getConfigLabel('transport',orderData.transportId)}}</view>
Smile's avatar
Smile committed
20 21 22
						<view class="" >{{$lang.lang.exception.startCity}}{{orderData.logisticsInfoDto?(orderData.logisticsInfoDto[$lang.startTitle]):''}}</view>
						<view class="">{{$lang.lang.exception.endCity}}{{orderData.logisticsInfoDto?(orderData.logisticsInfoDto[$lang.destTitle]):''}}</view>
						<view class="">{{$lang.lang.exception.consignee}}{{orderData.consigneeVO?orderData.consigneeVO.name:''}}</view>
lanbaoming's avatar
lanbaoming committed
23 24 25
					</view>
				</view>
				<view class="order-info-line">
Smile's avatar
Smile committed
26
					<view class="order-info-line-v">
lanbaoming's avatar
lanbaoming committed
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
						<view class="">{{$lang.lang.exception.company}}{{orderData.consigneeVO?orderData.consigneeVO.company:''}}</view>
						<view class="">{{$lang.lang.exception.phone}}{{orderData.consigneeVO?$request.checkAddIcon(orderData.consigneeVO.countryCode):''}}{{orderData.consigneeVO?orderData.consigneeVO.phone:''}}</view>
						<view class="">{{$lang.lang.orderInfo.consignorCom}}{{orderData.consignorVO?orderData.consignorVO.company:''}}</view>
						<view class="">{{$lang.lang.orderInfo.consignorTel}}{{orderData.consignorVO?$request.checkAddIcon(orderData.consignorVO.countryCode):''}}{{orderData.consignorVO?orderData.consignorVO.phone:''}}</view>
						<view class="">{{$lang.lang.exception.date}}{{orderData.deliveryDate||$lang.lang.create.no}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="corder-tab2 bgf">
			<view class="corder-tab-top">
				<image src="../../static/img/corder-2.png" mode=""></image>
				<view class="noborder">
					<text>{{$lang.lang.exception.question}}</text>
					<!-- <text class="addGoods" @click="open(-1)">添加商品</text> -->
				</view>
			</view>
			<view class="corder-goods">
				<view class="" v-for="(item,index) in exceptiondata" :key="index">
					<view class="corder-gnums">{{index+1}}</view>
					<view class="corder-goods-v">
						<view class="corder-goods-v-item">
							<view class="">
								<text>{{$lang.lang.exception.exception}}</text>
								<text>{{getConfigLabel('exceptionType',item.orderExceptionType)}}</text>
							</view>
							<view class="">
Smile's avatar
Smile committed
54
								<text>{{$lang.lang.exception.describe}}</text>
honghy's avatar
honghy committed
55
								<text>{{$lang.locale=='zh'?item.orderExceptionDescVO.descZh:$lang.locale=='en'?item.orderExceptionDescVO.descEn:item.orderExceptionDescVO.descFr}}</text>
lanbaoming's avatar
lanbaoming committed
56 57 58 59 60 61 62 63 64
							</view>
							<view class="">
								<text>{{$lang.lang.exception.file}}:</text>
								<view  class="" v-for="(itemFile,index) in item.orderExceptionAttr" :key="index" @click="downLoadFile(itemFile)">
									<view class="fileName">{{$lang.lang.exception.file}}{{index+1}}</view>
								</view>
							</view>

						</view>
Smile's avatar
Smile committed
65

lanbaoming's avatar
lanbaoming committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
						<view class="corder-goods-v-item">
							<view class="">
								<text>{{$lang.lang.exception.money}}:</text>
								<text>{{item.orderExceptionAmount}}</text>
							</view>
							<view class="">
								<text>{{$lang.lang.exception.status}}:</text>
								<text>{{getConfigLabel('exceptionStatus',item.orderExceptionStatus)}}</text>
							</view>

						</view>
					</view>
					<view class="corder-link" v-if="item.orderExceptionStatus!='2'">
<!-- 						<view class="">
							<text>类型:</text>
							<text>{{getConfigLabel('exceptionType',item.orderExceptionType)}}</text>
						</view> -->
						<view v-if="item.orderExceptionType=='order_superfluous_box_exception'||item.orderExceptionType=='order_lack_box_exception'" class="link-btn" @click="toBoxExcetpion('../box_exception/box_exception',item.id)">{{$lang.lang.exception.toDeal}}</view>
						<view v-if="item.orderExceptionType=='order_heavy_cargo_exception'" class="link-btn" @click="toBoxExcetpion('../weight_exception/weight_exception',item.id)">{{$lang.lang.exception.toDeal}}</view>
						<view v-if="item.orderExceptionType=='order_doc_exception'" class="link-btn" @click="toBoxExcetpion('../doc_exception/doc_exception',item.id)">{{$lang.lang.exception.toDeal}}</view>
Smile's avatar
Smile committed
86
						<view v-if="item.orderExceptionType=='order_bulky_cargo_exception'" class="link-btn" @click="toBoxExcetpion('../light_exception/light_exception',item.id)">{{$lang.lang.exception.toDeal}}</view>
lanbaoming's avatar
lanbaoming committed
87 88
					</view>
				</view>
Smile's avatar
Smile committed
89
			</view>
lanbaoming's avatar
lanbaoming committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
		</view>
	</view>
</template>

<script>
	import dHeader from '../../components/dHeader/index.vue'
	import config from '../../utils/config.js'
	export default {
		components: {
			dHeader
		},
		data() {
			return {
				exceptiondata:[],
				orderData:{},
				statusData:[],
				config:{
					transport:[],
					exceptionType:[],
					exceptionStatus:[]
				},
				orderId:0
			}
		},
		onLoad(op) {

			this.getStatusData()
			if(op.id){
				this.orderId = op.id
				this.getOrderData(op.id)
				this.getExcetpionData(op.id)
			}
			this.orderConfig('transport_type', 'transport')
			this.orderConfig('order_error_type', 'exceptionType')
			this.orderConfig('order_exception_status', 'exceptionStatus')
		},
		created() {
			if(this.orderId){
				this.getExcetpionData(this.orderId)
			}
		},
		methods: {
			getConfigLabel(key,value){
				var label = ''
				let that = this
				that.config[key].forEach(function(item,index){
					if(item.value == value){
137
            label = item[that.$lang.label]
lanbaoming's avatar
lanbaoming committed
138 139 140 141 142 143 144 145 146
					}
				})
				return label
			},
			//获取状态名
			getStatusName (type){
				let that = this
				var status = that.statusData.find(item=>item.value == type)
				if(status) {
Smile's avatar
Smile committed
147
          return status[that.$lang.label]
lanbaoming's avatar
lanbaoming committed
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
				}
			},
			//获取异常
			getExcetpionData(id){
				let that = this
				that.exceptiondata = []
				that.$request.get('/app-api/ecw/order-exception/getExceptionListByOrderId',{orderId:id}).then(res => {
					if(res.code==0&&res.data){
						that.exceptiondata = res.data
						that.exceptiondata.forEach((item)=>{
							if(item.orderExceptionAttr){
								item.orderExceptionAttr = item.orderExceptionAttr.split(',')
							}else{
								item.orderExceptionAttr = []
							}
						})
					}
				})
			},
			//获取状态
			getStatusData () {
				this.$request.getConfig('order_status').then(res => {
					if(res.code==0&&res.data && res.data.list.length > 0){
						this.statusData = res.data.list
					}
				})
			},
			orderConfig (field, key) {
				this.$request.getConfig(field).then(res => {
					if(res.code==0&&res.data&&res.data.list.length > 0){
Smile's avatar
Smile committed
178
						this.config[key] = res.data.list
lanbaoming's avatar
lanbaoming committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
					}
				})
			},
			getOrderData(id){
				let that = this
				that.$request.get('/app-api/my/order/info/'+id).then(res => {
					if(res.code==0&&res.data){
						that.orderData = res.data
					}
				})
			},
			toBoxExcetpion(url,id){
				uni.navigateTo({
					url:url+'?id='+id+'&orderId='+this.orderData.orderId
				})
			},
			downLoadFile(file) {
			      uni.showLoading({
			        mask: true,
			      });
				  // var urlFile = config.CDN_DOMAIN + file
				var urlFile = file
			      uni.downloadFile({
			        url: urlFile, //仅为示例,并非真实的资源
			        success: (res) => {
						uni.hideLoading();
			          if (res.statusCode === 200) {
			            var filePath = res.tempFilePath;
			            uni.openDocument({
			              filePath: filePath,
			              success: function (res) {
			                console.log("打开文档成功");
			              },
			            });
			          }
			        },
			    })
			}
		}
	}
</script>

<style>
@import url("../../static/css/exception.css");
</style>