achao 1 rok temu
rodzic
commit
f2ac35caf3

+ 59 - 49
unimall-admin/src/api/gubi/info.js

@@ -2,72 +2,82 @@ import request from '@/utils/request'
 
 // 查询一级分类列表
 export function listInfo(query) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'list',
-      ...query
-    }
-  })
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'list',
+            ...query
+        }
+    })
+}
+export function clearCache(query) {
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'clearCache',
+            ...query
+        }
+    })
 }
 
 // 查询一级分类详细
 export function getInfo(id) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'get',
-      id: id
-    }
-  })
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'get',
+            id: id
+        }
+    })
 }
 
 // 新增一级分类
 export function addInfo(data) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'add',
-      gubiTypeInfo: data
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'add',
+            gubiTypeInfo: data
+        }
+    })
 }
 
 // 修改一级分类
 export function updateInfo(data) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'update',
-      gubiTypeInfo: data
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'update',
+            gubiTypeInfo: data
+        }
+    })
 }
 
 // 删除一级分类
 export function delInfo(id) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'delete',
-      id: id
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'delete',
+            id: id
+        }
+    })
 }
 
 // 导出一级分类
 export function exportInfo(query) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'export',
-      ...query
-    }
-  })
-}
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'export',
+            ...query
+        }
+    })
+}

+ 6 - 2
unimall-admin/src/views/gubi/info/index.vue

@@ -1,5 +1,6 @@
 <template>
-  <div v-loading="loading" style="width: 100%; display: flex">
+  <div v-loading="loading" style="width: 100%;">
+    <el-button size="mini" type="primary" style="margin:10px 0 0 10px" @click="clear">清除缓存</el-button>
     <div class="right-info-box">
       <div class="warp_group">
         <div class="line_box">
@@ -319,7 +320,7 @@
 <script>
 import { uploadPath } from '@/api/storage'
 import { getToken } from '@/utils/auth'
-import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from '@/api/gubi/info'
+import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, clearCache } from '@/api/gubi/info'
 import { listSecond, getSecond, delSecond, addSecond, updateSecond, exportSecond } from '@/api/gubi/second'
 import { listThree, getThree, delThree, addThree, updateThree, exportThree } from '@/api/gubi/three'
 import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from '@/api/gubi/transaction'
@@ -431,6 +432,9 @@ export default {
       this.open3 = true
       this.title3 = '添加三级分类'
     },
+    clear() {
+      clearCache().then(response => {})
+    },
     handleUpdate3(row) {
       this.reset3()
       this.imgsFileList3 = []

+ 170 - 95
unimall-admin/src/views/gubi/transaction/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
       <!-- <el-form-item label="" prop="companyId">
         <el-input
           v-model="queryParams.companyId"
@@ -20,7 +20,11 @@
         />
       </el-form-item> -->
       <el-form-item label="编号" prop="number">
-        <el-input v-model="queryParams.number" placeholder="请输入编号" clearable size="small"
+        <el-input
+          v-model="queryParams.number"
+          placeholder="请输入编号"
+          clearable
+          size="small"
           @keyup.enter.native="handleQuery" />
       </el-form-item>
       <!-- <el-form-item label="分值" prop="grade">
@@ -33,16 +37,29 @@
         />
       </el-form-item> -->
       <el-form-item label="时间" prop="collection">
-        <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.collection" type="date"
-          value-format="yyyy-MM-dd" placeholder="选择时间">
-        </el-date-picker>
+        <el-date-picker
+          v-model="queryParams.collection"
+          clearable
+          size="small"
+          style="width: 200px"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择时间"/>
       </el-form-item>
       <el-form-item label="价钱" prop="price">
-        <el-input v-model="queryParams.price" placeholder="请输入价钱" clearable size="small"
+        <el-input
+          v-model="queryParams.price"
+          placeholder="请输入价钱"
+          clearable
+          size="small"
           @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="状态" prop="status">
-        <el-input v-model="queryParams.price" placeholder="请输入状态" clearable size="small"
+        <el-input
+          v-model="queryParams.price"
+          placeholder="请输入状态"
+          clearable
+          size="small"
           @keyup.enter.native="handleQuery" />
       </el-form-item>
       <!-- <el-form-item label="状态" prop="status">
@@ -96,25 +113,48 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          size="mini"
+          @click="sx"
+        >筛选</el-button>
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
-          v-permission="['gubi:transaction:add']">新增</el-button>
+        <el-button
+          v-permission="['gubi:transaction:add']"
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd">新增</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
-          v-permission="['gubi:transaction:edit']">修改</el-button>
+        <el-button
+          v-permission="['gubi:transaction:edit']"
+          :disabled="single"
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleUpdate">修改</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
-          v-permission="['gubi:transaction:remove']">删除</el-button>
+        <el-button
+          v-permission="['gubi:transaction:remove']"
+          :disabled="multiple"
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          @click="handleDelete">删除</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
-          v-permission="['gubi:transaction:export']">导出</el-button>
+        <el-button
+          v-permission="['gubi:transaction:export']"
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport">导出</el-button>
       </el-col>
     </el-row>
 
@@ -152,15 +192,27 @@
       <el-table-column label="" align="center" prop="adminId" /> -->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-            v-permission="['gubi:transaction:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-permission="['gubi:transaction:remove']">删除</el-button>
+          <el-button
+            v-permission="['gubi:transaction:edit']"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)">修改</el-button>
+          <el-button
+            v-permission="['gubi:transaction:remove']"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
       @pagination="getList" />
 
     <!-- 添加或修改交易记录对话框 -->
