Browse Source

build:商品活动

snow 2 years ago
parent
commit
01b55391b2

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-elementUI.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-libs.js


+ 2 - 1
src/components/globalComponents/search-terrace/main.vue

@@ -96,6 +96,7 @@ export default {
             id: this.options[index].id,
             code: this.options[index].platform_code,
             label: this.options[index].platform_name,
+            platform_type:this.options[index].platform_type
           };
           this.$emit("searchChange", model);
         } else {
@@ -126,4 +127,4 @@ export default {
 </script>
 
 <style>
-</style>
+</style>

+ 73 - 0
src/components/good-online-platform-modal/columns.js

@@ -0,0 +1,73 @@
+export default [
+  { type: "selection", fixed: "left", _noset_: true },
+  {
+    prop: "skuCode",
+    label: "商品编码",
+    width: "160",
+  },
+  {
+    prop: "good_thumb_img",
+    label: "图片",
+    _slot_: "good_thumb_img", 
+    "width": "50",
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    // good_thumb_img
+    "min-width": "120",
+  },
+  {
+    prop: "plat_code",
+    label: "平台商品编号",
+    "width": "160",
+  },
+  {
+    prop: "cat_name",
+    label: "商品分类",
+    width: "120",
+  },
+
+  {
+    prop: "unit",
+    label: "单位",
+    width: "45",
+  },
+  {
+    prop: "model",
+    label: "规格",
+    _slot_: "model",
+    width: "110",
+  },
+  
+  {
+    prop: "brand_name",
+    label: "品牌",
+    "width": "100",
+  },
+  {
+    prop: "is_stock",
+    label: "库存类型",
+    _slot_: "is_stock",
+    "width": "100",
+  },
+  
+  {
+    prop: "platform_name",
+    label: "所属平台",
+    "width": "100",
+  },
+  
+  {
+    prop: "company",
+    label: "业务公司",
+    "min-width": "150",
+  },
+  {
+    prop: "purchase",
+    label: "供应商负责人",
+    fixed: "right",
+    width: "95",
+  },
+  
+]

+ 2 - 0
src/components/good-online-platform-modal/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 376 - 0
src/components/good-online-platform-modal/main.vue

@@ -0,0 +1,376 @@
+<template>
+  <el-dialog
+    :title="'选择已上线的商品'"
+    :center="true"
+    align="left"
+    top="8vh"
+    width="1040px"
+    @close="showModelThis = false"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    append-to-body
+  >
+    <el-card style="margin-top: -20px" class="modal-form-style">
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="'mini'"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+      >
+        <template #table-header="{ selection }">
+          <div style="width: 100%">
+            <el-row style="margin-top: -15px">
+              <el-col :span="24">
+                <el-col :span="4" style="width: 210px">
+                  <search-brand
+                    :value="parmValue.brandid"
+                    :disabled="false"
+                    :size="'mini'"
+                    :isDetail="false"
+                    :names="''"
+                    :placeholder="'品牌'"
+                    @searchChange="brandidsearchChange"
+                  />
+                </el-col>
+                <el-col :span="6" style="width: 370px; padding: 0 0 0 10px">
+                  <good-class
+                    :value="parmValue.cat_id"
+                    @handleChange="goods_class_change"
+                    :disabled="false"
+                    :size="searchSize"
+                    :isDetail="false"
+                    :placeholder="'分类'"
+                  />
+                </el-col>
+
+                <el-col :span="3" class="fr" style="width: 66px">
+                  <el-button
+                    :size="'mini'"
+                    type="primary"
+                    style="float: right; margin-left: 5px"
+                    @click="searchList"
+                  >
+                    刷新
+                  </el-button>
+                </el-col>
+                <el-col :span="4" class="fr" style="width: 66px">
+                  <el-button
+                    type="warning"
+                    class="fr"
+                    :size="'mini'"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                </el-col>
+              </el-col>
+              <el-col :span="24" style="padding: 10px 0 0 0">
+                <el-col :span="4" style="width: 450px">
+                  <el-input
+                    clearable
+                    :size="'mini'"
+                    v-model="sinput"
+                    :maxlength="40"
+                    placeholder="关键字"
+                    @blur="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
+                    <el-select
+                      v-model="select"
+                      style="width: 120px"
+                      slot="prepend"
+                      placeholder="关键字类型"
+                    >
+                      <el-option label="商品名称" value="1" />
+                      <el-option label="成本商品编码" value="2" />
+                      <el-option label="上线商品编码" value="4" />
+                      <el-option label="平台商品编码" value="3" />
+                    </el-select>
+                  </el-input>
+                </el-col>
+
+                <el-col :span="3" style="width: 66px; float: right">
+                  <el-button
+                    :size="'mini'"
+                    type="success"
+                    style="float: right; margin-left: 5px"
+                    @click="resultList(selection)"
+                  >
+                    保存
+                  </el-button>
+                </el-col>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #good_thumb_img="{ scope }">
+          <div
+            v-if="scope.row.good_thumb_img"
+            style="width: 20px; height: 20px"
+            class="hover"
+            v-viewer
+          >
+            <img
+              :src="scope.row.good_thumb_img"
+              style="display: inline-block; width: 100%; height: 100%"
+              alt=""
+            />
+          </div>
+        </template>
+        <template #model="{ scope }">
+          <span v-for="(si, sii) in scope.row.specinfo" :key="si.spec_id">
+            <span v-if="sii !== 0">--</span
+            ><span>{{ si.spec_name }}[{{ si.spec_value }}]</span></span
+          >
+        </template>
+        <template #is_stock="{ scope }">
+          <span>{{ scope.row.is_stock === "1" ? "库存品" : "非库存品" }} </span>
+        </template>
+      </ex-table>
+    </el-card>
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-good-online-modal";
+import asyncYZRequest from "@/apis/service/youzan/othgoodsOnline";
+import resToken from "@/mixins/resToken";
+import mixinPage from "@/mixins/elPaginationHandle";
+import { mapGetters } from "vuex";
+import columns from "./columns";
+export default {
+  name: "searchGoodOnlineModal",
+  mixins: [resToken, mixinPage],
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+  },
+  props: ["showModel", "once", "sitem", "active","platform_type"],
+
+  /**
+   * 属性集合
+   * @param {Boolean}       showModel             : 是否弹出弹窗        必填
+   * @param {Boolean}       once                  : 是否只选一条        非必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      select: "1",
+      sinput: "",
+      is_stock: [
+        { id: "0", name: "非库存品" },
+        { id: "1", name: "库存品" },
+      ],
+      selectLoading: false,
+      searchName: "",
+      supplierCode: [],
+      loading: true,
+      showModelThis: false,
+      parmValue: {
+        platform_code: "",
+        companyNo: "",
+        is_stock: "",
+        exam_status: "",
+        cat_id: [], // 商品属性code
+        brandid: [],
+        skucode: "",
+        spucode: "", // 商品编码
+        good_name: "", // 商品名称
+        plat_code: "",
+
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        // _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: columns,
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.restSearch();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+
+  methods: {
+    restSearch() {
+      console.log(this.active);
+      console.log(this.sitem);
+      const { platform_code, company_id, is_stock } = this.sitem;
+
+      this.parmValue = {
+        platform_code: platform_code || "",
+        companyNo: company_id || "", //业务企业编号
+        is_stock: is_stock || "",
+        cat_id: [], // 商品属性code
+        brandid: [],
+        exam_status: this.active ? "6" : "",
+       skucode: "",
+        spucode: "", // 商品编码
+        good_name: "", // 商品名称
+        plat_code: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+    async goods_class_change(e) {
+      this.parmValue.cat_id = e;
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async brandidsearchChange(e) {
+      const { id } = e;
+      this.parmValue.brandid = id ? [id] : [];
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async platform_codesearchChange(e) {
+      const { id, code, label } = e;
+      this.parmValue.platform_code = id ? [id] : [];
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async company_idsearchChange(e) {
+      const { id, code, label } = e;
+      this.parmValue.company_id = code || "";
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+    async searchList() {
+      this.loading = true;
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      model.cat_id =
+        model.cat_id.length > 0 ? model.cat_id[model.cat_id.length - 1] : "";
+      model.brandid =
+        model.brandid.length > 0 ? model.brandid[model.brandid.length - 1] : "";
+      model.spucode = this.select === "2" ? this.sinput : ""; // 商品编码
+      model.good_name = this.select === "1" ? this.sinput : ""; // 商品名称
+      model.plat_code = this.select === "3" ? this.sinput : "";
+      model.skucode = this.select === "4" ? this.sinput : "";
+      // model.platform_code =
+      //   model.platform_code.length > 0
+      //     ? model.platform_code[model.platform_code.length - 1]
+      //     : "";
+
+      const apis = this.platform_type === '1' ? asyncYZRequest : asyncRequest;
+
+      const res = await apis.list(model);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.tableData.map((e) => {
+          e.cat_name = "";
+          if (e.cat_info && e.cat_info.length > 0) {
+            e.cat_info.forEach((si, sii) => {
+              e.cat_name += `${sii !== 0 ? "_" : ""}${si.name}`;
+            });
+          }
+          return e;
+        });
+
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+    async remoteMethod(query) {
+      this.selectLoading = true;
+      if (query !== "") {
+        this.options = [];
+        let formValue = {
+          page: 1,
+          size: 100,
+          name: query,
+          code: "",
+        };
+
+        let res = await asyncRequest.supplierList(formValue);
+        if (res && res.code === 0 && res.data) {
+          const { list } = res.data;
+          this.options = list;
+        } else if (res && res.code >= 100 && res.code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(res.message);
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+    async resultList(selection) {
+      if (selection && selection.length > 1 && this.once) {
+        this.$message.warning("只能选择一条商品信息!");
+        return;
+      }
+      this.showModelThis = false;
+      this.$emit("resultList", selection);
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 0 - 0
src/components/good-online-platform-modal/上线后商品选择


+ 51 - 7
src/views/goodStore/active/components/baseForm.vue

@@ -138,6 +138,39 @@
                 width="170"
               />
               <el-table-column prop="good_name" label="商品名称" show-overflow-tooltip />
+
+              <el-table-column prop="is_activity" label="是否使用活动价" width="220px">
+                <template slot-scope="scope">
+                   <el-select v-if="type !== 'view'" v-model="scope.row.is_activity" placeholder="是否使用活动价">
+                      <el-option value="1" label="是" />
+                      <el-option value="0" label="否" />
+                   </el-select>
+
+                   <span v-else>{{scope.row.is_activity === '1' ? '是' : '否'}}</span>
+                 </template>
+              </el-table-column>
+
+              <el-table-column prop="settle_price" label="结算金额">
+                <template slot-scope="scope">
+                  <digital-input
+                    v-if="type !== 'view'"
+                    :values="ruleForm.settle_price"
+                    :placeholder="'结算金额'"
+                    :min="0"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :disabled="type === 'view'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="budget_total_change($event,scope)"
+                   />
+
+                   <span v-else>{{scope.row.settle_price}}</span>
+                </template>
+              </el-table-column>
+
               <el-table-column prop="activity_stock" label="活动库存" width="180">
                 <template slot-scope="scope">
                   <el-input-number
@@ -268,11 +301,12 @@
         </el-col>
       </el-row>
     </el-form>
-    <search-good-online-modal
+    <good-online-platform-modal
       :once="once"
       :sitem="ruleForm"
       :active="true"
       :show-model="showModel"
+      :platform_type="platform_type"
       @resultList="resultList"
       @cancel="showModel = false"
     />
@@ -301,7 +335,7 @@
 import asyncRequest from "@/apis/service/goodStore/active";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import searchGoodOnlineModal from "@/components/search-good-online-modal";
+import goodOnlinePlatformModal from "@/components/good-online-platform-modal";
 import showGoodDataModal from "@/components/show-good-data-modal";
 import addStock from "./addStock";
 
@@ -310,7 +344,7 @@ export default {
   mixins: [resToken],
   props: ["showModel", "id", "type", "sitem", "newTime"],
   components: {
-    searchGoodOnlineModal,
+    goodOnlinePlatformModal,
     showGoodDataModal,
     addStock,
   },
@@ -335,6 +369,7 @@ export default {
       size: "small",
       activeName: "3",
       status: "",
+      platform_type:"",
       options: [
         {
           value: "0",
@@ -453,6 +488,9 @@ export default {
     this.initForm();
   },
   methods: {
+    budget_total_change(e,scope){
+      scope.row.settle_price = e + "";
+    },
     async initForm() {
       this.loading = true;
       this.resetFormData();
@@ -512,8 +550,9 @@ export default {
     },
     platform_codesearchChange(e) {
       let old = this.ruleForm.platform_code;
-      const { id, code, label } = e;
+      const { id, code, label ,platform_type} = e;
       this.ruleForm.platform_code = id || "";
+      this.platform_type = platform_type;
       this.$refs.ruleForm.validateField("platform_code");
       let newList = this.ruleForm.platform_code;
       if (old !== newList) {
@@ -521,7 +560,6 @@ export default {
       }
     },
     resultList(e) {
-      console.log(e);
       this.showModel = false;
       let list = JSON.parse(JSON.stringify(e));
       let oldList = JSON.parse(JSON.stringify(this.ruleForm.good_list));
@@ -531,8 +569,11 @@ export default {
           let item = JSON.parse(JSON.stringify(list[ei]));
           item.activity_stock = "1";
           item.newTime = new Date().valueOf();
-          console.log(item.activity_stock);
-          this.ruleForm.good_list.push(item);
+          this.ruleForm.good_list.push({
+            ...item,
+            is_activity:'1',
+            settle_price:'0.00'
+          });
         }
       });
     },
@@ -592,6 +633,7 @@ export default {
               return;
             }
             let model = JSON.parse(JSON.stringify(this.ruleForm));
+
             const { good_list } = model;
 
             let list = JSON.parse(JSON.stringify(good_list));
@@ -601,6 +643,8 @@ export default {
               let item = {
                 skuCode: e.skuCode,
                 activity_stock: e.activity_stock,
+                is_activity:e.is_activity,
+                settle_price:e.settle_price
               };
               newList.push(item);
             });

+ 14 - 0
src/views/goodStore/activeGood/index.vue

@@ -158,6 +158,10 @@
           ></el-tag>
         </template>
 
+        <template #is_activity="{scope}">
+          {{scope.row.is_activity === '1' ? '是' : '否'}}
+        </template>
+
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((i) => i == '007')"
@@ -274,6 +278,16 @@ export default {
           prop: "moq_num",
           label: "起订量",
         },
+        {
+          prop:'is_activity',
+          label:'是否使用活动价',
+          width: "110",
+          _slot_:'is_activity'
+        },
+        {
+          prop:'settle_price',
+          label:'结算金额'
+        },
 
         // {
         //   prop: "cost_price",

Some files were not shown because too many files changed in this diff