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

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

parent 7f8d30fb
......@@ -25,18 +25,27 @@
<el-descriptions-item :label="$t('申请原因')" v-if="applyType == 8">
<dict-tag :type="DICT_TYPE.ECW_PICK_RECURRENT_NUCLEAR_TYPE" :value="detail.recurrentNuclearType" />
</el-descriptions-item>
<!-- 调货 -->
<el-descriptions-item :label="$t('申请原因')" v-if="applyType == 9">
{{$l(detail, 'reason')}}
</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,7 +86,24 @@ 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(){
if(this.id){
......@@ -92,11 +121,20 @@ export default {
})
},
getChannel(){
if(!this.order || !this.order.channelId) return
if(!this.order || !this.order.channelId) return
getChannel(this.order.channelId).then(res => {
this.channelName = this.$l(res.data, 'name')
})
},
// 播放视频
playVideo(url){
console.log('play video', url)
this.videoUrl = url
},
// 关闭视频播放器
closeVideoPlayer(){
this.videoUrl = null
}
}
}
</script>
......@@ -108,4 +146,4 @@ export default {
font-weight: bold;
}
}
</style>
\ No newline at end of file
</style>
......@@ -3,7 +3,7 @@
</template>
<script>
import {sendSmsCode} from '@/api/ecw/orderCargoControl'
const timeout = null
let timeout = null
export default {
props:{
orderId: [String, Number],
......@@ -46,10 +46,10 @@ export default {
countDown(){
this.leftTime --
if(this.leftTime <= 0){
return false
return false
}
timeout = setTimeout(this.countDown, 1000)
}
}
}
</script>
\ No newline at end of file
</script>
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