更新商品管理模块
This commit is contained in:
@@ -16,10 +16,10 @@
|
||||
报损数量
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<up-input v-model="form.number">
|
||||
<template #suffix>
|
||||
<up-input v-model="form.stockNumber" type="number">
|
||||
<!-- <template #suffix>
|
||||
<view>{{data.unitName}}</view>
|
||||
</template>
|
||||
</template> -->
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
@@ -28,7 +28,7 @@
|
||||
<view>备注</view>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
|
||||
<up-textarea :height="42" v-model="form.remark" placeholder="请输入备注"></up-textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-b-32">
|
||||
@@ -36,9 +36,7 @@
|
||||
<view>上传图片</view>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<scroll-view scroll-y="true" style="max-height: 300rpx;">
|
||||
<my-up-upload v-model="form.images"></my-up-upload>
|
||||
</scroll-view>
|
||||
<my-up-upload :maxCount="1" :multiple="false" v-model="form.coverImg"></my-up-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-60">
|
||||
@@ -67,8 +65,9 @@
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$tbShopUnit
|
||||
$frmLoss
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
@@ -88,9 +87,9 @@
|
||||
const data = ref(props.goods)
|
||||
const emits = defineEmits(['update:show', 'save'])
|
||||
const form = reactive({
|
||||
note: '',
|
||||
number: 1,
|
||||
images: []
|
||||
remark: '',
|
||||
stockNumber: 1,
|
||||
coverImg: []
|
||||
})
|
||||
let popShow = ref(props.show)
|
||||
watch(() => props.show, (newval) => {
|
||||
@@ -111,8 +110,21 @@
|
||||
|
||||
}
|
||||
|
||||
function save() {
|
||||
console.log(form.images);
|
||||
async function save() {
|
||||
if (form.stockNumber <= 0) {
|
||||
return infoBox.showToast('请输入正确的报损数量')
|
||||
}
|
||||
if (!form.remark) {
|
||||
return infoBox.showToast('请输入备注')
|
||||
}
|
||||
console.log(form);
|
||||
const res= await $frmLoss({
|
||||
...form,
|
||||
productId:props.goods.id,
|
||||
coverImg:form.coverImg[0]?form.coverImg[0].serveUrl:''
|
||||
})
|
||||
infoBox.showToast('提交成功!')
|
||||
popShow.value=false
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user