This commit is contained in:
aihe 2024-08-17 23:45:55 +08:00
parent 1612af9e41
commit f6eb2f9bd6
2 changed files with 57 additions and 16 deletions

View File

@ -4,7 +4,7 @@
{{label}}
</view>
<view style="width: 120rpx;">
<u-button @click="handleCheckDanJu(dataList)" :plain="true" shape="circle" custom-style="margin: 0 10rpx;height:50rpx;font-size: 28rpx;">
<u-button @click="handleCheckDanJu" :plain="true" shape="circle" custom-style="margin: 0 10rpx;height:50rpx;font-size: 28rpx;">
查看
</u-button>
</view>
@ -12,7 +12,7 @@
<view>
<u-row>
<u-image v-for="(item, index) in dataList"
@click="handlePreviewCur(dataList, index)" :src="item" width="100" height="50" mode="aspectFill"
@click="handlePreviewCur(index)" :src="item" width="100" height="50" mode="aspectFill"
custom-style="margin: 20rpx 20rpx 0 0;"
></u-image>
</u-row>
@ -28,6 +28,9 @@
if(typeof list == 'string') {
list = list.split(",")
}
if(!this.canView) {
list = []
}
return list
}
},
@ -42,6 +45,12 @@
return []
}
},
canView: {
default () {
return true
}
},
checkViewFun:{}
},
data() {
return {}
@ -56,16 +65,23 @@
},
methods: {
handleCheckDanJu(list, type){
let url = ''
if(list.length == 0) {
async handleCheckDanJu(){
if(!this.canView) {
if(this.checkViewFun) {
let bl = await this.checkViewFun()
if(!bl) {
return
}
}
}
if(this.dataList.length == 0) {
return this.showToast("暂无数据")
}
this.handlePreviewCur(list, 0)
this.handlePreviewCur(this.dataList, 0)
},
handlePreviewCur(list, index) {
handlePreviewCur(index) {
uni.previewImage({
urls: list,
urls: this.dataList,
current: index
})
},

View File

@ -17,19 +17,19 @@
<bpd-send-reciever-tmp :value="modelInfo" :showInfoBtn="false" :hideDetail="true"></bpd-send-reciever-tmp>
</view>
<!-- <view class="mp-aside">
<view class="">
<view class="mp-aside">
<!-- <view class="">
<bpd-pic-preview-tmp :list="modelInfo.billPicGoodsRmk" label="货物图片"></bpd-pic-preview-tmp>
</view>
<view class="mt-30">
<bpd-pic-preview-tmp :list="modelInfo.billPicSendRmk" label="揽收底单图片"></bpd-pic-preview-tmp>
</view>
</view> -->
<view class="mt-30">
<bpd-pic-preview-tmp :list="modelInfo.billPicDispatchRmk" label="签收底单"></bpd-pic-preview-tmp>
<view class="">
<bpd-pic-preview-tmp :list="modelInfo.billPicDispatchRmk" label="签收底单" :canView="canViewImg" :checkViewFun="handleViewImgCheck"></bpd-pic-preview-tmp>
</view>
</view> -->
</view>
</view>
<view class="dt-block">
@ -56,7 +56,7 @@
</view>
<view class="mt-40">
<u-row justify="center">
<u-code-input v-model="danCheckModal.yanCode" maxlength="4" space="20" fontSize="36" size="80"></u-code-input>
<u-code-input v-model="danCheckModal.validCode" maxlength="4" space="20" fontSize="36" size="80"></u-code-input>
</u-row>
</view>
</template>
@ -97,6 +97,7 @@
components: { BpdSendRecieverTmp, BpdPicPreviewTmp },
data() {
return {
canViewImg: false,
queryOption: {
billCode: '', // 运单id
},
@ -134,12 +135,36 @@
let res = await apiService.getOrderDetail({...this.searchParam, _loading: true})
// 通过对象合并才能修改父级 数据
Object.assign(this.modelInfo, res.data || {})
// 判断是否有权限查看图片
this.canViewImg = this.modelInfo.customerCode == this.$store.getters.userInfo.customerCode
setTimeout(()=> {
this.$refs.lcusRef.initData()
}, 300)
},
handleViewImgCheck(){
this.danCheckModal.show = true
this.danCheckModal.validCode = ''
let curPromise = new Promise((resolve)=> {
this.danCheckModal.submitResolve = resolve
})
return curPromise
},
handleSubmitDanCheck() {
this.danCheckModal.show = false
let senderPhoneCode = (this.modelInfo.sender?.phone + '').substr(-4);
let recieverPhoneCode = (this.modelInfo.reciever?.phone + '').substr(-4)
let { validCode } = this.danCheckModal
if(validCode == senderPhoneCode || validCode == recieverPhoneCode){
this.danCheckModal.show = false
this.canViewImg = true
this.showLoading()
setTimeout(()=> {
this.hideLoading()
this.danCheckModal.submitResolve(true)
}, 1500)
} else {
this.danCheckModal.validCode = ''
this.showToast('验证错误,请检查')
}
}
}
}