Browse Source

refactor: 交付物代码整理重构 未完

deliver
wally 4 years ago
parent
commit
d7c6e51e64
  1. 85
      CHANGELOG.md
  2. 89
      common/styles/theme/default.scss
  3. 5
      components/Plugin/Plugin.vue
  4. 231
      plugins/p-deliver-check/p-deliver-check.vue
  5. 199
      plugins/p-deliver-checker/p-deliver-checker.vue
  6. 4
      plugins/p-deliver/p-deliver.vue

85
CHANGELOG.md

@ -1,103 +1,104 @@
# 1.0.0 (2022-01-21)
# 1.0.0 (2022-01-22)
### 🌟 新功能
范围|描述|commitId
--|--|--
- | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e)
- | 财务条插件的进度条和上方悬浮按钮界面 | [8322e92](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8322e92)
- | app.vue | [970cf9a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/970cf9a)
- | first commit | [8dc26de](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dc26de)
project | 日常任务面板添加 | [b3f16ff](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b3f16ff)
theme | theme demo | [9175758](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9175758)
- | vue3 | [12ed2ad](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12ed2ad)
- | 使用uview完成api请求 | [1b3efd8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b3efd8)
- | 审核插件的基本信息展示 | [aa4f17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/aa4f17f)
- | 审核插件的通过与驳回功能 | [03a7c35](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/03a7c35)
- | 手机号登录 | [8f455da](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f455da)
- | 手机号登录 | [565585b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/565585b)
- | 插件的填写与提交,修改与删除 | [d461252](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d461252)
- | 插件面板分开显示 | [fb5e86b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/fb5e86b)
- | 更新代码 | [392c8cc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/392c8cc)
- | 获取交付物信息 | [5ae68e2](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5ae68e2)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 审核插件的基本信息展示 | [aa4f17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/aa4f17f)
- | 审核插件的通过与驳回功能 | [03a7c35](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/03a7c35)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 时间轴展示 | [8b1b380](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8b1b380)
- | 时间轴接口 | [a95d005](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a95d005)
- | 时间轴页面 | [e926b75](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e926b75)
- | 时间轴展示 | [8b1b380](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8b1b380)
- | 使用uview完成api请求 | [1b3efd8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b3efd8)
- | 手机号登录 | [8f455da](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f455da)
- | 手机号登录 | [565585b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/565585b)
- | 更新代码 | [392c8cc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/392c8cc)
- | 添加 timeline | [72dad2b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/72dad2b)
- | 项目操作面板 | [3beb05e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3beb05e)
- | 获取交付物信息 | [5ae68e2](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5ae68e2)
- | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e)
- | 财务条插件的进度条和上方悬浮按钮界面 | [8322e92](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8322e92)
- | 账户名密码登录 | [ebf456e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf456e)
- | 项目列表 | [a52e6d5](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a52e6d5)
- | 项目列表新 | [88cf48d](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/88cf48d)
- | 账户名密码登录 | [ebf456e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf456e)
- | app.vue | [970cf9a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/970cf9a)
- | first commit | [8dc26de](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dc26de)
project | 日常任务面板添加 | [b3f16ff](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b3f16ff)
theme | theme demo | [9175758](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9175758)
- | vue3 | [12ed2ad](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12ed2ad)
- | 项目操作面板 | [3beb05e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3beb05e)
### 🎨 代码样式
范围|描述|commitId
--|--|--
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b)
- | 交付物相关细节调整 | [87ae00d](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/87ae00d)
- | 细节调整 | [ebf678f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf678f)
- | 细节调整 | [759ef52](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/759ef52)
- | 细节调整 | [bdd5f87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/bdd5f87)
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b)
### 🐛 Bug 修复
范围|描述|commitId
--|--|--
- | 插件接口修改 | [53c6b90](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/53c6b90)
交付物 | 修复检查人选择组件之间相互影响的bug | [435c0bd](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/435c0bd)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)
- | 删除多余的引入 | [050b12a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/050b12a)
- | 时间轴任务 | [98abdf6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/98abdf6)
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
- | 修复p-deliver报错taskRef的问题 | [880cf7c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/880cf7c)
app.vue | 修复获取token报错的问题 | [9120d54](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9120d54)
createTask | 修复createTask v-model的问题 | [b20d3f0](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b20d3f0)
- | defineExpose, defineEmits不需要引入 | [902cacc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/902cacc)
交付物 | 修复检查人选择组件之间相互影响的bug | [435c0bd](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/435c0bd)
- | 修复p-deliver报错taskRef的问题 | [880cf7c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/880cf7c)
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
- | 删除多余的引入 | [050b12a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/050b12a)
- | 插件接口修改 | [53c6b90](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/53c6b90)
- | 时间轴任务 | [98abdf6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/98abdf6)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)
### 📝 文档
范围|描述|commitId
--|--|--
- | 添加交付物http测试文件 | [0b7e6ab](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0b7e6ab)
- | deliver http 文件更新 | [568115c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/568115c)
- | 添加交付物http测试文件 | [0b7e6ab](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0b7e6ab)
### 📦 持续集成
范围|描述|commitId
--|--|--
- | 测试ci | [6ab95f8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/6ab95f8)
- | 测试ci' | [d25f2a7](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d25f2a7)
- | ci update | [d38262e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d38262e)
- | drone | [8cddc7b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8cddc7b)
- | 修改.drone.yml | [f5b52e3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f5b52e3)
- | 更新drone.yml | [63ec5a3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/63ec5a3)
- | 更新drone.yml | [a57d598](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a57d598)
- | 测试ci | [6ab95f8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/6ab95f8)
- | 测试ci' | [d25f2a7](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d25f2a7)
- | 添加drone.yml | [9fbae89](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9fbae89)
- | 修改.drone.yml | [f5b52e3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f5b52e3)
- | ci update | [d38262e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d38262e)
- | drone | [8cddc7b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8cddc7b)
### 🔨 代码重构
范围|描述|commitId
--|--|--
- | 查看提交历史记录页面数据同步更新 | [749cb10](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/749cb10)
- | deliver检查人重构;更新真实数据的检查人 | [ce808c4](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ce808c4)
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87)
- | 交付物插件代码审查 | [5f4d47b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5f4d47b)
- | 修改插件名的输入框和查看历史记录 | [99fb88e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/99fb88e)
- | 修改错误单词‘confirmDeleDte’ | [ddbb04c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ddbb04c)
- | 原有功能提交别的分支 | [eb02b72](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/eb02b72)
- | 完善历史记录页面和修改插件的TODO | [3d58c15](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3d58c15)
- | 审查接口核对完成 | [43ae604](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/43ae604)
- | 审核插件的基本信息展示 | [4f2815f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/4f2815f)
- | 审核记录查看 | [915aa06](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/915aa06)
- | 审核记录查看 | [121d43f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/121d43f)
- | 提交交付物,查看提交记录,修改交付物标题的接口核对完成 | [7c08530](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/7c08530)
- | 提交交付物,修改交付物名称,查看交付物历史记录接口完成 | [f222bdf](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f222bdf)
- | 提交交付物,查看提交记录,修改交付物标题的接口核对完成 | [7c08530](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/7c08530)
- | 提取deliver store;细节调整 | [4d901ac](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/4d901ac)
- | 完善历史记录页面和修改插件的TODO | [3d58c15](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3d58c15)
- | 查看提交历史记录页面数据同步更新 | [749cb10](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/749cb10)
- | 细节调整 | [7f9cf1f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/7f9cf1f)
- | 细节调整 | [3d1c463](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3d1c463)
- | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98)
- | 修改插件名的输入框和查看历史记录 | [99fb88e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/99fb88e)
- | 修改错误单词‘confirmDeleDte’ | [ddbb04c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ddbb04c)
- | 原有功能提交别的分支 | [eb02b72](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/eb02b72)
- | 调整进度条样式 | [b142651](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b142651)
- | 重构project init 部分 | [c7bf2df](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/c7bf2df)
- | deliver检查人重构;更新真实数据的检查人 | [ce808c4](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ce808c4)
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87)
- | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98)
### 🚀 性能优化

