更换正式环境,测试修改
This commit is contained in:
@@ -110,6 +110,7 @@
|
||||
const res= await productReportDamage(par)
|
||||
infoBox.showToast('提交成功!')
|
||||
popShow.value=false
|
||||
emits('save')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,38 +1,13 @@
|
||||
<template>
|
||||
<view class="control" :style="getComputedStyle()">
|
||||
<view class="u-flex control1" v-if="showControl1">
|
||||
<!-- <view class="btn" @click="changeShowControl1">批量管理</view> -->
|
||||
<view class="u-flex control1">
|
||||
<view class="btn add font-bold u-font-28 color-fff" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
|
||||
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
|
||||
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
|
||||
<view class="arrow-down" :class="{'up':categoryShow}">
|
||||
<uni-icons type="right" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="u-flex control2 u-row-between" v-else>
|
||||
<view class="u-flex btn">
|
||||
<view class="u-m-r-58">
|
||||
<label class="radio" @click="changeIsSelectAll">
|
||||
<radio class="scale7" @tap.stop="changeIsSelectAll" :color="ColorMain" value="" :checked="isSelectAll" />
|
||||
<text>全选</text>
|
||||
</label>
|
||||
</view>
|
||||
<view class="u-p-l-30 u-p-r-30 my-bg-main" @click="changeShowControl1">取消</view>
|
||||
<view class="u-p-l-60 u-p-r-60 borde-r" @click="offShelf">下架</view>
|
||||
</view>
|
||||
<view class=" u-flex u-row-center btn" @click="emitToggleCategory">
|
||||
<text class="u-m-r-10">分类至</text>
|
||||
<uni-icons type="right" size="16" color="#fff"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {$tbShopCategory} from '@/http/yskApi/goods.js'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {ColorMain} from '@/commons/color.js'
|
||||
import {
|
||||
onMounted,
|
||||
reactive,
|
||||
@@ -43,53 +18,18 @@
|
||||
type: [Number, String],
|
||||
default: 30
|
||||
},
|
||||
categoryName:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
categoryShow:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let showControl1 = ref(true)
|
||||
const emits = defineEmits(['toggleCategory','controlChange','allCheckedChange','offShelf','categoryChange'])
|
||||
|
||||
function emitToggleCategory() {
|
||||
emits('toggleCategory')
|
||||
}
|
||||
|
||||
function changeShowControl1() {
|
||||
showControl1.value = !showControl1.value
|
||||
emits('controlChange',!showControl1.value)
|
||||
}
|
||||
|
||||
let isSelectAll = ref(false)
|
||||
|
||||
function changeIsSelectAll() {
|
||||
isSelectAll.value = !isSelectAll.value
|
||||
emits('allCheckedChange',isSelectAll.value)
|
||||
}
|
||||
|
||||
function getComputedStyle() {
|
||||
return {
|
||||
bottom: props.bottom + 'rpx'
|
||||
}
|
||||
}
|
||||
//设置是否全选
|
||||
function setisSelectAll(checked){
|
||||
isSelectAll.value =checked
|
||||
}
|
||||
defineExpose({
|
||||
setisSelectAll
|
||||
})
|
||||
|
||||
//下架
|
||||
function offShelf(){
|
||||
emits('offShelf')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<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">
|
||||
<view class="up-line-1" style="width: 60%;">{{data.name}}</view>
|
||||
<view class="u-font-24" style="flex-shrink: 1;">
|
||||
<text>变动数量:</text>
|
||||
<text class="number">{{data.stockNumber-data._stockNumber}}</text>
|
||||
</view>
|
||||
@@ -48,7 +48,7 @@
|
||||
<view>{{item.name}}</view>
|
||||
<view class="u-font-24">
|
||||
<text>变动数量:</text>
|
||||
<text class="number">{{item.stockNumber-item._stockNumber}}</text>
|
||||
<text class="number">{{(item.stockNumber-item._stockNumber).toFixed(2)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
@@ -110,21 +110,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {
|
||||
returnSkuSnap,
|
||||
returnTypeEnum,
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$tbShopUnit,$getProductStockDetail
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import { reactive, ref, watch, onMounted, computed } from 'vue';
|
||||
|
||||
import { $invoicingType } from '@/commons/goodsData.js'
|
||||
import { productStockFlow } from '@/http/api/product.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
const refForm = ref(null)
|
||||
const props = defineProps({
|
||||
@@ -156,7 +145,6 @@
|
||||
]
|
||||
})
|
||||
function toRecodes(){
|
||||
console.log(props.goods.id);
|
||||
go.to('PAGES_PRODUCT_INVOICING_LIST',{
|
||||
productId:props.goods.id
|
||||
})
|
||||
@@ -185,26 +173,27 @@
|
||||
getProductStockDetail()
|
||||
}
|
||||
})
|
||||
let getTypeName = (type) => {
|
||||
let item = $invoicingType.filter(item=> item.value == type)[0]
|
||||
return item?item.text:''
|
||||
}
|
||||
async function getProductStockDetail(){
|
||||
const {content}=await $getProductStockDetail({
|
||||
page:0,
|
||||
size:2,
|
||||
productId:props.goods.id,
|
||||
column:'/api/tbProductStockDetail/stock/count',
|
||||
shopId:uni.getStorageSync('shopId'),
|
||||
createdAt:[]
|
||||
const { records }=await productStockFlow({
|
||||
page: 1,
|
||||
size: 2,
|
||||
productId: props.goods.id,
|
||||
})
|
||||
console.log(content);
|
||||
recoders.list=content.map(v=>{
|
||||
console.log(records);
|
||||
recoders.list = records.map(v=>{
|
||||
return {
|
||||
...v,
|
||||
title:v.createdAt,
|
||||
content:v.type+':'+Math.abs(v.stockNumber)
|
||||
title: v.createTime,
|
||||
content: getTypeName(v.inOutItem)+':'+Math.abs(v.inOutNumber)
|
||||
}
|
||||
})
|
||||
}
|
||||
const isSku = computed(() => {
|
||||
// return data.value.typeEnum == '多规格'
|
||||
// return data.value.type == 'sku'
|
||||
return false
|
||||
})
|
||||
watch(() => popShow.value, (newval) => {
|
||||
@@ -223,6 +212,7 @@
|
||||
refForm.value.validate().then(valid => {
|
||||
if (valid) {
|
||||
emits('save', {
|
||||
remark: form.note,
|
||||
...data.value,
|
||||
})
|
||||
} else {
|
||||
@@ -232,28 +222,7 @@
|
||||
// 处理验证错误
|
||||
});
|
||||
}
|
||||
// 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)
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
onMounted(()=>{
|
||||
// #ifndef H5
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="u-font-28 color-666" @click="changePrice">改价</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>
|
||||
@@ -90,7 +90,6 @@
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<!-- <view class="btn-default btn" @tap="xiajia">下架商品</view> -->
|
||||
<!-- <view class="btn-default btn" @tap="del">删除</view> -->
|
||||
<view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -104,7 +103,7 @@
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js';
|
||||
import { ColorMain } from '@/commons/color.js'
|
||||
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','update',
|
||||
const emits = defineEmits(['radioClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','update',
|
||||
'editStock'
|
||||
])
|
||||
const props = defineProps({
|
||||
@@ -145,7 +144,6 @@
|
||||
const max=247;
|
||||
for(let i in props.data.skuList){
|
||||
const sku=props.data.skuList[i]
|
||||
console.log(sku)
|
||||
width+=(fontSize*sku.specInfo.length+boxWith+gap)
|
||||
if(width>max){
|
||||
isOne=false
|
||||
@@ -232,10 +230,6 @@
|
||||
console.log(props.index);
|
||||
emits('radioClick', props.index)
|
||||
}
|
||||
|
||||
function changeClick() {
|
||||
emits('changeClick', props.index)
|
||||
}
|
||||
|
||||
function reportDamage () {
|
||||
emits('reportDamage', props.index)
|
||||
|
||||
Reference in New Issue
Block a user