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

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/index.html


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/chunk-0edf86e8.03c5ca80.css


BIN
dist/static/css/chunk-20e7c678.3cf97bc9.css.gz → dist/static/css/chunk-0edf86e8.03c5ca80.css.gz


BIN
dist/static/js/app.17cbcf38.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.6de7f805.js


BIN
dist/static/js/app.6de7f805.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/chunk-0edf86e8.57a967c1.js


BIN
dist/static/js/chunk-0edf86e8.57a967c1.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/chunk-20e7c678.4514134a.js


BIN
dist/static/js/chunk-20e7c678.4514134a.js.gz


+ 2 - 0
src/apis/service/goodStore/sort/index.js

@@ -18,4 +18,6 @@ export default {
   goodsList: (data, params) => http(api + "catlist", data, "post", params),
   // 全部规格列表
   specstitle: (data, params) => http(api + "specstitle", data, "post", params),
+  // 修改毛利率
+  editRate: (data, params) => http(api + "catratedit", data, "post", params),
 };

+ 2 - 1
src/assets/js/btnList.js

@@ -58,7 +58,8 @@ const btnList = [
   { code: "057", name: "采购部定价" },
   { code: "058", name: "财务定价" },
   { code: "059", name: "财务审核定价" },
-  
+  { code: "060", name: "设置毛利率" },
+  { code: "061", name: "查看毛利率" },
   
 ];
 export default btnList;

+ 244 - 0
src/views/goodStore/searchSort/addEdit.vue

