Browse Source

feat(财务): 细节调整;根据任务获取财务条信息

deliver
wally 4 years ago
parent
commit
414106a027
  1. 1
      CHANGELOG.md
  2. 2
      apis/finance.js
  3. 33
      apis/mock.js
  4. 10
      components/Plugin/Plugin.vue
  5. 13
      components/TimeLine/component/TimeBox.vue
  6. 5
      plugins/p-finance/p-finance.vue

1
CHANGELOG.md

@ -37,6 +37,7 @@
--|--|--
- | 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)
- | 插件样式调整 | [7411d3a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/7411d3a)
- | 细节调整 | [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)

2
apis/finance.js

@ -6,5 +6,5 @@ console.log('fullPath: ', fullPath);
export function setupFinance(app) {
uni.$u.api = { ...uni.$u.api } || {};
// 根据任务id获取财务条信息
// uni.$u.api.getFinanceByTask = taskDetailId => uni.$u.post(`${fullPath}/getByTask`, { taskDetailId });
uni.$u.api.getFinanceByTask = taskDetailId => uni.$u.post(`${fullPath}/getByTask`, { taskDetailId });
}

33
apis/mock.js

@ -7,21 +7,22 @@ export function setupMock(app) {
uni.$u.api = { ...uni.$u.api } || {};
// 删除交付物
uni.$u.api.deleteDeliver = param => new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 100);
});
uni.$u.api.deleteDeliver = param =>
new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 100);
});
uni.$u.api.getFinanceByTask = taskDetailId => new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
financeId: '123',
budget: 1000 * 1000,
bonus: 200 * 1000,
projectExpend: 500 * 1000,
dailyExpend: 500 * 1000,
});
}, 100);
});
// uni.$u.api.getFinanceByTask = taskDetailId => new Promise((resolve, reject) => {
// setTimeout(() => {
// resolve({
// financeId: '123',
// budget: 1000 * 1000,
// bonus: 200 * 1000,
// projectExpend: 500 * 1000,
// dailyExpend: 500 * 1000,
// });
// }, 100);
// });
}

10
components/Plugin/Plugin.vue

@ -1,6 +1,5 @@
<template>
<view class="u-font-14 rounded-md bg-white p-2" style="height: 100%" @click="setStorage">
<Render :task="task" :pluginId="pluginId" :styleType="styleType" :pluginTaskId="pluginTaskId" :param="param" />
<!-- <plugin-default /> -->
<!-- <component :task="task" :is="pluginComponent"></component> -->
<p-task-title :task="task" v-if="pluginId === '1'" />
@ -19,10 +18,11 @@
<p-wbs-import :task="task" v-if="pluginId === '13' || pluginId === '14'" /> -->
<!-- 交付物插件 -->
<p-deliver v-if="pluginId === '15'" />
<p-source-manage v-if="pluginId === '16'" />
<p-finance-audit v-if="pluginId === '17'" />
<p-finance v-if="pluginId === '18'" />
<p-deliver v-else-if="pluginId === '15'" />
<p-source-manage v-else-if="pluginId === '16'" />
<p-finance-audit v-else-if="pluginId === '17'" />
<p-finance v-else-if="pluginId === '18'" />
<Render v-else :task="task" :pluginId="pluginId" :styleType="styleType" :pluginTaskId="pluginTaskId" :param="param" />
</view>
</template>

13
components/TimeLine/component/TimeBox.vue

@ -29,16 +29,7 @@
<view><skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton></view>
</view>
</u-card>
<!-- <u-card
@click="onClickTask(task.planStart - 0, task.id)"
:style="{ height: setHeight(task.panel) }"
:show-foot="false"
:show-head="false"
class="h-16"
margin="0"
v-if="tasks && tasks.length && task.process !== 4 && !showSkeleton"
>
<template v-slot:body> -->
<view v-if="tasks && tasks.length && task.process !== 4 && !showSkeleton" @click="onClickTask(task.planStart - 0, task.id)">
<view class="p-0 u-col-between grid gap-3">
<view :key="pIndex" v-for="(row, pIndex) in task.plugins">
@ -57,8 +48,6 @@
</view>
</view>
</view>
<!-- </template>
</u-card> -->
</view>
</view>
</view>

5
plugins/p-finance/p-finance.vue

@ -37,8 +37,9 @@ const data = ref(null);
//
async function getFinanceByTaskData() {
try {
const taskDetailId = task.taskDetailId;
data.value = await uni.$u.api.getFinanceByTask(taskDetailId);
console.log('task: ', task);
const detailId = task.detailId;
data.value = await uni.$u.api.getFinanceByTask(detailId);
} catch (error) {
console.log('getFinanceByTaskData error: ', error);
}

Loading…
Cancel
Save