Commit 04f34775 authored by dragondean@qq.com's avatar dragondean@qq.com

取消放货审核显示凭证,修复放货验证码报错

parent 7f8d30fb
......@@ -32,11 +32,20 @@
</el-descriptions-item>
<!-- 取消放货 -->
<el-descriptions-item :label="$t('申请原因')" v-if="applyType == 10">
<el-descriptions-item :label="$t('申请原因')" v-if="applyType == 10" :span="2">
<dict-tag :type="DICT_TYPE.ECW_CANCEL_PICK_TYPE" :value="detail.cancelPickType" />
</el-descriptions-item>
<el-descriptions-item v-if="voucherList.length" :label="$t('凭证')" :span="3">
<div v-for="(item, index) in voucherList" :key="index" style="padding:5px">
<video v-if="isVideo(item)" :src="item" @click="playVideo(item)" style="width: 100px; height: 100px;"></video>
<el-image v-else :src="item" style="width: 100px; height: 100px;" :preview-src-list="voucherImages"></el-image>
</div>
</el-descriptions-item>
</el-descriptions>
<el-dialog :visible="!!videoUrl" :before-close="closeVideoPlayer">
<video v-if="!!videoUrl" :src="videoUrl" style="width: 500px; height: 500px" controls></video>
</el-dialog>
</div>
</template>
<script>
......@@ -44,7 +53,9 @@ import {getPickUpdateApproveInfo} from '@/api/ecw/orderCargoControl'
import {getOrder} from '@/api/ecw/order'
import {getChannelListByIds} from '@/api/ecw/channel'
import {parseTime} from '@/utils/ruoyi'
import Template from "@/views/cms/template/index.vue";
export default {
components: {Template},
filters: {parseTime},
props:{
id: [String, Number],
......@@ -55,7 +66,8 @@ export default {
detail: null,
order: null,
channels: [],
channelName: '/'
channelName: '/',
videoUrl: null
}
},
watch:{
......@@ -74,6 +86,23 @@ export default {
let channel = this.channels.find(item => item.channelId == id)
return channel ? channel.nameZh : '/'
}
},
// 凭证
voucherList(){
if(!this.detail || !this.detail.voucher) return []
return this.detail.voucher.split(',')
},
// 图片类型的凭证
voucherImages(){
return this.voucherList.filter(item => {
return !this.isVideo(item)
})
},
// 判断是否是视频链接
isVideo(){
return (url) => {
return ['mp4'].indexOf(url.split('.').pop().toLowerCase()) > -1
}
}
},
created(){
......@@ -97,6 +126,15 @@ export default {
this.channelName = this.$l(res.data, 'name')
})
},
// 播放视频
playVideo(url){
console.log('play video', url)
this.videoUrl = url
},
// 关闭视频播放器
closeVideoPlayer(){
this.videoUrl = null
}
}
}
</script>
......
......@@ -3,7 +3,7 @@
</template>
<script>
import {sendSmsCode} from '@/api/ecw/orderCargoControl'
const timeout = null
let timeout = null
export default {
props:{
orderId: [String, Number],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment