sunny 1 ano atrás
pai
commit
526c2c2fa7

+ 29 - 0
src/api/certManage.js

@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+
+export function list(query) {
+  return request({
+    url: '/mall-integral-obtain/certificate/sys/page',
+    method: 'get',
+    params:query
+  })
+}
+
+export function complete(query) {
+  return request({
+    url: '/mall-integral-obtain/certificate/complete',
+    method: 'post',
+    params:query
+  })
+}
+
+export function types(query) {
+  return request({
+    url: '/mall-integral-obtain/certificate/types',
+    method: 'get',
+    params:query
+  })
+}
+
+
+
+

+ 10 - 1
src/api/public.js

@@ -38,4 +38,13 @@ export function companyTypeList(query) {
       method: 'post',
       params:query
     })
-  }
+  }
+
+  //字典下拉列表
+  export function dataTypeList(query) {
+    return request({
+      url: '/system/dict/data/type',
+      method: 'get',
+      params:query
+    })
+  }

+ 2 - 0
src/permission.js

@@ -44,6 +44,8 @@ const myRoles = [
   'commendList', 
   'festivalManage', 
   'festivalList', 
+  'certManage', 
+  'certList', 
   'dictManage', 
   'dictList', 
   'dictDataList', 

+ 13 - 0
src/router/index.js

@@ -203,6 +203,19 @@ export const asyncRouterMap = [
       { path: 'festivalList', component: _import('festivalManage/festivalList'), name: 'festivalList', meta: { title: '节日列表', icon: 'lipin', noCache: true }},
     ]
   },
