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