From 78580644f54096759b181380e6af8431071b4548 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Sat, 28 Sep 2024 15:16:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=AF=A6=E6=83=85=E6=94=B6?= =?UTF-8?q?=E6=AC=BE=E7=A0=81=E4=B8=8B=E8=BD=BD=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E8=80=97=E6=9D=90=E6=8A=A5=E6=8D=9F=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-components/my-reportDamage.vue | 69 +++++-- http/yskApi/breakage.js | 33 ++++ pageInvoicing/index/index.vue | 10 +- pageProduct/index/components/goods.vue | 8 +- pageProduct/index/index.vue | 18 +- pages/shopSetUp/index.vue | 61 ++++-- pages/shopSetUp/shopQRcode.vue | 185 +++++++++--------- .../cloudfunctions/queryCids/index.js | 15 -- .../cloudfunctions/queryCids/package.json | 7 - .../cloudfunctions/unipush/index.js | 19 -- .../cloudfunctions/unipush/package.json | 7 - 11 files changed, 252 insertions(+), 180 deletions(-) create mode 100644 http/yskApi/breakage.js delete mode 100644 uniCloud-aliyun/cloudfunctions/queryCids/index.js delete mode 100644 uniCloud-aliyun/cloudfunctions/queryCids/package.json delete mode 100644 uniCloud-aliyun/cloudfunctions/unipush/index.js delete mode 100644 uniCloud-aliyun/cloudfunctions/unipush/package.json diff --git a/components/my-components/my-reportDamage.vue b/components/my-components/my-reportDamage.vue index 9c70e87..e71d6cd 100644 --- a/components/my-components/my-reportDamage.vue +++ b/components/my-components/my-reportDamage.vue @@ -2,24 +2,24 @@ - {{item.title}} - + {{title}} + - - {{item.name}} + + {{item.conName}} - {{vdata.num}} + {{vdata.stockNumber}} 商品单位 - + {{item.conUnit}} 报损图片 @@ -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({ diff --git a/http/yskApi/breakage.js b/http/yskApi/breakage.js new file mode 100644 index 0000000..a3c6f2e --- /dev/null +++ b/http/yskApi/breakage.js @@ -0,0 +1,33 @@ +import http from './http.js' +const request=http.request + + +/** + * 商品报损 + * @returns + */ +export function productBreakage(data) { + return request({ + url: `/api/tbProductStockDetail/frmLoss`, + method: 'post', + data:{ + shopId: uni.getStorageSync('shopId'), + ...data + } + }) +} + +/** + * 耗材报损 + * @returns + */ +export function consumableBreakage(data) { + return request({ + url: `/api/tbConsInfoFlow/frmLoss`, + method: 'post', + data:{ + shopId: uni.getStorageSync('shopId'), + ...data + } + }) +} diff --git a/pageInvoicing/index/index.vue b/pageInvoicing/index/index.vue index 4638b51..07492ab 100644 --- a/pageInvoicing/index/index.vue +++ b/pageInvoicing/index/index.vue @@ -71,7 +71,7 @@ - +