Browse Source

refactor: 细节调整;交付物记录没有数据显示empty

test2
wally 4 years ago
parent
commit
79c3051f42
  1. 1
      CHANGELOG.md
  2. 4
      common/styles/tailwind.scss
  3. 11
      pages/checkLog/checkLog.vue
  4. 8
      pages/submitLog/submitLog.vue
  5. 63
      plugins/p-deliver-upload/p-deliver-upload.vue
  6. 91
      plugins/p-delivery-history/p-delivery-history.vue

1
CHANGELOG.md

@ -85,6 +85,7 @@
- | 细节调整 | [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)
- | 移除财务审计统计插件的DEBUG标识 | [e9afef5](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e9afef5)
- | 重排代码格式、删除打印 | [83a14c4](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/83a14c4)
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b)

4
common/styles/tailwind.scss

@ -4350,7 +4350,9 @@
.opacity-100 {
opacity: 1;
}
.min-h-full {
min-height: 100%;
}
.h-3 {
height: 0.9rem;
}

11
pages/checkLog/checkLog.vue

@ -1,6 +1,6 @@
<template>
<theme class="pt-1 h-full">
<view class="h-full overflow-y-scroll bg-white rounded-md p-3 text-gray-400">
<view class="bg-white p-3 text-gray-400">
<template v-if="checkerList && checkerList.length">
<view v-for="item in checkerList" class="flex justify-between">
<view>
<view class="mb-1 text-gray-800">
@ -23,8 +23,9 @@
</view>
</view>
</view>
</view>
</theme>
</template>
<u-empty text="暂无审核记录" mode="history" style="margin-top: 120rpx" v-else></u-empty>
</view>
</template>
<script setup>
@ -49,5 +50,3 @@ async function getQueryCheckLog(options) {
}
}
</script>
<style lang="scss"></style>

8
pages/submitLog/submitLog.vue

@ -1,6 +1,6 @@
<template>
<theme>
<view class="h-full w-full px-3 pt-1 overflow-y-scroll">
<theme class="min-h-full">
<view class="px-3 pt-1" v-if="listRef && listRef.length">
<view class="bg-white my-2 rounded-md p-3 text-gray-400" v-for="item in listRef">
<!-- 插件名称和提交时间显示 -->
<view class="flex justify-between mb-2">
@ -38,6 +38,8 @@
</view>
</view>
</view>
<u-empty text="暂无记录" mode="history" style="padding-top: 120rpx" v-else></u-empty>
</theme>
</template>
@ -64,5 +66,3 @@ onLoad(options => {
})();
});
</script>
<style lang="scss"></style>

63
plugins/p-deliver-upload/p-deliver-upload.vue

@ -172,7 +172,7 @@ function paste() {
//
async function uploadFile() {
// #ifdef APP-PLUS
uni.$ui.showToast('APP暂不支持上传文件')
uni.$ui.showToast('APP暂不支持上传文件');
// #endif
// #ifdef H5
@ -184,46 +184,45 @@ async function uploadFile() {
console.error('error: ', error);
}
// #endif
}
//
function uploadPhoto (){
function uploadPhoto() {
uni.$ui.hideLoading();
let timer = null;
clearTimeout(timer);
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album','camera'], //
success: (res) => {
if (!timer) {
timer = setTimeout(() => {
uni.$ui.showLoading('正在上传...');
timer = null;
}, 800);
}
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: UPLOAD_URL, //
filePath: tempFilePaths[0],
name: 'files',
formData: {},
success: (res) => {
clearTimeout(timer);
uni.$ui.hideLoading();
const data = JSON.parse(res.data)
if(data.code === 200){
linkValue.value = data.data[0].visitUrl;
}
},
fail: error => {
clearTimeout(timer);
uni.$ui.hideLoading();
console.error('error',error)
},
});
}
sourceType: ['album', 'camera'], //
success: res => {
if (!timer) {
timer = setTimeout(() => {
uni.$ui.showLoading('正在上传...');
timer = null;
}, 800);
}
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: UPLOAD_URL, //
filePath: tempFilePaths[0],
name: 'files',
formData: {},
success: res => {
clearTimeout(timer);
uni.$ui.hideLoading();
const data = JSON.parse(res.data);
if (data.code === 200) {
linkValue.value = data.data[0].visitUrl;
}
},
fail: error => {
clearTimeout(timer);
uni.$ui.hideLoading();
console.error('error', error);
},
});
},
});
}

91
plugins/p-delivery-history/p-delivery-history.vue

