商品列表修改,商品修改去掉库存相关东西,增加退菜是否退库存的选项,分类增加退菜是否退库存的选项,店铺增加退菜退库存模式配置,增加退款退菜是否退库存弹窗,增加购物车重复物品提示弹窗

This commit is contained in:
2026-04-11 15:31:57 +08:00
parent bc7b6d41f5
commit 2db9f6811a
15 changed files with 3002 additions and 2373 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
<template>
<view>
<view class="default-box-padding bg-fff border-r-18">
<view class="font-bold u-m-b-32">绑定耗材</view>
<view class="u-flex u-row-between">
<view>商品名称</view>
</view>
@@ -38,14 +39,14 @@
</view>
<view class="u-flex u-m-t-16 u-font-24" v-if="item.stockNumber">
<view class="xuhao">
</view>
<view class="u-flex u-flex-1 u-p-l-32 gap-20">库存{{item.stockNumber}}
{{item.conUnit}}
</view>
</view>
</view>
</view>
</view>
<view class="u-flex">
@@ -53,17 +54,34 @@
<up-icon :size="18" color="#318AFE" name="plus-circle-fill"></up-icon>
<view class="u-m-l-16">添加耗材</view>
</view>
</view>
</view>
</view>
<view class="default-box-padding bg-fff border-r-18 u-flex u-row-between u-m-t-32">
<view>当某个耗材的使用库存不足时商品自动售罄</view>
<view class="default-box-padding bg-fff border-r-18 u-m-t-32">
<view class="up-border-bottom u-p-b-32">
<view class="u-flex u-row-between ">
<view class="font-bold"> 自动售罄</view>
<up-switch :size="16" v-model="isAutoSoldStock" :inactive-value="0" :active-value="1"></up-switch>
</view>
<view class=" u-m-t-10">当某个耗材的使用库存不足时商品自动售罄</view>
</view>
<view class=" u-p-t-32">
<view class="">
<view class="font-bold u-m-b-16"> 退菜是否退库存</view>
<up-radio-group v-model="refundMode">
<up-radio v-for="(item,index) in tuiStockTypes" :key="index" :label="item.label"
:name="item.key"></up-radio>
</up-radio-group>
<view class="color-red u-m-t-10">当前店铺退菜退库存规则跟随商品分类</view>
</view>
</view>
</view>
<view class="bottom">
<my-button type="primary" shape="circle" font-weight="700" @click="save">保存</my-button>
<my-button type="primary" shape="circle" font-weight="700" @click="save">保存</my-button>
<my-button bgColor="#F9F9F9" shape="circle" color="#999" @click="cancel">取消</my-button>
</view>
@@ -72,16 +90,43 @@
</template>
<script setup>
import { ref, reactive, watch, computed, onMounted } from 'vue';
import {
ref,
reactive,
watch,
computed,
onMounted
} from 'vue';
import infoBox from '@/commons/utils/infoBox.js'
import chooseHaocai from './choose-haocai.vue';
import chooseDanwei from './choose-danwei.vue';
import { hasPermission } from '@/commons/utils/hasPermission.js';
import { getConsList } from '@/http/api/cons.js';
import { productBindCons } from '@/http/api/product.js';
import {
hasPermission
} from '@/commons/utils/hasPermission.js';
import {
getConsList
} from '@/http/api/cons.js';
import {
productBindCons
} from '@/http/api/product.js';
const tuiStockTypes = ref([{
label: '退菜退库存',
key: 1
},
{
label: '仅退菜不退库存',
key: 2
},
{
label: '每次询问-退菜后弹窗提示,可手动选择',
key: 3
},
])
const isAutoSoldStock=defineModel('isAutoSoldStock',0)
const refundMode=defineModel('refundMode',1)
const emits = defineEmits(['cancel', 'updateGoods'])
const props = defineProps({
@@ -91,27 +136,30 @@
return {
consList: [],
skuList: [],
type: ''
type: '',
isAutoSoldStock:0,
isRefundStock:1,
}
}
}
})
const pageData = reactive({
isBindGuige: false, //是否绑定至规格
isBindGuige: false, //是否绑定至规格
})
let haoCaiList = ref([])
let $haocaiMap = reactive({})
const skuList = ref(props.goods.skuList)
const consList = ref(props.goods.consList||[])
const consList = ref(props.goods.consList || [])
watch(() => props.goods.consList, (newval) => {
consList.value = newval
})
watch(() => props.goods.skuList, (newval) => {
skuList.value = newval
})
onMounted(() => {
init()
})
@@ -126,16 +174,16 @@
}
haoCaiList.value = res
})
}
/**
* 取消耗材绑定
*/
function cancel() {
emits('cancel')
}
/**
* 耗材选择
* @param {Object} newval
@@ -157,7 +205,7 @@
surplusStock: ''
})
}
/**
* 删除商品耗材
* @param {Object} index
@@ -207,7 +255,6 @@
emits('updateGoods')
infoBox.showToast('修改成功')
}
</script>
<style lang="scss" scoped>

View File

@@ -0,0 +1,11 @@
<template>
<view>
<view></view>
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>

View File

@@ -6,10 +6,10 @@
<text class="">排序</text>
<text class="u-m-l-20">{{data.sort}}</text>
</view>
<view class="color-333 u-m-l-42 u-flex">
<!-- <view class="color-333 u-m-l-42 u-flex">
<text class="stock u-m-l-4">库存:{{data.stockNumber}}</text>
<up-icon @click="editStock" name="edit-pen" :size="16" :color="$utils.ColorMain"></up-icon>
</view>
</view> -->
</view>
<view>
<!-- <text class="u-font-28 color-666" @click="changePrice">改价</text> -->