代码更新

This commit is contained in:
GaoHao
2025-03-10 09:14:57 +08:00
parent 4f65b08c06
commit 490c513f48
48 changed files with 1162 additions and 537 deletions

View File

@@ -12,7 +12,7 @@
<view class="u-m-b-32" v-for="(item,index) in list" :key="index">
<view>{{item.text}}</view>
<view class="u-m-t-16">
<up-input type="number" v-model="item.value">
<up-input type="digit" v-model="item.value">
<template #suffix>
<up-button @click="itemClick(item)" type="primary" text="修改" size="mini"></up-button>
</template>

View File

@@ -16,11 +16,7 @@
报损数量
</view>
<view class="u-m-t-16">
<up-input v-model="form.stockNumber" type="number">
<!-- <template #suffix>
<view>{{data.unitName}}</view>
</template> -->
</up-input>
<up-input v-model="form.number" type="number"></up-input>
</view>
</view>
<view class="u-m-b-32">
@@ -53,30 +49,15 @@
</template>
<script setup>
import {
reactive,
ref,
watch,
onMounted
} from 'vue';
import {
returnSkuSnap,
returnTypeEnum,
returnCategory
} from '@/pageProduct/util.js'
import {
$frmLoss
} from '@/http/yskApi/goods.js'
import { reactive, ref, watch } from 'vue';
import { productReportDamage } from '@/api/product.js'
import infoBox from '@/commons/utils/infoBox.js'
const props = defineProps({
show: {
type: Boolean,
default: false
},
category: {
type: Array,
default: () => []
},
goods: {
type: Object,
default: () => {
@@ -88,7 +69,7 @@
const emits = defineEmits(['update:show', 'save'])
const form = reactive({
remark: '',
stockNumber: 1,
number: 1,
coverImg: []
})
let popShow = ref(props.show)
@@ -96,6 +77,9 @@
popShow.value = newval
if (newval) {
data.value = props.goods
form.remark = ''
form.number = 1
form.coverImg = []
}
})
watch(() => popShow.value, (newval) => {
@@ -111,18 +95,19 @@
}
async function save() {
if (form.stockNumber <= 0) {
if (form.number <= 0) {
return infoBox.showToast('请输入正确的报损数量')
}
if (!form.remark) {
return infoBox.showToast('请输入备注')
}
console.log(form);
const res= await $frmLoss({
let par = {
...form,
productId:props.goods.id,
coverImg:form.coverImg[0]?form.coverImg[0].serveUrl:''
})
imgUrls:form.coverImg[0]?form.coverImg[0].serveUrl:''
}
delete par.coverImg
const res= await productReportDamage(par)
infoBox.showToast('提交成功!')
popShow.value=false
}

View File

@@ -40,7 +40,7 @@
</view>
</view>
<view class="u-m-t-24">
<template v-if="data.skuList.length>=2">
<template v-if="data.skuList.length>=1">
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top" :style="skuStyle">
<view class="u-font-24 info-p-l u-m-t-6">规格</view>
<view class="skd" v-for="(item,index) in data.skuList" :key="index"