戴艳蓉 3 anos atrás
pai
commit
f24ac2f93e

+ 63 - 18
src/views/goodStore/active/index.vue

@@ -24,20 +24,16 @@
       <template #table-header="{}">
         <div style="width: 100%">
           <el-row style="padding: 0 0 10px 80px">
-            <el-col :span="6" style="width: 303px">
-              <period-date-picker
-                :type="1"
-                :width="'135px'"
-                :size="searchSize"
-                :start="parmValue.starttime"
-                :end="parmValue.endtime"
-                @timeReturned="handleTime"
-              />
-            </el-col>
-            <el-col :span="6" style="width: 250px; padding: 0 0 0 10px">
-              所属平台 platform_code</el-col
-            >
-            <el-col :span="4" style="width: 160px">
+            <el-col :span="6" style="width: 240px">
+              <search-terrace
+                :value="parmValue.platform_code"
+                :disabled="false"
+                :size="'mini'"
+                :isDetail="false"
+                :placeholder="'所属平台'"
+                @searchChange="platform_codesearchChange"
+            /></el-col>
+            <el-col :span="4" style="width: 205px; padding: 0 0 0 10px">
               <el-select
                 v-model="parmValue.status"
                 filterable
@@ -59,6 +55,16 @@
                 />
               </el-select>
             </el-col>
+            <el-col :span="6" style="width: 303px; padding: 0 0 0 10px">
+              <period-date-picker
+                :type="1"
+                :width="'135px'"
+                :size="searchSize"
+                :start="parmValue.starttime"
+                :end="parmValue.endtime"
+                @timeReturned="handleTime"
+              />
+            </el-col>
 
             <el-col
               :span="3"
@@ -80,17 +86,37 @@
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="4" style="width: 373px">
+            <el-col :span="4" style="width: 320px">
+              <search-work-company
+                :value="parmValue.company_id"
+                :placeholder="'业务公司'"
+                :disabled="false"
+                :size="searchSize"
+                :isDetail="false"
+                @searchChange="company_idsearchChange"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 373px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
-                v-model="parmValue.goodStore_name"
+                v-model="sinput"
                 :maxlength="40"
                 @blur="
                   pageInfo.curr = 1;
                   parmValue.page = 1;
                   searchList();
                 "
-                placeholder="活动名称"
+                placeholder="关键字"
+              >
+                <el-select
+                  v-model="select"
+                  slot="prepend"
+                  style="width: 120px"
+                  placeholder="关键字类型"
+                >
+                  <el-option label="活动名称" value="1" />
+                  <el-option label="活动编码" value="2" />
+                  <el-option label="创建人" value="3" /> </el-select
               ></el-input>
             </el-col>
             <el-col :span="6" style="width: 250px; padding: 0 0 0 10px">
@@ -263,6 +289,7 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
         starttime: "",
+        platform_code: [],
         endtime: "",
         status: "",
         creater: "",
@@ -338,10 +365,26 @@ export default {
         starttime: "",
         endtime: "",
         status: "",
+        platform_code: [],
         creater: "",
       };
       this.searchList();
     },
