sunlupeng 7 ヶ月 前
コミット
521afd8be4

+ 5 - 5
src/views/basicSetting/supplier.vue

@@ -211,7 +211,7 @@ categoryOptions<template>
 </template>
 <script>
 import { createItem, updateItem, goodsList, removeItem, typeList } from "@/api/supplier";
-import { listDept } from "@/api/goodsTypeList";
+import { listDept } from "@/api/dept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -330,17 +330,17 @@ export default {
         },
         getListCategory() {
             listDept().then(response => {
-                this.categoryOptions = this.handleTree(response.data.data, "id");
+                this.categoryOptions = this.handleTree(response.data.data, "deptId");
             });
         },
-        /** 转换证书数据结构 */
+        /** 转换部门数据结构 */
         normalizer(node) {
             if (node.children && !node.children.length) {
                 delete node.children;
             }
             return {
-                id: node.id,
-                label: node.categoryName,
+                id: node.deptId,
+                label: node.deptName,
                 children: node.children
             };
         },

+ 13 - 3
src/views/dictManage/dictDataList.vue

@@ -13,8 +13,9 @@
                 <el-option :key="item.type" v-for="item in typeList" :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>
-            <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
+            <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
+            <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+            <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
             <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button>
 
         </div>
@@ -245,10 +246,19 @@ export default {
             })
         },
 
-        handleFilter() {
+        handleQuery() {
             this.listQuery.page = 1
             this.getList()
         },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.listQuery = {
+                dictType: '',
+                dictLabel: '',
+                status: '',
+            };
+            this.handleQuery();
+        },
 
         handleSizeChange(val) {
             this.listQuery.limit = val

+ 13 - 3
src/views/dictManage/dictList.vue

@@ -9,8 +9,9 @@
             <el-option :key="item.type" v-for="item in typeList" :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>
-        <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
+        <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+        <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
         <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button>
       </div>
   
@@ -228,10 +229,19 @@
         })
       },
   
