瀏覽代碼

商品 业代价 最小议价区间 最大议价区间添加

malz 1 年之前
父節點
當前提交
1b8ae0decc

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 # 标题
-VITE_APP_TITLE=芋道管理系统
+VITE_APP_TITLE=桔医商城管理系统
 
 # 项目本地运行端口号
 VITE_PORT=80

+ 13 - 0
src/api/mall/product/spu.ts

@@ -7,6 +7,11 @@ export interface Property {
   valueName?: string // 属性值名称
 }
 
+export interface WmsItemVO {
+  id?: number // 产品id
+  number?: number // 产品数量
+}
+
 export interface Sku {
   id?: number // 商品 SKU 编号
   name?: string // 商品 SKU 名称
@@ -23,6 +28,10 @@ export interface Sku {
   firstBrokeragePrice?: number | string // 一级分销的佣金
   secondBrokeragePrice?: number | string // 二级分销的佣金
   salesCount?: number // 商品销量
+  agentPrice?: number | string // 业代价格
+  minBargain?: number | string // 最小议价区间
+  maxBargain?: number | string // 最大议价区间
+
 }
 
 export interface GiveCouponTemplate {
@@ -61,6 +70,10 @@ export interface Spu {
   createTime?: Date // 商品创建时间
   status?: number // 商品状态
   activityOrders: number[] // 活动排序
+  agentPrice?: number // 业代价格
+  minBargain?: number // 最小议价区间
+  maxBargain?: number // 最大议价区间
+  wmsItems?: WmsItemVO[] // 产品数组
 }
 
 // 获得 Spu 列表

+ 72 - 0
src/views/mall/product/spu/components/SkuList.vue

@@ -50,6 +50,39 @@
         />
       </template>
     </el-table-column>
+    <el-table-column align="center" label="业代价(元)" min-width="168">
+      <template #default="{ row }">
+        <el-input-number
+            v-model="row.agentPrice"
+            :min="0"
+            :precision="2"
+            :step="0.1"
+            class="w-100%"
+        />
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最小议价区间(元)" min-width="168">
+      <template #default="{ row }">
+        <el-input-number
+            v-model="row.minBargain"
+            :min="0"
+            :precision="2"
+            :step="0.1"
+            class="w-100%"
+        />
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最大议价区间(元)" min-width="168">
+      <template #default="{ row }">
+        <el-input-number
+            v-model="row.maxBargain"
+            :min="0"
+            :precision="2"
+            :step="0.1"
+            class="w-100%"
+        />
+      </template>
+    </el-table-column>
     <el-table-column align="center" label="成本价(元)" min-width="168">
       <template #default="{ row }">
         <el-input-number
@@ -158,6 +191,21 @@
         {{ row.marketPrice }}
       </template>
     </el-table-column>
+    <el-table-column align="center" label="业代价(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.agentPrice }}
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最小议价区间(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.minBargain }}
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最大议价区间(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.maxBargain }}
+      </template>
+    </el-table-column>
     <el-table-column align="center" label="成本价(元)" min-width="80">
       <template #default="{ row }">
         {{ row.costPrice }}
@@ -238,6 +286,21 @@
         {{ row.marketPrice }}
       </template>
     </el-table-column>
+    <el-table-column align="center" label="业代价(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.agentPrice }}
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最小议价区间(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.minBargain }}
+      </template>
+    </el-table-column>
+    <el-table-column align="center" label="最大议价区间(元)" min-width="80">
+      <template #default="{ row }">
+        {{ row.maxBargain }}
+      </template>
+    </el-table-column>
     <el-table-column align="center" label="成本价(元)" min-width="80">
       <template #default="{ row }">
         {{ row.costPrice }}
