feat: 修改按钮颜色,商品添加输入售价其他为0则回填
This commit is contained in:
parent
6bf6ee4749
commit
250317f1ca
|
|
@ -8,7 +8,7 @@
|
||||||
<template v-if="typeof item === 'string'">
|
<template v-if="typeof item === 'string'">
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<template v-if="item === 'add'">
|
<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)">
|
@click="handleToolbar(item)">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
|
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['add']);
|
const emit = defineEmits(['add']);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
|
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['add']);
|
const emit = defineEmits(['add']);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
|
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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>
|
<el-button @click="toUrl('supplier')">其他按钮</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
|
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['add']);
|
const emit = defineEmits(['add']);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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>
|
<el-button @click="toUrl('supplier')">其他按钮</el-button>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,18 @@
|
||||||
<el-table-column :label="item.label" :prop="item.value" v-for="(item, index) in props.specTableHeaders"
|
<el-table-column :label="item.label" :prop="item.value" v-for="(item, index) in props.specTableHeaders"
|
||||||
:key="index">
|
:key="index">
|
||||||
</el-table-column>
|
</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">
|
<el-table-column prop="originPrice">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>原价</span>
|
<span>原价</span>
|
||||||
|
|
@ -29,18 +41,7 @@
|
||||||
@blur="priceFormat(scope.row, 'costPrice')" controls-position="right"></el-input-number>
|
@blur="priceFormat(scope.row, 'costPrice')" controls-position="right"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column prop="memberPrice">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>会员价</span>
|
<span>会员价</span>
|
||||||
|
|
@ -145,8 +146,20 @@ function getdata() {
|
||||||
return skuList.value
|
return skuList.value
|
||||||
}
|
}
|
||||||
function priceFormat(item, key) {
|
function priceFormat(item, key) {
|
||||||
const messageheight = 48;
|
console.log(item, key, 'debug222')
|
||||||
const offset = window.innerHeight / 2 - messageheight / 2 - 100;
|
// 输入售价其他行为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(() => {
|
nextTick(() => {
|
||||||
const min = 0;
|
const min = 0;
|
||||||
const max = 100000000;
|
const max = 100000000;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue