潘超林 месяцев назад: 6
Родитель
Сommit
6fd6f72fca

+ 34 - 0
src/api/manage/product.js

@@ -101,4 +101,38 @@ export function cancelLowPrice(query) {
         method: 'post',
         data: query
     })
+}
+
+
+export function getFreightTemplate(query) {
+    return request({
+        url: '/system/freightTemplate/getFreightTemplate',
+        method: 'get',
+        params: query
+    })
+}
+
+
+export function savaLogisticsTemplate(query) {
+    return request({
+        url: '/system/logisticsTemplate/savaLogisticsTemplate',
+        method: 'post',
+        data: query
+    })
+}
+
+export function getLogisticsTemplateInfo(query) {
+    return request({
+        url: '/system/logisticsTemplate/getTemplateByUserId',
+        method: 'post',
+        data: query
+    })
+}
+
+export function queryUserRelevanceTemplate(query) {
+    return request({
+        url: '/system/logisticsTemplate/queryUserRelevanceTemplate',
+        method: 'get',
+        params: query
+    })
 }

+ 1 - 1
src/layout/components/Navbar.vue

@@ -83,7 +83,7 @@ export default {
       this.$store.dispatch("app/toggleSideBar");
     },
     async logout() {
-      this.$confirm("确定注销并退出系统吗?", "提示", {
+      this.$confirm("确定退出系统吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",

+ 26 - 67
src/views/manage/afterSaleOrder.vue

@@ -82,30 +82,7 @@
         >
         </el-date-picker>
       </el-form-item>
-      <!-- 
-      <el-form-item label="订单状态" prop="orderStatus">
-        <el-select
-          v-model="queryParams.orderStatus"
-          placeholder="请选择订单状态"
-          style="width: 180px"
-        >
-          <el-option label="待商家确认修改运费" :value="0"> </el-option>
-          <el-option label="等待买家支付" :value="10"> </el-option>
-          <el-option label="等待商家发布货运信息" :value="20"> </el-option>
-          <el-option label="等待司机接单" :value="90"> </el-option>
-          <el-option label="等待司机支付保证金" :value="100"> </el-option>
-          <el-option label="等待司机装货" :value="110"> </el-option>
-          <el-option label="已装货,运输中" :value="120"> </el-option>
-          <el-option label="司机已到达,等待买家签收" :value="30"> </el-option>
-          <el-option label="买家已收货" :value="40"> </el-option>
-          <el-option label="已取消" :value="50"> </el-option>
-          <el-option label="退款中" :value="60"> </el-option>
-          <el-option label="退款成功" :value="70"> </el-option>
-          <el-option label="退款失败" :value="80"> </el-option>
-          <el-option label="待处理售后" :value="130"> </el-option>
-          <el-option label="已处理售后" :value="140"> </el-option>
-        </el-select>
-      </el-form-item> -->
+     
       <el-form-item label="售后状态" prop="orderStatusKey">
         <el-select
           v-model="queryParams.orderStatusKey"
@@ -115,12 +92,20 @@
           <el-option label="已完成" value="ALREADY"> </el-option>
           <el-option label="已拒绝" value="ALREADY_REFUSE"> </el-option>
           <el-option label="待审核" value="WAIT_AUDIT"> </el-option>
-          <!-- <el-option label="审核成功(退款中)" value="3"> </el-option>
-          <el-option label="退款成功" value="4"> </el-option>
-          <el-option label="退款失败(联系客服解决)" value="5"> </el-option> -->
+       
         </el-select>
       </el-form-item>
-
+      <!-- <el-form-item label="配送方式" prop="deliveryType ">
+        <el-select
+          v-model="queryParams.deliveryType "
+          placeholder="请选择支付方式"
+          style="width: 180px"
+        >
+          <el-option label="自提" value="0"> </el-option>
+          <el-option label="同城下单" value="1"> </el-option>
+          <el-option label="异地下单" value="2"> </el-option>
+        </el-select>
+      </el-form-item> -->
       <el-form-item label="支付方式" prop="paymentType">
         <el-select
           v-model="queryParams.paymentType"
@@ -213,45 +198,19 @@
         :show-overflow-tooltip="true"
       >
       </el-table-column>
-
-      <!-- <el-table-column label="运费(元)" align="center" prop="freightFee" /> -->
-      <!-- <el-table-column label="订单状态" align="center">
-        <template slot-scope="scope">
-          {{
-            scope.row.orderStatus == 0
-              ? "待商家确认修改运费"
-              : scope.row.orderStatus == 10
-              ? "等待买家支付"
-              : scope.row.orderStatus == 20
-              ? "等待商家发布货运信息"
-              : scope.row.orderStatus == 90
-              ? "等待司机接单"
-              : scope.row.orderStatus == 100
-              ? "等待司机支付保证金"
-              : scope.row.orderStatus == 110
-              ? "等待司机装货"
-              : scope.row.orderStatus == 120
-              ? "已装货,运输中"
-              : scope.row.orderStatus == 30
-              ? "司机已到达,等待买家签收"
-              : scope.row.orderStatus == 40
-              ? "买家已收货"
-              : scope.row.orderStatus == 50
-              ? "已取消"
-              : scope.row.orderStatus == 60
-              ? "退款中"
-              : scope.row.orderStatus == 70
-              ? "退款成功"
-              : scope.row.orderStatus == 80
-              ? "退款失败"
-              : scope.row.orderStatus == 130
-              ? "待处理售后"
-              : scope.row.orderStatus == 140
-              ? "已处理售后"
-              : ""
-          }}
-        </template>
-      </el-table-column> -->
+      <!-- <el-table-column label="配送方式" align="center" prop="paymentType" width="150">
+            <template slot-scope="scope">
+              {{
+                scope.row.deliveryType == "0"
+                  ? "自提"
+                  : scope.row.deliveryType == "1"
+                  ? "同城下单"
+                  : scope.row.deliveryType == "2"
+                  ? "异地下单"
+                  : ""
+              }}
+            </template>
+          </el-table-column> -->
       <el-table-column label="支付方式" align="center">
         <template slot-scope="scope">
           {{

+ 32 - 18
src/views/manage/order.vue

@@ -178,21 +178,6 @@
           <el-option label="已取消/申请售后" value="CANCEL"> </el-option>
           <el-option label="待发布货运信息" value="WAIT_PUBLISH_INVOICE"> </el-option>
           <el-option label="等待司机接单" value="WAIT_DRIVER_ERCEIVE"> </el-option>
-          <!-- <el-option label="待商家确认修改运费" :value="0"> </el-option>
-          <el-option label="等待买家支付" :value="10"> </el-option>
-          <el-option label="等待商家发布货运信息" :value="20"> </el-option>
-          <el-option label="等待司机接单" :value="90"> </el-option>
-          <el-option label="等待司机支付保证金" :value="100"> </el-option>
-          <el-option label="等待司机装货" :value="110"> </el-option>
-          <el-option label="已装货,运输中" :value="120"> </el-option>
-          <el-option label="司机已到达,等待买家签收" :value="30"> </el-option>
-          <el-option label="买家已收货" :value="40"> </el-option>
-          <el-option label="已取消" :value="50"> </el-option>
-          <el-option label="退款中" :value="60"> </el-option>
-          <el-option label="退款成功" :value="70"> </el-option>
-          <el-option label="退款失败" :value="80"> </el-option>
-          <el-option label="待处理售后" :value="130"> </el-option>
-          <el-option label="已处理售后" :value="140"> </el-option> -->
         </el-select>
       </el-form-item>
       <el-form-item label="售后状态" prop="afterSaleStatus">
@@ -220,6 +205,17 @@
           <el-option label="微信支付" value="wechat"> </el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="配送方式" prop="deliveryType ">
+        <el-select
+          v-model="queryParams.deliveryType "
+          placeholder="请选择支付方式"
+          style="width: 180px"
+        >
+          <el-option label="自提" value="0"> </el-option>
+          <el-option label="同城下单" value="1"> </el-option>
+          <el-option label="异地下单" value="2"> </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
           >搜索</el-button
@@ -299,7 +295,12 @@
 
       <el-table-column label="规格名称" align="center" prop="specsName" />
       <el-table-column label="规格值" align="center" prop="specsValue" />
-      <el-table-column label="实付金额(元)" align="center" prop="paymentAmount">
+      <el-table-column
+        label="实付金额(元)"
+        align="center"
+        prop="paymentAmount"
+        width="150"
+      >
         <template slot-scope="scope">
           {{ scope.row.paymentAmount.toFixed(2) }}元
         </template>
@@ -318,7 +319,7 @@
           <el-avatar :size="40" :src="scope.row.userHeadUrl"></el-avatar>
         </template>
       </el-table-column>
-      <el-table-column label="买家手机号" align="center" prop="userPhone" />
+      <el-table-column label="买家手机号" align="center" prop="userPhone"  width="120"/>
 
       <el-table-column
         label="商品名称"
@@ -329,7 +330,20 @@
       >
       </el-table-column>
 
-      <el-table-column label="运费(元)" align="center" prop="freightFee" />
+      <!-- <el-table-column label="运费(元)" align="center" prop="freightFee" /> -->
+      <el-table-column label="配送方式" align="center" prop="paymentType" width="150">
+            <template slot-scope="scope">
+              {{
+                scope.row.deliveryType == "0"
+                  ? "自提"
+                  : scope.row.deliveryType == "1"
+                  ? "同城下单"
+                  : scope.row.deliveryType == "2"
+                  ? "异地下单"
+                  : ""
+              }}
+            </template>
+          </el-table-column>
       <el-table-column label="订单状态" align="center">
         <template slot-scope="scope">
           {{

+ 19 - 47
src/views/product/createProduct.vue

@@ -6,7 +6,11 @@
           <el-descriptions title="基本信息" column="1"> </el-descriptions>
           <basicInfo @updateValue="updateValue" ref="basicRefs"></basicInfo>
           <el-descriptions title="销售信息" column="1"> </el-descriptions>
-          <salesInfo @updateValue="updateValue" ref="salesRefs"></salesInfo>
+          <salesInfo
+            @updateValue="updateValue"
+            ref="salesRefs"
+            :saleType="form.saleType"
+          ></salesInfo>
           <el-descriptions title="商品详情" column="1"> </el-descriptions>
           <productInfo @updateValue="updateValue" ref="productRefs"></productInfo>
 
@@ -223,7 +227,7 @@
 
 <script>
 import { publishGoods } from "@/api/publish/index";
-import { saveGoodsDraft } from "@/api/manage/product";
+import { saveGoodsDraft, queryUserRelevanceTemplate } from "@/api/manage/product";
 import basicInfo from "./module/basic-info.vue";
 import productInfo from "./module/product-info.vue";
 import salesInfo from "./module/sales-info.vue";
@@ -266,6 +270,16 @@ export default {
         });
     },
     async submitForm() {
+      queryUserRelevanceTemplate().then((res) => {
+        if (res.code == 200) {
+          if (!res.data) {
+            this.$message.success(
+              "您未设置同城运费规则,请先暂存草稿箱,待设置同城运费规则后再次进行发布!"
+            );
+            return false;
+          }
+        }
+      });
       let basic = await this.$refs.basicRefs.formvalidate();
       if (basic) {
         let sales = await this.$refs.salesRefs.formvalidate();
@@ -284,50 +298,6 @@ export default {
         this.$message.error(`商品规格不能为空`);
         return;
       }
-      // console.log(this.form);
-      // if (this.form.scope === "") {
-      //   this.$message.error(`经营区域不能为空!`);
-      //   return;
-      // } else if (this.form.saleType === "") {
-      //   this.$message.error(`销售方式不能为空`);
-      //   return;
-      // } else if (this.form.saleType === "") {
-      //   this.$message.error(`销售方式不能为空`);
-      //   return;
-      // } else if (this.form.categoryId === "") {
-      //   this.$message.error(`商品分类不能为空`);
-      //   return;
-      // } else if (this.form.pic === "") {
-      //   this.$message.error(`商品封面图不能为空`);
-      //   return;
-      // } else if (this.form.unit === "") {
-      //   this.$message.error(`商品封面图不能为空`);
-      //   return;
-      // } else
-      // else if (this.form.packing === "") {
-      //   this.$message.error(`包装方式不能为空`);
-      //   return;
-      // } else if (this.form.shippingTimeDesc === "") {
-      //   this.$message.error(`发货时间不能为空`);
-      //   return;
-      // } else if (this.form.freeShipping === "") {
-      //   this.$message.error(`运费不能为空`);
-      //   return;
-      // } else if (this.form.shippingAddr === "") {
-      //   this.$message.error(`发货地址不能为空`);
-      //   return;
-      // } else if (this.form.spuDesc === "") {
-      //   this.$message.error(`商品介绍不能为空`);
-      //   return;
-      // } else if (this.form.saleModel === "2") {
-      //   if (this.form.presaleStartTime === "" || this.form.presaleEndTime === "") {
-      //     this.$message.error(`预售时间不能为空`);
-      //     return;
-      //   }
-      // } else if (this.form.skuList.length< 1) {
-      //     this.$message.error(`请输入规格`);
-      //     return;
-      // }
 
       if (this.form.bannerList?.length > 0) {
         this.form.bannerList.shift();
@@ -345,8 +315,10 @@ export default {
       });
     },
     updateValue(val) {
-      console.log(val);
+      console.log("skuList", val);
       this.form = { ...this.form, ...val };
+      console.log("this.form", this.form);
+
       this.headerImg = [];
       if (val.vid || this.form.vid) {
         this.headerImg.push({

+ 36 - 9
src/views/product/list/allProduct.vue

@@ -6,7 +6,7 @@
       size="small"
       :inline="true"
       v-show="showSearch"
-      label-width="80px"
+      label-width="140px"
     >
       <el-form-item label="商品名称" prop="spuName">
         <el-input
@@ -22,18 +22,42 @@
           v-model="queryParams.categoryId"
           ref="formCascader"
           placeholder="请选择分类"
-          :props="categoryprops"
+          :props="categoryprops"   style="width: 240px"
           @change="cascaderChange"
         />
       </el-form-item>
 
       <el-form-item label="商品状态" prop="spuStatus">
-        <el-select v-model="queryParams.spuStatus" placeholder="请选择商品状态">
+        <el-select v-model="queryParams.spuStatus" placeholder="请选择商品状态"    style="width: 240px">
+          <el-option label="全部" value=""> </el-option>
           <el-option label="售罄" value="2"> </el-option>
           <el-option label="上架" value="0"> </el-option>
           <el-option label="下架" value="1"> </el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="销售方式" prop="saleType">
+        <el-select v-model="queryParams.saleType" placeholder="请选择销售方式"    style="width: 240px">
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="整车" value="0" v-if="shopInfo.scope==0"> </el-option>
+          <el-option label="拼车" value="2" v-if="shopInfo.scope==0"> </el-option>
+          <el-option label="礼包商品" value="4" v-if="shopInfo.scope==1"> </el-option>
+          <el-option label="普通商品" value="0" v-if="shopInfo.scope==1"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="关联活动商品" prop="promotionTitle">
+        <el-select v-model="queryParams.promotionTitle" placeholder="请选择关联活动商品"    style="width: 240px">
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="年货节" value="年货节"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="是否为特价商品" prop="scope">
+        <el-select v-model="queryParams.scope" placeholder="请选择关联活动商品"    style="width: 240px">
+          <el-option label="全部" value=""> </el-option>
+          <el-option label="是" value="1"> </el-option>
+          <el-option label="否" value="0"> </el-option>
+          
+        </el-select>
+      </el-form-item>
 
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
@@ -70,9 +94,7 @@
             更多批量操作<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item style="color: red" @click.native="BatchRemove"
-              >批量删除</el-dropdown-item
-            >
+            <el-dropdown-item @click.native="BatchRemove">批量删除</el-dropdown-item>
             <el-dropdown-item @click.native="handleEvents">批量加入活动</el-dropdown-item>
             <el-dropdown-item @click.native="handleExport">批量导出</el-dropdown-item>
             <el-dropdown-item @click.native="handleDelist">批量下架</el-dropdown-item>
@@ -143,6 +165,9 @@
           }}
         </template>
       </el-table-column>
+      <el-table-column label="关联活动" align="center" prop="promotionTitle">
+      </el-table-column>
+
       <el-table-column label="发布状态" align="center">
         <template slot-scope="scope">
           {{
@@ -424,9 +449,11 @@ export default {
       queryParams: {
         pageNo: 1,
         pageSize: 10,
+        spuName: "",
         categoryId: "",
         spuStatus: "",
-        spuName: "",
+        saleType: "",
+        scope: "",
       },
       // 表单参数
       form: {},
@@ -499,9 +526,9 @@ export default {
         if (res.code == 200) {
           let params = res.data;
           this.speList = params;
-          
+
           this.speList.skuList.forEach((e) => {
-            e.skuPriceList[0].price=undefined
+            e.skuPriceList[0].price = undefined;
             if (!e.limitationDto) {
               e.limitationDto = {
                 dayCount: undefined,

+ 201 - 0
src/views/product/material.vue

@@ -0,0 +1,201 @@
+<template>
+  <div class="app-container">
+    <div>
+      <h4>设置同城运费</h4>
+      <el-form
+        :model="queryParams"
+        ref="queryForm"
+        size="small"
+        :inline="true"
+        label-width="120px"
+      >
+        <el-form-item label="小于商品金额:" prop="spuName">
+          <el-input
+            v-model="queryParams.referencePrice"
+            placeholder="请输入"
+            clearable
+            style="width: 180px"
+          >
+            <span slot="suffix">元</span>
+          </el-input>
+          ,运费
+          <el-input
+            v-model="queryParams.freight"
+            placeholder="请输入"
+            clearable
+            style="width: 180px"
+          >
+            <span slot="suffix">元</span>
+          </el-input>
+          <br />
+          <div style="margin-top: 10px">
+            <span>当用户商品金额大于所设置金额时,则包邮</span>
+          </div>
+        </el-form-item>
+      </el-form>
+      <el-row>
+        <el-col style="text-align: center">
+          <el-button size="mini" type="primary" @click="submitFree"
+            >保存</el-button
+          ></el-col
+        >
+      </el-row>
+    </div>
+    <div style="height: 20px; background: #f4f4f4; margin-top: 20px"></div>
+    <div>
+      <h4>异地运费</h4>
+      <el-row>
+        <el-col
+          :span="24"
+          v-for="(item, index) in tableData"
+          :key="index"
+          style="margin-bottom: 20px"
+        >
+          <div
+            style="
+              padding: 10px 10px;
+              background: #0ea0df2e;
+              display: flex;
+              flex-direction: row;
+              justify-content: space-between;
+              align-items: center;
+            "
+          >
+            <span style="font-size: 14px"> 发货地:{{ item.sendCityName }}</span>
+          </div>
+          <el-table :data="item.detailList" style="width: 100%" border>
+            <el-table-column prop="receiveCityJson" label="送达地区" width="800">
+              <template slot-scope="scope">
+                <span v-if="scope.row.isDefault == 0">
+                  {{ scope.row.receiveCityJson }}
+                </span>
+                <span
+                  v-else
+                  v-for="(item, index) in scope.row.receiveCityJson
+                    ? JSON.parse(scope.row.receiveCityJson)
+                    : []"
+                  :key="index"
+                >
+                  <div>
+                    {{ item.provinceName }}
+                    (<span v-for="(item, index) in item.cityList" :key="index">
+                      {{ item.cityName }}
+                    </span>
+                    )
+                  </div>
+                </span>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" width="180">
+              <template slot="header" slot-scope="scope">
+                <div>首重价格(元)</div>
+                <div>1kg</div>
+              </template>
+              <template slot-scope="scope">
+                {{ scope.row.firstWeightPrice }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center">
+              <template slot="header" slot-scope="scope">
+                <div>续重价格①(元/kg)</div>
+                {{ item.secondStartWeight }}-{{ item.secondEndWeight }}kg
+              </template>
+              <template slot-scope="scope">
+                {{ scope.row.secondWeightPrice }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center">
+              <template slot="header" slot-scope="scope">
+                <div>续重价格②(元/kg)</div>
+                <div>{{ item.secondEndWeight }}kg以上</div>
+              </template>
+              <template slot-scope="scope">
+                {{ scope.row.lastWeightPrice }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+      <el-row v-if="tableData.length < 1">
+        <el-col :sm="24" :lg="24">
+          <el-result icon="info" title="信息提示" subTitle="暂无异地运费规则">
+          </el-result>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getFreightTemplate,
+  savaLogisticsTemplate,
+  getLogisticsTemplateInfo,
+} from "@/api/manage/product";
+import { getStoreInfo } from "@/api/common/index";
+export default {
+  data() {
+    return {
+      queryParams: {
+        shopId: "",
+        freight: "",
+        referencePrice: "",
+      },
+      tableData: [],
+      shopInfo: {},
+    };
+  },
+  created() {
+    this.getInfo();
+  },
+  mounted() {
+    this.getFree();
+  },
+  methods: {
+    getFree() {
+      getLogisticsTemplateInfo(this.queryParams).then((res) => {
+        if (res.code == 200) {
+            this.queryParams=res.data
+        //   this.queryParams.freight = res.data[0].freight;
+        //   this.queryParams.referencePrice = res.data[0].referencePrice;
+        }
+      });
+    },
+    submitFree() {
+      this.queryParams.shopId = this.shopInfo.id;
+      savaLogisticsTemplate(this.queryParams).then((res) => {
+        if (res.code == 200) {
+          this.$message.success("保存成功");
+          this.getFree();
+        }
+      });
+    },
+    getInfo() {
+      getStoreInfo().then((res) => {
+        if (res.code == 200) {
+          this.shopInfo = res.data;
+          this.getFreightTemplate();
+        }
+      });
+    },
+    getFreightTemplate() {
+      let cityCode = JSON.parse(this.shopInfo.storeCityCode);
+      getFreightTemplate({ sendCityCode: cityCode[1], pageNo: 1, pageSize: 999 }).then(
+        (res) => {
+          if (res.code == 200) {
+            res.data.records.forEach((e) => {
+              e.detailList.forEach((a, index) => {
+                e.secondStartWeight = a.secondStartWeight;
+                e.secondEndWeight = a.secondEndWeight;
+              });
+            });
+            this.tableData = res.data.records;
+          }
+        }
+      );
+    },
+  },
+};
+</script>
+
+<style></style>

+ 26 - 19
src/views/product/module/basic-info.vue

@@ -31,9 +31,7 @@
               }}</el-radio
             >
             <el-radio :label="2" :value="2" v-if="shopInfo.scope == 0">拼车</el-radio>
-            <!-- <el-radio :label="3">预售</el-radio> -->
             <el-radio :label="4" :value="4" v-if="shopInfo.scope == 1">礼包</el-radio>
-            <!-- <el-radio :label="1" :value="1" v-if="shopInfo.scope == 1">一键代发</el-radio> -->
           </el-radio-group>
         </el-form-item>
       </el-col>
@@ -143,7 +141,7 @@
         <el-form-item prop="bannerList">
           <span slot="label">商品图</span>
           <span class="tips"
-            >图片要求:大小3M内,至多可上传10张,第一张图默认为商品封面图</span
+            >图片要求:大小3M内,至多可上传11张,第一张图默认为商品封面图</span
           >
           <div style="display: flex; flex-direction: row; align-items: center">
             <draggable
@@ -198,7 +196,7 @@ export default {
       form: {
         carpoolSuccessTime: "",
         scope: "",
-        saleType: undefined,
+        saleType: 0,
         saleModel: undefined,
         categoryId: "",
         title: "",
@@ -226,7 +224,7 @@ export default {
         categoryId: [{ required: true, message: "分类不能为空", trigger: "blur" }],
         title: [{ required: true, message: "商品名称不能为空", trigger: "blur" }],
         giftDesc: [{ required: true, message: "礼包描述不能为空", trigger: "blur" }],
-        bannerList: [{ required: true, message: "商品图不能为空", trigger: "blur" }],
+        bannerList: [{ required: true, message: "商品图最低上传两张图片", trigger: "blur" }],
         carpoolSuccessTime: [
           { required: true, message: "拼车成功时间不能为空", trigger: "blur" },
         ],
@@ -235,6 +233,7 @@ export default {
       shopInfo: {},
       datePicker: [],
       categoryName: "",
+      radio: "",
     };
   },
   watch: {
@@ -288,13 +287,22 @@ export default {
     },
 
     formvalidate() {
+      console.log(this.bannerList);
+
       let that = this;
       return new Promise((resolve) => {
-        that.$refs.queryForm.validate((valid) => {
-          console.log(valid);
+        that.$refs.queryForm.validate((valid, row) => {
           if (valid) {
             resolve(valid);
           } else {
+            for (const key in row) {
+              for (let index = 0; index < row[key].length; index++) {
+                
+                this.$message.error(row[key][index].message);
+                return;
+              }
+    
+            }
             resolve(valid);
           }
         });
@@ -315,6 +323,10 @@ export default {
         if (res.code == 200) {
           this.shopInfo = res.data;
           this.form.scope = res.data.scope;
+          if (res.data.scope == 1) {
+            this.form.saleType = 0;
+            this.form.saleModel = 1;
+          }
         }
       });
     },
@@ -324,20 +336,15 @@ export default {
 
     passValue() {
       this.form.bannerList = [];
-
-      for (let index = 0; index < this.bannerList.length; index++) {
-        this.form.bannerList.push({
-          fileUrl: this.bannerList[index].url,
-          sort: this.bannerList[index].name,
-        });
-      }
-      if (this.bannerList.length > 1) {
+      if (this.bannerList?.length > 1) {
+        for (let index = 0; index < this.bannerList.length; index++) {
+          this.form.bannerList.push({
+            fileUrl: this.bannerList[index].url,
+            sort: this.bannerList[index].name,
+          });
+        }
         this.form.pic = this.bannerList[0].url;
       }
-      if (this.form.scope == 1) {
-        this.form.saleType = 0;
-        this.form.saleModel = 1;
-      }
 
       this.$emit("updateValue", this.form);
     },

+ 6 - 0
src/views/product/module/product-info.vue

@@ -133,6 +133,12 @@ export default {
           if (valid) {
             resolve(valid);
           } else {
+            for (const key in row) {
+              for (let index = 0; index < row[key].length; index++) {
+                this.$message.error(row[key][index].message);
+                return;
+              }
+            }
             resolve(valid);
           }
         });

+ 78 - 16
src/views/product/module/sales-info.vue

@@ -135,7 +135,6 @@
                 </el-input-number>
               </template>
             </el-table-column>
-            <!-- <el-table-column prop="name" label="原价" width="180"> </el-table-column> -->
             <el-table-column prop="address" label="商品单价" width="80">
               <template slot-scope="scope">
                 {{ computePrice(scope.row) }}元/{{ form.unit }}
@@ -222,12 +221,13 @@
                 </el-input-number>
               </template>
             </el-table-column>
-            <el-table-column label="批发价" width="160">
+
+            <el-table-column label="原价" width="160" v-if="saleType == 4">
               <template slot-scope="scope">
                 <el-input-number
                   :controls="false"
                   v-model="scope.row.skuPriceList[0].originalPrice"
-                  placeholder="收购价"
+                  placeholder="价"
                   clearable
                   @input="passValue"
                 >
@@ -235,17 +235,52 @@
                 </el-input-number>
               </template>
             </el-table-column>
-            <el-table-column prop="address" label="商品单价" width="80">
+            <el-table-column label="现价" width="160" v-if="saleType == 4">
+              <template slot-scope="scope">
+                <el-input-number
+                  :controls="false"
+                  v-model="scope.row.skuPriceList[0].price"
+                  placeholder="现价"
+                  clearable
+                  @input="passValue"
+                >
+                  <template slot="suffix"> {{ form.unit }}/元 </template>
+                </el-input-number>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="批发价" width="160" v-if="saleType != 4">
+              <template slot-scope="scope">
+                <el-input-number
+                  :controls="false"
+                  v-model="scope.row.skuPriceList[0].originalPrice"
+                  placeholder="批发价"
+                  clearable
+                  @input="passValue"
+                >
+                  <template slot="suffix"> {{ form.unit }}/元 </template>
+                </el-input-number>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="address"
+              label="商品单价"
+              width="80"
+              v-if="saleType == 4"
+            >
+              <template slot-scope="scope">
+                {{ compilatePrice(scope.row.skuPriceList[0]) }}
+                元/{{ form.unit }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="address" label="商品单价" width="80" v-else>
               <template slot-scope="scope">
                 {{
-                  scope.row.skuPriceList[0].originalPrice
-                    ? scope.row.skuPriceList[0].originalPrice
-                    : 0
+                  scope.row.skuPriceList[0].price ? scope.row.skuPriceList[0].price : 0
                 }}
                 元/{{ form.unit }}
               </template>
             </el-table-column>
-
             <el-table-column label="净重量" width="160">
               <template slot-scope="scope">
                 <el-input-number
@@ -411,7 +446,7 @@ import { getStoreInfo } from "@/api/common/index";
 import Amap from "@/components/Map/map.vue";
 import { getDict } from "@/api/common/index.js";
 export default {
-  props: ["data"],
+  props: ["data", "saleType"],
   components: { Amap },
   data() {
     return {
@@ -449,6 +484,7 @@ export default {
         ],
       },
       shopInfo: {},
+      saleType: undefined,
     };
   },
   mounted() {
@@ -488,8 +524,23 @@ export default {
       deep: true, //深度监听
       immediate: true,
     },
+    saleType: {
+      handler(newVal, oldVal) {
+        console.log("123123", newVal);
+        this.saleType = newVal;
+      },
+    },
   },
   methods: {
+    compilatePrice(data) {
+      if (data.price) {
+        return data.price;
+      } else if (data.originalPrice) {
+        return data.originalPrice;
+      } else if (data.originalPrice && data.price) {
+        return data.price;
+      }
+    },
     formvalidate() {
       let that = this;
       return new Promise((resolve) => {
@@ -498,6 +549,12 @@ export default {
           if (valid) {
             resolve(valid);
           } else {
+            for (const key in row) {
+              for (let index = 0; index < row[key].length; index++) {
+                this.$message.error(row[key][index].message);
+                return;
+              }
+            }
             resolve(valid);
           }
         });
@@ -539,9 +596,12 @@ export default {
         } else {
           return 0;
         }
+      } else {
+        console.log("1231231", data);
       }
     },
-    passValue() {
+   
+    passValue(val) {
       if (this.shopInfo.scope == 0) {
         this.form.skuList.forEach((e) => {
           e.skuPriceList.forEach((a) => {
@@ -550,12 +610,15 @@ export default {
             a.lowestPrice = this.computePrice(e);
           });
         });
-      } else {
-        this.form.skuList.forEach((e) => {
-          e.skuPriceList.forEach((a) => {
-            a.price = a.originalPrice;
+      } 
+      else {
+        if (this.saleType != 4) {
+          this.form.skuList.forEach((e) => {
+            e.skuPriceList.forEach((a) => {
+              a.price = a.originalPrice;
+            });
           });
-        });
+        }
       }
       this.$emit("updateValue", this.form);
     },
@@ -571,7 +634,6 @@ export default {
         this.form.shippingAddrBean.longitude = data.location.lng;
       }
       this.form.shippingAddrBean.provinceCode = data.pcode;
-      this.form.skuList = [];
       this.addr = data.address;
       this.$refs.mapOpen.closeMap();
       this.passValue();