+    platform_codesearchChange(e) {
+      if (e) {
+        const { id, code, label } = e;
+        this.parmValue.platform_code = id ? [id] : [];
+      }
+    },
+
+    company_idsearchChange(e) {
+      console.log(e);
+      let old = this.parmValue.company_id;
+      if (e) {
+        const { id, code, label } = e;
+        this.parmValue.company_id = code || "";
+      }
+    },
     // 新建/编辑/详情
     openModal(row, type) {
       this.sitem = row;
@@ -427,7 +470,9 @@ export default {
     // 刷新表格
     async searchList() {
       this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
+      let model = JSON.parse(JSON.stringify(this.parmValue));
+      model.platform_code = model.platform_code.toString();
+      const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 170 - 0
src/views/goodStore/goodsOnline/components/handle-online-form.vue

@@ -0,0 +1,170 @@
+<template>
+  <el-form
+    v-loading="loading"
+    ref="ruleForm"
+    :model="ruleForm"
+    status-icon
+    :rules="rulesThis"
+    :label-width="labelWidth || '110px'"
+    class="demo-ruleForm-goodsOnline"
+    :size="'mini'"
+  >
+    <el-row>
+      <el-col :span="12"
+        ><el-form-item label="平台商品编码" prop="plat_code">
+          <el-input
+            v-model="ruleForm.plat_code"
+            placeholder="平台商品编码"
+            maxlength="50"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" class="tr">
+        <el-button :size="'mini'" type="primary" @click="submitForm"
+          >保 存
+        </el-button>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+import costFormAddEdit from "./costFormAddEdit";
+import asyncRequest from "@/apis/service/goodStore/goodsOnline";
+export default {
+  name: "exam-form",
+  props: ["size", "statusList", "disabled", "isMust", "labelWidth", "id"],
+  components: {
+    costFormAddEdit,
+  },
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小             非必填
+   * @param {Array}         statusList       : 驳回至备选项          必填
+   * @param {Boolean}       disabled         : 是否禁用              必填
+   * @param {Boolean}       isMust           : 是否需要展示驳回节点   必填
+   *
+   *
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      loading: false,
+
+      showModelThis: this.showModel,
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 60 * 60 * 24 * 1000;
+        },
+      },
+
+      ruleForm: {
+        plat_code: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        plat_code: [
+          {
+            required: true,
+            message: "平台商品编码不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      this.loading = false;
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+
+          this.ruleForm = {
+            plat_code: "",
+          };
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          // 刷新
+          this.$emit("resSuccess", model);
+          // this.routeReGoto("goodsOnline", {});
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    //图片上传成功
+    async UploadSuccessEventproof_url(data) {
+      const { url } = data;
+      if (url === "noToken") {
+        await this.logout();
+      } else {
+        this.ruleForm.proof_url = url;
+        this.$refs.ruleForm.validateField("proof_url");
+        this.$message.success("图片上传成功!");
+      }
+    },
+
+    //图片上传失败
+    UploadErrorEventproof_url(res) {
+      if (res !== "break") {
+        this.$message.error("图片上传失败!");
+        this.$refs.ruleForm.validateField("proof_url");
+      }
+    },
+
+    //判断图片规格
+    beforeAvatarUpload(file) {
+      let isJPG = false;
+      if (
+        file.type === "image/jpg" ||
+        file.type === "image/png" ||
+        file.type === "image/jpeg"
+      ) {
+        isJPG = true;
+      }
+      const isLt2M = file.size / 1024 / 1024 < 1;
+      if (!isJPG) {
+        this.$message.error("图片格式不正确!");
+      }
+      if (!isLt2M) {
+        this.$message.error("图片大小不能超过 1MB!");
+      }
+      return isJPG && isLt2M;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.demo-ruleForm-goodsOnline {
+  .shangchuan-ul {
+    li {
+      position: relative;
+      width: 100%;
+      &.tupian {
+      }
+    }
+  }
+}
+</style>

+ 0 - 291
src/views/goodStore/goodsOnline/components/operate-online-form.vue

@@ -1,291 +0,0 @@
-<template>
-  <el-form
-    v-loading="loading"
-    ref="ruleForm"
-    :model="ruleForm"
-    status-icon
-    :rules="rulesThis"
-    :label-width="labelWidth || '110px'"
-    class="demo-ruleForm-goodsOnline"
-    :size="'mini'"
-  >
-    <el-row>
-      <el-col :span="12"
-        ><el-form-item label="平台商品编码" prop="proof_type">
-          <el-radio-group v-model="ruleForm.proof_type">
-            <el-radio
-              v-for="item in options"
-              :key="item.value"
-              :label="item.value"
-              >{{ item.label }}</el-radio
-            >
-          </el-radio-group>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-button :size="'mini'" type="primary" @click="submitForm"
-          >保 存
-        </el-button>
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-
-<script>
-import costFormAddEdit from "./costFormAddEdit";
-import asyncRequest from "@/apis/service/goodStore/goodsOnline";
-export default {
-  name: "exam-form",
-  props: ["size", "statusList", "disabled", "isMust", "labelWidth", "id"],
-  components: {
-    costFormAddEdit,
-  },
-  /**
-   * 属性集合
-   * @param {String}        size             : 组件大小             非必填
-   * @param {Array}         statusList       : 驳回至备选项          必填
-   * @param {Boolean}       disabled         : 是否禁用              必填
-   * @param {Boolean}       isMust           : 是否需要展示驳回节点   必填
-   *
-   *
-   */
-  /**
-   * 事件集合
-   * @searchChange             : 选中值变化调用   抛出选中数据
-   */
-  data() {
-    return {
-      loading: false,
-      options: [
-        {
-          value: "1",
-          label: "视频",
-        },
-        {
-          value: "2",
-          label: "图片",
-        },
-        {
-          value: "3",
-          label: "其他",
-        },
-      ],
-      showModelThis: this.showModel,
-      pickerOptions: {
-        disabledDate(time) {
-          return time.getTime() < Date.now() - 60 * 60 * 24 * 1000;
-        },
-      },
-      costshowModel: false,
-      costmodelIndex: "",
-      costsitem: {},
-      ruleForm: {
-        skuCode: "",
-        proof_type: "1", // 通过or驳回
-        proof_url: "", //驳回至
-        good_ladder: [],
-      },
-      rulesThis: this.rules,
-      rules: {
-        proof_type: [
-          {
-            required: true,
-            message: "请选择审核状态",
-            trigger: "change",
-          },
-        ],
-        proof_url: [
-          {
-            required: true,
-            message: "请上传",
-            trigger: "change",
-          },
-        ],
-        rebut: [
-          {
-            required: true,
-            message: "请选择驳回节点",
-            trigger: "change",
-          },
-        ],
-        remark: [
-          { required: true, message: "请输入审核备注", trigger: "blur" },
-          {
-            min: 1,
-            max: 250,
-            message: "长度在 1 到 250 个字符",
-            trigger: "blur",
-          },
-        ],
-      },
-    };
-  },
-  watch: {
-    isDetail: function (val, old) {
-      if (this.isDetail !== val) {
-        this.options = [];
-        this.selectLoading = false;
-      }
-    },
-  },
-  mounted() {
-    this.initForm();
-  },
-  methods: {
-    async initForm() {
-      this.loading = true;
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
-    },
-
-    openCostEdit(index, sitem) {
-      this.costmodelIndex = index;
-      this.costsitem = sitem;
-      this.costshowModel = true;
-    },
-
-    openCostEditDelete(index) {
-      this.ladder_tableData.splice(index, 1);
-    },
-    //阶梯成本修改
-    costrefreshEdit(e) {
-      let item = JSON.parse(JSON.stringify(e));
-      console.log(item);
-      const {
-        index,
-        id,
-        min_num,
-        sale_price,
-        market_price,
-        market_platform,
-        status,
-        is_del,
-      } = item;
-      if (index + "" === "-1") {
-        this.ruleForm.good_ladder.push(item);
-      } else {
-        this.ruleForm.good_ladder.forEach((i, findex) => {
-          if (i.id === id && findex === parseInt(i.index)) {
-            this.ruleForm.good_ladder[findex].id = id;
-            this.ruleForm.good_ladder[findex].sale_price = sale_price;
-            this.ruleForm.good_ladder[findex].market_price = market_price;
-            this.ruleForm.good_ladder[findex].min_num = min_num;
-            this.ruleForm.good_ladder[findex].market_platform = market_platform;
-            this.ruleForm.good_ladder[findex].status = status;
-            this.ruleForm.good_ladder[findex].id_del = is_del;
-          }
-        });
-        // this.ladder_tableData = this.ladder_tableData.sort(
-        //   this.dataSort("min_num")
-        // );
-      }
-      this.showModel = false;
-    },
-
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-
-          this.ruleForm = {
-            skuCode: this.id,
-            proof_type: "1", // 通过or驳回
-            proof_url: "", //驳回至
-            good_ladder: [],
-          };
-        }
-      });
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let list = JSON.parse(JSON.stringify(model.good_ladder));
-          let list2 = [];
-          list.forEach((e) => {
-            let n = JSON.parse(JSON.stringify(e));
-            for (let key in n) {
-              n[key] += "";
-            }
-            delete n["index"];
-            list2.push(n);
-          });
-          model.good_ladder = list2;
-          model.skuCode = this.id;
-          let res = await asyncRequest.ladderOne(model);
-          this.loading = false;
-          if (res && res.code === 0) {
-            const { spuCode } = res.data;
-            this.$notify.success({
-              title: "信息提交成功",
-              message: "",
-            });
-            // this.showModelThis = false;
-            // 刷新
-            this.$emit("resSuccess", true);
-            // this.routeReGoto("goodsOnline", {});
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    //图片上传成功
-    async UploadSuccessEventproof_url(data) {
-      const { url } = data;
-      if (url === "noToken") {
-        await this.logout();
-      } else {
-        this.ruleForm.proof_url = url;
-        this.$refs.ruleForm.validateField("proof_url");
-        this.$message.success("图片上传成功!");
-      }
-    },
-
-    //图片上传失败
-    UploadErrorEventproof_url(res) {
-      if (res !== "break") {
-        this.$message.error("图片上传失败!");
-        this.$refs.ruleForm.validateField("proof_url");
-      }
-    },
-
-    //判断图片规格
-    beforeAvatarUpload(file) {
-      let isJPG = false;
-      if (
-        file.type === "image/jpg" ||
-        file.type === "image/png" ||
-        file.type === "image/jpeg"
-      ) {
-        isJPG = true;
-      }
-      const isLt2M = file.size / 1024 / 1024 < 1;
-      if (!isJPG) {
-        this.$message.error("图片格式不正确!");
-      }
-      if (!isLt2M) {
-        this.$message.error("图片大小不能超过 1MB!");
-      }
-      return isJPG && isLt2M;
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.demo-ruleForm-goodsOnline {
-  .shangchuan-ul {
-    li {
-      position: relative;
-      width: 100%;
-      &.tupian {
-      }
-    }
-  }
-}
-</style>

+ 41 - 14
src/views/goodStore/goodsOnline/detail.vue

@@ -171,12 +171,19 @@
                 @searchChange="examForm2"
               />
             </el-collapse-item>
-                 <el-collapse-item
+            <el-collapse-item
               title="操作商品上线"
               name="4"
               v-if="status === '5'"
             >
-            11111
+              <handle-online-form
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :options="[]"
+                :disabled="false"
+                :isMust="false"
+                @resSuccess="examForm3"
+              />
             </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
@@ -195,6 +202,8 @@ import { mapGetters } from "vuex";
 import ShowDataTableColumns from "./ShowDataTableColumns";
 import onlineExamForm from "./components/online-exam-form";
 import fixedPriceForm from "./components/fixed-price-form";
+import handleOnlineForm from "./components/handle-online-form";
+
 import {
   options1,
   options2,
@@ -211,6 +220,7 @@ export default {
   components: {
     onlineExamForm,
     fixedPriceForm,
+    handleOnlineForm,
   },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -272,32 +282,49 @@ export default {
     async examForm(e) {
       console.log(e);
       if (!this.loading) {
-        let type = e.state === "1" ? "3" : e.rebut;
-        await this.setstatus(type, "提交产品部门审核", e.online_time, e.remark);
+        let model = {
+          skuCode: this.queryId,
+          exam_status: e.state === "1" ? "3" : e.rebut,
+          online_time: e.online_time,
+          remark: remark,
+        };
+        await this.setstatus("提交产品部门审核结果", model);
       }
     },
     // 财务审核的保存按钮
     async examForm2(e) {
       console.log(e);
       if (!this.loading) {
-        let type = e.state === "1" ? "5" : '3';
-        await this.setstatus(type, "提交财务审核结果", e.online_time||"", e.remark);
+        let model = {
+          skuCode: this.queryId,
+          exam_status: e.state === "1" ? "5" : "3",
+          remark: remark,
+        };
+        await this.setstatus("提交财务审核结果", model);
+      }
+    },
+    // 操作上线的保存按钮
+    async examForm3(e) {
+      console.log(e);
+      if (!this.loading) {
+        let model = {
+          skuCode: this.queryId,
+          exam_status: "6",
+          plat_code: e.plat_code,
+          remark: "",
+        };
+        await this.setstatus("提交商品上线结果", model);
       }
     },
-    async setstatus(type, detail, time, remark) {
+
+    async setstatus(detail, model) {
       await this.$confirm(`确定要${detail}?`, {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(async () => {
-          let _model = {
-            skuCode: this.queryId,
-            online_time: time,
-            exam_status: type,
-            remark: remark,
-          };
-          let res = await asyncRequest.status(_model);
+          let res = await asyncRequest.status(model);
           if (res && res.code === 0) {
             this.$notify.success({
               title: "提交成功!",

+ 10 - 4
src/views/goodStore/goodsOnline/index.vue

@@ -275,12 +275,18 @@ export default {
       options1: options1,
       loading: false,
       parmValue: {
+        good_name: "", //商品名称
+        spucodecode: "", //商品编号
+        cat_id: "", //商品分类
+        start: "", //开始日期
+        end: "", //结束日期
+        platform_code:"",//平台编码
+        is_stock:"",//是否库存品
         page: 1, // 页码
         size: 15, // 每页显示条数
-        start: "",
-        end: "",
-        status: "",
-        creater: "",
+
+        status: "", //状态
+        creater: "", //
       },
 
       // 表格 - 数据