Browse Source

refactor: 查看提交历史记录页面数据同步更新

deliver
Min5203 4 years ago
parent
commit
749cb105d3
  1. 3
      CHANGELOG.md
  2. 142
      common/styles/tailwind.scss
  3. 38
      pages.json
  4. 23
      pages/checkerList/checkerList.vue
  5. 159
      pages/submitlist/submitlist.vue
  6. 151
      plugins/p-deliver-checker/p-deliver-checker.vue
  7. 3
      plugins/p-deliver/p-deliver.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-01-19)
# 1.0.0 (2022-01-20)
### 🌟 新功能
范围|描述|commitId
@ -76,6 +76,7 @@
范围|描述|commitId
--|--|--
- | 交付物插件代码审查 | [5f4d47b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5f4d47b)
- | 审查接口核对完成 | [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)
- | 提交交付物,查看提交记录,修改交付物标题的接口核对完成 | [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)

142
common/styles/tailwind.scss

@ -2198,9 +2198,9 @@
.-ml-px {
margin-left: -1px;
}
.border-none{
border-style: none;
.border-none {
border-style: none;
}
.box-border {
box-sizing: border-box;
@ -2213,22 +2213,22 @@
.border-l-2 {
border-left-width: 2px;
}
.border-b{
border-bottom-width: 1px;
.border-b {
border-bottom-width: 1px;
}
.border-gray-400{
--tw-border-opacity: 1;
border-color: rgba(156, 163, 175, var(--tw-border-opacity));
.border-gray-400 {
--tw-border-opacity: 1;
border-color: rgba(156, 163, 175, var(--tw-border-opacity));
}
.border-gray-300 {
--tw-border-opacity: 1;
border-color: rgba(209, 213, 219, var(--tw-border-opacity));
}
.border{
border-width: 1px;
.border {
border-width: 1px;
}
.border-solid{
border-style: solid;
.border-solid {
border-style: solid;
}
.block {
display: block;
@ -2439,15 +2439,15 @@
grid-auto-flow: column dense;
}
.gap-1{
.gap-1 {
gap: 0.25rem;
}
.gap-2{
.gap-2 {
gap: 0.5rem;
}
.gap-3{
.gap-3 {
gap: 0.75rem;
}
@ -2710,11 +2710,11 @@
.overflow-hidden {
overflow: hidden;
}
.visible{
visibility: visible;
.visible {
visibility: visible;
}
.invisible{
visibility: hidden;
.invisible {
visibility: hidden;
}
.overflow-visible {
overflow: visible;
@ -4354,21 +4354,20 @@
.h-3 {
height: 0.75rem;
}
.h5{
height: 1.25rem;
}
.h-10{
height: 2.5rem;
.h5 {
height: 1.25rem;
}
.h-10 {
height: 2.5rem;
}
.h-full {
height: 100%;
}
.leading-10{
line-height: 2.5rem;
.leading-10 {
line-height: 2.5rem;
}
.bg-gray-50 {
--tw-bg-opacity: 1;
@ -4400,8 +4399,8 @@
.h-12 {
height: 3.15rem;
}
.h-8{
height: 2.2rem;
.h-8 {
height: 2.2rem;
}
.bg-white {
--tw-bg-opacity: 1;
@ -4415,10 +4414,6 @@
--tw-bg-opacity: 1;
background-color: rgba(59, 130, 246, var(--tw-bg-opacity));
}
.text-green-400 {
--tw-text-opacity: 1;
color: rgba(52, 211, 153, var(--tw-text-opacity));
}
.text-black {
--tw-text-opacity: 1;
color: rgba(0, 0, 0, var(--tw-text-opacity));
@ -4499,8 +4494,8 @@
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.rounded-md{
border-radius: 0.375rem;
.rounded-md {
border-radius: 0.375rem;
}
.shadow-md {
@ -4533,56 +4528,57 @@ border-radius: 0.375rem;
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.bg-red-500{
--tw-bg-opacity: 1;
background-color: rgba(239, 68, 68, var(--tw-bg-opacity));
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgba(239, 68, 68, var(--tw-bg-opacity));
}
.bg-yellow-500 {
--tw-bg-opacity: 1;
background-color: rgba(245, 158, 11, var(--tw-bg-opacity));
}
.bg-yellow-500{
--tw-bg-opacity: 1;
background-color: rgba(245, 158, 11, var(--tw-bg-opacity));
.leading-12 {
line-height: 3.15rem;
}
.leading-12{
line-height: 3.15rem;
.rounded-w-12 {
border-radius: 1.5rem;
}
.rounded-w-12{
border-radius: 1.5rem;
.bg-opacity-100 {
--tw-bg-opacity: 1;
}
.bg-opacity-100{
--tw-bg-opacity: 1;
.bg-grey {
background-color: rgba(0, 0, 0, 0.5);
}
.bg-grey{
background-color: rgba(0,0,0,0.5);
.rounded-md {
border-radius: 0.375rem;
}
.rounded-md{
border-radius: 0.375rem;
.border-t {
border-top-width: 1px;
}
.border-t{
border-top-width: 1px;
.border-gray-200 {
--tw-border-opacity: 1;
border-color: rgba(229, 231, 235, var(--tw-border-opacity));
}
.border-gray-200{
--tw-border-opacity: 1;
border-color: rgba(229, 231, 235, var(--tw-border-opacity));
.w-64 {
width: 16rem;
}
.w-64{
width: 16rem;
.w-32 {
width: 8rem;
}
.w-32{
width: 8rem
.w-58 {
width: 14.5rem;
}
.w-58{
width: 14.5rem;
.h-16 {
height: 4rem;
}
.h-16{
height: 4rem;
.break-all {
word-break: break-all;
}
.break-all{
word-break: break-all;
.h-1-4 {
height: 1.4rem;
}
.h-1-4{
height: 1.4rem;
.leading-1-4 {
line-height: 1.4rem;
}
.leading-1-4{
line-height: 1.4rem;
.h-screen {
height: 100vh;
}

38
pages.json

@ -12,7 +12,7 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
},
//
{
"path": "pages/user/accountLogin",
@ -20,24 +20,34 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
//
{
"path": "pages/user/login",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
//
{
"path": "pages/user/login",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}
//
,{
"path" : "pages/submitList/submitList",
"style" :
"style" :
{
"navigationStyle": "historty",
"navigationBarTitleText": "历史交付物"
}
}
//
,{
"path" : "pages/checkerList/checkerList",
"style" :
{
"navigationStyle": "historty",
"navigationBarTitleText": "历史交付物"
"navigationStyle": "kkkkk",
"navigationBarTitleText": "审核记录"
}
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

23
pages/checkerList/checkerList.vue

@ -0,0 +1,23 @@
<template>
<view> </view>
</template>
<script setup>
onLoad(options => {
// id
(async function getHistory() {
try {
const param = { deliverId: options.deliverId };
const data = await uni.$u.api.getDeliverHistory(param);
name.value = data.deliverName;
listRef.value = data.deliverRecordList;
console.log(data);
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('获取交付物历史失败');
}
}());
});
</script>
<style lang="scss"></style>

159
pages/submitlist/submitlist.vue

@ -1,109 +1,114 @@
<template>
<theme class="h-full w-full pt-1">
<theme class="pt-1">
<view class="h-full w-full overflow-y-scroll">
<view class="bg-white mx-5 my-2 rounded-md p-3 text-gray-400" v-for="item in listRef">
<!-- 插件名称和提交时间显示 -->
<view class="flex justify-between mb-2">
<view class="text-gray-800">{{item.plugname}}</view>
<view>{{item.subtime}}</view>
<view class="text-gray-800">{{ name }}</view>
<view>{{ dayjs(+item.submitTime).format('MM-DD HH:mm') }}</view>
</view>
<!-- 提交的链接 -->
<view class="text-blue-400 mb-2">
{{item.link}}
<view class="w-64 break-all text-blue-400 py-2">
{{ item.details[0] }}
</view>
<!-- 该插件物的审核人 -->
<view class="mb-2">审核人</view>
<view class="flex justify-between my-3" v-for="items in item.reviewer">
<view>
<view class="pb-2 text-gray-800">
{{items.name}}
</view>
<view class="pb-2">
{{items.advise}}
</view>
<view class="pb-2">
{{items.time}}
</view>
<view class="flex justify-between my-3" v-for="items in item.checkerList">
<view>
<view class="pb-2 text-gray-800">
{{ items.checkerName }}
</view>
<view class="text-center">
<view :class="items.state === '已通过' ? 'text-green-500' : items.state === '已驳回' ? 'text-red-500' : '' ">
{{items.state}}
</view>
<view v-if="items.state === '已通过'">
<u-circle-progress active-color="#FA8C16" :percent="items.grade" width="90" border-width="7" class="mt-2">
<view class="u-progress-content">
<view class="progressDot text-white">{{items.grade}}</view>
</view>
</u-circle-progress>
</view>
<view class="pb-2">
{{ items.remark }}
</view>
<view class="pb-2" v-if="items.checkTime > 0">
{{ dayjs(+items.checkTime).format('MM-DD HH:mm') }}
</view>
</view>
<view class="text-center">
<view v-show="items.isMine !== 1">{{ item.status == null ? '待审核' : item.status === 1 ? '已通过' : '已驳回' }}</view>
<view v-show="items.isMine === 1 && items.status == null" class="text-sm">待审核</view>
<view v-show="items.isMine === 1 && items.status !== null" class="text-sm">
<view>
{{ items.status === 1 ? '已通过' : '已驳回' }}
</view>
<view v-if="items.score > 0">
<u-circle-progress active-color="#FA8C16" :percent="items.score" width="90" border-width="7" class="mt-2">
<view class="u-progress-content">
<view class="progressDot text-white text-center">{{ items.score }}</view>
</view>
</u-circle-progress>
</view>
</view>
</view>
</view>
</view>
</view>
</theme>
</template>
<script setup>
import{ref} from 'vue'
import { onLoad } from '@dcloudio/uni-app';
const listRef = ref([
{
plugname:'入职插件V0.8输出',
subtime:'12/25 13:01',
link:'https://www.baidu.com/',
reviewer:[
{
name:'冯老师',
time: '12/25 14:22',
advise:'加油!',
state:'已通过',
grade:80
},
{
name:'宋老师',
time: '12/28 8:22',
advise:'不详细!',
state:'已驳回',
grade:''
},
{
name:'张老师',
time: '',
advise:'',
state:'待审批',
grade:''
},
]
},
])
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import dayjs from 'dayjs';
// const listRef = ref([
// {
// plugname:'V0.8',
// subtime:'12/25 13:01',
// link:'https://www.baidu.com/',
// reviewer:[
// {
// name:'',
// time: '12/25 14:22',
// advise:'',
// state:'',
// grade:80
// },
// {
// name:'',
// time: '12/28 8:22',
// advise:'',
// state:'',
// grade:''
// },
// {
// name:'',
// time: '',
// advise:'',
// state:'',
// grade:''
// },
// ]
// },
// ])
const listRef = ref([]);
const name = ref('');
onLoad(options => {
// id
(async function getHistory(){
// id
(async function getHistory() {
try {
const param = { deliverId : options.deliverId };
const data = await uni.$u.api.getDeliverHistory(param)
// console.log(data.deliverRecordList[32].checkerList)
console.log(data)
const param = { deliverId: options.deliverId };
const data = await uni.$u.api.getDeliverHistory(param);
name.value = data.deliverName;
listRef.value = data.deliverRecordList;
console.log(data);
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('获取交付物历史失败');
console.log('error: ', error);
uni.$ui.showToast('获取交付物历史失败');
}
}());
});
});
</script>
<style lang="scss">
.progressDot{
.progressDot {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
line-height: 50rpx;
background-color: #FA8C16;
background-color: #fa8c16;
}
</style>

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

@ -6,45 +6,45 @@
<!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ nameRef }}
</span>
<u-icon :name=" iconRef ? 'arrow-right' : 'arrow-down' " ></u-icon>
<u-icon :name="iconRef ? 'arrow-right' : 'arrow-down'"></u-icon>
</view>
<view class="p-3 pt-0" v-show="iconRef">
<!-- 提交人和时间信息 -->
<view class="text-gray-400">
<span class="mr-2">{{ submitter }}</span> <span> {{ dayjs(+timeRef).format('MM-DD HH:mm') }}</span>
<span class="mr-2">{{ submitter }}</span> <span> {{ dayjs(+timeRef).format('MM-DD HH:mm') }}</span>
</view>
<!-- 提交的链接信息 -->
<view class="w-64 break-all text-blue-400 py-2"> {{linkRef}} </view>
<view class="w-64 break-all text-blue-400 py-2"> {{ linkRef }} </view>
<!-- 审核人信息 -->
<view class="text-gray-400 flex justify-between">
<span>审核</span>
<span class="text-blue-400">更多记录</span>
<span class="text-blue-400" @click="moreRecords">更多记录</span>
</view>
<view class="px-2">
<!-- 遍历审核人信息 -->
<view class="mt-3 text-sm flex justify-between" v-for="item in 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>{{ 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 ? '待审核' : 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="approved">通过</u-button>
<u-button size="mini" shape="circle" class="h-1-4 leading-1-4" type="error" @click="rebut">驳回</u-button>
</view>
<!-- 当前审核人的审核状态并展示得分情况 -->
<view v-show="item.isMine === 1 && item.status !== null" class="text-sm">
<view v-show="item.isMine === 1 && item.status !== null" class="text-sm">
<view>
{{item.status == '1' ? '已通过':'已驳回'}}
{{ 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="progressDot text-white text-center">{{item.score}}</view>
</view>
</u-circle-progress>
<u-circle-progress active-color="#FA8C16" :percent="item.score" width="90" border-width="7" class="mt-2">
<view class="u-progress-content">
<view class="progressDot text-white text-center">{{ item.score }}</view>
</view>
</u-circle-progress>
</view>
</view>
</view>
@ -65,15 +65,16 @@
</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
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>
{{ item }}
</view>
</view>
</view>
<view class="flex justify-around h-12 mt-7 justify-self-stretch box-modal-border">
@ -91,15 +92,16 @@
<!-- 通过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
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>
{{ item }}
</view>
</view>
</view>
<view class="flex justify-around h-12 mt-7 justify-self-stretch box-modal-border">
@ -114,41 +116,38 @@
</template>
<script setup>
import { ref} from 'vue';
import { ref } from 'vue';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
const props = defineProps({ task: { type: Object, default: () => {} } });
const store = useStore();
const nameRef = ref('入职插件V0.8原型输出');
const nameRef = ref('');
const iconRef = ref(false);
const submitter = ref('黛西');
const timeRef = ref('');
const linkRef = ref('')
const approvedModal = ref(false); //modal
const rebutModal = ref(false) //modal
const score = ref(1); //
const adviceRef = ref('') //
const rebutRef = ref('') //
const commonWords = ['加油,再接再厉!','很棒!','不错,很详细!','加油,再接再厉'] //
const rebutWords = ['不详细','还有需要改进的地方','驳回审批1','驳回审批2'] //
const checkerList = ref([])
//
const member = store.state.role.members.filter(item => item.isMine === 1);
const linkRef = ref('');
const approvedModal = ref(false); // modal
const rebutModal = ref(false); // modal
const score = ref(1); //
const adviceRef = ref(''); //
const rebutRef = ref(''); //
const commonWords = ['加油,再接再厉!', '很棒!', '不错,很详细!', '加油,再接再厉']; //
const rebutWords = ['不详细', '还有需要改进的地方', '驳回审批1', '驳回审批2']; //
const checkerList = ref([]);
//
(async function getDeliverList(){
const param = { taskId:props.task.id}
const data = await uni.$u.api.getDeliverByTaskId(param);
// console.log(data)
linkRef.value = data.details[0]
timeRef.value = data.submitTime
nameRef.value = data.deliverName
checkerList.value = data.checkerList
console.log(checkerList.value)
})();
(async function getDeliverList() {
const param = { taskId: props.task.id };
const data = await uni.$u.api.getDeliverByTaskId(param);
// console.log(data)
linkRef.value = data.details[0];
timeRef.value = data.submitTime;
nameRef.value = data.deliverName;
checkerList.value = data.checkerList;
}());
//
async function approved() {
@ -156,51 +155,53 @@ async function approved() {
}
//
function rebut() {
rebutModal.value = true
rebutModal.value = true;
}
//
function confirmAdvice(){
function confirmAdvice() {
// TODO:
// console.log('')
try {
try {
const param = {
projectId: store.state.project.project.id,
deliverRecordId:store.state.project.deliverRecordId,
type:1,
remark:adviceRef.value,
score:score.value
}
uni.$u.api.checkDeliver(param)
deliverRecordId: store.state.project.deliverRecordId,
type: 1,
remark: adviceRef.value,
score: score.value,
};
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
console.log('error: ', error);
}
approvedModal.value = false
approvedModal.value = false;
}
//
function confirmReject(){
function confirmReject() {
// TODO:
try {
try {
const param = {
projectId: store.state.project.project.id,
deliverRecordId:store.state.project.deliverRecordId,
type:2,
remark:rebutRef.value,
score:''
}
uni.$u.api.checkDeliver(param)
deliverRecordId: store.state.project.deliverRecordId,
type: 2,
remark: rebutRef.value,
score: '',
};
uni.$u.api.checkDeliver(param);
} catch (error) {
console.log('error: ', error);
console.log('error: ', error);
}
rebutModal.value = false
rebutModal.value = false;
}
//
function moreRecords() {
uni.navigateTo({ url: '/pages/checkerList/checkerList' });
}
</script>
<style scoped lang="scss">
.progressDot {
width: 50rpx;
height: 50rpx;

3
plugins/p-deliver/p-deliver.vue

@ -135,8 +135,7 @@ function submit() {
checkerList
};
uni.$u.api.submitDeliverInfo(param);
store.state.project.checkerList = checkerList
uBadgeShow.value = true;
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('提交交付物信息失败');

Loading…
Cancel
Save