Browse Source

feat: 获取交付物信息

deliver
wally 4 years ago
parent
commit
5ae68e2ac8
  1. 1
      CHANGELOG.md
  2. 2
      apis/plugin.js
  3. 27
      plugins/p-deliver/p-deliver.vue

1
CHANGELOG.md

@ -51,6 +51,7 @@
### 📝 文档
范围|描述|commitId
--|--|--
- | 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)

2
apis/plugin.js

@ -19,4 +19,6 @@ export function setupPlugin(app) {
uni.$u.api.queryDeliverOfTask = param => uni.$u.post(`${defaultwbs}/deliver/queryDeliverOfTask`, param);
// 检查交付物
uni.$u.api.checkDeliver = param => uni.$u.post(`${defaultwbs}/deliver/checkDeliver`, param);
// 根据任务id获取任务的交付物信息
uni.$u.api.getDeliverByTaskId = param => uni.$u.post(`${defaultwbs}/deliver/getDeliver`, param);
}

27
plugins/p-deliver/p-deliver.vue

@ -8,9 +8,9 @@
<!-- TODO: 可能会有多个交付物 需要遍历 或者展示第一个 -->
<!-- TODO: 应该是交付物的名称 -->
<view class="flex-1">
<span class="relative px-1">
<span class="relative px-1" v-if="deliver && deliver.deliverName">
<u-badge :is-dot="true" is-center v-if="uBadgeShow"></u-badge>
{{ task.name }}
{{ deliver.deliverName }}
</span>
</view>
@ -66,8 +66,8 @@
<script setup>
import { ref, computed} from 'vue';
const taskRef = defineProps({ task: { type: Object, default: () => {} } })
// console.log(taskRef.task.name)
const props = defineProps({ task: { type: Object, default: () => {} } })
// console.log(props.task.name)
//
@ -77,15 +77,29 @@ const linkValue = ref(''); // 链接的值
const historyIcon = ref(false); //
const showMask = ref(false); //
const showEditModal = ref(false); // modal
const newInputRef = ref(taskRef.task.name); //
const newInputRef = ref(props.task.name); //
// const reviewerData = ref(); //
const showDeleteModal = ref(false) // modal
const content = ref('是否确定删除')
const uBadgeShow = ref(false) //u-badge
const deliver = ref(null);
//
const submitState = computed(() => !linkValue.value);
// id
(async function getDeliverData() {
try{
const { id: taskId } = props.task;
if (!taskId) return;
const param = { "taskId": props.task.id }
const data = await uni.$u.api.getDeliverByTaskId(param)
deliver.value = data;
}catch(error){
console.log('error: ', error);
uni.$ui.showToast('获取交付物信息失败');
}
})();
//
function submit() {
@ -115,7 +129,6 @@ function paste() {
}
//
async function uploadFile(){
try{
const data = await uni.$upload.chooseAndUpload('https://test.tall.wiki/filedeal/file/upload/multiple',{}, ['.xls', '.xlsx','.zip','.exe','.pdf','.doc','.docx','.ppt','.pptx'] , 'files')
@ -129,7 +142,6 @@ async function uploadFile(){
//
async function uploadPhoto() {
try{
const data = await uni.$upload.chooseAndUpload('https://test.tall.wiki/filedeal/file/upload/multiple',{}, ['.xls', '.xlsx','.zip','.exe','.pdf','.doc','.docx','.ppt','.pptx'] , 'files')
// console.log(data[0])
@ -137,7 +149,6 @@ async function uploadPhoto() {
}catch(error){
console.error('error: ', error);
}
}
//

Loading…
Cancel
Save