-      handleFilter() {
+      handleQuery() {
         this.listQuery.page = 1
         this.getList()
       },
+       /** 重置按钮操作 */
+       resetQuery() {
+            this.listQuery = {
+              dictName: '',
+              dictType: '',
+              status: '',
+            };
+            this.handleQuery();
+        },
   
       handleSizeChange(val) {
         this.listQuery.limit = val

+ 1 - 1
src/views/goodsManage/goodsTypeList.vue

@@ -153,7 +153,7 @@
       this.getList();
     },
     methods: {
-      //选中树形部门选项
+      //选中树形选项
       departTreeSelected(node,instanceId){
         console.log(node,instanceId);
         this.form.categoryParentCode = node.categoryCode;

+ 19 - 7
src/views/sys/admin.vue

@@ -5,9 +5,12 @@
     <div class="filter-container">
       <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入用户名称" v-model="listQuery.username">
       </el-input>
-      <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
-      <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
-      <el-button class="filter-item" type="primary" :loading="downloadLoading" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
+      <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入用户昵称" v-model="listQuery.nickname">
+      </el-input>
+      <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
+      <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
+      <el-button class="filter-item" :loading="downloadLoading" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
     </div>
 
     <!-- 查询结果 -->
@@ -31,9 +34,9 @@
 
       <el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button type="primary" size="mini" @click="handleUpdate(scope.row, false)">编辑</el-button>
-          <el-button type="primary" size="mini" @click="handleUpdate(scope.row, true)">角色</el-button>
-          <el-button type="danger" size="mini"  @click="handleDelete(scope.row)">删除</el-button>
+          <el-button type="primary" size="small" @click="handleUpdate(scope.row, false)">编辑</el-button>
+          <el-button type="primary" size="small" @click="handleUpdate(scope.row, true)">角色</el-button>
+          <el-button type="danger" size="small"  @click="handleDelete(scope.row)">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -301,10 +304,19 @@ export default {
         this.listLoading = false
       })
     },
-    handleFilter() {
+    handleQuery() {
       this.listQuery.page = 1
       this.getList()
     },
+     /** 重置按钮操作 */
+     resetQuery() {
+        this.listQuery = {
+          username: undefined,
+          nickname: undefined,
+          sort: '+id'
+        };
+        this.handleQuery();
+      },
     handleSizeChange(val) {
       this.listQuery.limit = val
       this.getList()

+ 57 - 40
src/views/sys/dept.vue

@@ -1,28 +1,25 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-      <el-form-item label="部门名称" prop="deptName">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item>
         <el-input
           v-model="queryParams.deptName"
           placeholder="请输入部门名称"
           clearable
-          @keyup.enter.native="handleQuery"
+          style="width: 200px;"
         />
       </el-form-item>
-      <!-- <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="部门状态" clearable>
-          <el-option
-            v-for="dict in dict.type.sys_normal_disable"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item> -->
+      <el-form-item>
+        <el-select v-model="queryParams.status" clearable placeholder="状态" class="filter-item" style="width: 200px;">
+                <el-option :key="item.value" v-for="item in statusList" :label="item.label" :value="item.value">
+                </el-option>
+            </el-select>
+      </el-form-item>
+      
       <el-form-item>
           <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleQuery">查找</el-button>
-          <el-button class="filter-item" type="primary" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
-          <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleAdd">添加</el-button>
+          <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+          <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleAdd">添加</el-button>
           <el-button class="filter-item" type="info" icon="el-icon-sort" @click="toggleExpandAll">展开/折叠</el-button>
         </el-form-item>
     </el-form>
@@ -36,33 +33,34 @@
       :default-expand-all="isExpandAll"
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
-      <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
-      <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
-      <!-- <el-table-column prop="status" label="状态" width="100">
+      <el-table-column align="center" prop="deptName" label="部门名称" min-width="260"></el-table-column>
+      <el-table-column align="center" prop="orderNum" label="排序" min-width="100"></el-table-column>
+      <el-table-column align="center" min-width="80px" label="状态">
+                <template slot-scope="props">
+                    <span v-if="props.row.status == 0" style="color: #67C23A;font-weight: bold;">启用</span>
+                    <span v-if="props.row.status == 1" style="color: #E6A23C;font-weight: bold;">停用</span>
+                </template>
+            </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" min-width="100">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
-        </template>
-      </el-table-column> -->
-      <el-table-column label="创建时间" align="center" prop="createTime" width="200">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
+          <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" min-width="110px">
         <template slot-scope="scope">
             <el-button
-              size="mini"
+              size="small"
               type="primary"
               @click="handleUpdate(scope.row)"
             >修改</el-button>
             <el-button
-              size="mini"
+              size="small"
               type="success"
               @click="handleAdd(scope.row)"
             >添加</el-button>
             <el-button
               v-if="scope.row.parentId != 0"
-              size="mini"
+              size="small"
               type="danger"
               @click="handleDelete(scope.row)"
             >删除</el-button>
@@ -110,17 +108,17 @@
               <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="12">
+          <el-col :span="12">
             <el-form-item label="部门状态">
               <el-radio-group v-model="form.status">
                 <el-radio
-                  v-for="dict in dict.type.sys_normal_disable"
+                  v-for="dict in statusList"
                   :key="dict.value"
                   :label="dict.value"
                 >{{dict.label}}</el-radio>
               </el-radio-group>
             </el-form-item>
-          </el-col> -->
+          </el-col>
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -138,10 +136,19 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Dept",
-  // dicts: ['sys_normal_disable'],
   components: { Treeselect },
   data() {
     return {
+     statusList: [
+                {
+                  value: '0',
+                  label: '启用'
+                },
+                {
+                  value: '1',
+                  label: '停用'
+                },
+            ],
       // 遮罩层
       loading: true,
       // 显示搜索条件
@@ -201,7 +208,7 @@ export default {
     getList() {
       this.loading = true;
       listDept(this.queryParams).then(response => {
-        this.deptList = this.handleTree(response.data, "deptId");
+        this.deptList = this.handleTree(response.data.data, "deptId");
         this.loading = false;
       });
     },
@@ -253,7 +260,7 @@ export default {
       this.open = true;
       this.title = "添加部门";
       listDept().then(response => {
-        this.deptOptions = this.handleTree(response.data, "deptId");
+        this.deptOptions = this.handleTree(response.data.data, "deptId");
       });
     },
     /** 展开/折叠操作 */
@@ -268,11 +275,11 @@ export default {
     handleUpdate(row) {
       this.reset();
       getDept(row.deptId).then(response => {
-        this.form = response.data;
+        this.form = response.data.data;
         this.open = true;
         this.title = "修改部门";
         listDeptExcludeChild(row.deptId).then(response => {
-          this.deptOptions = this.handleTree(response.data, "deptId");
+          this.deptOptions = this.handleTree(response.data.data, "deptId");
           if (this.deptOptions.length == 0) {
             const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
             this.deptOptions.push(noResultsOptions);
@@ -286,13 +293,23 @@ export default {
         if (valid) {
           if (this.form.deptId != undefined) {
             updateDept(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
+              this.$notify({
+                title: '成功',
+                message: '修改成功',
+                type: 'success',
+                duration: 2000
+              })
               this.open = false;
               this.getList();
             });
           } else {
             addDept(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
+              this.$notify({
+                title: '成功',
+                message: '新增成功',
+                type: 'success',
+                duration: 2000
+              })
               this.open = false;
               this.getList();
             });
@@ -302,11 +319,11 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
+      this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
         return delDept(row.deptId);
       }).then(() => {
         this.getList();
-        this.$modal.msgSuccess("删除成功");
+        this.$msgSuccess("删除成功");
       }).catch(() => {});
     }
   }

+ 13 - 5
src/views/sys/role.vue

@@ -5,8 +5,9 @@
     <div class="filter-container">
       <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入角色名称" v-model="listQuery.roleName">
       </el-input>
-      <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
-      <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
+      <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
+      <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
     </div>
 
     <!-- 查询结果 -->
@@ -19,8 +20,8 @@
       </el-table-column>
       <el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button type="primary" size="mini" @click="handleUpdate(scope.row, false)">编辑</el-button>
-          <el-button type="primary" size="mini" @click="handleUpdate(scope.row, true)">权限</el-button>
+          <el-button type="primary" size="small" @click="handleUpdate(scope.row, false)">编辑</el-button>
+          <el-button type="primary" size="small" @click="handleUpdate(scope.row, true)">权限</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -149,10 +150,17 @@ export default {
           this.listLoading = false
         })
     },
-    handleFilter() {
+    handleQuery() {
       this.listQuery.page = 1
       this.getList()
     },
+     /** 重置按钮操作 */
+     resetQuery() {
+        this.listQuery = {
+           roleName: ''
+        };
+        this.handleQuery();
+      },
     handleSizeChange(val) {
       this.listQuery.limit = val
       this.getList()