戴艳蓉 3 jaren geleden
bovenliggende
commit
f7481ddb0d

+ 3 - 3
src/views/goodStore/active/index.vue

@@ -141,7 +141,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? 'warning' : ''"
+          :type="scope.row.status == '0' ? 'warning' : ''"
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -178,7 +178,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '0'
+            powers.some((item) => item == '004') && scope.row.status === '1'
           "
           effect="dark"
           content="禁用"
@@ -191,7 +191,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '1'
+            powers.some((item) => item == '004') && scope.row.status === '0'
           "
           effect="dark"
           content="启用"

+ 3 - 3
src/views/goodStore/activeGood/index.vue

@@ -162,7 +162,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? 'warning' : ''"
+          :type="scope.row.status == '0' ? 'warning' : ''"
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -195,7 +195,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '0'
+            powers.some((item) => item == '004') && scope.row.status === '1'
           "
           effect="dark"
           content="禁用"
@@ -208,7 +208,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '1'
+            powers.some((item) => item == '004') && scope.row.status === '0'
           "
           effect="dark"
           content="启用"

+ 1 - 1
src/views/goodStore/dealGoodsPool/index.vue

@@ -114,7 +114,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? '' : 'warning'"
+          :type="scope.row.status == '0' ? '' : 'warning'"
           v-text="
             (statusList.find((item) => item.code == scope.row.status) || {})
               .name || '--'

+ 1 - 1
src/views/goodStore/goodsCost/index.vue

@@ -202,7 +202,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? '' : 'warning'"
+          :type="scope.row.status == '0' ? '' : 'warning'"
           v-text="
             (statusList.find((item) => item.code == scope.row.status) || {})
               .name || '--'

+ 44 - 7
src/views/goodStore/goodsOnline/components/costFormAddEdit.vue

