更新订单列表详情,更新商品管理,更新代客下单

This commit is contained in:
2024-09-23 17:39:38 +08:00
parent 90e3866524
commit edcf844adb
36 changed files with 5301 additions and 949 deletions

View File

@@ -0,0 +1,134 @@
<template>
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9" :zIndex="999">
<view class="u-p-32 box u-font-28">
<view class="u-flex u-relative u-row-center">
<view class="u-font-32">报损</view>
<view class="u-absolute close">
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
</view>
</view>
<view class="u-m-t-48">
<view>商品名称</view>
<view class="u-m-t-16">{{data.name}}</view>
<view class="u-m-t-38">
<view class="u-m-b-32">
<view class="u-flex ">
报损数量
</view>
<view class="u-m-t-16">
<up-input v-model="form.number">
<template #suffix>
<view>{{data.unitName}}</view>
</template>
</up-input>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>备注</view>
</view>
<view class="u-m-t-16">
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<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>
</view>
</view>
<view class="u-m-t-60">
<my-button type="primary" shape="circle" @tap="save">
<view class="u-font-32">
保存
</view>
</my-button>
</view>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
import {
reactive,
ref,
watch,
onMounted
} from 'vue';
import {
returnSkuSnap,
returnTypeEnum,
returnCategory
} from '@/pageProduct/util.js'
import {
$tbShopUnit
} from '@/http/yskApi/goods.js'
const props = defineProps({
show: {
type: Boolean,
default: false
},
category: {
type: Array,
default: () => []
},
goods: {
type: Object,
default: () => {
skuList: []
}
}
})
const data = ref(props.goods)
const emits = defineEmits(['update:show', 'save'])
const form = reactive({
note: '',
number: 1,
images: []
})
let popShow = ref(props.show)
watch(() => props.show, (newval) => {
popShow.value = newval
if (newval) {
data.value = props.goods
}
})
watch(() => popShow.value, (newval) => {
emits('update:show', newval)
})
function close() {
popShow.value = false
}
function open() {
}
function save() {
console.log(form.images);
}
</script>
<style lang="scss" scoped>
.box {
width: 556rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
box-sizing: border-box;
}
.close {
position: absolute;
right: 0;
}
.number {
color: #EE4646;
}
</style>

View File