+  {
+    path: '/certManage',
+    component: Layout,
+    redirect: 'noredirect',
+    name: 'certManage',
+    meta: {
+      title: '证书管理',
+      icon: 'lipin'
+    },
+    children: [
+      { path: 'certList', component: _import('certManage/certList'), name: 'certList', meta: { title: '证书列表', icon: 'lipin', noCache: true }},
+    ]
+  },
   {
     path: '/dictManage',
     component: Layout,

+ 275 - 0
src/views/certManage/certList.vue

@@ -0,0 +1,275 @@
+<template>
+    <div class="app-container calendar-list-container">
+      <!-- 查询和其他操作 -->
+      <div class="filter-container">
+        <!-- <el-select v-model="listQuery.type" clearable placeholder="证书类型" style="top: -4px; width: 200px">
+          <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
+          </el-option>
+        </el-select> -->
+        <el-select v-model="listQuery.status" clearable placeholder="审批状态" style="top: -4px; width: 200px">
+          <el-option :key="item.type" v-for="item in statusTypeList" :label="item.name" :value="item.type">
+          </el-option>
+        </el-select>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
+      </div>
+  
+      <!-- 查询结果 -->
+      <el-table size="small" :data="list" v-loading="listLoading"
+        element-loading-text="正在查询中。。。" border fit highlight-current-row>
+        <el-table-column type="index" label="序号" header-align="center" align="center">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="证书">
+            <template slot-scope="props">
+                <a style="color: #1e80ff;" target="_blank" :href="props.row.file">{{ props.row.title }}</a>
+            </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="类型" prop="typeName">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="上传人" prop="userName">
+        </el-table-column>
+        <el-table-column align="center" min-width="180px" label="公司" prop="companyName">
+        </el-table-column>
+        <el-table-column align="center" min-width="180px" label="部门" prop="deptName">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="获得积分" prop="integral">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="审核状态" prop="statusName">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="日期" prop="createTime">
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="100px" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button type="primary" size="small" @click="handleView(scope.row)">审批</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+  
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
+          :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
+          layout="total, sizes, prev, pager, next, jumper" :total="total">
+        </el-pagination>
+      </div>
+  
+      <!-- 添加或修改对话框 -->
+      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="45%">
+        <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px"
+          style="width: 700px; margin-left: 50px">
+          <el-form-item label="证书类型" prop="type">
+            <el-select v-model="dataForm.type" filterable placeholder="请选择" style="width: 350px">
+              <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
+              </el-option>
+            </el-select>
+          </el-form-item>
+  
+        </el-form>
+  
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="dialogFormVisible = false">取消</el-button>
+          <el-button type="primary" @click="handleComplete(0)">通过</el-button>
+          <el-button type="warning" @click="handleComplete(1)">不通过</el-button>
+        </div>
+      </el-dialog>
+    </div>
+  </template>
+    
+  <style>
+  .demo-table-expand {
+    font-size: 0;
+  }
+  
+  .demo-table-expand label {
+    width: 200px;
+    color: #99a9bf;
+  }
+  
+  .demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+  }
+  </style>
+    
+  <script>
+  import {
+    types,
+    complete,
+    list,
+  } from "@/api/certManage";
+  import waves from "@/directive/waves"; // 水波纹指令
+  import Tinymce from "@/components/Tinymce";
+  
+  export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        typeVisible: false,
+        fileImgUrl: this.upLoadUrl,
+        recipientsList: [],
+        typeList: [],
+        statusTypeList: [
+          {
+            type: 0,
+            name: "审核中",
+          },
+          {
+            type: 1,
+            name: "通过",
+          },
+          {
+            type: 2,
+            name: "不通过",
+          },
+        ],
+        subTypeList: [
+          {
+            type: 0,
+            name: "奖状",
+          },
+          {
+            type: 1,
+            name: "邮件",
+          },
+        ],
+        list: [
+        ],
+        delarr: [],
+        multipleSelection: [],
+        total: 0,
+        listLoading: false,
+        listQuery: {
+          page: 1,
+          limit: 10,
+        //   type: "",
+          status: "",
+        },
+        dataForm: {
+          type: undefined,
+          flag:'',
+          certificateId:'',
+        },
+        dialogFormVisible: false,
+        dialogStatus: "",
+        textMap: {
+          update: "证书审核",
+          create: "创建",
+        },
+        rules: {
+          type: [{ required: true, message: "请选择证书类型", trigger: "blur" }],
+        },
+      };
+    },
+    created() {
+      this.getTypeList();
+      this.getList();
+    },
+    methods: {
+      getTypeList(){
+        types().then(response => {
+          this.typeList = response.data.data;
+        })
+      },
+      getList() {
+        this.listLoading = true;
+        list(this.listQuery)
+          .then((response) => {
+            this.list = response.data.data.items;
+            this.total = response.data.data.total;
+            this.listLoading = false;
+          })
+          .catch(() => {
+            this.list = [];
+            this.total = 0;
+            this.listLoading = false;
+          });
+      },
+  
+      handleFilter() {
+        this.listQuery.page = 1;
+        this.getList();
+      },
+  
+      handleSizeChange(val) {
+        this.listQuery.limit = val;
+        this.getList();
+      },
+  
+      handleCurrentChange(val) {
+        this.listQuery.page = val;
+        this.getList();
+      },
+  
+      handleView(row) {
+        this.dataForm.type = '';
+        this.dataForm.certificateId =row.id;
+        this.dialogStatus = "update";
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs["dataForm"].clearValidate();
+        });
+      },
+      handleComplete(flag){
+        if(flag==0){
+            this.$refs["dataForm"].validate((valid) => {
+                if (valid) {
+                    this.dataForm.flag = flag;
+                    complete(this.dataForm).then(() => {
+                        this.dialogFormVisible = false;
+                        this.$notify({
+                        title: "成功",
+                        message: "审批成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                        this.getList();
+                    });
+                }
+            });
+        }else{
+                    this.dataForm.flag = flag;
+                    complete(this.dataForm).then(() => {
+                        this.dialogFormVisible = false;
+                        this.$notify({
+                        title: "成功",
+                        message: "审批成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                        this.getList();
+                    });
+        }
+
+        
+      }
+      
+    },
+  };
+  </script>
+  <style>
+  .ad-avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  
+  .ad-avatar-uploader .el-upload:hover {
+    border-color: #409eff;
+  }
+  
+  .ad-avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+  }
+  
+  .ad-avatar {
+    display: block;
+  }
+  </style>
+    

+ 16 - 4
src/views/giftManage/giftList.vue

@@ -146,8 +146,8 @@
                 <el-form-item label="礼品属性" prop="productAttribute">
                     <el-select v-model="dataForm.productAttribute" filterable placeholder="请选择" style="width: 350px"
                         value-key="value" @change="changeProductAttribute">
-                        <el-option :key="item.type" v-for="item in productAttributeList" :label="item.name"
-                            :value="item.type">
+                        <el-option :key="item.dictValue" v-for="item in productAttributeList" :label="item.dictLabel"
+                            :value="item.dictValue">
                         </el-option>
                     </el-select>
                 </el-form-item>
@@ -159,7 +159,7 @@
                 </el-form-item>
                 <el-form-item v-if="dataForm.productAttribute==1" label="礼品所在地" prop="location">
                     <el-select v-model="dataForm.location" filterable placeholder="请选择" style="width: 350px">
-                        <el-option :key="item.index" v-for="item in locationList" :label="item" :value="item">
+                        <el-option :key="item.dictValue" v-for="item in locationList" :label="item.dictLabel" :value="item.dictValue">
                         </el-option>
                     </el-select>
                 </el-form-item>
@@ -224,7 +224,7 @@
   
 <script>
 import { createItem, updateItem, giftList, giftState, exchangeHistory, relatedWelfare, welfareList } from "@/api/giftManage";
-import { depTypeList } from "@/api/public";
+import { depTypeList,dataTypeList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
 import Tinymce from '@/components/Tinymce'
 
@@ -415,10 +415,22 @@ export default {
     },
     created() {
         // this.getCompanyTypeList();
+        this.getProductAttributeList();
+        this.getDataTypeList(); 
         this.getDepTypeList(); 
         this.getList();
     },
     methods: {
+        getDataTypeList() {
+            dataTypeList({dictType:'mall_sku_location'}).then(response => {
+                this.locationList = response.data.data;
+            }).catch(() => {});
+        },
+        getProductAttributeList(){
+            dataTypeList({dictType:'mall_sku_attribute'}).then(response => {
+                this.productAttributeList = response.data.data;
+            }).catch(() => {});
+        },
         getWelfareList(){
             welfareList({status:1}).then(response => {
                 this.options = response.data.data;

+ 16 - 4
src/views/goodsManage/goodsList.vue

@@ -142,8 +142,8 @@
                 <el-form-item label="商品属性" prop="productAttribute">
                     <el-select v-model="dataForm.productAttribute" filterable placeholder="请选择" style="width: 350px"
                         value-key="value" @change="changeProductAttribute">
-                        <el-option :key="item.type" v-for="item in productAttributeList" :label="item.name"
-                            :value="item.type">
+                        <el-option :key="item.dictValue" v-for="item in productAttributeList" :label="item.dictLabel"
+                            :value="item.dictValue">
                         </el-option>
                     </el-select>
                 </el-form-item>
@@ -155,7 +155,7 @@
                 </el-form-item>
                 <el-form-item v-if="dataForm.productAttribute==1" label="商品所在地" prop="location">
                     <el-select v-model="dataForm.location" filterable placeholder="请选择" style="width: 350px">
-                        <el-option :key="item.index" v-for="item in locationList" :label="item" :value="item">
+                        <el-option :key="item.dictValue" v-for="item in locationList" :label="item.dictLabel" :value="item.dictValue">
                         </el-option>
                     </el-select>
                 </el-form-item>
@@ -211,7 +211,7 @@
   
 <script>
 import { createItem, updateItem, goodsList, goodsState, exchangeHistory } from "@/api/goodsManage";
-import { depTypeList } from "@/api/public";
+import { depTypeList,dataTypeList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
 import Tinymce from '@/components/Tinymce'
 
@@ -305,6 +305,8 @@ export default {
         }
     },
     created() {
+        this.getProductAttributeList();
+        this.getDataTypeList(); 
         this.getDepTypeList(); 
         this.getList();
     },
@@ -511,6 +513,16 @@ export default {
             })
 
         },
+        getDataTypeList() {
+            dataTypeList({dictType:'mall_sku_location'}).then(response => {
+                this.locationList = response.data.data;
+            }).catch(() => {});
+        },
+        getProductAttributeList(){
+            dataTypeList({dictType:'mall_sku_attribute'}).then(response => {
+                this.productAttributeList = response.data.data;
+            }).catch(() => {});
+        },
         getDepTypeList() {
             depTypeList().then(response => {
                 this.depTypeList = response.data.data;