@@ -194,7 +246,7 @@
           >
             <i class="el-icon-plus" />
           </el-upload>
-        </el-form-item> 
+        </el-form-item>
         <el-form-item label="编号" prop="number">
           <el-input v-model="form.number" placeholder="请输入编号" />
         </el-form-item>
@@ -202,9 +254,14 @@
           <el-input v-model="form.grade" placeholder="请输入分值等级" />
         </el-form-item>
         <el-form-item label="时间" prop="collection">
-          <el-date-picker clearable size="small" style="width: 200px" v-model="form.collection" type="date"
-            value-format="yyyy-MM-dd" placeholder="选择时间">
-          </el-date-picker>
+          <el-date-picker
+            v-model="form.collection"
+            clearable
+            size="small"
+            style="width: 200px"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择时间"/>
         </el-form-item>
         <el-form-item label="价钱" prop="price">
           <el-input v-model="form.price" placeholder="请输入价钱" />
@@ -246,26 +303,35 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="分值" :visible.sync="dialogFormVisible">
+    <el-dialog :visible.sync="dialogFormVisible" title="分值">
       <el-form :model="form">
-        <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
+        <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"/>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取 消</el-button>
         <el-button type="primary" @click="typeConfirm">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog :visible.sync="dialogFormVisible1" title="分类">
+      <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick1"/>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
+        <el-button type="primary" @click="typeConfirm1">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { uploadPath } from '@/api/storage'
 import { getToken } from '@/utils/auth'
