Переглянути джерело

Merge remote-tracking branch 'gogs-epliboly/master'

Huanyi 1 місяць тому
батько
коміт
2b4b696df8

+ 25 - 19
src/views/archieves/customer/index.vue

@@ -12,7 +12,7 @@
               <el-option v-for="station in filteredStationList" :key="station.id" :label="station.name" :value="station.id" />
             </el-select>
             <el-input v-model="searchForm.keyword" placeholder="搜索姓名/手机号" style="width: 200px; margin-right: 10px;" clearable @keyup.enter="handleSearch" @clear="handleSearch" />
-            <el-button type="primary" icon="Plus" @click="handleAdd">新增用户</el-button>
+            <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['archieves:customer:add']">新增用户</el-button>
           </div>
         </div>
       </template>
@@ -73,19 +73,16 @@
         <el-table-column prop="remark" label="备注" show-overflow-tooltip />
         <el-table-column label="操作" width="200" align="center">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="handleDetail(scope.row)">详情</el-button>
-            <el-button link type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
+            <el-button link type="primary" size="small" @click="handleDetail(scope.row)" v-hasPermi="['archieves:customer:query']">详情</el-button>
+            <el-button link type="primary" size="small" @click="handleEdit(scope.row)" v-hasPermi="['archieves:customer:edit']">编辑</el-button>
             <el-dropdown trigger="click" @command="(cmd) => handleCommand(cmd, scope.row)" style="margin-left: 10px; vertical-align: middle">
               <el-button link type="primary" size="small">
                 更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
               </el-button>
               <template #dropdown>
                 <el-dropdown-menu>
-                  <el-dropdown-item command="remark">添加备注</el-dropdown-item>
-                  <el-dropdown-item :command="scope.row.status ? 'disable' : 'enable'">
-                    {{ scope.row.status ? '停用用户' : '启用用户' }}
-                  </el-dropdown-item>
-                  <el-dropdown-item command="delete" style="color: #F56C6C">删除用户</el-dropdown-item>
+                  <el-dropdown-item command="remark" v-hasPermi="['archieves:customer:edit']">添加备注</el-dropdown-item>
+                  <el-dropdown-item command="delete" style="color: #F56C6C" v-hasPermi="['archieves:customer:remove']">删除用户</el-dropdown-item>
                 </el-dropdown-menu>
               </template>
             </el-dropdown>
@@ -129,10 +126,10 @@
           <el-descriptions :column="2" border>
             <el-descriptions-item label="姓名">{{ currentUser.name }}</el-descriptions-item>
             <el-descriptions-item label="电话">{{ currentUser.phone }}</el-descriptions-item>
