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) - | 细节调整 | [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)
- | 移除财务审计统计插件的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) - | 重排代码格式、删除打印 | [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) - | 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-100 {
opacity: 1; opacity: 1;
} }
.min-h-full {
min-height: 100%;
}
.h-3 { .h-3 {
height: 0.9rem; height: 0.9rem;
} }

11
pages/checkLog/checkLog.vue

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

8
pages/submitLog/submitLog.vue

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

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

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

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

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

Loading…
Cancel
Save