@@ -0,0 +1,141 @@
<template>
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9">
<view class="u-p-32 box u-font-28">
<view class="u-flex u-relative u-row-center">
<view class="u-font-32">{{data.specSnap}}</view>
<view class="u-absolute close">
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
</view>
</view>
<view class="u-m-t-48">
<view class="u-flex u-row-between border-bottom u-p-b-30">
<view>当前状态</view>
<view class="u-flex">
<up-radio-group v-model="isGrounding" placement="row" @change="isGroundingChange">
<up-radio :customStyle="{marginRight: '10px'}" v-for="(item, index) in status.list"
:key="index" :label="item.label" :name="item.name">
</up-radio>
</up-radio-group>
</view>
</view>
<view class=" u-flex u-row-between u-m-t-30">
<view>售罄</view>
<up-switch :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
import {
reactive,
ref,
watch
} from 'vue';
import {
returnSkuSnap,
returnTypeEnum,
returnCategory
} from '@/pageProduct/util.js'
import {
$updateGrounding, $updateProductStatus
} from '@/http/yskApi/goods.js'
import infoBox from '@/commons/utils/infoBox.js'
const props = defineProps({
show: {
type: Boolean,
default: false
},
category: {
type: Array,
default: () => []
},
goods: {
type: Object,
default: () => {
skuList: []
}
}
})
const status = reactive({
list: [{
name: 1,
label: '上架中'
}, {
name: 0,
label: '已下架'
}],
})
// 是否售罄
const isPauseSale = ref(false)
// 是否上架
const isGrounding = ref(1)
const data = ref(props.goods)
const emits = defineEmits(['update:show', 'save', 'isGroundingChange','isPauseSaleChange'])
const form = reactive({
note: ''
})
let popShow = ref(props.show)
watch(() => props.show, (newval) => {
popShow.value = newval
if (newval) {
console.log(props.goods);
data.value = props.goods
isPauseSale.value = props.goods.isPauseSale ? true : false
isGrounding.value = props.goods.isGrounding
}
})
watch(() => popShow.value, (newval) => {
emits('update:show', newval)
})
function close() {
popShow.value = false
}
function open() {
}
function save() {
emits('save')
}
async function isGroundingChange(e) {
console.log(e);
await $updateGrounding({
isGrounding: e ? true : false,
skuId: props.goods.id
})
emits('isGroundingChange', e)
infoBox.showToast('更新成功')
}
async function isPauseSaleChange(e) {
console.log(e);
await $updateProductStatus({
targetId: props.goods.id,
updateKey: "pauseSaleSku",
updateValue: e?1:0
})
emits('isPauseSaleChange', e)
infoBox.showToast('更新成功')
}
</script>
<style lang="scss" scoped>
.box {
width: 556rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
box-sizing: border-box;
}
.close {
position: absolute;
right: 0;
}
.number {
color: #EE4646;
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9">
<view class="u-p-32 box u-font-28">
<view class="u-flex u-relative u-row-center">
<view class="u-font-32">修改价格</view>
<view class="u-absolute close">
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
</view>
</view>
<view class="u-m-t-48">
<view>商品名称</view>
<view class="u-m-t-16" v-if="isSku">{{data.name}}</view>
<view class="u-m-t-38">
<template v-if="!isSku">
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>{{data.name}}</view>
<view class="u-font-24">
<text>变动金额</text>
<text class="number">{{data.lowPrice-data._lowPrice}}</text>
</view>
</view>
<view class="u-m-t-16">
<up-input v-model="data.lowPrice">
<template #suffix>
<view></view>
</template>
</up-input>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>备注</view>
</view>
<view class="u-m-t-16">
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
</view>
</view>
</template>
<template v-else>
<scroll-view scroll-y="true" style="max-height: 50vh;">
<view class="u-m-b-32" v-for="(item,index) in data.skuList" :key="index">
<view class="u-flex u-row-between">
<view>{{item.name}}</view>
<view class="u-font-24">
<text>变动金额</text>
<text class="number">{{item.lowPrice-item._lowPrice}}</text>
</view>
</view>
<view class="u-m-t-16">
<up-input v-model="item.lowPrice">
<template #suffix>
<view></view>
</template>
</up-input>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>备注</view>
</view>
<view class="u-m-t-16">
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
</view>
</view>
</scroll-view>
</template>
<view class="u-m-t-60">
<my-button type="primary" shape="circle" @tap="save">
<view class="u-font-32">
保存
</view>
</my-button>
</view>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
import {
computed,
reactive,
ref,
watch
} from 'vue';
import {
returnSkuSnap,
returnTypeEnum,
returnCategory
} from '@/pageProduct/util.js'
const props = defineProps({
show: {
type: Boolean,
default: false
},
category: {
type: Array,
default: () => []
},
goods: {
type: Object,
default: () => {
return {
lowPrice:0,
skuList: []
}
}
}
})
const data = ref(props.goods)
const emits = defineEmits(['update:show', 'save'])
const form = reactive({
note: ''
})
let popShow = ref(props.show)
watch(() => props.show, (newval) => {
popShow.value = newval
if (newval) {
data.value = props.goods
}
})
const isSku=computed(()=>{
return data.value.typeEnum=='多规格'
})
watch(() => popShow.value, (newval) => {
emits('update:show', newval)
})
function close() {
popShow.value = false
}
function open() {
}
function save() {
emits('save', {
...data.value,
})
}
// function save() {
// const skuSnap = returnSkuSnap(data.value)
// let typeEnum = returnTypeEnum(data.value.typeEnum)
// let lowPrice = undefined
// typeEnum = typeEnum ? typeEnum : 'normal'
// const findCategory = returnCategory(data.value.categoryName, props.category)
// console.log(typeEnum);
// console.log(findCategory);
// const categoryId = findCategory ? findCategory.id : ''
// if (typeEnum == 'normal') {
// // 单规格
// lowPrice = data.value.skuList[0].salePrice
// }
// emits('save', {
// ...data.value,
// lowPrice,
// typeEnum,
// images: data.value.images ? data.value.images : [data.value.coverImg],
// categoryId,
// skuSnap: JSON.stringify(skuSnap)
// })
// }
</script>
<style lang="scss" scoped>
.box {
width: 556rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
box-sizing: border-box;
}
.close {
position: absolute;
right: 0;
}
.number {
color: #EE4646;
}
</style>

View File

@@ -0,0 +1,235 @@
<template>
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9">
<view class="u-p-32 box u-font-28">
<view class="u-flex u-relative u-row-center">
<view class="u-font-32">修改库存</view>
<view class="u-absolute close">
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
</view>
</view>
<view class="u-m-t-48">
<view>商品名称</view>
<view class="u-m-t-16" v-if="isSku">{{data.name}}</view>
<view class="u-m-t-38">
<template v-if="!isSku">
<view class="u-m-b-32" >
<view class="u-flex u-row-between">
<view>{{data.name}}</view>
<view class="u-font-24">
<text>变动数量</text>
<text class="number">{{data.stockNumber-data._stockNumber}}</text>
</view>
</view>
<view class="u-m-t-16">
<up-input v-model="data.stockNumber">
<template #suffix>
<view>{{data.unitName||''}}</view>
</template>
</up-input>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>备注</view>
</view>
<view class="u-m-t-16">
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
</view>
</view>
</template>
<template v-else>
<scroll-view scroll-y="true" style="max-height: 30vh;">
<view class="u-m-b-32" v-for="(item,index) in data.skuList" :key="index">
<view class="u-flex u-row-between">
<view>{{item.name}}</view>
<view class="u-font-24">
<text>变动数量</text>
<text class="number">{{item.stockNumber-item._stockNumber}}</text>
</view>
</view>
<view class="u-m-t-16">
<up-input v-model="item.stockNumber">
<template #suffix>
<view>{{data.unitName||''}}</view>
</template>
</up-input>
</view>
</view>
<view class="u-m-b-32">
<view class="u-flex u-row-between">
<view>备注</view>
</view>
<view class="u-m-t-16">
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
</view>
</view>
</scroll-view>
</template>
<view class="u-m-t-60">
<my-button type="primary" shape="circle" @tap="save">
<view class="u-font-32">
保存
</view>
</my-button>
<view class="u-m-t-30">
<template v-if="!recoders.show">
<view class="color-999 u-font-24 u-flex u-row-center u-col-center">
<view class="u-flex" @click="changeShowRecoders(true)">
<view class="u-m-r-6">查看记录</view>
<up-icon name="arrow-down" :size="12"></up-icon>
</view>
</view>
</template>
<template v-else>
<scroll-view scroll-y="true" style="max-height: 30vh;">
<my-step :list="recoders.list"></my-step>
</scroll-view>
<view class="color-999 u-font-24 u-flex u-row-center u-col-center">
<view class="u-flex" @click="changeShowRecoders(false)">
<view class="u-m-r-6">收起记录</view>
<up-icon name="arrow-up" :size="12"></up-icon>
</view>
</view>
</template>
</view>
</view>
</view>
</view>
</view>
</up-popup>
</template>
<script setup>
import {
reactive,
ref,
watch,
onMounted,
computed
} from 'vue';
import {
returnSkuSnap,
returnTypeEnum,
returnCategory
} from '@/pageProduct/util.js'
import {
$tbShopUnit
} from '@/http/yskApi/goods.js'
const props = defineProps({
show: {
type: Boolean,
default: false
},
category: {
type: Array,
default: () => []
},
goods: {
type: Object,
default: () => {
skuList: []
}
}
})
function changeShowRecoders(show) {
recoders.show = show
}
const recoders = reactive({
list: [{
title: '2024-09-15 112030',
content: '开启了库存库存由0件修改为5件'
},
{
title: '2024-09-15 ',
content: '开启了库存库存由0件修改为4件'
},
{
title: '2024-09-15 ',
content: '开启了库存库存由0件修改为3件'
},
{
title: '2024-09-15 ',
content: '开启了库存库存由0件修改为2件'
},
],
show: false,
active: 0
})
const data = ref(props.goods)
const emits = defineEmits(['update:show', 'save'])
const form = reactive({
note: ''
})
let popShow = ref(props.show)
watch(() => props.show, (newval) => {
popShow.value = newval
if (newval) {
data.value = props.goods
}
})
const isSku = computed(() => {
// return data.value.typeEnum == '多规格'
return false
})
watch(() => popShow.value, (newval) => {
emits('update:show', newval)
})
function close() {
popShow.value = false
}
function open() {
}
function save() {
emits('save', {
...data.value,
})
}
// function save() {
// const skuSnap = returnSkuSnap(data.value)
// let typeEnum = returnTypeEnum(data.value.typeEnum)
// let lowPrice = undefined
// typeEnum = typeEnum ? typeEnum : 'normal'
// const findCategory = returnCategory(data.value.categoryName, props.category)
// console.log(typeEnum);
// console.log(findCategory);
// const categoryId = findCategory ? findCategory.id : ''
// if (typeEnum == 'normal') {
// // 单规格
// lowPrice = data.value.skuList[0].salePrice
// }
// emits('save', {
// ...data.value,
// lowPrice,
// typeEnum,
// images: data.value.images ? data.value.images : [data.value.coverImg],
// categoryId,
// skuSnap: JSON.stringify(skuSnap)
// })
// }
</script>
<style lang="scss" scoped>
.box {
width: 556rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
box-sizing: border-box;
}
.close {
position: absolute;
right: 0;
}
.number {
color: #EE4646;
}
</style>

View File

@@ -7,55 +7,81 @@
<text class="u-m-l-20">{{data.sort}}</text>
</view>
<view class="color-333 u-m-l-42 u-flex">
<up-icon name="edit-pen" :size="16" :color="ColorMain"></up-icon>
<text class="stock">库存:</text>
<text class="font-bold u-m-l-10">{{data.stockNumber}}</text>
<up-icon @click="editStock" name="edit-pen" :size="16" :color="ColorMain"></up-icon>
<text class="stock u-m-l-4">库存:{{data.stockNumber}}</text>
</view>
</view>
<text class="u-font-28 color-666" @click="changeClick">修改</text>
<view>
<!-- <text class="u-font-28 color-666" @click="changeClick">修改</text> -->
<text class="u-font-28 color-666" @click="changePrice">改价</text>
<text class="u-font-28 color-red u-m-l-24" @click="baosun">报损</text>
</view>
</view>
<view class="u-m-t-48 u-flex">
<view class="u-m-t-48 u-flex u-col-top u-relative">
<view v-if="props.showChecked">
<label class="radio">
<radio :color="ColorMain" style="transform: scale(0.7);" @click="radioClick"
:checked="props.data.checked" /><text></text>
</label>
</view>
<image :src="data.coverImg" lazy-load class="img"></image>
<view class="h-100 u-p-l-16 u-flex-1 u-flex u-flex-col u-row-between">
<view class="color-333 w-full u-flex u-row-between">
<view class="img">
<up--image :width="63" :height="63" :radius="3" :src="data.coverImg"></up--image>
</view>
<view class="w-full info">
<view class="info-p-l color-333 u-flex u-row-between">
<view class="u-flex">
<text class="u-m-r-24">{{data.name}}</text><uni-tag size="small" type="primary"
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag>
<text class="u-m-r-24">{{data.name}}</text>
<!-- <uni-tag size="small" type="primary"
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag> -->
</view>
<view class="u-font-32">
<text>{{data.lowPrice}}</text>
<!-- <text>¥</text>
<text>{{data.lowPrice}}</text>
<text v-if="data.typeEnum == '多规格'">~{{data.maxPrice }}</text> -->
</view>
<view class="price">¥{{data.lowPrice}}</view>
</view>
<view class="u-m-t-44">
<template v-if="data.skuList.length>=2">
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top">
<view class="u-font-24 info-p-l u-m-t-14">规格</view>
<view class="skd" v-for="(item,index) in data.skuList" :key="index"
@click="guigeClick(index)">
<text>{{item.specSnap||item.name}}</text>
<view class="tag-primary tag" v-if="item.isGrounding">上架中</view>
<view class="tag-gray tag" v-else>已下架</view>
<!-- <template v-if="item.isPauseSale">
<view class="tag-gray tag" >已售罄</view>
</template>
<template v-else>
<view class="tag-primary tag" v-if="item.isGrounding">上架中</view>
<view class="tag-gray tag" v-else>已下架</view>
</template> -->
</view>
</view>
</template>
<template v-else>
<view style="height: 24rpx;">
</view>
</template>
</view>
</view>
</view>
<view class="u-m-t-16 skus u-text-center" v-if="data.skuList.length>=2">
<!-- <view class="u-flex u-row-between font-bold">
<view class="u-flex-1">商品信息</view>
<view class="u-flex-1">售价</view>
<view class="u-flex-1">库存</view>
</view>
<view v-for="(item,index) in data.skuList" :key="index">
<view class="u-flex u-m-t-10">
<view class="color-333 u-flex-1"> <text class="u-m-r-24">{{item.specSnap||''}}</text></view>
<view class="price u-flex-1">¥{{data.lowPrice||0}}</view>
<view class=" u-flex-1">{{item.stockNumber||0}} {{data.unitName||''}}</view>
</view>
</view> -->
<!-- <view class="u-m-t-16 skus u-text-center" v-if="data.skuList.length>=2">
<view class="u-flex u-flex-wrap skds">
<view class="skd" v-for="(item,index) in data.skuList" :key="index"><text>{{item.specSnap}}</text>
<view class="tag-primary tag">上架中</view>
</view>
</view>
</view>
</view> -->
<view class="u-m-t-24 u-flex u-row-between">
<view class="u-flex">
<view class="u-flex">
@@ -93,7 +119,7 @@
import {
ColorMain
} from '@/commons/color.js'
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del'])
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','editStock'])
const props = defineProps({
index: {
type: Number
@@ -113,7 +139,8 @@
default: false
}
})
function isHotChange(e) {
$goodsIsHot({
@@ -155,6 +182,20 @@
emits('del', props.index)
}
function changePrice() {
emits('changePrice', props.index)
}
function baosun() {
emits('baosun', props.index)
}
function guigeClick(guigeIndex) {
emits('guigeClick', props.index, guigeIndex)
}
function editStock(){
emits('editStock', props.index)
}
//携带参数type edit跳转到商品添加页面编辑与添加同一页面根据type值来判断
function toEdit() {
go.to('PAGES_PRODUCT_ADD', {
@@ -174,9 +215,12 @@
border: 2rpx solid transparent;
}
.gap-10 {
gap: 10rpx;
}
.btn-primary {
border-color: $my-main-color;
;
color: $my-main-color;
}
@@ -194,8 +238,15 @@
}
.img {
width: $imgSize;
height: $imgSize;
position: absolute;
left: 0;
top: 0;
// width: $imgSize;
// height: $imgSize;
}
.info-p-l {
padding-left: 71px;
}
.icon-arrow-right {
@@ -219,6 +270,10 @@
// border: 2rpx solid #333333;
}
.color-red {
color: #F0465B;
}
.goods {
border-radius: 10rpx 10rpx 10rpx 10rpx;
background-color: #fff;
@@ -239,33 +294,37 @@
.skds {
gap: 10rpx 50rpx;
}
}
}
.skd {
padding: 14rpx 40rpx 14rpx 20rpx;
background: #F0F2F5;
border-radius: 4rpx;
position: relative;
color: #666;
overflow: hidden;
margin-bottom: 10rpx;
.skd {
padding: 14rpx 40rpx 14rpx 20rpx;
background: #F0F2F5;
border-radius: 4rpx;
position: relative;
color: #666;
overflow: hidden;
margin-bottom: 10rpx;
font-size: 24rpx;
.tag {
position: absolute;
right: 0;
top: 0;
font-size: 12rpx;
right: 0;
padding: 2rpx 4rpx;
border-radius: 0rpx 4rpx 4rpx 4rpx;
}
.tag-primary {
background-color: $my-main-color;
color: #fff;
}
}
.tag {
position: absolute;
right: 0;
top: 0;
font-size: 12rpx;
right: 0;
padding: 2rpx 4rpx;
border-radius: 0rpx 4rpx 4rpx 4rpx;
}
.tag-primary {
background-color: $my-main-color;
color: #fff;
}
.tag-gray {
background-color: rgb(144, 147, 153);
color: #fff;
}
}
</style>