@@ -289,6 +352,9 @@ const skuList = ref<Sku[]>([
   {
     price: 0, // 商品价格
     marketPrice: 0, // 市场价
+    agentPrice: 0, // 业代价
+    minBargain: 0, // 最小议价区间
+    maxBargain: 0, // 最大议价区间
     costPrice: 0, // 成本价
     barCode: '', // 商品条码
     picUrl: '', // 图片地址
@@ -409,6 +475,9 @@ const generateTableData = (propertyList: any[]) => {
       properties: Array.isArray(item) ? item : [item], // 如果只有一个属性的话返回的是一个 property 对象
       price: 0,
       marketPrice: 0,
+      agentPrice: 0, // 业代价
+      minBargain: 0, // 最小议价区间
+      maxBargain: 0, // 最大议价区间
       costPrice: 0,
       barCode: '',
       picUrl: '',
@@ -486,6 +555,9 @@ watch(
           price: 0,
           marketPrice: 0,
           costPrice: 0,
+          agentPrice: 0, // 业代价
+          minBargain: 0, // 最小议价区间
+          maxBargain: 0, // 最大议价区间
           barCode: '',
           picUrl: '',
           stock: 0,

+ 4 - 1
src/views/mall/product/spu/form/BasicInfoForm.vue

@@ -350,7 +350,10 @@ const onChangeSpec = () => {
       weight: 0,
       volume: 0,
       firstBrokeragePrice: 0,
-      secondBrokeragePrice: 0
+      secondBrokeragePrice: 0,
+      agentPrice: 0, // 业代价格
+      minBargain: 0, // 最小议价区间
+      maxBargain: 0
     }
   ]
 }

+ 13 - 1
src/views/mall/product/spu/form/index.vue

@@ -83,7 +83,10 @@ const formData = ref<ProductSpuApi.Spu>({
       weight: 0, // 商品重量
       volume: 0, // 商品体积
       firstBrokeragePrice: 0, // 一级分销的佣金
-      secondBrokeragePrice: 0 // 二级分销的佣金
+      secondBrokeragePrice: 0, // 二级分销的佣金
+      agentPrice: 0, // 业代价格
+      minBargain: 0, // 最小议价区间
+      maxBargain: 0
     }
   ],
   description: '', // 商品详情
@@ -113,6 +116,9 @@ const getDetail = async () => {
           item.price = floatToFixed2(item.price)
           item.marketPrice = floatToFixed2(item.marketPrice)
           item.costPrice = floatToFixed2(item.costPrice)
+          item.agentPrice = floatToFixed2(item.agentPrice)
+          item.minBargain = floatToFixed2(item.minBargain)
+          item.maxBargain = floatToFixed2(item.maxBargain)
           item.firstBrokeragePrice = floatToFixed2(item.firstBrokeragePrice)
           item.secondBrokeragePrice = floatToFixed2(item.secondBrokeragePrice)
         } else {
@@ -120,6 +126,9 @@ const getDetail = async () => {
           item.price = formatToFraction(item.price)
           item.marketPrice = formatToFraction(item.marketPrice)
           item.costPrice = formatToFraction(item.costPrice)
+          item.agentPrice = formatToFraction(item.agentPrice)
+          item.minBargain = formatToFraction(item.minBargain)
+          item.maxBargain = formatToFraction(item.maxBargain)
           item.firstBrokeragePrice = formatToFraction(item.firstBrokeragePrice)
           item.secondBrokeragePrice = formatToFraction(item.secondBrokeragePrice)
         }
@@ -149,6 +158,9 @@ const submitForm = async () => {
       // sku相关价格元转分
       item.price = convertToInteger(item.price)
       item.marketPrice = convertToInteger(item.marketPrice)
+      item.agentPrice = convertToInteger(item.agentPrice)
+      item.minBargain = convertToInteger(item.minBargain)
+      item.maxBargain = convertToInteger(item.maxBargain)
       item.costPrice = convertToInteger(item.costPrice)
       item.firstBrokeragePrice = convertToInteger(item.firstBrokeragePrice)
       item.secondBrokeragePrice = convertToInteger(item.secondBrokeragePrice)