feat: 修改按钮颜色,商品添加输入售价其他为0则回填

This commit is contained in:
duan 2025-03-03 15:09:26 +08:00
parent 6bf6ee4749
commit 250317f1ca
8 changed files with 34 additions and 21 deletions

View File

@ -8,7 +8,7 @@
<template v-if="typeof item === 'string'">
<!-- 新增 -->
<template v-if="item === 'add'">
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="success" icon="plus"
<el-button v-hasPerm="[`${contentConfig.pageName}:${item}`]" type="primary" icon="plus"
@click="handleToolbar(item)">
新增
</el-button>

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
</template>
<script setup>
const emit = defineEmits(['add']);

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
</template>
<script setup>
const emit = defineEmits(['add']);

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
</template>
<script setup>
import { useRouter } from 'vue-router';

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
<el-button @click="toUrl('supplier')">其他按钮</el-button>
</template>
<script setup>

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
</template>
<script setup>
const emit = defineEmits(['add']);

View File

@ -1,5 +1,5 @@
<template>
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
<el-button @click="toUrl('supplier')">其他按钮</el-button>
</template>
<script setup>

View File

@ -5,6 +5,18 @@
<el-table-column :label="item.label" :prop="item.value" v-for="(item, index) in props.specTableHeaders"
:key="index">
</el-table-column>
<el-table-column prop="salePrice">
<template #header>
<span>售价</span>
<el-icon style="margin-left: 10px;" color="#409EFC" class="no-inherit" @click="batchNumber('salePrice')">
<EditPen />
</el-icon>
</template>
<template v-slot="scope">
<el-input-number size="default" v-model="scope.row.salePrice" @change="priceFormat(scope.row, 'salePrice')"
@blur="priceFormat(scope.row, 'salePrice')" controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="originPrice">
<template #header>
<span>原价</span>
@ -29,18 +41,7 @@
@blur="priceFormat(scope.row, 'costPrice')" controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="salePrice">
<template #header>
<span>售价</span>
<el-icon style="margin-left: 10px;" color="#409EFC" class="no-inherit" @click="batchNumber('salePrice')">
<EditPen />
</el-icon>
</template>
<template v-slot="scope">
<el-input-number size="default" v-model="scope.row.salePrice" @change="priceFormat(scope.row, 'salePrice')"
@blur="priceFormat(scope.row, 'salePrice')" controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="memberPrice">
<template #header>
<span>会员价</span>
@ -145,8 +146,20 @@ function getdata() {
return skuList.value
}
function priceFormat(item, key) {
const messageheight = 48;
const offset = window.innerHeight / 2 - messageheight / 2 - 100;
console.log(item, key, 'debug222')
// 0
// originPrice
if (key == 'salePrice' && item.originPrice == 0) {
item.originPrice = item.salePrice;
}
// memberPrice
if (key == 'salePrice' && item.memberPrice == 0) {
item.memberPrice = item.costPrice;
}
// costPrice
if (key == 'salePrice' && item.costPrice == 0) {
item.costPrice = item.originPrice;
}
nextTick(() => {
const min = 0;
const max = 100000000;