Browse Source

修改bug

戴艳蓉 3 years ago
parent
commit
3fa0746e81

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-1a9f19f9.d858aafe.css


BIN
dist/static/css/chunk-1a9f19f9.d858aafe.css.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-6a7b2a9c.a6b986d8.css


BIN
dist/static/css/chunk-6a7b2a9c.a6b986d8.css.gz


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


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


BIN
dist/static/js/app.cde11f99.js.gz


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


BIN
dist/static/js/chunk-1a9f19f9.f5c79534.js.gz


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


BIN
dist/static/js/chunk-6a7b2a9c.d1e62e18.js.gz


+ 22 - 4
src/views/goodStore/goldPrice/index.vue

@@ -5,7 +5,16 @@
       v-loading="loading"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <el-col :span="4" style="width: 160px"> 分类 </el-col>
+      <el-col :span="4" style="width: 200px">
+        <search-metal-kind
+          :values="parmValue.type"
+          :disabled="false"
+          :isDetail="false"
+          :size="searchSize"
+          :placeholder="'金属类型'"
+          @searchChange="noble_metalsearchChange"
+        />
+      </el-col>
 
       <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
         <el-button type="primary" :size="searchSize" @click="searchList">
@@ -186,11 +195,11 @@ export default {
     this.searchList();
   },
   methods: {
-    restSearch() {
+    async restSearch() {
       this.parmValue = {
         type: "",
       };
-      this.searchList();
+      await this.searchList();
     },
     // 新建/编辑/详情
     openModal(row, type) {
@@ -198,7 +207,16 @@ export default {
       this.modelId = type;
       this.showModel = true;
     },
- 
+    //贵金属种类选择
+    async noble_metalsearchChange(e) {
+      const { id, code, label } = e;
+      if (id) {
+        this.parmValue.type = id;
+      } else {
+        this.parmValue.type = "";
+      }
+      await this.searchList();
+    },
     /**
      * 启用/禁用
      * @param {String} id id

+ 0 - 420
src/views/goodStore/priceRecord/addEdit.vue

@@ -1,420 +0,0 @@
-<template>
-  <el-dialog
-    :title="title"
-    :center="true"
-    align="left"
-    top="5vh"
-    width="700px"
-    @close="closeModel"
-    :close-on-click-modal="false"
-    :visible.sync="showModelThis"
-    v-loading="loading"
-    element-loading-text="拼命加载中"
-    element-loading-spinner="el-icon-loading"
-    element-loading-background="rgba(0, 0, 0, 0.8)"
-  >
-    <el-card>
-      <el-row :gutter="10">
-        <el-col :span="24">
-          <el-form
-            v-if="isApproval"
-            :model="cexForm"
-            status-icon
-            :rules="cexRules"
-            ref="cexForm"
-            label-width="80px"
-            class="cexForm-ruleForm"
-            ><el-row>
-              <el-col :span="12">
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">规格名称:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    ruleForm.name
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">规格排序:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    ruleForm.weight
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">规格备注:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    ruleForm.Fremark
-                  }}</el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="审核状态" prop="status">
-                  <el-select
-                    v-model="cexForm.status"
-                    placeholder="请选择审核状态"
-                    @change="selectChange"
-                  >
-                    <el-option
-                      v-for="item in statusList"
-                      :key="item.code"
-                      :label="item.name"
-                      :value="item.code"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="审核说明" prop="remark">
-                  <el-input
-                    v-model="cexForm.remark"
-                    type="textarea"
-                    placeholder="请输入审核说明"
-                    :rows="5"
-                    maxlength="300"
-                    show-word-limit
-                  ></el-input>
-                </el-form-item>
-                <el-col :span="24" style="text-align: right">
-                  <el-button type="primary" @click="submitCexForm"
-                    >保 存
-                  </el-button>
-                  <el-button @click="showModelThis = false">取 消</el-button>
-                </el-col>
-              </el-col>
-            </el-row></el-form
-          >
-
-          <el-form
-            v-else
-            :model="ruleForm"
-            status-icon
-            :rules="rulesThis"
-            ref="ruleForm"
-            label-width="80px"
-            class="demo-ruleForm"
-            ><el-row>
-              <el-col :span="12">
-                <el-form-item label="规格名称" prop="name" :disabled="isDetail">
-                  <el-input
-                    placeholder="规格名称"
-                    v-model="ruleForm.name"
-                    :disabled="isDetail"
-                  ></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="规格排序" prop="weight">
-                  <el-input-number
-                    :disabled="isDetail"
-                    id="tl-number"
-                    style="width: 100%; text-align: left"
-                    v-model="ruleForm.weight"
-                    :step="1"
-                    :min="1"
-                    :max="1000"
-                    :precision="0"
-                    step-strictly
-                    :controls="false"
-                  ></el-input-number>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-form-item label="规格备注" prop="remark">
-              <el-input
-                v-model="ruleForm.remark"
-                type="textarea"
-                placeholder="请输入备注"
-                :rows="5"
-                maxlength="300"
-                show-word-limit
-                :disabled="isDetail"
-              ></el-input>
-            </el-form-item>
-            <el-col :span="24" style="text-align: right">
-              <el-tag
-                type="warning"
-                class="fl"
-                style="max-width: 500px"
-                v-if="dataInfo.ex_remark && dataInfo.ex_status === '2'"
-                >审核备注:{{ dataInfo.ex_remark }}</el-tag
-              >
-
-              <el-button type="primary" @click="submitForm" v-if="!isDetail"
-                >保 存
-              </el-button>
-              <el-button @click="showModelThis = false">{{
-                isDetail ? "关 闭" : "取 消"
-              }}</el-button>
-            </el-col>
-          </el-form>
-        </el-col>
-      </el-row>
-    </el-card>
-  </el-dialog>
-</template>
-   <script>
-import asyncRequest from "@/apis/service/goodStore/priceRecord";
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
-import statusList from "@/assets/js/cexStatusList";
-export default {
-  name: "priceRecord",
-  props: ["showModel", "id", "isDetail", "isApproval"],
-  data() {
-    const validatename = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("规格名称不能为空!"));
-      } else {
-        if (value.lenght < 2 || value.lenght > 12) {
-          callback(new Error("规格名称规则为2~12位汉字!"));
-        } else {
-          if (!isChinese(value)) {
-            console.log(9999);
-            callback(new Error("规格名称规则为2~12位汉字!"));
-          } else if (isEmoticon(value)) {
-            console.log(2345);
-            callback(new Error("规格名称规则为2~12位汉字!"));
-          } else {
-            callback();
-          }
-        }
-      }
-    };
-    return {
-      statusList: statusList,
-      loading: false,
-      title: "添加商品规格",
-      showModelThis: this.showModel,
-      dataInfo: {},
-      cexForm: {
-        id: this.id,
-        remark: "",
-        status: "1",
-      },
-      ruleForm: {
-        id: this.id,
-        remark: "",
-        weight: "1",
-        name: "",
-      },
-      cexRules: {
-        status: {
-          required: true,
-          message: "请选择审核状态",
-          trigger: "change",
-        },
-        remark: [
-          {
-            required: false,
-            message: "请输入审核说明!",
-            trigger: "blur",
-          },
-        ],
-      },
-      rulesThis: this.rules,
-      rules: {
-        name: [
-          {
-            required: true,
-            validator: validatename,
-            trigger: "blur",
-          },
-        ],
-        weight: [
-          {
-            required: true,
-            message: "排序不能为空!",
-            trigger: "blur",
-          },
-        ],
-
-        remark: [
-          {
-            required: false,
-            trigger: "blur",
-          },
-        ],
-      },
-    };
-  },
-  methods: {
-    closeModel() {
-      console.log("closeModel!!");
-    },
-    selectChange() {
-      if (this.cexForm.status === "1") {
-        this.cexRules.remark[0].required = false;
-      } else {
-        this.cexRules.remark[0].required = true;
-      }
-    },
-    async initForm() {
-      if (this.isApproval) {
-        this.loading = true;
-        this.title = "商品规格审核";
-        await this.initData();
-        await  this.resetcexForm()
-        this.selectChange()
-        this.loading = false;
-      } else {
-        if (this.id === "add") {
-          this.title = "添加商品规格";
-          // this.ruleForm.isAdmin = 0;
-          this.loading = false;
-          this.rulesThis = this.rules;
-          await this.resetForm();
-        } else {
-          if (this.isDetail) {
-            this.title = "商品规格";
-            this.rulesThis = {};
-          } else {
-            this.title = "修改商品规格";
-            this.rulesThis = this.rules;
-          }
-          await this.resetForm();
-          await this.initData();
-        }
-      }
-    },
-       async resetcexForm() {
-      if (this.$refs.cexForm) {
-        this.$refs.cexForm.resetFields();
-        this.$refs.cexForm.clearValidate();
-        this.cexForm = {
-          id: this.id,
-          remark: "",
-          status: "1",
-        };
-      }
-    },
-    async initData() {
-      this.loading = true;
-      let res = await asyncRequest.detail({ id: this.id });
-      this.loading = false;
-      if (res.code === 0) {
-        let data = res.data;
-        this.dataInfo = data;
-        this.ruleForm = {
-          id: this.id,
-          remark: data.spec_desc,
-          weight: data.weight,
-          name: data.spec_name,
-        };
-      }
-    },
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            id: this.id,
-            remark: "",
-            weight: "",
-            name: "",
-            // isAdmin: 0
-          };
-        }
-      });
-    },
-    async submitCexForm() {
-      await this.$refs.cexForm.validate(async (valid) => {
-        if (valid) {
-          this.loading = true;
-          console.log(this.id);
-          console.log(this.cexForm);
-          let obj = JSON.parse(JSON.stringify(this.cexForm));
-
-          obj.id = this.id;
-          console.log(obj);
-          let res = await asyncRequest.exam(obj);
-          this.loading = false;
-          if (res.code === 0) {
-            let title = "审核审批成功!";
-            this.$notify.success({
-              title,
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        if (valid) {
-          this.loading = true;
-          let obj = JSON.parse(JSON.stringify(this.ruleForm));
-          let res = {};
-          if (this.id === "add") {
-            delete obj["id"];
-            res = await asyncRequest.add(obj);
-          } else {
-            res = await asyncRequest.update(obj);
-          }
-          this.loading = false;
-          if (res.code === 0) {
-            let title = this.id === "add" ? "添加成功" : "修改成功";
-            this.$notify.success({
-              title,
-              message: "",
-            });
-            this.showModelThis = false;
-            // 刷新
-            this.$emit("refresh");
-          }
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-  watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
-      if (val) {
-        this.initForm();
-      }
-    },
-    showModelThis(val) {
-      if (!val) {
-        this.$emit("cancel");
-      }
-    },
-  },
-};
-</script>
-
-   <style lang="scss" scoped>
-.priceRecord {
-  .cexForm-ruleForm {
-    .cexForm-div {
-      margin-bottom: 22px;
-      .cexForm-label {
-        padding-right: 12px;
-        color: #606266;
-        line-height: 40px;
-        font-size: 14px;
-      }
-      .cexForm-main {
-        line-height: 40px;
-        color: rgb(151, 168, 190);
-        line-height: 40px;
-        font-size: 14px;
-      }
-    }
-  }
-}
-</style>
-   

+ 28 - 107
src/views/goodStore/priceRecord/index.vue

@@ -34,10 +34,15 @@
                 @timeReturned="handleTime"
               />
             </el-col>
-            <el-col :span="4" style="width: 160px">
-        
-
-        
+            <el-col :span="4" style="width: 200px">
+              <search-metal-kind
+                :values="parmValue.type"
+                :disabled="false"
+                :isDetail="false"
+                :size="searchSize"
+                :placeholder="'金属类型'"
+                @searchChange="noble_metalsearchChange"
+              />
             </el-col>
             <el-col :span="4" style="width: 170px; padding: 0 0 0 10px">
               <el-input
@@ -74,33 +79,18 @@
           </el-row>
         </div></template
       >
-      <template #type="{ scope }">
-        <el-tag
-          :size="tablebtnSize"
-          v-text="
-            (typeOptions.find((item) => item.id == scope.row.type) || {})
-              .label || '--'
-          "
-        ></el-tag>
-      </template>
     </ex-table>
     <no-auth v-else></no-auth>
   </div>
 </template>
 <script>
-import addEdit from "./addEdit";
 import asyncRequest from "@/apis/service/goodStore/priceRecord";
-import statusList from "@/assets/js/statusList";
-import roleLevel from "@/assets/js/roleLevel";
 import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
 export default {
   name: "priceRecord",
   mixins: [mixinPage, resToken],
-  components: {
-    addEdit,
-  },
   computed: {
     //组件SIZE设置
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -118,30 +108,17 @@ export default {
   },
   data() {
     return {
-      statusList: statusList,
-      roleLevel: roleLevel,
       loading: true,
-      showModel: false,
-      modelId: "000",
-      sitem: {},
       parmValue: {
         page: 1, // 页码
         size: 15, // 每页显示条数
         start: "",
         end: "",
-        status: "",
+        type: "",
         action_name: "",
       },
-      // 状态
-      statusOptions: [
-        { id: "0", label: "禁用" },
-        { id: "1", label: "启用" },
-      ],
-      typeOptions: [
-        { id: "1", label: "18K" },
-        { id: "2", label: "24K" },
-        { id: "3", label: "白银" },
-      ],
+    
+
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -164,9 +141,8 @@ export default {
           width: "70",
         },
         {
-          prop: "type",
+          prop: "type_cn",
           label: "金属种类",
-          _slot_: "type",
         },
         {
           prop: "price",
@@ -180,7 +156,6 @@ export default {
         {
           prop: "addtime",
           label: "创建时间",
-          sortable: true,
         },
       ],
     };
@@ -201,17 +176,12 @@ export default {
         size: 15, // 每页显示条数
         start: "",
         end: "",
-        status: "",
+        type: "",
         action_name: "",
       };
       this.searchList();
     },
-    // 新建/编辑/详情
-    openModal(row, type) {
-      this.sitem = row;
-      this.modelId = type;
-      this.showModel = true;
-    },
+
     // 时间
     async handleTime(e) {
       this.parmValue.start = e.startTime || "";
@@ -225,69 +195,20 @@ export default {
         await this.searchList();
       }
     },
-    /**
-     * 启用/禁用
-     * @param {String} id id
-     * @param {String} status 0-禁用 1-启用
-     */
-    async changeStatus(id, status) {
-      await this.$confirm(`确定要改为${status === "0" ? "禁用" : "启用"}?`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          this.loading = true;
-          const model = {
-            id: id,
-            status: status === "1" ? "0" : "1",
-          };
-          const res = await asyncRequest.status(model);
-          if (res && res.code === 0) {
-            this.loading = false;
-            this.$notify.success({
-              title: "状态修改成功!",
-              message: "",
-            });
-            await this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.loading = false;
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
-    async deleteItem(id) {
-      await this.$confirm("确定要删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(async () => {
-          const model = {
-            id: id,
-          };
-          const res = await asyncRequest.delete(model);
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "删除成功",
-              message: "",
-            });
-            this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
+    //贵金属种类选择
+    async noble_metalsearchChange(e) {
+      const { id, code, label } = e;
+      if (id) {
+        this.parmValue.type = id;
+      } else {
+        this.parmValue.type = "";
+      }
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
     },
+ 
+ 
     // 刷新表格
     async searchList() {
       this.loading = true;

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