@@ -0,0 +1,244 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="'查看毛利率'"
+    :center="true"
+    align="left"
+    top="12vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="0">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'small'"
+            :rules="rulesThis"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="分类名称" prop="cat_name">
+              <el-input
+                v-model="ruleForm.cat_name"
+                disabled
+                placeholder="分类名称"
+                minlength="20"
+              />
+            </el-form-item>
+            <el-form-item label="预算→成本" prop="order_rate">
+              <digital-input
+                :values="ruleForm.order_rate"
+                :placeholder="'预算→成本'"
+                :min="0"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                 disabled
+                :append="'%'"
+                @reschange="order_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="成本→售价" prop="sale_rate">
+              <digital-input
+                :values="ruleForm.sale_rate"
+                :placeholder="'成本→售价'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                 disabled
+                :controls="false"
+                :append="'%'"
+                @reschange="sale_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="最低毛利" prop="lower_rate">
+              <digital-input
+                :values="ruleForm.lower_rate"
+                :placeholder="'最低毛利'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                 disabled
+                :append="'%'"
+                @reschange="lower_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="单品修改下限" prop="rate">
+              <digital-input
+                :values="ruleForm.rate"
+                :placeholder="'单品修改下限'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                 disabled
+                :append="'%'"
+                @reschange="rate_change"
+              />
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/goodStore/sort";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "sort",
+  props: ["showModel", "id", "sitem"],
+  mixins: [resToken],
+  data() {
+    const validate_order_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("预算→成本毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_sale_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("成本→售价毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_lower_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("最低毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("单品修改下限毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      loading: false,
+      showModelThis: this.showModel,
+      ruleForm: {
+        id: "",
+        cat_name: "",
+        order_rate: "0",
+        sale_rate: "0",
+        lower_rate: "0",
+        rate: "0",
+      },
+      rulesThis: this.rules,
+      rules: {
+        order_rate: [{ required: true, validator: validate_order_rate, trigger: "blur" }],
+        sale_rate: [{ required: true, validator: validate_sale_rate, trigger: "blur" }],
+        lower_rate: [{ required: true, validator: validate_lower_rate, trigger: "blur" }],
+        rate: [{ required: true, validator: validate_rate, trigger: "blur" }],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      await this.initData();
+      this.loading = false;
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { pid, id, cat_name, order_rate, sale_rate, lower_rate, rate } = this.sitem;
+          this.ruleForm = {
+            pid: pid || "",
+            id: id || "",
+            cat_name: cat_name || "",
+            order_rate: order_rate || "0",
+            sale_rate: sale_rate || "0",
+            lower_rate: lower_rate || "0",
+            rate: rate || "0",
+          };
+        }
+      });
+    },
+    order_rate_change(e) {
+      this.ruleForm.order_rate = e + "";
+      this.$refs.ruleForm.validateField("order_rate");
+    },
+    sale_rate_change(e) {
+      this.ruleForm.sale_rate = e + "";
+      this.$refs.ruleForm.validateField("sale_rate");
+    },
+    lower_rate_change(e) {
+      this.ruleForm.lower_rate = e + "";
+      this.$refs.ruleForm.validateField("lower_rate");
+    },
+    rate_change(e) {
+      this.ruleForm.rate = e + "";
+      this.$refs.ruleForm.validateField("rate");
+    },
+
+    async initData() {
+      const res = await asyncRequest.detail({ id: this.sitem.id });
+      if (res && res.code === 0 && res.data) {
+        console.log(res.data);
+        const { pid, id, cat_name, order_rate, sale_rate, lower_rate, rate } = res.data;
+        this.ruleForm = {
+          pid: pid || "",
+          id: id || "",
+          cat_name: cat_name || "",
+          order_rate: order_rate || "0",
+          sale_rate: sale_rate || "0",
+          lower_rate: lower_rate || "0",
+          rate: rate || "0",
+        };
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+   
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.sort {
+}
+</style>

+ 163 - 133
src/views/goodStore/searchSort/index.vue

@@ -1,137 +1,150 @@
 <template>
   <div class="searchSort pagePadding">
-    <ex-table
-      v-loading="loading"
+    <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-      :table="table"
-      :data="tableData"
-      :columns="columns"
-      :page="pageInfo"
-      :size="size"
-      @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="{}">
-        <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.start"
-                :end="parmValue.end"
-                @timeReturned="handleTime"
-              />
-            </el-col>
-            <el-col :span="4" style="width: 160px">
-              <el-select
-                v-model="parmValue.status"
-                filterable
-                clearable
-                :size="searchSize"
-                placeholder="分类状态"
-                style="width: 100%"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <el-option
-                  v-for="item in statusList"
-                  :key="'status' + item.code"
-                  :label="item.name"
-                  :value="item.code"
+      <ex-table
+        :table="table"
+        v-loading="loading"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @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="{}">
+          <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.start"
+                  :end="parmValue.end"
+                  @timeReturned="handleTime"
                 />
-              </el-select>
-            </el-col>
+              </el-col>
+              <el-col :span="4" style="width: 160px">
+                <el-select
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  :size="searchSize"
+                  placeholder="分类状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusList"
+                    :key="'status' + item.code"
+                    :label="item.name"
+                    :value="item.code"
+                  />
+                </el-select>
+              </el-col>
 
-            <el-col
-              :span="3"
-              class="fr"
-              style="width: 66px; padding: 0 0 0 10px"
-            >
-              <el-button type="primary" :size="searchSize" @click="searchList">
-                刷新
-              </el-button>
-            </el-col>
-            <el-col
-              :span="3"
-              class="fr"
-              style="width: 66px; padding: 0 0 0 10px"
-            >
-              <el-button type="warning" :size="searchSize" @click="restSearch">
-                重置
-              </el-button>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="4" style="width: 373px">
-              <el-input
-                :size="searchSize"
-                v-model="parmValue.cat_name"
-                :maxlength="40"
-                @blur="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-                placeholder="分类名称"
-              ></el-input>
-            </el-col>
-            <el-col :span="4" style="width: 170px; padding: 0 0 0 10px">
-              <el-input
-                :size="searchSize"
-                v-model="parmValue.creater"
-                :maxlength="40"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-                placeholder="创建人"
-              ></el-input>
-            </el-col>
-            <el-col
-              :span="3"
-              class="fr"
-              style="width: 66px; padding: 0 0 0 10px"
-              v-if="powers.some((item) => item == '003')"
-            >
-              <el-button
-                :size="searchSize"
-                type="success"
-                style="float: right"
-                @click="openModal({}, '003')"
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
               >
-                添加
-              </el-button>
-            </el-col>
-          </el-row>
-        </div></template
-      >
-      <template #status="{ scope }">
-        <el-tag
-          :size="tablebtnSize"
-          :type="scope.row.status == '0' ? 'warning' : ''"
-          v-text="
-            (statusOptions.find((item) => item.id == scope.row.status) || {})
-              .label || '--'
-          "
-        ></el-tag>
-      </template>
-    </ex-table>
+                <el-button
+                  type="primary"
+                  :size="searchSize"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="warning"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="4" style="width: 373px">
+                <el-input
+                  :size="searchSize"
+                  v-model="parmValue.cat_name"
+                  :maxlength="40"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                  placeholder="分类名称"
+                ></el-input>
+              </el-col>
+              <el-col :span="4" style="width: 170px; padding: 0 0 0 10px">
+                <el-input
+                  :size="searchSize"
+                  v-model="parmValue.creater"
+                  :maxlength="40"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                  placeholder="创建人"
+                ></el-input>
+              </el-col>
+            </el-row></div
+        ></template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((item) => item == '061')"
+            effect="dark"
+            content="查看毛利率"
+            placement="top"
+          >
+            <i class="el-icon-view tb-icon" @click="openModal(scope.row)"></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+      <!-- 弹窗 新增/修改 -->
+      <add-edit
+        :id="modelId"
+        :show-model="showModel"
+        :sitem="sitem"
+        @refresh="searchList"
+        @cancel="showModel = false"
+      />
+    </div>
     <no-auth v-else></no-auth>
   </div>
 </template>
@@ -142,10 +155,13 @@ import roleLevel from "@/assets/js/roleLevel";
 import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
+import addEdit from "./addEdit";
 export default {
   name: "searchSort",
   mixins: [mixinPage, resToken],
-
+  components: {
+    addEdit,
+  },
   computed: {
     //组件SIZE设置
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -199,11 +215,11 @@ export default {
       },
       // 表格 - 列参数
       columns: [
-        {
-          prop: "id",
-          label: "ID",
-          width: "80px",
-        },
+        // {
+        //   prop: "id",
+        //   label: "ID",
+        //   width: "80px",
+        // },
         {
           prop: "cat_name",
           label: "分类名称",
@@ -237,6 +253,14 @@ export default {
           sortable: true,
           width: "145px",
         },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          width: "50px",
+          _noset_: true,
+          _slot_: "operation",
+        },
       ],
     };
   },
@@ -277,6 +301,12 @@ export default {
         await this.searchList();
       }
     },
+    // 新建/编辑/详情
+    openModal(row) {
+      this.sitem = row;
+      this.modelId = row.id;
+      this.showModel = true;
+    },
 
     // 刷新表格
     async searchList() {

+ 287 - 0
src/views/goodStore/sort/addEditRate.vue

@@ -0,0 +1,287 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="'设置毛利率'"
+    :center="true"
+    align="left"
+    top="12vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="0">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'small'"
+            :rules="rulesThis"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="上级分类" prop="pid">
+              <el-input
+                v-model="ruleForm.pid"
+                placeholder="上级分类"
+                minlength="20"
+                disabled
+              />
+            </el-form-item>
+            <el-form-item label="分类名称" prop="cat_name">
+              <el-input
+                v-model="ruleForm.cat_name"
+                disabled
+                placeholder="分类名称"
+                minlength="20"
+              />
+            </el-form-item>
+            <el-form-item label="预算→成本" prop="order_rate">
+              <digital-input
+                :values="ruleForm.order_rate"
+                :placeholder="'预算→成本'"
+                :min="0"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                :append="'%'"
+                @reschange="order_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="成本→售价" prop="sale_rate">
+              <digital-input
+                :values="ruleForm.sale_rate"
+                :placeholder="'成本→售价'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                :append="'%'"
+                @reschange="sale_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="最低毛利" prop="lower_rate">
+              <digital-input
+                :values="ruleForm.lower_rate"
+                :placeholder="'最低毛利'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                :append="'%'"
+                @reschange="lower_rate_change"
+              />
+            </el-form-item>
+            <el-form-item label="单品修改下限" prop="rate">
+              <digital-input
+                :values="ruleForm.rate"
+                :placeholder="'单品修改下限'"
+                :min="-100"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                :append="'%'"
+                @reschange="rate_change"
+              />
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right">
+          <el-button
+            v-if="id !== '007'"
+            type="primary"
+            :size="'small'"
+            @click="submitForm"
+            >保 存
+          </el-button>
+          <el-button :size="'small'" @click="showModelThis = false">{{
+            id == "007" ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/goodStore/sort";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "sort",
+  props: ["showModel", "id", "sitem"],
+  mixins: [resToken],
+  data() {
+    const validate_order_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("预算→成本毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_sale_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("成本→售价毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_lower_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("最低毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_rate = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("单品修改下限毛利率不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      loading: false,
+      showModelThis: this.showModel,
+      ruleForm: {
+        id: "",
+        cat_name: "",
+        order_rate: "0",
+        sale_rate: "0",
+        lower_rate: "0",
+        rate: "0",
+      },
+      rulesThis: this.rules,
+      rules: {
+        order_rate: [{ required: true, validator: validate_order_rate, trigger: "blur" }],
+        sale_rate: [{ required: true, validator: validate_sale_rate, trigger: "blur" }],
+        lower_rate: [{ required: true, validator: validate_lower_rate, trigger: "blur" }],
+        rate: [{ required: true, validator: validate_rate, trigger: "blur" }],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      await this.initData();
+      this.loading = false;
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { pid, id, cat_name, order_rate, sale_rate, lower_rate, rate } = this.sitem;
+          this.ruleForm = {
+            pid: pid || "",
+            id: id || "",
+            cat_name: cat_name || "",
+            order_rate: order_rate || "0",
+            sale_rate: sale_rate || "0",
+            lower_rate: lower_rate || "0",
+            rate: rate || "0",
+          };
+        }
+      });
+    },
+    order_rate_change(e) {
+      this.ruleForm.order_rate = e + "";
+      this.$refs.ruleForm.validateField("order_rate");
+    },
+    sale_rate_change(e) {
+      this.ruleForm.sale_rate = e + "";
+      this.$refs.ruleForm.validateField("sale_rate");
+    },
+    lower_rate_change(e) {
+      this.ruleForm.lower_rate = e + "";
+      this.$refs.ruleForm.validateField("lower_rate");
+    },
+    rate_change(e) {
+      this.ruleForm.rate = e + "";
+      this.$refs.ruleForm.validateField("rate");
+    },
+
+    async initData() {
+      const res = await asyncRequest.detail({ id: this.sitem.id });
+      if (res && res.code === 0 && res.data) {
+        console.log(res.data);
+        const { pid, id, cat_name, order_rate, sale_rate, lower_rate, rate } = res.data;
+        this.ruleForm = {
+          pid: pid || "",
+          id: id || "",
+          cat_name: cat_name || "",
+          order_rate: order_rate || "0",
+          sale_rate: sale_rate || "0",
+          lower_rate: lower_rate || "0",
+          rate: rate || "0",
+        };
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          delete model["cat_name"];
+          delete model["pid"];
+          let res = await asyncRequest.editRate(model);
+          this.loading = false;
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "毛利率设置成功!",
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.sort {
+}
+</style>

+ 40 - 24
src/views/goodStore/sort/index.vue

@@ -184,7 +184,17 @@
             @click="deleteItem(scope.row.id)"
           ></i>
         </el-tooltip>
-
+        <el-tooltip
+          v-if="powers.some((item) => item == '060')"
+          effect="dark"
+          content="设置毛利率"
+          placement="top"
+        >
+          <i
+            class="el-icon-s-check tb-icon"
+            @click="setRate(scope.row)"
+          ></i>
+        </el-tooltip>
         <el-tooltip
           v-if="parseInt(scope.row.level) < 3"
           effect="dark"
@@ -207,10 +217,19 @@
       @refresh="searchList"
       @cancel="showModel = false"
     />
+    <!-- 弹窗 新增/修改 -->
+    <add-edit-rate
+      :id="modelRateId"
+      :show-model="showRateModel"
+      :sitem="sitemRate"
+      @refresh="searchList"
+      @cancel="showRateModel = false"
+    />
   </div>
 </template>
 <script>
 import addEdit from "./addEdit";
+import addEditRate from "./addEditRate";
 import asyncRequest from "@/apis/service/goodStore/sort";
 import statusList from "@/assets/js/statusList";
 import roleLevel from "@/assets/js/roleLevel";
@@ -222,6 +241,7 @@ export default {
   mixins: [mixinPage, resToken],
   components: {
     addEdit,
+    addEditRate,
   },
   computed: {
     //组件SIZE设置
@@ -245,6 +265,9 @@ export default {
       showModel: false,
       modelId: "000",
       sitem: {},
+      showRateModel: false,
+      modelRateId: "000",
+      sitemRate: {},
       titleList: [],
       parmValue: {
         page: 1, // 页码
@@ -274,11 +297,11 @@ export default {
       },
       // 表格 - 列参数
       columns: [
-        {
-          prop: "id",
-          label: "ID",
-          "min-width": "100px",
-        },
+        // {
+        //   prop: "id",
+        //   label: "ID",
+        //   "min-width": "100px",
+        // },
         {
           prop: "cat_name",
           label: "分类名称",
@@ -290,37 +313,24 @@ export default {
         {
           prop: "status",
           label: "状态",
-          sortable: true,
           _slot_: "status",
-          "min-width": "70px",
-        },
-        {
-          prop: "creater",
-          label: "预算→成本",
+          "width": "70px",
         },
         {
           prop: "creater",
-          label: "成本→售价",
-        },
-        {
-          prop: "creater",
-          label: "最低毛利",
-        },
-        {
-          prop: "creater",
-          label: "单品修改下限",
+          label: "创建人",
+          width: "70px",
         },
         {
           prop: "addtime",
           label: "创建时间",
-          sortable: true,
-          "min-width": "145px",
+          "width": "145px",
         },
         {
           prop: "",
           label: "操作",
           fixed: "right",
-          "min-width": "170px",
+          width: "200px",
           _noset_: true,
           _slot_: "operation",
         },
@@ -367,6 +377,12 @@ export default {
       };
       this.titleList.push(model);
     },
+    //设置毛利率
+    setRate(row) {
+      this.modelRateId = row.id;
+      this.sitemRate = row;
+      this.showRateModel = true;
+    },
     // 新建/编辑/详情
     openModal(row, type) {
       this.sitem = row;

+ 19 - 19
src/views/sellOut/zixunOrder/components/ShowDataTableColumns.js

@@ -1,42 +1,42 @@
 export default [
   {
-    prop: "good_name",
-    label: "商品名称",
-    _slot_: "good_name",
+    prop: "brand_id",
+    label: "品牌",
   },
 
   {
-    prop: "speclist",
-    label: "规格",
-    _slot_: "speclist",
+    prop: "model",
+    label: "型号",
   },
   {
-    prop: "supplierName",
-    label: "供应商名称",
+    prop: "color",
+    label: "颜色",
   },
   {
-    prop: "company",
-    label: "业务企业名称",
+    prop: "material",
+    label: "材质",
   },
   {
-    prop: "good_info_img",
-    _slot_: "good_info_img",
-    label: "详情图",
+    prop: "total_weight",
+    label: "商品重量(g)",
   },
   {
-    prop: "online_reason",
-    label: "上线原因",
+    prop: "is_addrs",
+    label: "是否多地",
+    _slot_: "is_auth",
   },
   {
-    prop: "spuCode",
-    label: "商品编号",
+    prop: "is_custom",
+    label: "是否定制",
+    _slot_: "is_custom",
     span: 8,
   },
 
 
   {
-    prop: "creater",
-    label: "申请人",
+    prop: "is_gold_price",
+    label: "启用金价",
+    _slot_: "is_gold_price",
     span: 8,
   },
   {

+ 19 - 17
src/views/sellOut/zixunOrder/components/addEditForm.vue

@@ -136,14 +136,9 @@
         </el-form-item>
       </el-col>
       <el-co :span="24">
-        <el-form-item
-          label="商品信息"
-          :label-position="'top'"
-          prop="ladder"
-          class="clear"
-        >
+        <el-form-item label="商品信息" class="clear" required>
           <el-table
-            :data="ruleForm.ladder"
+            :data="tableData"
             stripe
             border
             :size="'mini'"
@@ -261,7 +256,7 @@
               show-overflow-tooltip
               width="110"
             />
-              <el-table-column
+            <el-table-column
               prop="good_name"
               label="商品分类"
               show-overflow-tooltip
@@ -390,6 +385,8 @@ export default {
   },
   data() {
     return {
+      // 表格 - 数据
+      tableData: [],
       showModel: false,
       editItem: {},
       options: [
@@ -465,14 +462,6 @@ export default {
             trigger: "change",
           },
         ],
-        ladder: [
-          {
-            type: "array",
-            required: true,
-            message: "至少添加两个商品要求",
-            trigger: "change",
-          },
-        ],
       },
     };
   },
@@ -518,7 +507,15 @@ export default {
       this.editItem.index = index;
       this.showModel = true;
     },
-    editGoodRefresh() {
+    editGoodRefresh(e) {
+      const { index } = e;
+      if (index + "" === "-1") {
+        this.tableData.push(JSON.parse(JSON.stringify(e)));
+      } else {
+        const fsindex = parseInt(index + "");
+        this.tableData[fsindex] = JSON.parse(JSON.stringify(e));
+        this.$set(this.tableData, fsindex, this.tableData[fsindex]);
+      }
       this.showModel = false;
     },
     async resetForm() {
@@ -538,6 +535,7 @@ export default {
             companyNo,
             endtime, //咨询截止时间
             platform_code, //平台id
+            ladder,
           } = this.sitem;
 
           this.ruleForm = {
@@ -549,6 +547,10 @@ export default {
             endtime: endtime || "", //咨询截止时间
             platform_code: platform_code ? [platform_code] : [], //平台id
           };
+          this.tableData =
+            ladder && ladder.length > 0
+              ? JSON.parse(JSON.stringify(ladder))
+              : [];
         }
       });
     },

+ 10 - 26
src/views/sellOut/zixunOrder/components/addEditGoodModal.vue

@@ -27,7 +27,7 @@
           >
             <el-row>
               <el-col :span="8">
-                <el-form-item label="到货时间" prop="arrival_time">
+                <el-form-item label="到货日期" prop="arrival_time">
                   <el-date-picker
                     v-model="ruleForm.arrival_time"
                     type="date"
@@ -35,7 +35,7 @@
                     :disabled="type === 'view'"
                     value-format="yyyy-MM-dd"
                     :picker-options="pickerOptions"
-                    placeholder="到货时间"
+                    placeholder="到货日期"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -379,7 +379,7 @@ export default {
   data() {
     return {
       loading: false,
-      is_noble: true,
+      is_noble: false,
       is_addrs_options: [
         { value: "0", label: "一地" },
         { value: "1", label: "多地" },
@@ -450,7 +450,8 @@ export default {
     async initForm() {
       this.loading = true;
       const { index } = this.sitem;
-      this.findex = index | +"" | "-1";
+      console.log(index);
+      this.findex = index ? index + "" : "-1";
       if (this.findex === "-1") {
         this.title = "添加咨询商品";
       } else {
@@ -569,28 +570,11 @@ export default {
         if (valid) {
           this.loading = true;
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let res = {};
-          if (this.id === "003") {
-            delete model["id"];
-            res = await asyncRequest.add(model);
-          } else {
-            res = await asyncRequest.update(model);
-          }
-          this.loading = false;
-          if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功!" : "修改成功!";
-            this.$notify.success({
-              title,
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
+          model.index = this.findex;
+
+          this.showModelThis = false;
+          // 刷新
+          this.$emit("refresh", model);
         } else {
           console.log("error submit!!");
           return false;

+ 48 - 12
src/views/serviceParam/supplier/components/baseForm.vue

@@ -10,12 +10,12 @@
     class="supplierAdd"
   >
     <el-row>
-      <el-col :span="8">
+      <el-col :span="6">
         <div class="supplierAdd-title" style="margin: 6px 0 0 10px">
           基础信息
         </div></el-col
       >
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="合作状态" prop="coop_state">
           <el-select
             style="width: 100%"
@@ -34,7 +34,7 @@
         </el-form-item>
       </el-col>
 
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="供应商来源" prop="source">
           <el-select
             style="width: 100%"
@@ -52,7 +52,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="申请类型" prop="type">
           <el-select
             style="width: 100%"
@@ -70,7 +70,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="所属类别" prop="category">
           <el-select
             style="width: 100%"
@@ -88,7 +88,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="物流方式" prop="delivery_way">
           <el-select
             style="width: 100%"
@@ -105,7 +105,7 @@
             </el-option>
           </el-select> </el-form-item
       ></el-col>
-      <el-col :span="8"
+      <el-col :span="6"
         ><el-form-item label="供应商类型" prop="supplier_type">
           <el-select
             style="width: 100%"
@@ -122,7 +122,7 @@
             </el-option>
           </el-select> </el-form-item
       ></el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="供应商级别" prop="level">
           <el-select
             style="width: 100%"
@@ -140,7 +140,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item label="付款方式" prop="pay_type">
           <el-select
             style="width: 100%"
@@ -157,8 +157,19 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="负责人" prop="personid">
+          <search-account
+            :disabled="type !== 'add' && type !== 'edit'"
+            :is-detail="type !== 'add'"
+            :value="ruleForm.personid"
+            :size="'small'"
+            :names="hand_name"
+            :placeholder="'负责人名称'"
+            @searchChange="handleHandoverName"
+          />
+        </el-form-item>
       </el-col>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-form-item
           label="营业执照"
           prop="supplier_img"
@@ -185,7 +196,7 @@
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="16">
+      <el-col :span="12">
         <el-form-item label="资质证明" prop="prove_img">
           <div class="good_info_img_div">
             <ul class="clear">
@@ -358,7 +369,9 @@
         style="text-align: right"
         v-if="type === 'add' || type === 'edit'"
       >
-        <el-button type="primary" @click="submitForm">保 存 </el-button>
+        <el-button type="primary" :size="'small'" @click="submitForm"
+          >保 存
+        </el-button>
       </el-col>
     </el-row>
   </el-form>
@@ -398,6 +411,7 @@ export default {
 
     return {
       loading: false,
+      hand_name: "",
       coop_stateoptions: [
         { value: "0", label: "白名单" },
         { value: "1", label: "黑名单" },
@@ -479,6 +493,14 @@ export default {
             trigger: "change",
           },
         ],
+        personid: [
+          {
+            required: true,
+            type: "array",
+            message: "请选择负责人",
+            trigger: "change",
+          },
+        ],
         contactor: [
           { required: true, message: "姓名不能为空", trigger: "blur" },
         ],
@@ -517,6 +539,7 @@ export default {
   },
   methods: {
     async initForm() {
+      this.hand_name = "";
       this.loading = true;
       this.resetFormData();
       this.rulesThis = this.rules;
@@ -556,7 +579,10 @@ export default {
         legaler,
         registertime,
         scope,
+        personid,
+        person,
       } = this.sitem;
+      this.hand_name = person || "";
       this.ruleForm = {
         id: id || "",
         coop_state: coop_state || "",
@@ -579,6 +605,7 @@ export default {
         legaler: legaler || "",
         registertime: registertime || "",
         scope: scope || "",
+        personid: personid ? [personid] : [],
       };
     },
     async submitForm() {
@@ -588,6 +615,7 @@ export default {
 
           let model = JSON.parse(JSON.stringify(this.ruleForm));
           model.prove_img = model.prove_img.toString();
+          model.personid = model.personid.toString();
           let res = {};
           if (this.id === "add") {
             delete model["id"];
@@ -616,6 +644,14 @@ export default {
         }
       });
     },
+    handleHandoverName(e) {
+      if (e && e.id) {
+        this.ruleForm.personid = [e.id];
+      } else {
+        this.ruleForm.personid = [];
+      }
+      this.$refs.ruleForm.validateField("personid");
+    },
     type_search_change(e) {
       const { id, code, label } = e;
       if (id) {

Неке датотеке нису приказане због велике количине промена