店铺详情收款码下载处理,耗材报损增加

This commit is contained in:
GaoHao
2024-09-28 15:16:31 +08:00
parent fad44dd3c5
commit 78580644f5
11 changed files with 252 additions and 180 deletions

View File

@@ -2,24 +2,24 @@
<up-popup customStyle="overflow: hidden;" :show="show" round="20" mode="bottom" @close="close" @open="open">
<view class="reportDamage">
<view class="reportDamage_head">
<view class="reportDamage_title">{{item.title}}</view>
<up-icon name="close-circle-fill" color="#333" size="25" @tap="show=false"></up-icon>
<view class="reportDamage_title">{{title}}</view>
<up-icon name="close-circle-fill" color="#333" size="25" @tap="close"></up-icon>
</view>
<view class="reportDamage_content">
<view class="reportDamage_cell">
<view class="cell_lable">
<up-image class="thumbnail" radius="10" :show-loading="true" :src="item.thumbnail"></up-image>
<view>{{item.name}}</view>
<up-image v-if="type=='product'" class="thumbnail" radius="10" :show-loading="true" :src="item.coverImg"></up-image>
<view>{{item.conName}}</view>
</view>
<view class="cell_value">
<up-icon name="minus-circle" color="#999" size="25" @tap="minus"></up-icon>
<view class="text">{{vdata.num}}</view>
<view class="text">{{vdata.stockNumber}}</view>
<up-icon name="plus-circle-fill" color="#318AFE" size="25" @tap="plus"></up-icon>
</view>
</view>
<view class="reportDamage_cell">
<view class="cell_lable">商品单位</view>
<view class="cell_value"><view></view> <up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
<view class="cell_value"><view>{{item.conUnit}}</view> <up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
</view>
<view class="reportDamage_cell">
<view class="cell_lable">报损图片</view>
@@ -49,14 +49,25 @@
computed,
ref,
reactive,
onMounted,
watch
} from 'vue';
import { $uploadFile } from '@/http/yskApi/file.js'
import { consumableBreakage , productBreakage ,tbConCheck} from '@/http/yskApi/breakage.js'
const props = defineProps({
show:{
type: Boolean,
default: false
},
type:{
type: String,
default: ""
},
title:{
type: String,
default: ""
},
item:{
type: Object,
},
@@ -64,16 +75,23 @@
})
const emits = defineEmits(['close','open',"affirm"])
const vdata = reactive({
num: 1,
stockNumber: 1,
imgUrlList: [],
})
let show = ref(props.show)
let type = ref(props.type)
let itemData = ref(props.item)
watch(()=>props.show,(newval)=>{
show.value=newval
})
let show = ref(props.show)
onMounted(() => {
})
function close() {
show.value = false
show.value = false;
vdata.imgUrlList = [];
vdata.stockNumber = 1;
emits('close')
}
@@ -81,7 +99,7 @@
* 打开报损弹窗
*/
function open() {
show.value = true
show.value = true;
emits('open')
}
@@ -89,17 +107,17 @@
* 报损数量减少
*/
function minus() {
if ( vdata.num <= 1) {
if ( vdata.stockNumber <= 1) {
return;
}
vdata.num--;
vdata.stockNumber--;
}
/**
* 报损数量增加
*/
function plus() {
vdata.num++;
vdata.stockNumber++;
}
@@ -155,7 +173,28 @@
* 确认
*/
function affirm () {
emits('affirm')
// emits('affirm')
if (vdata.imgUrlList.length <= 0) {
uni.showToast({
title:'请上传报损图片',
icon:'none'
})
return;
}
let params = {
coverImg: vdata.imgUrlList,
}
//商品报损
if ( type.value == 'consumable') {
params.consId = itemData.value.conIn;
params.amount = vdata.stockNumber;
}
consumableBreakage(params).then((res) => {
show.value = false;
vdata.imgUrlList = [];
vdata.stockNumber = 1;
})
}
defineExpose({