Browse Source

refactor: 细节调整

deliver
wally 4 years ago
parent
commit
7f9cf1f0f5
  1. 1
      CHANGELOG.md
  2. 12
      common/styles/theme/default.scss
  3. 1
      components/Reviewer/Reviewer.vue
  4. 81
      plugins/p-deliver-checker/p-deliver-checker.vue
  5. 11
      plugins/p-deliver/p-deliver.vue

1
CHANGELOG.md

@ -35,6 +35,7 @@
--|--|-- --|--|--
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b) - | 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) - | 交付物相关细节调整 | [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) - | 细节调整 | [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) - | 细节调整 | [bdd5f87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/bdd5f87)

12
common/styles/theme/default.scss

@ -14,10 +14,10 @@
z-index: 100; z-index: 100;
} }
.box-modal-border { .box-modal-border {
border-top:1px solid #D1D5DB; border-top: 1px solid #d1d5db;
} }
.delete-modal-border { .delete-modal-border {
border-right:1px solid #D1D5DB ; border-right: 1px solid #d1d5db;
} }
} }
.warp { .warp {
@ -31,10 +31,10 @@
height: 375rpx; height: 375rpx;
background-color: #fff; background-color: #fff;
} }
.linkBox{ .link-box {
::v-deep .input{ :deep(.input) {
.u-input__input { .u-input__input {
color: #60A5FA; color: #60a5fa;
} }
} }
} }
@ -43,7 +43,7 @@
height: 12.5rem; height: 12.5rem;
overflow-y: scroll; overflow-y: scroll;
view { view {
border-bottom: 1px solid #E5E7EB; border-bottom: 1px solid #e5e7eb;
} }
} }
.rect2 { .rect2 {

1
components/Reviewer/Reviewer.vue

@ -43,6 +43,7 @@ const checkers = computed(() => store.state.role.members);
// //
const checkedCheckers = computed(() => checkers.value.filter(item => item.checked) || []); const checkedCheckers = computed(() => checkers.value.filter(item => item.checked) || []);
// //
// //
const showCheckers = computed(() => { const showCheckers = computed(() => {

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

@ -1,40 +1,48 @@
<template> <template>
<theme>
<view class="bg-white rounded-md"> <view class="bg-white rounded-md">
<view class="p-3 flex justify-between" @click="iconRef = !iconRef"> <view class="p-3 flex justify-between" @click="collapsed = !collapsed">
<span class="relative p-1"> <span class="relative p-1">
<!-- <u-badge :is-dot="true" is-center></u-badge> --> <!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ nameRef }} {{ checkData ? checkData.deliverName : '' }}
</span> </span>
<u-icon :name="iconRef ? 'arrow-right' : 'arrow-down'"></u-icon> <!-- 展开折叠按钮 -->
<u-icon :name="collapsed ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
<view class="p-3 pt-0" v-show="iconRef">
<view class="p-3 pt-0" v-show="collapsed">
<!-- 提交人和时间信息 --> <!-- 提交人和时间信息 -->
<view class="text-gray-400"> <view class="text-gray-400">
<span class="mr-2">{{ submitter }}</span> <span> {{ dayjs(+timeRef).format('MM-DD HH:mm') }}</span> <!-- <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>
<!-- 提交的链接信息 --> <!-- 提交的链接信息 -->
<view class="w-64 break-all text-blue-400 py-2"> {{ linkRef }} </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"> <view class="text-gray-400 flex justify-between">
<span>审核</span> <span>审核</span>
<span class="text-blue-400" @click="moreRecords">更多记录</span> <span class="text-blue-400" @click="moreRecords">更多记录</span>
</view> </view>
<view class="px-2"> <view class="px-2" v-if="checkData && checkData.checkerList">
<!-- 遍历审核人信息 --> <!-- 遍历审核人信息 -->
<view class="mt-3 text-sm flex justify-between" v-for="item in checkerList"> <view class="mt-3 text-sm flex justify-between" v-for="item in checkData.checkerList">
<view> <view>
<view>{{ item.checkerName }}</view> <view>{{ item.checkerName }}</view>
<view class="my-1">{{ item.remark }}</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 class="my-1" v-if="item.checkTime > 0">{{ dayjs(+item.checkTime).format('MM-DD HH:mm') }}</view>
</view> </view>
<view v-show="item.isMine !== 1">{{ item.status == null ? '待审核' : item.status === 1 ? '已通过' : '已驳回' }}</view>
<!-- 判断是否是当前审核人 --> <!-- 不是自己 -->
<view v-show="item.isMine === 1 && item.status == null"> <view v-show="item.isMine !== 1">{{ item.status === null ? '待审核' : item.status === 1 ? '已通过' : '已驳回' }}</view>
<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 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>
<!-- 当前审核人的审核状态并展示得分情况 -->
<!-- 自己是审核人 且审核过 当前审核人的审核状态并展示得分情况 -->
<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> <view>
{{ item.status == '1' ? '已通过' : '已驳回' }} {{ item.status == '1' ? '已通过' : '已驳回' }}
@ -57,11 +65,11 @@
<view class="rect2" @tap.stop> <view class="rect2" @tap.stop>
<!-- 通过modal的标题 --> <!-- 通过modal的标题 -->
<view class="text-center my-7 font-semibold"> 审核通过 </view> <view class="text-center my-7 font-semibold"> 审核通过 </view>
<!-- 通过modal的进步器和滑动选择器 --> <!-- 评分 -->
<view class="flex justify-between mx-5"> <view class="flex justify-between mx-5">
<u-number-box v-model="score" size="30" input-width="50"></u-number-box> <u-number-box v-model="score" size="30" input-width="50" :max="10" :min="0" :step="0.01"></u-number-box>
<view class="w-32 pt-4"> <view class="w-32 pt-4">
<u-slider v-model="score" active-color="#34D399"></u-slider> <u-slider v-model="score" active-color="#34D399" :max="10" :min="0" :step="0.01"></u-slider>
</view> </view>
</view> </view>
<view> <view>
@ -112,7 +120,6 @@
</view> </view>
</u-mask> </u-mask>
</view> </view>
</theme>
</template> </template>
<script setup> <script setup>
@ -123,43 +130,29 @@ import dayjs from 'dayjs';
const props = defineProps({ task: { type: Object, default: () => {} } }); const props = defineProps({ task: { type: Object, default: () => {} } });
const store = useStore(); const store = useStore();
const nameRef = ref(''); const projectId = computed(() => store.getters['project/projectId']);
const iconRef = ref(false); const collapsed = ref(false);
const submitter = ref('黛西'); const checkData = ref(null); //
const timeRef = ref('');
const linkRef = ref('');
const approvedModal = ref(false); // modal const approvedModal = ref(false); // modal
const rebutModal = ref(false); // modal const rebutModal = ref(false); // modal
const score = ref(1); // const score = ref(10); //
const adviceRef = ref(''); // const adviceRef = ref(''); //
const rebutRef = ref(''); // const rebutRef = ref(''); //
const commonWords = ['加油,再接再厉!', '很棒!', '不错,很详细!', '加油,再接再厉']; // const commonWords = ['加油,再接再厉!', '很棒!', '不错,很详细!', '加油,再接再厉']; //
const rebutWords = ['不详细', '还有需要改进的地方', '驳回审批1', '驳回审批2']; // const rebutWords = ['不详细', '还有需要改进的地方', '驳回审批1', '驳回审批2']; //
const checkerList = ref([]);
// id // id
const deliverRecordId = computed(() => store.state.deliver.deliverRecordId); const deliverRecordId = computed(() => store.state.deliver.deliverRecordId);
// //
(async function getDeliverList() { (async function getDeliverList() {
try {
const param = { taskId: props.task.id }; const param = { taskId: props.task.id };
const data = await uni.$u.api.getDeliverByTaskId(param); checkData.value = await uni.$u.api.getDeliverByTaskId(param);
// console.log(data) } catch (error) {
linkRef.value = data.details[0]; console.error('getDeliverList error: ', error);
timeRef.value = data.submitTime;
nameRef.value = data.deliverName;
checkerList.value = data.checkerList;
}());
//
async function approved() {
approvedModal.value = true;
}
//
function rebut() {
rebutModal.value = true;
} }
})();
// //
function confirmAdvice() { function confirmAdvice() {
@ -167,7 +160,7 @@ function confirmAdvice() {
// console.log('') // console.log('')
try { try {
const param = { const param = {
projectId: store.state.project.project.id, projectId: projectId.value,
deliverRecordId: deliverRecordId.value, deliverRecordId: deliverRecordId.value,
type: 1, type: 1,
remark: adviceRef.value, remark: adviceRef.value,
@ -185,7 +178,7 @@ function confirmReject() {
// TODO: // TODO:
try { try {
const param = { const param = {
projectId: store.state.project.project.id, projectId: projectId.value,
deliverRecordId: deliverRecordId.value, deliverRecordId: deliverRecordId.value,
type: 2, type: 2,
remark: rebutRef.value, remark: rebutRef.value,

11
plugins/p-deliver/p-deliver.vue

@ -24,7 +24,8 @@
:ripple="true" :ripple="true"
:loading="submitBtnLoading" :loading="submitBtnLoading"
v-show="!uBadgeShow" v-show="!uBadgeShow"
>提交</u-button> >提交</u-button
>
<!-- 查看提交历史的按钮 --> <!-- 查看提交历史的按钮 -->
<u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon> <u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon>
@ -32,7 +33,7 @@
<!-- 插件上传方式 --> <!-- 插件上传方式 -->
<view> <view>
<view class="linkBox"> <view class="link-box">
<u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接" class="input"></u-input> <u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接" class="input"></u-input>
</view> </view>
<view class="mt-3"> <view class="mt-3">
@ -44,7 +45,9 @@
<!-- 编辑和删除的遮罩层 --> <!-- 编辑和删除的遮罩层 -->
<view class="mask flex items-center justify-center bg-grey" v-show="showMask" @click="showMask = false"> <view class="mask flex items-center justify-center bg-grey" v-show="showMask" @click="showMask = false">
<view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="showEditModal = true">修改</view> <view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="showEditModal = true"
>修改</view
>
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="deleteDeliver">删除</view> <view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="deleteDeliver">删除</view>
<!-- 删除的二次提示modal --> <!-- 删除的二次提示modal -->
<u-modal v-model="showDeleteModal" :content="content" :show-cancel-button="true" @confirm="confirmDelete"></u-modal> <u-modal v-model="showDeleteModal" :content="content" :show-cancel-button="true" @confirm="confirmDelete"></u-modal>
@ -111,7 +114,7 @@ const checkedCheckers = computed(() => checkers.value.filter(item => item.checke
} catch (error) { } catch (error) {
console.log('error: ', error); console.log('error: ', error);
} }
}()); })();
// //
function validateDeliverForm() { function validateDeliverForm() {

Loading…
Cancel
Save