-import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from "@/api/gubi/transaction";
-import { listThree, getThree, delThree, addThree, updateThree, exportThree } from "@/api/gubi/three";
+import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from '@/api/gubi/transaction'
+import { listThree, getThree, delThree, addThree, updateThree, exportThree } from '@/api/gubi/three'
 export default {
   data() {
     return {
+      dialogFormVisible1: false,
       imgsFileList: [],
       uploadPath,
       data: [],
@@ -290,7 +356,7 @@ export default {
       transactionList: [],
       threeList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -313,14 +379,14 @@ export default {
       },
       // 表单参数
       form: {},
-      orderName: "",
+      orderName: '',
       // 表单校验
       rules: {
         deleteFlag: [
-          { required: true, message: "0:否(默认) 1:是不能为空", trigger: "blur" }
-        ],
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ]
       }
-    };
+    }
   },
   computed: {
     headers() {
@@ -330,9 +396,12 @@ export default {
     }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
+    sx() {
+      this.dialogFormVisible1 = true
+    },
     uploadOverrun: function() {
       this.$message({
         type: 'error',
@@ -366,21 +435,29 @@ export default {
       }
     },
     handleNodeClick(data) {
-      console.log(data);
+      console.log(data)
       this.form.orderId = data.id
       this.orderName = data.typeName
-      this.urlPath = data.urlPath.split(",")
+      this.urlPath = data.urlPath.split(',')
+    },
+    handleNodeClick1(data) {
+      console.log(data)
+      this.queryParams.grade = data.typeId
     },
     typeConfirm() {
       this.dialogFormVisible = false
     },
+    typeConfirm1() {
+      this.dialogFormVisible1 = false
+      this.handleQuery()
+    },
     selectType() {
       this.dialogFormVisible = true
     },
     /** 查询交易记录列表 */
     getList() {
-      this.loading = true;
-      listTransaction(this.queryParams).then(response => {debugger
+      this.loading = true
+      listTransaction(this.queryParams).then(response => {
         this.transactionList = response.data.data.items
         for (let i = 0; i < this.transactionList.length; i++) {
           if (this.transactionList[i].urlPath) {
@@ -390,8 +467,8 @@ export default {
           }
         }
         this.total = response.data.data.count
-        this.loading = false;
-      });
+        this.loading = false
+      })
       typeList().then(response => {
         this.makeData(response.data.data)
 
@@ -405,19 +482,18 @@ export default {
         // }
         // this.total = response.data.data.count
         // this.loading = false;
-      });
-
+      })
     },
     makeData(val) {
       for (let i = 0; i < val.length; i++) {
         if (val[i].children) {
           for (let j = 0; j < val[i].children.length; j++) {
-            let _obj = val[i].children[j]
+            const _obj = val[i].children[j]
             _obj.typeName = val[i].children[j].secondName
             val[i].children[j] = _obj
             if (val[i].children[j].children) {
               for (let k = 0; k < val[i].children[j].children.length; k++) {
-                let _obj1 = val[i].children[j].children[k]
+                const _obj1 = val[i].children[j].children[k]
                 _obj1.typeName = val[i].children[j].children[k].typeId
                 val[i].children[j].children[k] = _obj1
               }
@@ -430,8 +506,8 @@ export default {
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -443,25 +519,25 @@ export default {
         grade: undefined,
         collection: undefined,
         price: undefined,
-        status: "",
+        status: '',
         urlPath: [],
         deleteFlag: undefined,
         gmtCreate: undefined,
         gmtUpdate: undefined,
         userId: undefined,
         adminId: undefined
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -471,85 +547,84 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加交易记录";
+      this.reset()
+      this.open = true
+      this.title = '添加交易记录'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       this.imgsFileList = []
       const id = row.id || this.ids.join(',')
       getTransaction(id).then(response => {
         this.form = response.data.data
         if (this.form.urlPath) {
-            this.form.urlPath = this.form.urlPath.split(',')
-          } else {
-            this.form.urlPath = []
-          }
+          this.form.urlPath = this.form.urlPath.split(',')
+        } else {
+          this.form.urlPath = []
+        }
         this.form.collection = new Date(response.data.data.collection)
-        this.open = true;
-        this.title = "修改交易记录";
-      });
+        this.open = true
+        this.title = '修改交易记录'
+      })
     },
     /** 提交按钮 */
     submitForm: function () {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           console.log()
           this.form.urlPath = this.form.urlPath.toString()
           if (this.form.id != undefined) {
             updateTransaction(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           } else {
-
             addTransaction(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids.join(',')
-      this.$confirm('是否确认删除交易记录编号为"' + ids + '"的数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      this.$confirm('是否确认删除交易记录编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       }).then(function () {
-        return delTransaction(ids);
+        return delTransaction(ids)
       }).then(() => {
-        this.getList();
-        this.msgSuccess("删除成功");
-      }).catch(function () { });
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function () { })
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有交易记录数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有交易记录数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       }).then(function () {
-        return exportTransaction(queryParams);
+        return exportTransaction(queryParams)
       }).then(response => {
-        this.download(response.data.data);
-      }).catch(function () { });
+        this.download(response.data.data)
+      }).catch(function () { })
     }
   }
-};
-</script>
+}
+</script>