@@ -102,6 +102,29 @@ export default {
   props: ["showModel", "index", "sitem"],
   mixins: [resToken],
   data() {
+    const validate_min_num = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("起订量不能为空!"));
+      } else if (value === "0") {
+        callback(new Error("起订量不能为零!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_sale_price = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("售价不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_market_price = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("市场价不能为空!"));
+      } else {
+        callback();
+      }
+    };
     return {
       loading: false,
       title: "",
@@ -110,13 +133,26 @@ export default {
       rulesThis: this.rules,
       rules: {
         min_num: [
-          { required: true, message: "起订量应为合法数字", trigger: "blur" },
+          {
+            required: true,
+            validator: validate_min_num,
+            trigger: "blur",
+          },
         ],
         sale_price: [
-          { required: true, message: "工艺费应为合法数字", trigger: "blur" },
+          {
+            required: true,
+            validator: validate_sale_price,
+            trigger: "blur",
+          },
         ],
         market_price: [
-          { required: true, message: "成本合计应为合法数字", trigger: "blur" },
+          {
+            required: true,
+            type: "number",
+            validator: validate_market_price,
+            trigger: "blur",
+          },
         ],
         market_platform: [
           { required: true, message: "对比平台不能为空", trigger: "blur" },
@@ -178,11 +214,11 @@ export default {
       this.ruleForm = {
         id: id || "",
         index: this.index,
-        min_num: min_num || "",
-        sale_price: sale_price || "",
-        market_price: market_price || "",
+        min_num: min_num || "0",
+        sale_price: sale_price || "0",
+        market_price: market_price || "0",
         market_platform: market_platform || "",
-        status: status || "",
+        status: status || "1",
         is_del: is_del || "0",
       };
     },
@@ -194,6 +230,7 @@ export default {
           // 刷新
           this.$emit("refresh", this.ruleForm);
         } else {
+          console.log(this.ruleForm);
           console.log("error submit!!");
           return false;
         }

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

@@ -0,0 +1,291 @@
+<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>

+ 29 - 3
src/views/goodStore/goodsOnline/detail.vue

@@ -152,13 +152,32 @@
                 :newTime="newTime"
                 :id="queryId"
                 v-if="newTime !== ''"
-                :options8="options8"
                 :disabled="false"
                 :isMust="false"
                 @resSuccess="initForm"
               />
-              财务定价</el-collapse-item
+            </el-collapse-item>
+            <el-collapse-item
+              title="财务审核定价"
+              name="3"
+              v-if="status === '4'"
             >
+              <exam-form
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :options8="options8"
+                :disabled="false"
+                :isMust="false"
+                @searchChange="examForm2"
+              />
+            </el-collapse-item>
+                 <el-collapse-item
+              title="操作商品上线"
+              name="4"
+              v-if="status === '5'"
+            >
+            11111
+            </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="2"> 111 </el-tab-pane>
@@ -250,7 +269,6 @@ export default {
       this.loading = false;
     },
     // 点击业务审核的保存按钮
-
     async examForm(e) {
       console.log(e);
       if (!this.loading) {
@@ -258,6 +276,14 @@ export default {
         await this.setstatus(type, "提交产品部门审核", e.online_time, e.remark);
       }
     },
+    // 财务审核的保存按钮
+    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);
+      }
+    },
     async setstatus(type, detail, time, remark) {
       await this.$confirm(`确定要${detail}?`, {
         confirmButtonText: "确定",

+ 1 - 1
src/views/goodStore/goodsOnline/index.vue

@@ -178,7 +178,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? '' : 'warning'"
+          :type="scope.row.status == '0' ? '' : 'warning'"
           v-text="
             (statusList.find((item) => item.code == scope.row.status) || {})
               .name || '--'

+ 3 - 3
src/views/goodStore/specs/index.vue

@@ -124,7 +124,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? 'warning' : ''"
+          :type="scope.row.status == '0' ? 'warning' : ''"
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -157,7 +157,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '0'
+            powers.some((item) => item == '004') && scope.row.status === '1'
           "
           effect="dark"
           content="禁用"
@@ -170,7 +170,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '1'
+            powers.some((item) => item == '004') && scope.row.status === '0'
           "
           effect="dark"
           content="启用"

+ 3 - 3
src/views/serviceParam/parameter/index.vue

@@ -124,7 +124,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? 'warning' : ''"
+          :type="scope.row.status == '0' ? 'warning' : ''"
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -157,7 +157,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '0'
+            powers.some((item) => item == '004') && scope.row.status === '1'
           "
           effect="dark"
           content="禁用"
@@ -170,7 +170,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '1'
+            powers.some((item) => item == '004') && scope.row.status === '0'
           "
           effect="dark"
           content="启用"

+ 2 - 2
src/views/serviceParam/terrace/index.vue

@@ -157,7 +157,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '0'
+            powers.some((item) => item == '004') && scope.row.status === '1'
           "
           effect="dark"
           content="禁用"
@@ -170,7 +170,7 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            powers.some((item) => item == '004') && scope.row.status === '1'
+            powers.some((item) => item == '004') && scope.row.status === '0'
           "
           effect="dark"
           content="启用"

+ 9 - 9
src/views/serviceParam/workCompany/index.vue

@@ -51,10 +51,10 @@
                   "
                 >
                   <el-option
-                    v-for="item in statusList"
-                    :key="'status' + item.code"
-                    :label="item.name"
-                    :value="item.code"
+                    v-for="item in statusOptions"
+                    :key="'status' + item.id"
+                    :label="item.label"
+                    :value="item.id"
                   />
                 </el-select>
               </el-col>
@@ -134,7 +134,7 @@
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
-            :type="scope.row.status == '1' ? 'warning' : ''"
+            :type="scope.row.status == '0' ? 'warning' : ''"
             v-text="
               (statusOptions.find((item) => item.id == scope.row.status) || {})
                 .label || '--'
@@ -167,7 +167,7 @@
           </el-tooltip>
           <el-tooltip
             v-if="
-              powers.some((item) => item == '004') && scope.row.status === '0'
+              powers.some((item) => item == '004') && scope.row.status === '1'
             "
             effect="dark"
             content="禁用"
@@ -180,7 +180,7 @@
           </el-tooltip>
           <el-tooltip
             v-if="
-              powers.some((item) => item == '004') && scope.row.status === '1'
+              powers.some((item) => item == '004') && scope.row.status === '0'
             "
             effect="dark"
             content="启用"
@@ -320,8 +320,8 @@ export default {
       ],
       // 状态
       statusOptions: [
-        { id: "0", label: "用" },
-        { id: "1", label: "用" },
+        { id: "0", label: "用" },
+        { id: "1", label: "用" },
       ],
     };
   },