@ -1,53 +1,49 @@
<template>
<!-- 交付物 -->
<view class="box shadow-lg">
<view class="mt-3">
<view v-if="data.lists && data.lists.length">
<view :key="list.id" v-for="list in data.lists">
<view class="p-3 mt-3 shadow">
<view class="text-gray-400 pb-2">
<span class="mr-4">{{ list.name }}</span>
<span>{{ $moment(+list.time).format('YYYY-MM-DD HH:mm:ss') }}</span>
</view>
<view class="pb-2 flex flex-wrap overflow-hidden" v-if="list.content">
<a :href="list.content" class="text-blue-500" target="_blank" v-if="CheckUrl(list.content)">{{ list.content }}</a>
<span v-else>{{ list.content }}</span>
</view>
<view :key="checker.checkerId" v-for="checker in list.checkerList" class="mb-2">
<view class="flex justify-between">
<view class="font-bold">
{{ checker.checkerName }}
<span v-if="checker.isMine">()</span>
</view>
<view>
<span class="text-blue-500" v-if="checker.status === 1">通过</span>
<span class="text-red-500" v-if="checker.status === 2">驳回</span>
<span class="ml-4" v-if="checker.status !== 0">{{ checker.score }}</span>
<span class="text-gray-400" v-if="checker.status === 0 && !checker.isMine">未审核</span>
<view v-if="checker.status === 0 && checker.isMine">
<u-button @click="showScore(checker.checkId, 2)" class="mr-3" plain size="mini" type="error">驳回</u-button>
<u-button @click="showScore(checker.checkId, 1)" plain size="mini" type="primary">通过</u-button>
<view class="mt-3">
<view v-if="data.lists && data.lists.length">
<view :key="list.id" v-for="list in data.lists">
<view class="p-3 mt-3 shadow">
<view class="text-gray-400 pb-2">
<span class="mr-4">{{ list.name }}</span>
<span>{{ $moment(+list.time).format('YYYY-MM-DD HH:mm:ss') }}</span>
</view>
<view class="pb-2 flex flex-wrap overflow-hidden" v-if="list.content">
<a :href="list.content" class="text-blue-500" target="_blank" v-if="CheckUrl(list.content)">{{ list.content }}</a>
<span v-else>{{ list.content }}</span>
</view>
<view :key="checker.checkerId" v-for="checker in list.checkerList" class="mb-2">
<view class="flex justify-between">
<view class="font-bold">
{{ checker.checkerName }}
<span v-if="checker.isMine">()</span>
</view>
<view>
<span class="text-blue-500" v-if="checker.status === 1">通过</span>
<span class="text-red-500" v-if="checker.status === 2">驳回</span>
<span class="ml-4" v-if="checker.status !== 0">{{ checker.score }}</span>
<span class="text-gray-400" v-if="checker.status === 0 && !checker.isMine">未审核</span>
<view v-if="checker.status === 0 && checker.isMine">
<u-button @click="showScore(checker.checkId, 2)" class="mr-3" plain size="mini" type="error">驳回</u-button>
<u-button @click="showScore(checker.checkId, 1)" plain size="mini" type="primary">通过</u-button>
</view>
</view>
</view>
<view class="text-gray-400 text-xs mt-1">{{ checker.remark }}</view>
</view>
<view class="text-gray-400 text-xs mt-1">{{ checker.remark }}</view>
</view>
</view>
</view>
</view>
<u-empty icon-size="90" mode="history" text="暂未上传交付物" v-else></u-empty>
<!-- 评分 -->
<!-- <uni-popup :maskClick="false" background-color="#fff" ref="popup" type="bottom"><PDeliverCheck @closeScore="closeScore" @submit="submit"></PDeliverCheck></uni-popup> -->
</view>
<u-empty icon-size="90" mode="history" text="暂未上传交付物" v-else></u-empty>
</view>
</view>
</template>
<script setup>
import { ref, reactive, onMounted, computed } from 'vue';
import { useStore } from 'vuex';
// import UniPopup from '../../components/uni-popup/uni-popup.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue';
const props = defineProps({ task: { type: Object, default: null } });
@ -97,13 +93,13 @@ async function submit(remark, score) {
}
/**
* 检查交付物
* @param {string} checkId 检查记录id
* @param {string} projectId 项目id
* @param {string} remark 评论
* @param {number} score 分数
* @param {number} status 检查状态(1-通过,2-驳回)
*/
* 检查交付物
* @param {string} checkId 检查记录id
* @param {string} projectId 项目id
* @param {string} remark 评论
* @param {number} score 分数
* @param {number} status 检查状态(1-通过,2-驳回)
*/
async function checkDeliver(remark, score) {
try {
data.show = true;
@ -131,11 +127,10 @@ function CheckUrl(url) {
</script>
<style scoped lang="scss">
.box{
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
.box {
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
</style>

Loading…
Cancel
Save