89
common/styles/theme/default.scss

@ -13,47 +13,72 @@
height: 100%;
z-index: 100;
}
.box-modal-border {
}
// 弹出层 内容盒子
.modal-content-wrap {
position: absolute;
left: 50rpx;
top: 50%;
width: 650rpx;
transform: translate3d(0, -50%, 0);
background-color: #fff;
.modal-content-head {
text-align: center;
margin-top: 40rpx;
margin-bottom: 20rpx;
font-size: 16px;
font-weight: 600;
}
.modal-content-body {
padding: 32rpx;
// 审核插件
.common-list {
height: 12.5rem;
overflow-y: scroll;
view {
border-bottom: 1px solid #e5e7eb;
&:last-child {
border-bottom: none;
}
}
}
}
.modal-content-foot {
display: flex;
border-top: 1px solid #d1d5db;
.cancel,
.confirm {
flex: 1;
text-align: center;
@extend .leading-12;
}
.cancel {
border-right: 1px solid #d1d5db;
}
.confirm {
@extend .text-blue-700;
}
// .leading-12 flex-1 text-center delete-modal-border
}
.delete-modal-border {
border-right: 1px solid #d1d5db;
uni-textarea {
width: 596rpx;
padding: 24rpx;
height: 140rpx;
box-sizing: border-box !important;
}
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 80%;
height: 375rpx;
background-color: #fff;
}
.link-box {
:deep(.u-input__input) {
color: #60a5fa;
}
}
// 审核插件
.common-list {
height: 12.5rem;
overflow-y: scroll;
view {
border-bottom: 1px solid #e5e7eb;
}
}
.rect2 {
width: 80%;
height: 1000rpx;
background-color: #fff;
}
.rect3 {
width: 80%;
height: 895rpx;
background-color: #fff;
}
.progress-dot {
width: 50rpx;
height: 50rpx;

5
components/Plugin/Plugin.vue

@ -26,8 +26,9 @@
<f-financial />
<!-- 交付物插件 -->
<p-deliver :task="task" v-if="pluginId === '15'" />
<p-deliver-checker :task="task" />
<!-- <p-deliver :task="task" v-if="pluginId === '15'" /> -->
<!-- TODO: 判断显示条件 -->
<p-deliver-check :task="task" />
</view>
</view>
</template>

231
plugins/p-deliver-check/p-deliver-check.vue

@ -1,69 +1,198 @@
<template>
<!-- 上传交付物 -->
<view class="box shadow-lg">
<view class="px-3 py-6 bg-white">
<u-input :auto-height="autoHeight" :border="border" :height="height" :type="type" placeholder="输入备注" v-model="remark" />
<view class="flex flex-row-reverse text-xs text-gray-400 mt-2">{{ wordNum }}/140</view>
<!-- 评分 -->
<view class="flex justify-between mt-3">
<slider :value="score" @change="sliderChange" max="100" min="0" show-value style="width: 60%" />
<u-input :border="border" :type="type1" @input="changeNumber" maxlength="100" placeholder="输入分数" v-model="score" />
<view class="bg-white rounded-md">
<view class="p-3 flex justify-between" @click="collapsed = !collapsed">
<span class="relative p-1">
<!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ deliverData ? deliverData.deliverName : '' }}
</span>
<!-- 展开折叠按钮 -->
<u-icon :name="collapsed ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
<view class="flex flex-col justify-center mt-5">
<u-button @click="submit" size="medium" type="primary">提交</u-button>
<u-button @click="$emit('closeScore')" class="mt-2" size="medium">取消</u-button>
<view class="p-3 pt-0" v-show="collapsed">
<!-- 提交人和时间信息 -->
<view class="text-gray-400">
<!-- <span class="mr-2" v-if="deliverData && deliverData.submitter">{{ deliverData.submitter }}</span> -->
<span v-if="deliverData && deliverData.submitTime"> {{ dayjs(+deliverData.submitTime).format('MM-DD HH:mm') }}</span>
</view>
<!-- 提交的链接信息 -->
<view class="w-64 break-all text-blue-400 py-2" v-if="deliverData && deliverData.details && deliverData.details[0]">
{{ deliverData.details[0] }}
</view>
<!-- 审核人信息 -->
<view class="text-gray-400 flex justify-between">
<span>审核</span>
<span class="text-blue-400" @click="moreRecords">更多记录</span>
</view>
<view class="px-2" v-if="deliverData && deliverData.checkerList">
<!-- 遍历审核人信息 -->
<view class="mt-3 text-sm flex justify-between" v-for="item in deliverData.checkerList">
<view>
<view>{{ item.checkerName }}</view>
<view class="my-1">{{ item.remark }}</view>
<view class="my-1" v-if="item.checkTime > 0">{{ dayjs(+item.checkTime).format('MM-DD HH:mm') }}</view>
</view>
<!-- 不是自己 -->
<view v-show="item.isMine !== 1">{{ item.status === null ? '待审核' : item.status === 1 ? '已通过' : '已驳回' }}</view>
<!-- 是当前审核人 且未审核状态 -->
<view v-show="item.isMine === 1 && item.status === null">
<u-button size="mini" shape="circle" class="mr-4 h-1-4 leading-1-4" type="primary" @click="approvedModal = true">通过</u-button>
<u-button size="mini" shape="circle" class="h-1-4 leading-1-4" type="error" @click="rebutModal = true">驳回</u-button>
</view>
<!-- 自己是审核人 且审核过 当前审核人的审核状态并展示得分情况 -->
<view v-show="item.isMine === 1 && item.status !== null" class="text-sm">
<view>
{{ item.status == '1' ? '已通过' : '已驳回' }}
</view>
<view v-if="item.score > 0">
<u-circle-progress active-color="#FA8C16" :percent="item.score" width="90" border-width="7" class="mt-2">
<view class="u-progress-content">
<view class="progress-dot text-white text-center">{{ item.score }}</view>
</view>
</u-circle-progress>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 审核通过的modal -->
<u-mask :show="approvedModal" @click="approvedModal = false">
<view class="modal-content-wrap" @click.stop>
<!-- 通过modal的标题 -->
<view class="modal-content-head"> 审核通过 </view>
<view class="modal-content-body">
<!-- 评分 -->
<view class="flex justify-between mb-4">
<u-number-box v-model="score" size="30" input-width="50" :max="100" :min="0" :step="1"></u-number-box>
<view class="w-32 pt-4">
<u-slider v-model="score" active-color="#34D399" :max="100" :min="0" :step="1"></u-slider>
</view>
</view>
<textarea
class="border-solid border border-gray-300 rounded-md"
placeholder="请输入通过建议"
maxlength="30"
v-model="adviceRef"
></textarea>
<view class="common-list">
<view v-for="item in commonWords" class="leading-12" @click="adviceRef = item">
{{ item }}
</view>
</view>
</view>
<view class="modal-content-foot">
<view class="cancel" @click="approvedModal = false"> 取消 </view>
<view class="confirm" @click="confirmAdvice"> 确定 </view>
</view>
</view>
</u-mask>
<!-- 审批驳回的modal -->
<u-mask :show="rebutModal" @click="rebutModal = false">
<view class="modal-content-wrap" @click.stop>
<!-- 通过modal的标题 -->
<view class="modal-content-head"> 审核驳回 </view>
<view class="modal-content-body">
<textarea
class="border-solid border border-gray-300 rounded-md"
placeholder="请输入通过建议"
maxlength="30"
v-model="rebutRef"
></textarea>
<view class="common-list">
<view v-for="item in rebutWords" class="leading-12" @click="rebutRef = item">
{{ item }}
</view>
</view>
</view>
<view class="modal-content-foot">
<view class="cancel" @click="rebutModal = false"> 取消 </view>
<view class="confirm" @click="confirmReject"> 确定 </view>
</view>
</view>
</u-mask>
</view>
</template>
<script setup>
import { reactive, watchEffect } from 'vue';
const data = reactive({
remark: '',
type: 'textarea',
border: true,
height: 100,
autoHeight: true,
wordNum: 0,
score: 0,
type1: 'number',
});
import { ref, computed } from 'vue';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
const emit = defineEmits(['submit']);
const props = defineProps({ task: { type: Object, default: () => {} } });
const store = useStore();
const projectId = computed(() => store.getters['project/projectId']);
const collapsed = ref(false);
const deliverData = ref(null); //
const approvedModal = ref(false); // modal
const rebutModal = ref(false); // modal
const score = ref(100); //
const adviceRef = ref(''); //
const rebutRef = ref(''); //
const commonWords = ['加油,再接再厉!', '很棒!', '不错,很详细!', '加油,再接再厉']; //
const rebutWords = ['不详细', '还有需要改进的地方', '驳回审批1', '驳回审批2']; //
watchEffect(() => {
if (remark) {
data.wordNum = remark.value.length;
//
(async function getDeliverList() {
try {
const param = { taskId: props.task.id };
deliverData.value = await uni.$u.api.getDeliverByTaskId(param);
} catch (error) {
console.error('getDeliverList error: ', error);
}
})();
if (score) {
data.score1 = score.value;
}
});
//
function confirmAdvice() {
// TODO:
// console.log('')
//
function submit() {
emit('submit', this.remark, this.score);
try {
const deliverRecordId = deliverData.value.deliverRecordId;
const param = {
projectId: projectId.value,
deliverRecordId,
type: 1,
remark: adviceRef.value,
score: score.value,
};
console.log(param);
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
}
approvedModal.value = false;
}
function sliderChange(e) {
data.score = e.detail.value;
//
function confirmReject() {
// TODO:
try {
const { deliverRecordId } = store.state.deliver;
const param = {
projectId: projectId.value,
deliverRecordId,
type: 2,
remark: rebutRef.value,
score: '',
};
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
}
rebutModal.value = false;
}
function changeNumber(e) {
if (e > 100) {
data.score = 100;
}
//
function moreRecords() {
const { deliverRecordId } = store.state.deliver;
uni.navigateTo({ url: `/pages/checkerList/checkerList?deliverRecordId=${deliverRecordId}` });
}
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>
<style scoped lang="scss"></style>

199
plugins/p-deliver-checker/p-deliver-checker.vue

@ -1,199 +0,0 @@
<template>
<view class="bg-white rounded-md">
<view class="p-3 flex justify-between" @click="collapsed = !collapsed">
<span class="relative p-1">
<!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ checkData ? checkData.deliverName : '' }}
</span>
<!-- 展开折叠按钮 -->
<u-icon :name="collapsed ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
<view class="p-3 pt-0" v-show="collapsed">
<!-- 提交人和时间信息 -->
<view class="text-gray-400">
<!-- <span class="mr-2" v-if="checkData && checkData.submitter">{{ checkData.submitter }}</span> -->
<span v-if="checkData && checkData.submitTime"> {{ dayjs(+checkData.submitTime).format('MM-DD HH:mm') }}</span>
</view>
<!-- 提交的链接信息 -->
<view class="w-64 break-all text-blue-400 py-2" v-if="checkData && checkData.details && checkData.details[0]">
{{ checkData.details[0] }}
</view>
<!-- 审核人信息 -->
<view class="text-gray-400 flex justify-between">
<span>审核</span>
<span class="text-blue-400" @click="moreRecords">更多记录</span>
</view>
<view class="px-2" v-if="checkData && checkData.checkerList">
<!-- 遍历审核人信息 -->
<view class="mt-3 text-sm flex justify-between" v-for="item in checkData.checkerList">
<view>
<view>{{ item.checkerName }}</view>
<view class="my-1">{{ item.remark }}</view>
<view class="my-1" v-if="item.checkTime > 0">{{ dayjs(+item.checkTime).format('MM-DD HH:mm') }}</view>
</view>
<!-- 不是自己 -->
<view v-show="item.isMine !== 1">{{ item.status === null ? '待审核' : item.status === 1 ? '已通过' : '已驳回' }}</view>
<!-- 是当前审核人 且未审核状态 -->
<view v-show="item.isMine === 1 && item.status === null">
<u-button size="mini" shape="circle" class="mr-4 h-1-4 leading-1-4" type="primary" @click="approvedModal = true">通过</u-button>
<u-button size="mini" shape="circle" class="h-1-4 leading-1-4" type="error" @click="rebutModal = true">驳回</u-button>
</view>
<!-- 自己是审核人 且审核过 当前审核人的审核状态并展示得分情况 -->
<view v-show="item.isMine === 1 && item.status !== null" class="text-sm">
<view>
{{ item.status == '1' ? '已通过' : '已驳回' }}
</view>
<view v-if="item.score > 0">
<u-circle-progress active-color="#FA8C16" :percent="item.score" width="90" border-width="7" class="mt-2">
<view class="u-progress-content">
<view class="progress-dot text-white text-center">{{ item.score }}</view>
</view>
</u-circle-progress>
</view>
</view>
</view>
</view>
</view>
<!-- 审核通过的modal -->
<u-mask :show="approvedModal" @click="approvedModal = false">
<view class="warp">
<view class="rect2" @tap.stop>
<!-- 通过modal的标题 -->
<view class="text-center my-7 font-semibold"> 审核通过 </view>
<!-- 评分 -->
<view class="flex justify-between mx-5">
<u-number-box v-model="score" size="30" input-width="50" :max="100" :min="0" :step="1"></u-number-box>
<view class="w-32 pt-4">
<u-slider v-model="score" active-color="#34D399" :max="100" :min="0" :step="1"></u-slider>
</view>
</view>
<view>
<textarea
class="border-solid border border-gray-300 m-5 w-58 h-16 p-2 rounded-md"
placeholder="请输入通过建议"
maxlength="30"
v-model="adviceRef"
></textarea>
<view class="common-list">
<view v-for="item in commonWords" class="h-12 leading-12 w-62 mx-5" @click="adviceRef = item">
{{ item }}
</view>
</view>
</view>
<view class="flex justify-around h-12 mt-7 justify-self-stretch box-modal-border">
<view class="leading-12 flex-1 text-center delete-modal-border" @click="approvedModal = false"> 取消 </view>
<view class="text-blue-700 leading-12 flex-1 text-center" @click="confirmAdvice"> 确定 </view>
</view>
</view>
</view>
</u-mask>
<!-- 审批驳回的modal -->
<u-mask :show="rebutModal" @click="rebutModal = false">
<view class="warp">
<view class="rect3" @tap.stop>
<!-- 通过modal的标题 -->
<view class="text-center my-6 font-semibold"> 审核驳回 </view>
<view>
<textarea
class="border-solid border border-gray-300 m-5 w-58 h-16 p-2 rounded-md"
placeholder="请输入通过建议"
maxlength="30"
v-model="rebutRef"
></textarea>
<view class="common-list">
<view v-for="item in rebutWords" class="h-12 leading-12 w-62 mx-5" @click="rebutRef = item">
{{ item }}
</view>
</view>
</view>
<view class="flex justify-around h-12 mt-7 justify-self-stretch box-modal-border">
<view class="leading-12 flex-1 text-center delete-modal-border" @click="rebutModal = false"> 取消 </view>
<view class="text-blue-700 leading-12 flex-1 text-center" @click="confirmReject"> 确定 </view>
</view>
</view>
</view>
</u-mask>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
const props = defineProps({ task: { type: Object, default: () => {} } });
const store = useStore();
const projectId = computed(() => store.getters['project/projectId']);
const collapsed = ref(false);
const checkData = ref(null); //
const approvedModal = ref(false); // modal
const rebutModal = ref(false); // modal
const score = ref(10); //
const adviceRef = ref(''); //
const rebutRef = ref(''); //
const commonWords = ['加油,再接再厉!', '很棒!', '不错,很详细!', '加油,再接再厉']; //
const rebutWords = ['不详细', '还有需要改进的地方', '驳回审批1', '驳回审批2']; //
//
(async function getDeliverList() {
try {
const param = { taskId: props.task.id };
checkData.value = await uni.$u.api.getDeliverByTaskId(param);
} catch (error) {
console.error('getDeliverList error: ', error);
}
}());
//
function confirmAdvice() {
// TODO:
// console.log('')
try {
const { deliverRecordId } = store.state.deliver;
const param = {
projectId: projectId.value,
deliverRecordId,
type: 1,
remark: adviceRef.value,
score: score.value,
};
console.log(param)
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
}
approvedModal.value = false;
}
//
function confirmReject() {
// TODO:
try {
const { deliverRecordId } = store.state.deliver;
const param = {
projectId: projectId.value,
deliverRecordId,
type: 2,
remark: rebutRef.value,
score: '',
};
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
}
rebutModal.value = false;
}
//
function moreRecords() {
const { deliverRecordId } = store.state.deliver;
uni.navigateTo({ url: `/pages/checkerList/checkerList?deliverRecordId=${deliverRecordId}` });
}
</script>
<style scoped lang="scss"></style>

4
plugins/p-deliver/p-deliver.vue

@ -51,7 +51,7 @@
<!-- 编辑交付物标题的modal -->
<u-mask :show="showEditModal" @click="showEditModal = false">
<view class="warp">
<view class="modal-content-wrap">
<view class="rect rounded-md" @tap.stop>
<view class="text-center my-7 font-semibold">交付物标题名称</view>
<view>
@ -107,7 +107,7 @@ const isMine = computed(() => store.getters['role/isMine']); // 是不是我的
} catch (error) {
console.log('error: ', error);
}
}());
})();
//
function validateDeliverForm(checkedCheckers) {

Loading…
Cancel
Save