戴艳蓉 пре 3 година
родитељ
комит
845651b88a

+ 2 - 2
src/apis/service/goodStore/goodsOnline/index.js

@@ -10,6 +10,8 @@ export default {
   detail: (data, params) => http(api + "goodinfo", data, "post", params),
   // 产品部门审核
   goodupexam: (data, params) => http(api + "goodupexam", data, "post", params),
+  // 更新状态
+  status: (data, params) => http(api + "goodupexam", data, "post", params),
 
   // 更改
   update: (data, params) => http(api + "goodsave", data, "post", params),
@@ -17,8 +19,6 @@ export default {
   delete: (data, params) => http(api + "gooddel", data, "post", params),
 
 
-  // 更新状态
-  status: (data, params) => http(api + "goodstatus", data, "post", params),
   // 复制
   copy: (data, params) => http(api + "goodcopy", data, "post", params),
   // 获取全部分类

+ 4 - 4
src/components/globalComponents/search-work-company/main.vue

@@ -62,12 +62,12 @@ export default {
   methods: {
     async selectChange(e) {
       // console.log(e);
-      let index = this.options.findIndex((v) => v.rate + "%" === e);
+      let index = this.options.findIndex((v) => v.companyNo === e);
       if (index !== -1) {
         let model = {
-          id: this.options[index].rate,
-          code: this.options[index].rate,
-          label: this.options[index].rate + "%",
+          id: this.options[index].id,
+          code: this.options[index].companyNo,
+          label: this.options[index].company,
         };
         this.$emit("searchChange", model);
       } else {

+ 5 - 5
src/components/globalComponents/show-data-table/main.vue

@@ -84,8 +84,8 @@ export default {
       //
       border-right: 1px solid #ebeef5 !important;
       .label {
-        width: 145px;
-        line-height: 40px;
+        width: 100px;
+        line-height: 35px;
         text-align: right;
         background: #fafafa !important;
         font-weight: 400 !important;
@@ -95,12 +95,12 @@ export default {
         border-right: 1px solid #ebeef5 !important;
       }
       .name {
-        width: calc(100% - 145px);
+        width: calc(100% - 100px);
         text-align: left;
-        line-height: 40px;
+        line-height: 35px;
         font-size: 12px !important;
         border-bottom: 1px solid #ebeef5 !important;
-        padding: 0 0 0 12px !important;
+        padding: 0 0 0 10px !important;
         word-break: break-all!important;
         color: #606266 !important;
       }

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

@@ -11,14 +11,14 @@
     >
       <el-row>
         <el-col :span="8">
-          <el-form-item label="业务企业" prop="platform_code1">
+          <el-form-item label="业务企业" prop="company_id">
             <search-work-company
-              :value="ruleForm.platform_code1"
+              :value="ruleForm.company_id"
               :disabled="false"
               :size="'mini'"
               :isDetail="false"
               :placeholder="'业务企业'"
-              @searchChange="platform_codesearchChange"
+              @searchChange="company_idsearchChange"
             />
           </el-form-item>
         </el-col>
@@ -31,7 +31,6 @@
             />
           </el-form-item>
         </el-col>
-
         <el-col :span="8">
           <el-form-item label="所属平台" prop="platform_code">
             <search-terrace
@@ -52,6 +51,8 @@
                   <el-date-picker
                     type="datetime"
                     placeholder="开始时间"
+                    value-format="yyyy-MM-dd hh:mm:ss"
+                    :picker-options="pickerOptions1"
                     v-model="ruleForm.activity_start"
                     style="width: 100%"
                   ></el-date-picker>
@@ -62,7 +63,9 @@
                 <el-form-item prop="activity_end">
                   <el-date-picker
                     type="datetime"
+                    value-format="yyyy-MM-dd hh:mm:ss"
                     placeholder="结束时间"
+                    :picker-options="pickerOptions2"
                     v-model="ruleForm.activity_end"
                     style="width: 100%"
                   ></el-date-picker>
@@ -163,6 +166,32 @@ export default {
     return {
       size: "small",
       activeName: "3",
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (
+            this.ruleForm.activity_end != null &&
+            this.ruleForm.activity_end != "" &&
+            time
+          ) {
+            return (
+              time.getTime() > new Date(this.ruleForm.activity_end).valueOf()
+            );
+          }
+        },
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          if (
+            this.ruleForm.activity_start != null &&
+            this.ruleForm.activity_start != "" &&
+            time
+          ) {
+            return (
+              time.getTime() < new Date(this.ruleForm.activity_start).valueOf()
+            );
+          }
+        },
+      },
       loading: false,
       showModel: false,
       once: false,
@@ -176,9 +205,8 @@ export default {
             trigger: "blur",
           },
         ],
-        platform_code1: [
+        company_id: [
           {
-            type: "array",
             required: true,
             message: "业务公司不能为空",
             trigger: "change",
@@ -254,11 +282,25 @@ export default {
         }
       });
     },
+    company_idsearchChange(e) {
+      if (e) {
+        const { id, code, label } = e;
+        this.ruleForm.company_id = code || "";
+      }
+      this.$refs.ruleForm.validateField("company_id");
+    },
+    platform_codesearchChange(e) {
+      if (e) {
+        const { id, code, label } = e;
+        this.ruleForm.platform_code = id ? [id] : [];
+      }
+      this.$refs.ruleForm.validateField("platform_code");
+    },
     resetFormData() {
       this.ruleForm = {
         activity_name: "",
-        platform_code1: [],
         platform_code: [],
+        company_id: "",
         activity_start: "",
         activity_end: "",
         activity_desc: "",

+ 2 - 1
src/views/goodStore/goodsCost/columns.js

@@ -35,6 +35,7 @@ const options7 = [
   { id: "0", name: "否" },
   { id: "1", name: "是" },
 ]
+
 const listCol = [
   {
     prop: "spuCode",
@@ -428,4 +429,4 @@ const rules = {
   },
 }
 
-export { options1, options2, options3, options4, options5, options6, options7, listCol, rules }
+export { options1, options2, options3, options4, options5, options6, options7,  listCol, rules }

+ 209 - 27
src/views/goodStore/goodsOnline/ShowDataTableColumns.js

@@ -1,11 +1,14 @@
 export default [
   {
-    prop: "spuCode",
-    label: "商品编号",
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
   },
+
   {
-    prop: "creater",
-    label: "申请人"
+    prop: "speclist",
+    label: "规格",
+    _slot_: "speclist",
   },
   {
     prop: "supplierName",
@@ -16,75 +19,254 @@ export default [
     label: "业务企业名称",
   },
   {
-    prop: "good_name",
-    label: "商品名称",
+    prop: "good_info_img",
+    _slot_: "good_info_img",
+    label: "详情图",
+  },
+  {
+    prop: "online_reason",
+    label: "上线原因",
+  },
+  {
+    prop: "spuCode",
+    label: "商品编号",
+    span: 8,
+  },
+
+
+  {
+    prop: "creater",
+    label: "申请人",
+    span: 8,
   },
   {
     prop: "platform_name",
-    label: "上线平台"
+    label: "上线平台",
+    span: 8,
   },
   {
     prop: "platform_name",
-    label: "上线平台商品编码"
+    label: "平台商品编码",
+    span: 8,
   },
   {
     prop: "online_time",
-    label: "上线时间"
+    label: "上线时间",
+    span: 8,
   },
   {
-    prop: "online_reason",
-    label: "上线原因"
+    prop: "cat",
+    label: "分类",
+    span: 8,
   },
   {
     prop: "online_remark",
     label: "上线备注",
-  },
-
-  {
-    prop: "cat",
-    label: "分类",
+    span: 24,
   },
   {
     prop: "brand_name",
     label: "品牌",
+    span: 8,
   },
   {
     prop: "unit",
     label: "单位",
+    span: 8,
   },
 
   {
-    prop: "diff_weight",
+    prop: "is_auth",
     label: "供应商权限",
+    _slot_: "is_auth",
+    span: 8,
+  },
+  {
+    prop: "diff_price1",
+    label: "专属类型",
+    _slot_: "diff_price1",
+    span: 8,
+  },
+  {
+    prop: "weight",
+    label: "商品总克重",
+    span: 8,
   },
   {
-    prop: "diff_price",
-    label: "金额差价",
+    prop: "is_stock",
+    label: "是否库存品",
+    _slot_: "is_stock",
+    span: 8,
   },
   {
-    prop: "gold_price",
-    label: "实时金价",
+    prop: "tax",
+    label: "税点",
+    span: 8,
+  },
+  {
+    prop: "good_type",
+    label: "是否定制",
+    _slot_: "good_type",
+    span: 8,
   },
 
-  // {
-  //   prop: "good_price",
-  //   label: "商品单价",
-  // },
+  {
+    prop: "packing_list",
+    label: "包装清单",
+    span: 8,
+  },
+  {
+    prop: "packing_way",
+    label: "包装方式",
+    span: 8,
+  },
+  {
+    prop: "packing_spec",
+    label: "装箱规格",
+    span: 8,
+  },
+  {
+    prop: "packing_weight",
+    label: "装箱重量(g)",
+    span: 8,
+  },
+  {
+    prop: "packing_size",
+    label: "装箱尺寸",
+    span: 8,
+  },
+  {
+    prop: "good_bar",
+    label: "商品条形码",
+    span: 8,
+  },
+  {
+    prop: "supply_area",
+    label: "供货区域",
+    _slot_: "supply_area",
+    span: 8,
+  },
+  {
+    prop: "delivery_place",
+    label: "发货地",
+    span: 8,
+  },
+  {
+    prop: "origin_place",
+    label: "产地",
+    span: 8,
+  },
+  {
+    prop: "delivery_day",
+    label: "物流时间(天)",
+    span: 8,
+  },
+  {
+    prop: "lead_time",
+    label: "供货周期(天)",
+    span: 8,
+  },
+  {
+    prop: "sample_day",
+    label: "调样周期(天)",
+    span: 8,
+  },
+
+
+  {
+    prop: "cert_fee",
+    label: "证书费(元)",
+    span: 8,
+  },
+  {
+    prop: "packing_fee",
+    label: "包装费(元)",
+    span: 8,
+  },
+  {
+    prop: "cost_fee",
+    label: "成本工艺费(元)",
+    span: 8,
+  },
+
+  {
+    prop: "mark_fee",
+    label: "加标费(元)",
+    span: 8,
+  },
+  {
+    prop: "demo_fee",
+    label: "打样费(元)",
+    span: 8,
+  },
+  {
+    prop: "open_fee",
+    label: "开模费(元)",
+    span: 8,
+  },
 
   {
-    prop: "status",
+    prop: "sample_fee",
+    label: "调样费(元)",
+    span: 8,
+  },
+  {
+    prop: "market_price",
+    label: "市场价(元)",
+    span: 8,
+  },
+  {
+    prop: "nake_price",
+    label: "含税成本合计",
+    span: 8,
+  },
+  {
+    prop: "is_step",
+    label: "启用阶梯",
+    _slot_: "is_step",
+    span: 8,
+  },
+  {
+    prop: "exam_status",
     label: "状态",
-    _slot_: "status",
+    _slot_: "exam_status",
+    span: 8,
   },
   {
     prop: "updatetime",
     label: "更新时间",
+    span: 8,
   },
   {
     prop: "addtime",
     label: "创建时间",
+    span: 8,
   },
 
 
+  {
+    prop: "after_sales",
+    label: "售后说明",
+    span: 24,
+  },
+  {
+    prop: "good_remark",
+    label: "商品备注",
+    span: 24,
+  },
+
+  {
+    prop: "craft_desc",
+    label: "工艺说明",
+    span: 24,
+  },
+
+  // {
+  //   prop: "good_price",
+  //   label: "商品单价",
+  // },
+
+
+
 ]
 

+ 11 - 2
src/views/goodStore/goodsOnline/columns.js

@@ -35,6 +35,15 @@ const options7 = [
   { id: "0", name: "否" },
   { id: "1", name: "是" },
 ]
+const options8 = [
+  { id: "0", name: "待提交" },
+  { id: "1", name: "待完善成本" },
+  { id: "2", name: "待产品审核" },
+  { id: "3", name: "待财务定价" },
+  { id: "4", name: "待财务审核定价" },
+  { id: "5", name: "待上线" },
+  { id: "6", name: "上线成功" },
+]
 const listCol = [
   {
     prop: "spuCode",
@@ -131,7 +140,7 @@ const rules = {
       trigger: "blur",
     },
   ],
- 
+
 }
 
-export { options1, options2, options3, options4, options5, options6, options7, listCol, rules }
+export { options1, options2, options3, options4, options5, options6, options7, options8, listCol, rules }

+ 207 - 0
src/views/goodStore/goodsOnline/components/online-exam-form.vue

@@ -0,0 +1,207 @@
+<template>
+  <el-form
+    v-loading="loading"
+    ref="ruleForm"
+    :model="ruleForm"
+    status-icon
+    :rules="rulesThis"
+    :label-width="labelWidth || '100px'"
+    class="demo-ruleForm"
+    :size="size || 'medium'"
+  >
+    <el-row>
+      <el-col :span="12"
+        ><el-form-item label="审核状态" prop="state">
+          <el-radio-group
+            v-model="ruleForm.state"
+            placeholder="请选择审核状态"
+            style="width: 100%"
+            :size="size || 'medium'"
+            @change="stateChange"
+          >
+            <el-radio
+              v-for="item in stateList"
+              :key="item.value"
+              :label="item.value"
+              >{{ item.label }}</el-radio
+            >
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="上线时间" prop="online_time">
+          <el-date-picker
+            v-model="ruleForm.online_time"
+            type="datetime"
+            value-format="yyyy-MM-dd hh:mm:ss"
+            style="width: 100%"
+            :picker-options="pickerOptions"
+            placeholder="上线时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item
+          label="审核备注"
+          v-if="ruleForm.state === '0'"
+          prop="remark"
+        >
+          <el-input
+            type="textarea"
+            placeholder="请输入审核备注"
+            v-model="ruleForm.remark"
+            :disabled="disabled"
+            maxlength="250"
+            :autosize="{ minRows: 3, maxRows: 3 }"
+            show-word-limit
+          />
+        </el-form-item>
+        <el-form-item class="fr">
+          <el-button
+            v-if="!isDetail"
+            :size="'mini'"
+            type="primary"
+            @click="submitForm"
+            >保 存
+          </el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  name: "exam-form",
+  props: ["size", "statusList", "disabled", "isMust", "labelWidth"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小             非必填
+   * @param {Array}         statusList       : 驳回至备选项          必填
+   * @param {Boolean}       disabled         : 是否禁用              必填
+   * @param {Boolean}       isMust           : 是否需要展示驳回节点   必填
+   *
+   *
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      loading: false,
+      stateList: [
+        {
+          value: "1",
+          label: "通过",
+        },
+        {
+          value: "0",
+          label: "驳回",
+        },
+      ],
+      showModelThis: this.showModel,
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 60 * 60 * 24 * 1000;
+        },
+      },
+      ruleForm: {
+        state: "1", // 通过or驳回
+        rebut: "", //驳回至
+        online_time: "",
+        remark: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        state: [
+          {
+            required: true,
+            message: "请选择审核状态",
+            trigger: "change",
+          },
+        ],
+        online_time: [
+          {
+            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.stateChange();
+      this.loading = false;
+    },
+    stateChange() {
+      if (this.ruleForm.state === "1") {
+        this.rulesThis.rebut[0].required = false;
+        this.rulesThis.remark[0].required = false;
+      } else {
+        this.rulesThis.rebut[0].required = true;
+        this.rulesThis.remark[0].required = true;
+      }
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            state: "1", // 通过or驳回
+            rebut: "", //驳回至
+            online_time: "",
+            remark: "",
+          };
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.$emit("searchChange", this.ruleForm);
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 129 - 17
src/views/goodStore/goodsOnline/detail.vue

@@ -14,31 +14,121 @@
                 :sitem="sitem"
                 :columns="ShowDataTableColumns"
               >
-                <template slot="status">
+                <template slot="good_name">
+                  <img
+                    v-viewer
+                    style="width: 30px; heigth: 30px; margin: 3px 5px 0 0"
+                    class="fl"
+                    v-if="sitem.good_thumb_img"
+                    :src="sitem.good_thumb_img"
+                    alt=""
+                  />
+                  <div>{{ sitem.good_name }}</div>
+                </template>
+                <template slot="speclist">
+                  <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
+                    <span v-if="i !== 0">-</span
+                    ><span>{{ si.spec_value }}</span>
+                  </span>
+                </template>
+                <template slot="good_info_img">
+                  <img
+                    class="fl"
+                    style="width: 30px; heigth: 30px; margin: 3px 5px 2px 0"
+                    v-viewer
+                    v-for="(si, i) in sitem.good_info_img"
+                    :src="si"
+                    :key="si + i"
+                  />
+                </template>
+                <template slot="is_auth">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options3.find((item) => item.id == sitem.is_auth) || {})
+                        .name || '--'
+                    "
+                  />
+                </template>
+                <template slot="diff_price1"> ???? </template>
+                <template slot="is_stock">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options4.find((item) => item.id == sitem.is_stock) || {})
+                        .name || '--'
+                    "
+                  />
+                </template>
+                <template slot="good_type">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (
+                        options1.find((item) => item.id == sitem.good_type) ||
+                        {}
+                      ).name || '--'
+                    "
+                  />
+                  <span v-if="sitem.good_type === '1'"
+                    >起订量:{{ sitem.moq }},工期:{{
+                      sitem.customized
+                    }}天</span
+                  >
+                </template>
+                <template slot="supply_area">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (
+                        options6.find((item) => item.id == sitem.supply_area) ||
+                        {}
+                      ).name || '--'
+                    "
+                  />
+                </template>
+                <template slot="is_step">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options7.find((item) => item.id == sitem.is_step) || {})
+                        .name || '--'
+                    "
+                  />
+                </template>
+
+                <template slot="exam_status">
                   <el-tag
                     :size="'mini'"
-                    :type="sitem.status == '0' ? 'warning' : ''"
                     v-text="
                       (
-                        statusList.find((item) => item.value == sitem.status) ||
+                        options8.find((item) => item.id == sitem.exam_status) ||
                         {}
-                      ).label || '--'
+                      ).name || '--'
                     "
-                  ></el-tag>
+                  />
                 </template>
               </show-data-table>
             </el-collapse-item>
-            <el-collapse-item title="采购部门审批" name="1">
-              <exam-form
-                :statusList="statusList"
+            <el-collapse-item
+              title="产品部门审批"
+              name="1"
+              v-if="status === '2'"
+            >
+              <online-exam-form
+                :options8="options8"
                 :newTime="newTime"
                 :disabled="false"
                 :isMust="false"
                 @searchChange="examForm"
               />
-
-              123
             </el-collapse-item>
+                <el-collapse-item
+              title="财务定价"
+              name="2"
+              v-if="status === '3'"
+            >
+            财务定价</el-collapse-item>
           </el-collapse>
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="2"> 111 </el-tab-pane>
@@ -54,10 +144,23 @@ import asyncRequest from "@/apis/service/goodStore/goodsOnline";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
 import ShowDataTableColumns from "./ShowDataTableColumns";
+import onlineExamForm from "./components/online-exam-form";
+import {
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+} from "./columns";
 export default {
   name: "goodsOnlineDetail",
   mixins: [resToken],
-
+  components: {
+    onlineExamForm,
+  },
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -76,7 +179,14 @@ export default {
   data() {
     return {
       ShowDataTableColumns: ShowDataTableColumns,
-      statusList: [],
+      options1: options1,
+      options2: options2,
+      options3: options3,
+      options4: options4,
+      options5: options5,
+      options6: options6,
+      options7: options7,
+      options8: options8,
       size: "small",
       activeTabs: "1",
       activeNames: ["0", "1"],
@@ -112,11 +222,11 @@ export default {
     async examForm(e) {
       console.log(e);
       if (!this.loading) {
-        let type = e.state === "1" ? "1" : e.rebut;
-        await this.setstatus(type, "提交采购部门审核", e.remark);
+        let type = e.state === "1" ? "3" : e.rebut;
+        await this.setstatus(type, "提交产品部门审核", e.online_time, e.remark);
       }
     },
-    async setstatus(type, detail, remark) {
+    async setstatus(type, detail, time, remark) {
       await this.$confirm(`确定要${detail}?`, {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -124,8 +234,9 @@ export default {
       })
         .then(async () => {
           let _model = {
-            spuCode: this.queryId,
-            status: type,
+            skuCode: this.queryId,
+            online_time: time,
+            exam_status: type,
             remark: remark,
           };
           let res = await asyncRequest.status(_model);
@@ -171,6 +282,7 @@ export default {
           });
         }
         this.sitem.cat = cat;
+        this.sitem.good_info_img = this.sitem.good_info_img.split(",");
         this.status = status;
         this.getNewTime();
       } else if (code >= 100 && code <= 104) {

+ 1 - 0
src/views/serviceParam/supplier/components/baseForm.vue

@@ -338,6 +338,7 @@
           <el-date-picker
             v-model="ruleForm.registertime"
             type="date"
+            value-format="yyyy-MM-dd"
             :disabled="type !== 'add' && type !== 'edit'"
             style="width: 100%"
             :picker-options="pickerOptions"