-            <el-descriptions-item label="所属区域">{{ currentUser.area || '-' }}</el-descriptions-item>
-            <el-descriptions-item label="所属站点">{{ currentUser.station || '-' }}</el-descriptions-item>
-            <el-descriptions-item label="录入来源">{{ currentUser.source }}</el-descriptions-item>
-            <el-descriptions-item label="录入时间">{{ currentUser.entryTime }}</el-descriptions-item>
+            <el-descriptions-item label="所属区域">{{ currentUser.areaName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="所属站点">{{ currentUser.stationName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="录入来源">{{ currentUser.source || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="录入时间">{{ currentUser.createTime || '-' }}</el-descriptions-item>
           </el-descriptions>
 
           <div class="section-title" style="margin-top: 20px">居住信息</div>
@@ -761,7 +758,22 @@ const handleEdit = (row) => {
 
 const handleDetail = (row) => {
   getCustomer(row.id).then((res) => {
-    currentUser.value = res.data
+    const data = res.data
+    // Convert areaId to area name
+    if (data.areaId) {
+      const area = allNodes.value.find(n => n.id === data.areaId)
+      data.areaName = area ? area.name : '-'
+    } else {
+      data.areaName = '-'
+    }
+    // Convert stationId to station name
+    if (data.stationId) {
+      const station = allNodes.value.find(n => n.id === data.stationId)
+      data.stationName = station ? station.name : '-'
+    } else {
+      data.stationName = '-'
+    }
+    currentUser.value = data
     detailActiveTab.value = 'info'
     loadDetailPets(row.id)
     loadDetailLogs(row.id, 'customer')
@@ -848,12 +860,6 @@ const handleCommand = (command, row) => {
     handleRemark(row)
   } else if (command === 'delete') {
     handleDelete(row)
-  } else if (command === 'enable') {
-    row.status = 0
-    handleStatusChange(row)
-  } else if (command === 'disable') {
-    row.status = 1
-    handleStatusChange(row)
   }
 }
 

+ 13 - 7
src/views/archieves/pet/index.vue

@@ -6,7 +6,7 @@
           <span class="title">宠物档案</span>
           <div class="header-actions">
             <el-input v-model="searchKey" placeholder="搜索宠物名/主人" style="width: 200px; margin-right: 10px" clearable @keyup.enter="handleSearch" @clear="handleSearch" />
-            <el-button type="primary" icon="Plus" @click="handleAdd">新增档案</el-button>
+            <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['archieves:pet:add']">新增档案</el-button>
           </div>
         </div>
       </template>
@@ -53,10 +53,10 @@
         </el-table-column>
         <el-table-column label="操作" width="200" align="center">
           <template #default="scope">
-            <el-button link type="primary" @click="handleDetail(scope.row)">详情</el-button>
-            <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-            <el-button link type="primary" @click="handleRemark(scope.row)">备注</el-button>
-            <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
+            <el-button link type="primary" @click="handleDetail(scope.row)" v-hasPermi="['archieves:pet:query']">详情</el-button>
+            <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['archieves:pet:edit']">编辑</el-button>
+            <el-button link type="primary" @click="handleRemark(scope.row)" v-hasPermi="['archieves:pet:edit']">备注</el-button>
+            <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['archieves:pet:remove']">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -222,7 +222,7 @@
           </div>
         </div>
         <div style="margin-left: auto">
-          <el-button type="primary" size="small" plain @click="handleRemark(currentPet)">添加备注</el-button>
+          <el-button type="primary" size="small" plain @click="handleRemark(currentPet)" v-hasPermi="['archieves:pet:edit']">添加备注</el-button>
         </div>
       </div>
 
@@ -295,7 +295,7 @@
         <el-tab-pane label="备注日志" name="logs">
           <el-timeline style="margin-top: 10px; padding-left: 5px">
             <el-timeline-item v-for="(log, index) in changeLogs" :key="index" :timestamp="log.createTime" type="primary">
-              [{{ log.changeType }}] {{ log.content }}
+              [{{ log.logType }}] {{ log.content }}
               <div style="font-size: 12px; color: #999; margin-top: 4px">操作人: {{ log.operatorName }}</div>
             </el-timeline-item>
           </el-timeline>
@@ -485,6 +485,12 @@ const saveRemark = () => {
     ElMessage.success('备注添加成功');
     remarkDialogVisible.value = false;
     getList();
+    // 刷新 drawer 中的变更日志
+    if (drawerVisible.value) {
+      listAllChangeLog(currentPet.value.id, 'pet').then((logRes) => {
+        changeLogs.value = logRes.data || [];
+      });
+    }
   });
 };
 

+ 6 - 6
src/views/archieves/tag/index.vue

@@ -10,7 +10,7 @@
       <el-tabs v-model="activeTab" class="demo-tabs" @tab-change="handleTabChange">
         <el-tab-pane label="用户标签" name="user">
           <div class="operation-bar">
-            <el-button type="primary" icon="Plus" @click="handleAdd('user')">新增标签</el-button>
+            <el-button type="primary" icon="Plus" @click="handleAdd('user')" v-hasPermi="['archieves:tag:add']">新增标签</el-button>
           </div>
           <el-table :data="tagList" v-loading="loading" style="width: 100%; margin-top: 20px" :header-cell-style="{ background: '#f5f7fa' }">
             <el-table-column label="标签名称" width="200">
@@ -26,8 +26,8 @@
             </el-table-column>
             <el-table-column label="操作" width="180">
               <template #default="scope">
-                <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-                <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
+                <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['archieves:tag:edit']">编辑</el-button>
+                <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['archieves:tag:remove']">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -45,7 +45,7 @@
         </el-tab-pane>
         <el-tab-pane label="宠物标签" name="pet">
           <div class="operation-bar">
-            <el-button type="primary" icon="Plus" @click="handleAdd('pet')">新增标签</el-button>
+            <el-button type="primary" icon="Plus" @click="handleAdd('pet')" v-hasPermi="['archieves:tag:add']">新增标签</el-button>
           </div>
           <el-table :data="tagList" v-loading="loading" style="width: 100%; margin-top: 20px" :header-cell-style="{ background: '#f5f7fa' }">
             <el-table-column label="标签名称" width="200">
@@ -61,8 +61,8 @@
             </el-table-column>
             <el-table-column label="操作" width="180">
               <template #default="scope">
-                <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-                <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
+                <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['archieves:tag:edit']">编辑</el-button>
+                <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['archieves:tag:remove']">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

+ 4 - 4
src/views/fulfiller/audit/index.vue

@@ -88,8 +88,8 @@
         <el-table-column label="操作" width="150" fixed="right">
           <template #default="scope">
             <div class="op-cell">
-              <el-button v-if="scope.row.status === 0" link type="primary" size="small" @click="handleDetail(scope.row)">审核</el-button>
-              <el-button link type="primary" size="small" @click="handleDetail(scope.row)">详情</el-button>
+              <el-button v-if="scope.row.status === 0" link type="primary" size="small" @click="handleDetail(scope.row)" v-hasPermi="['fulfiller:audit:approve', 'fulfiller:audit:reject']">审核</el-button>
+              <el-button link type="primary" size="small" @click="handleDetail(scope.row)" v-hasPermi="['fulfiller:audit:query']">详情</el-button>
             </div>
           </template>
         </el-table-column>
@@ -199,8 +199,8 @@
       </div>
       <template #footer>
         <span class="dialog-footer" v-if="currentItem?.status === 0">
-          <el-button type="danger" plain @click="rejectDialogVisible = true">驳回申请</el-button>
-          <el-button type="primary" @click="handlePass">通过审核</el-button>
+          <el-button type="danger" plain @click="rejectDialogVisible = true" v-hasPermi="['fulfiller:audit:reject']">驳回申请</el-button>
+          <el-button type="primary" @click="handlePass" v-hasPermi="['fulfiller:audit:approve']">通过审核</el-button>
         </span>
         <span class="dialog-footer" v-else>
           <el-button @click="dialogVisible = false">关闭</el-button>

+ 9 - 9
src/views/fulfiller/pool/index.vue

@@ -8,7 +8,7 @@
             <el-tag type="info" effect="plain" style="margin-left: 10px;">共 {{ total }} 人</el-tag>
           </div>
           <div class="right-panel">
-            <el-button type="primary" icon="Plus" style="margin-right: 15px" @click="handleCreate">新增履约者</el-button>
+            <el-button type="primary" icon="Plus" style="margin-right: 15px" @click="handleCreate" v-hasPermi="['fulfiller:pool:add']">新增履约者</el-button>
             <el-input
               v-model="searchKey"
               placeholder="搜索姓名/手机号/身份证"
@@ -139,18 +139,18 @@
         <el-table-column label="操作" width="240" fixed="right">
           <template #default="scope">
             <div class="op-cell">
-              <el-button link type="primary" size="small" @click="handleDetail(scope.row)">详情</el-button>
-              <el-button link type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
-              <el-button link type="warning" size="small" @click="handleReward(scope.row)">奖惩</el-button>
+              <el-button link type="primary" size="small" @click="handleDetail(scope.row)" v-hasPermi="['fulfiller:pool:query']">详情</el-button>
+              <el-button link type="primary" size="small" @click="handleEdit(scope.row)" v-hasPermi="['fulfiller:pool:edit']">编辑</el-button>
+              <el-button link type="warning" size="small" @click="handleReward(scope.row)" v-hasPermi="['fulfiller:pool:edit']">奖惩</el-button>
               <el-dropdown trigger="click" @command="(cmd) => handleCommand(cmd, scope.row)">
                 <el-button link type="primary">更多<el-icon class="el-icon--right"><arrow-down /></el-icon></el-button>
                 <template #dropdown>
                   <el-dropdown-menu>
-                    <el-dropdown-item command="adjustPoints">修改积分</el-dropdown-item>
-                    <el-dropdown-item command="adjustBalance">余额增减</el-dropdown-item>
-                    <el-dropdown-item v-if="scope.row.status !== 'disabled'" command="disable" divided style="color: #f56c6c">禁用账号</el-dropdown-item>
-                    <el-dropdown-item v-else command="enable" divided style="color: #67c23a">启用账号</el-dropdown-item>
-                    <el-dropdown-item command="resetPwd">重置密码</el-dropdown-item>
+                    <el-dropdown-item command="adjustPoints" v-hasPermi="['fulfiller:pool:edit']">修改积分</el-dropdown-item>
+                    <el-dropdown-item command="adjustBalance" v-hasPermi="['fulfiller:pool:edit']">余额增减</el-dropdown-item>
+                    <el-dropdown-item v-if="scope.row.status !== 'disabled'" command="disable" divided style="color: #f56c6c" v-hasPermi="['fulfiller:pool:edit']">禁用账号</el-dropdown-item>
+                    <el-dropdown-item v-else command="enable" divided style="color: #67c23a" v-hasPermi="['fulfiller:pool:edit']">启用账号</el-dropdown-item>
+                    <el-dropdown-item command="resetPwd" v-hasPermi="['fulfiller:pool:edit']">重置密码</el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
               </el-dropdown>

+ 3 - 3
src/views/fulfiller/tag/index.vue

@@ -4,7 +4,7 @@
       <template #header>
         <div class="card-header">
           <span class="title">履约者标签管理</span>
-          <el-button type="primary" icon="Plus" @click="handleAdd">新增标签</el-button>
+          <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['fulfiller:tag:add']">新增标签</el-button>
         </div>
       </template>
 
@@ -25,8 +25,8 @@
         <el-table-column prop="createTime" label="创建时间" width="180" />
         <el-table-column label="操作" width="150">
           <template #default="scope">
-            <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-            <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
+            <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['fulfiller:tag:edit']">编辑</el-button>
+            <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['fulfiller:tag:remove']">删除</el-button>
           </template>
         </el-table-column>
       </el-table>