feat:价格

This commit is contained in:
dzc committed 2025-11-11 15:50:44 +08:00
1 parent 25d4d396a7
commit 91c0927627
2 files changed
+27 -43

No files matched your search

+2 -2
View File
@@ -40,7 +40,7 @@
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="单价" prop="price">
<el-input-number :precision="2" :min="0" :step="1" v-model="form.price" placeholder="" />
<el-input-number :precision="2" :min="0" :step="0.1" v-model="form.price" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
@@ -174,7 +174,7 @@ const gethardSpuData = (id: string) => {
hardSpu
.getObj(id)
.then((res: any) => {
Object.assign(form, res.data, { price: Number(displayPrice(res.data.price, "", 0)) })
Object.assign(form, res.data, { price: displayPrice(res.data.price, "") })
})
.finally(() => {
loading.value = false
+25 -41
View File
@@ -13,39 +13,32 @@
<select-hard-spu-category v-model="state.queryForm.spuCategoryId" placeholder="请输入商品分类" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="Refresh" type="primary" class="ml10" @click="syncAll" v-auth="'hard_hardSpu_add'"> 拉取商品 </el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'hard_hardSpu_add'">
<el-button icon="Refresh" type="primary" class="ml10" @click="syncAll" v-auth="'hard_hardSpu_add'">
拉取商品 </el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
v-auth="'hard_hardSpu_add'">
新 增
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'hard_hardSpu_del'" @click="handleDelete(selectObjs)">
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'hard_hardSpu_del'"
@click="handleDelete(selectObjs)">
删除
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
:export="'hard_hardSpu_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar v-model:showSearch="showSearch" :export="'hard_hardSpu_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="name" width="120" label="商品名" />
@@ -107,34 +100,24 @@
<el-table-column label="操作" fixed="right" width="250">
<template #default="{ row }">
<div class="flex">
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardSpu_edit'" @click="formDialogRef.openDialog(row.id)">
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardSpu_edit'"
@click="formDialogRef.openDialog(row.id)">
编辑
</el-button>
<el-button
v-if="row.skuType != '0'"
icon="CircleCheck"
text
type="primary"
v-auth="'hard_hardSpu_edit'"
@click="checkProgRessRef.openDialog(row.id)"
>
<el-button v-if="row.skuType != '0'" icon="CircleCheck" text type="primary"
v-auth="'hard_hardSpu_edit'" @click="checkProgRessRef.openDialog(row.id)">
审核进度
</el-button>
<el-button
v-if="row.skuType != '0'"
icon="delete"
text
type="primary"
v-auth="'hard_hardSpu_del'"
@click="handleDelete([row.id])"
>
<el-button v-if="row.skuType != '0'" icon="delete" text type="primary"
v-auth="'hard_hardSpu_del'" @click="handleDelete([row.id])">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
@@ -194,12 +177,13 @@ const selectionChangHandle = (objs: { id: string }[]) => {
// 同步全部
const syncAll = async () => {
const spuName = state.queryForm.name
try {
await useMessageBox().confirm("是否同步全部商品")
await useMessageBox().confirm(`是否同步${spuName ? `关键字为[${spuName}]的` : "全部"}商品`)
} catch {
return
}
hardSpu.asyncAll()
hardSpu.asyncAll({ name: spuName })
}
// 删除操作