Browse Source

feat: 交付物2

test2
xuesinan 3 years ago
parent
commit
51db122d45
  1. 3
      CHANGELOG.md
  2. 8
      apis/plugin.js
  3. 4
      common/styles/tailwind.scss
  4. 4
      components/Plugin/Plugin.vue
  5. 32
      components/ReviewerSecond/ReviewerSecond.vue
  6. 9
      components/Title/Title.vue
  7. 1
      hooks/project/useInit.js
  8. 2
      manifest.json
  9. 3
      pages.json
  10. 107
      pages/submitLog/submitLog.vue
  11. 273
      plugins/p-deliver-check-second-detail/p-deliver-check-second-detail.vue
  12. 2
      plugins/p-deliver-check-second/check-form-modal-second.vue
  13. 47
      plugins/p-deliver-check-second/p-deliver-check-second.vue
  14. 67
      plugins/p-deliver-upload-second/p-deliver-upload-second.vue
  15. 1
      store/role/mutations.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-04-13)
# 1.0.0 (2022-04-17)
### 🌟 新功能
范围|描述|commitId
@ -35,6 +35,7 @@
- | 获取交付物信息 | [5ae68e2](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/5ae68e2)
- | 获取手机唯一码 | [3f60cf8](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/3f60cf8)
- | 将时间轴改成swiper滑动 | [12384f9](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/12384f9)
- | 交付物2 | [864b080](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/864b080)
- | 解决时间轴日常任务不显示问题 | [c532a93](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/c532a93)
- | 刻度模式时间轴 | [a9bc53a](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/a9bc53a)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/ccsens_tall/TALL-MUI-4/commits/561c8e6)

8
apis/plugin.js

@ -27,15 +27,15 @@ export function setupPlugin(app) {
uni.$u.api.queryDeliverOfTask = param => uni.$u.post(`${domain.value}/deliver/queryDeliverOfTask`, param);
// v4.0
// 根据任务id获取任务的交付物信息(已成功)
uni.$u.api.getDeliverByTaskId = param => uni.$u.post(`${domain.value}/deliver/getDeliver`, param);
uni.$u.api.getDeliverByTaskId = (param, url) => uni.$u.post(`${url || domain.value}/deliver/getDeliver`, param);
// 提交交付物信息(已成功)
uni.$u.api.submitDeliverInfo = param => uni.$u.post(`${domain.value}/deliver/submitDeliver`, param);
uni.$u.api.submitDeliverInfo = (param, url) => uni.$u.post(`${url || domain.value}/deliver/submitDeliver`, param);
// 查看交付物提交历史记录(已成功)
uni.$u.api.getDeliverHistory = param => uni.$u.post(`${domain.value}/deliver/queryRecord`, param);
uni.$u.api.getDeliverHistory = (param, url) => uni.$u.post(`${url}/deliver/queryRecord`, param);
// 修改交付物标题名称
uni.$u.api.editDeliverName = param => uni.$u.post(`${domain.value}/deliver/saveDeliver`, param);
// 检查交付物
uni.$u.api.checkDeliver = param => uni.$u.post(`${domain.value}/deliver/checkDeliver`, param);
uni.$u.api.checkDeliver = (param, url) => uni.$u.post(`${url || domain.value}/deliver/checkDeliver`, param);
// 查看检查记录
uni.$u.api.queryCheckLog = param => uni.$u.post(`${domain.value}/deliver/queryCheckLog`, param);
}

4
common/styles/tailwind.scss

@ -4625,6 +4625,10 @@
width: 5rem;
}
.w-24 {
width: 6rem;
}
.w-58 {
width: 14.5rem;
}

4
components/Plugin/Plugin.vue

@ -20,8 +20,8 @@
<p-wbs-import :task="task" v-if="pluginId === '13' || pluginId === '14'" /> -->
<!-- 交付物插件 -->
<p-deliver v-else-if="pluginId === '15'" />
<!-- <p-deliver-second v-else-if="pluginId === '15'" /> -->
<!-- <p-deliver v-else-if="pluginId === '15'" /> -->
<p-deliver-second v-else-if="pluginId === '15'" />
<p-source-manage v-else-if="pluginId === '16'" class="p-2" />
<p-finance-audit v-else-if="pluginId === '17'" class="p-2" />
<p-finance v-else-if="pluginId === '18'" class="p-2" />

32
components/ReviewerSecond/ReviewerSecond.vue

@ -6,7 +6,7 @@
<view class="flex flex-wrap">
<template v-for="(item, index) in checkers">
<u-button
v-if="index < 2"
v-if="index < 4"
:type="checkedCheckers.find(checker => checker.memberId === item.memberId) ? 'primary' : 'default'"
size="mini"
class="m-1"
@ -18,13 +18,12 @@
</view>
<!-- 展示选择的审核人 -->
<view class="flex items-center justify-end flex-1 text-sm">
<!-- <view class="flex items-center justify-end flex-1 text-sm">
<view v-for="item in showCheckers" class="mx-1">
<!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ item.name }}
</view>
<view class="mx-1" v-show="checkedCheckers.length > 3">...</view>
</view>
</view> -->
<!-- 点击更换图标 -->
<u-icon :name="collapsed ? 'arrow-down' : 'arrow-up'"></u-icon>
@ -34,7 +33,7 @@
<view v-show="!collapsed" class="foot mt-2 flex flex-wrap">
<template v-for="(item, index) in checkers">
<u-button
v-if="index >= 2"
v-if="index >= 4"
:type="checkedCheckers.find(checker => checker.memberId === item.memberId) ? 'primary' : 'default'"
size="mini"
class="m-1"
@ -65,16 +64,35 @@ const collapsed = ref(true);
// store
//
const checkers = computed(() => store.state.role.members);
const checkersStorage = uni.$storage.getStorageSync('checkers');
if (!checkers.value.length && checkersStorage) {
store.commit('role/setMembers', JSON.parse(checkersStorage));
}
//
let checkedCheckers = ref([]);
if (props.dataCheckers) {
checkedCheckers.value = props.dataCheckers;
if (props.dataCheckers && checkers.value.length > 0) {
props.dataCheckers.forEach(item => {
item.name = item.checkerName;
item.memberId = item.checkerId;
})
checkedCheckers.value = props.dataCheckers;
let arr = [];
checkers.value.forEach(item => {
let data = props.dataCheckers.find(checker => checker.memberId === item.memberId);
if (data) { arr.push(item); }
})
checkers.value.forEach(item => {
let data = props.dataCheckers.find(checker => checker.memberId === item.memberId);
if (!data) { arr.push(item); }
})
store.commit('role/setMembers', arr);
}
//

9
components/Title/Title.vue

@ -4,7 +4,7 @@
<!-- :is-back="false" -->
<u-navbar :custom-back="onBack" class="overflow-hidden">
<view class="flex justify-start flex-1 px-3 font-bold min-0">
<view class="truncate">{{ project.name }}</view>
<view class="truncate">{{ titleName || project.name }}</view>
</view>
<view class="mr-2" slot="right">
<u-icon class="m-1" name="xuanzhong2" custom-prefix="custom-icon" size="20px" @click="lwbs"></u-icon>
@ -55,6 +55,13 @@ import { useStore } from 'vuex';
import CreateTask from './components/CreateTask.vue';
import ShareProject from './components/ShareProject.vue';
defineProps({
titleName: {
type: String,
default: '',
},
});
const data = reactive({
show: false, // ...
createTaskShow: false, //

1
hooks/project/useInit.js

@ -92,6 +92,7 @@ export default function useInit() {
store.commit('project/setProject', options);
store.commit('role/setRoleId', '');
uni.$storage.setStorageSync('roleId', options.roleId || '');
uni.$storage.setStorageSync('projectId', options.p || '');
store.commit('task/setAllTasks', []);
store.commit('task/setBusinessCode', options.businessCode || '');
store.commit('task/setTargetTaskId', options.taskId || '');

2
manifest.json

@ -1,6 +1,6 @@
{
"name" : "时物链条2",
"appid" : "__UNI__6207504",
"appid" : "__UNI__3CBCFFF",
"description" : "",
"versionName" : "1.0.13",
"versionCode" : "100",

3
pages.json

@ -52,7 +52,8 @@
{
"path": "pages/submitLog/submitLog",
"style": {
"navigationBarTitleText": "交付物上传记录"
// "navigationBarTitleText": "交付物上传记录",
"navigationStyle": "custom"
}
},
{

107
pages/submitLog/submitLog.vue

@ -1,11 +1,45 @@
<template>
<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">
<!-- 标题栏 -->
<Title :titleName="deliverName" />
<view class="tab-box fixed w-full flex justify-between items-center bg-white">
<view class="tab-item text-center" :class="{'tab-curr': current === 0}" @click="changeTabs(0)">
<view class="tab-title px-1 inline-block">提交</view>
</view>
<view class="tab-item text-center" :class="{'tab-curr': current === 1}" @click="changeTabs(1)">
<view class="tab-title px-1 inline-block">审核</view>
</view>
<view class="tab-item text-center" :class="{'tab-curr': current === 2}" @click="changeTabs(2)">
<view class="tab-title px-1 inline-block">历史记录</view>
</view>
</view>
<view style="height: 44px;"></view>
<!-- 提交 -->
<view class="p-3 text-base">当前提交</view>
<view class="px-3">
<p-deliver-upload-second class="pb-2" v-if="deliverData" :deliverData="deliverData" :task="task" :url="url" @upload-success="getDeliverData" @edit-success="getDeliverData"></p-deliver-upload-second>
</view>
<!-- 审核 -->
<view class="p-3 text-base">审核状态</view>
<view class="px-3">
<p-deliver-check-second-detail v-if="deliverData" :deliverData="deliverData" :task="task" :url="url" @submit-end="getDeliverData"></p-deliver-check-second-detail>
</view>
<!-- 历史记录 -->
<view class="p-3 text-base">历史记录</view>
<view class="px-3" v-if="listRef && listRef.length">
<view class="bg-white mb-3 rounded-md p-3 text-gray-400" v-for="item in listRef">
<!-- 插件名称和提交时间显示 -->
<view class="flex justify-between mb-2">
<view class="text-gray-800">{{ deliverName }}</view>
<view class="text-xs">{{ dayjs(+item.submitTime).format('MM-DD HH:mm') }}</view>
<view class="ml-1 text-xs w-24 text-right">{{ dayjs(+item.submitTime).format('MM-DD HH:mm') }}</view>
</view>
<!-- 提交的链接 -->
<DeliverLink v-if="item.details[0]" :link="item.details[0]" />
@ -44,19 +78,42 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref, provide } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import dayjs from 'dayjs';
const listRef = ref([]);
const deliverName = ref('');
const deliverData = ref(null);
const task = ref(null);
const checkers = ref(null);
const clickList = [
{
name: '提交'
},
{
name: '审核'
},
{
name: '历史记录'
}
];
const current = ref(0);
const url = ref(null);
onLoad(options => {
deliverData.value = JSON.parse(options.deliverData);
provide('deliver', deliverData.value);
task.value = JSON.parse(options.task);
provide('task', task.value);
checkers.value = options.checkers;
url.value = options.url;
// id
(async function getHistory() {
try {
const param = { deliverId: options.deliverId };
const data = await uni.$u.api.getDeliverHistory(param);
const data = await uni.$u.api.getDeliverHistory(param, options.url);
deliverName.value = data.deliverName;
listRef.value = data.deliverRecordList;
} catch (error) {
@ -65,4 +122,44 @@ onLoad(options => {
}
})();
});
function changeTabs(index) {
current.value = index;
}
// id
async function getDeliverData() {
try {
const { id: taskId } = task.value;
if (!taskId) return;
const param = { taskId };
const data = await uni.$u.api.getDeliverByTaskId(param, url.value);
deliverData.value = data;
getHistory();
} catch (error) {
console.log('error: ', error);
}
}
</script>
<style scoped lang="scss">
.tab-box {
height: 44px;
z-index: 999;
.tab-item {
width: calc(100% / 3);
height: 44px;
line-height: 40px;
}
.tab-curr {
.tab-title {
color: #2979ff;
border-bottom: 3px solid #2979ff;
}
}
}
</style>

273
plugins/p-deliver-check-second-detail/p-deliver-check-second-detail.vue

@ -0,0 +1,273 @@
<template>
<view class="p-2 bg-white rounded-md">
<view class="flex justify-between items-center">
<!-- 提交人和时间信息 -->
<view class="text-gray-400 text-xs">
<text class="mr-4" v-if="deliverData.submitMemberName">{{ deliverData.submitMemberName }}</text>
<text v-if="deliverData.submitTime"> {{ dayjs(+deliverData.submitTime).format('MM-DD HH:mm') }}</text>
</view>
</view>
<!-- 提交的链接信息 -->
<DeliverLink :link="deliverData.details[0]" v-if="deliverData.details && deliverData.details[0]" />
<!-- 审核人 标题 -->
<view class="text-gray-400 flex justify-between mt-3">
<text>审核</text>
</view>
<!-- 审核人 列表 -->
<view v-if="deliverData.checkerList">
<!-- 遍历审核人信息 -->
<template v-for="item in deliverData.checkerList">
<!-- -->
<template v-if="item.isMine === 1">
<view class="mt-2 text-sm flex justify-between">
<view>
<view class="font-semibold">{{ item.checkerName }}</view>
<view class="text-xs text-gray-400">{{ item.remark }}</view>
<view class="text-xs text-gray-400" v-if="+item.checkTime > 0">{{ dayjs(+item.checkTime).format('MM-DD HH:mm') }}</view>
</view>
<view class="time-box" v-if="item.checkDuration">
<view class="initial-duration bg-yellow-400" :style="{width: item.initialPercent + '%'}"></view>
<view class="duration bg-blue-400" :style="{width: item.currPercent + '%'}"></view>
<view class="check-duration bg-green-400" :style="{width: item.checkPercent + '%'}"></view>
</view>
<!-- 自己是审核人 且审核过 当前审核人的审核状态并展示得分情况 -->
<view v-show="item.status > 0" class="text-xs">
<view class="mb-1">
<text v-if="item.status === 1" class="text-green-600"> 已通过 </text>
<text v-else-if="item.status === 2" class="text-red-600"> 已驳回 </text>
</view>
<view class="text-yellow-500 font-medium text-base">{{ item.score }}</view>
<!-- <zwp-ring-timing mode="chart" :value="item.score" active-color="#F59E0B" :radius="30" :bar-width="4" v-if="item.score"> -->
<!-- <text class="text-yellow-500 font-medium">{{ item.score }}</text> -->
<!-- </zwp-ring-timing> -->
</view>
</view>
<view v-if="item.status === null || item.status === 0">
<view class="mt-3" style="border-bottom: 1px solid #D1D5DB;" @click="collapsed = !collapsed">
<view class="flex justify-between">
<view class="mr-1 text-sm flex items-center">
<view class="mr-2">确认工作</view>
<view class="flex flex-wrap">
<u-button style="width: 45px;" :type="checkedIndex === 0 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-2" @click="handleSelectTime(0)">
半小时
</u-button>
<u-button style="width: 45px;" :type="checkedIndex === 1 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-2" @click="handleSelectTime(1)">
1小时
</u-button>
<u-button style="width: 45px;" :type="checkedIndex === 2 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-2" @click="handleSelectTime(2)">
2小时
</u-button>
</view>
</view>
<!-- 时长 -->
<view class="flex item-center justify-end flex-1 text-sm">
<u-input v-model="checkDuration" type="text" placeholder="工作量时长" class="input" style="text-align: right;"></u-input>
</view>
</view>
</view>
<view class="mt-3 flex justify-between items-center">
<view>交付物质量</view>
<view class="flex justify-end items-center">
<u-number-box v-model="score" size="30" :max="100" :min="0" :step="1"></u-number-box>
<view class="w-20 ml-2">
<u-slider v-model="score" active-color="#34D399" :max="100" :min="0" :step="1"></u-slider>
</view>
</view>
</view>
<view class="mt-3 relative">
<u-input class="h-20" v-model="commit" type="textarea" placeholder="鼓励一下小伙伴" :border="true" :auto-height="true" />
<view class="absolute border border-solid border-gray-300 rounded-md text-center text-base word-btn" @click="showWords = !showWords"></view>
</view>
<view class="common-list" v-if="showWords">
<view v-for="item in words" class="px-2 leading-12 word-item" @click="commit = item">
{{ item }}
</view>
</view>
<view class="mt-4 flex justify-center items-center">
<u-button class="mx-4" type="primary" @click="handleSubmit(1)">
通过
</u-button>
<u-button class="mx-4" type="error" @click="handleSubmit(2)">
驳回
</u-button>
</view>
</view>
</template>
</template>
<template v-for="item in deliverData.checkerList">
<!-- 不是我 -->
<template v-if="item.isMine !== 1">
<view class="mt-2 text-sm flex justify-between">
<view>
<view class="font-semibold">{{ item.checkerName }}</view>
<view class="text-xs text-gray-400">{{ item.remark }}</view>
<view class="text-xs text-gray-400" v-if="+item.checkTime > 0">{{ dayjs(+item.checkTime).format('MM-DD HH:mm') }}</view>
</view>
<view class="time-box" v-if="item.checkDuration">
<view class="initial-duration bg-yellow-400" :style="{width: item.initialPercent + '%'}"></view>
<view class="duration bg-blue-400" :style="{width: item.currPercent + '%'}"></view>
<view class="check-duration bg-green-400" :style="{width: item.checkPercent + '%'}"></view>
</view>
<!-- 不是自己 显示审核状态 -->
<view class="text-xs">
<text v-if="item.status === 1" class="text-green-600"> 已通过 </text>
<text v-else-if="item.status === 2" class="text-red-600"> 已驳回 </text>
<text v-else class="text-gray-400"> 待审核 </text>
</view>
</view>
</template>
</template>
</view>
</view>
</template>
<script setup>
import { ref, inject, computed, watch } from 'vue';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
import { quickWords } from '@/config/deliver';
const props = defineProps({
deliverData: { type: Object, default: {} },
task: { default: {}, type: Object },
url: { type: String, default: '' }
});
const store = useStore();
const projectId = computed(() => store.getters['project/projectId']);
const roleId = computed(() => store.state.role.roleId);
const projectIdStorage = uni.$storage.getStorageSync('projectId');
const roleIdStorage = uni.$storage.getStorageSync('roleId');
const words = computed(() => quickWords['RESOLVE']); //
const delivers = inject('deliver');
const deliverData = computed(() => (Object.keys(props.deliverData).length ? props.deliverData : delivers.value));
const tasks = inject('task');
const task = computed(() => (Object.keys(props.task).length ? props.task : tasks.value));
const checkDuration = ref('2小时'); //
const checkedIndex = ref(2); //
const score = ref(100); //
const commit = ref(''); //
let maxDuration = ref(null);
const showWords = ref(false); //
const emits = defineEmits(['submit-end']);
if (Object.keys(deliverData.value).length) {
checkDuration.value = deliverData.value.duration; //
checkedIndex.value = checkDuration.value === '半小时' ? 0 : checkDuration.value === '1小时' ? 1 : checkDuration.value === '2小时' ? 2 : -1;
}
watch(deliverData, () => {
checkDuration.value = deliverData.value.duration; //
checkedIndex.value = checkDuration.value === '半小时' ? 0 : checkDuration.value === '1小时' ? 1 : checkDuration.value === '2小时' ? 2 : -1;
handleDataRender(deliverData.value.checkerList);
})
//
function handleSelectTime(data) {
checkedIndex.value = data;
checkDuration.value = data === 0 ? '半小时' : data === 1 ? '1小时' : '2小时';
}
//
async function handleDataRender(data) {
console.log('111111', data);
maxDuration.value = deliverData.value.initialDuration > deliverData.value.duration ? deliverData.value.initialDuration : deliverData.value.duration;
data.checkerList.forEach(item => {
if (item.checkDuration) {
maxDuration.value = maxDuration > item.checkDuration ? maxDuration : item.checkDuration;
if (maxDuration === deliverData.value.initialDuration) {
item.initialPercent = 100;
item.currPercent = Math.floor(deliverData.value.duration / deliverData.value.initialDuration);
item.checkPercent = Math.floor(item.checkDuration / deliverData.value.initialDuration);
} else if (maxDuration === deliverData.value.duration) {
item.currPercent = 100;
item.initialPercent = Math.floor(deliverData.value.initialDuration / deliverData.value.duration);
item.checkPercent = Math.floor(item.checkDuration / deliverData.value.duration);
} else if (maxDuration === item.checkDuration) {
item.checkPercent = 100;
item.initialPercent = Math.floor(deliverData.value.initialDuration / item.checkDuration);
item.currPercent = Math.floor(deliverData.value.duration / item.checkDuration);
}
}
})
return data;
}
/**
* 提交评审信息
* 提交成功后隐藏modal 重置表单控件
* 给父组件信息 更新值
* @param {string} mode 'RESOLVE'|'REJECT'
*/
async function handleSubmit(mode) {
try {
const deliverRecordId = deliverData.value.deliverRecordId;
const param = {
projectId: projectId.value || projectIdStorage,
roleId: roleId.value || roleIdStorage,
deliverRecordId,
type: mode,
remark: commit.value,
score: score.value,
checkDuration: checkDuration.value,
msgId: task.value.msgId,
};
await uni.$u.api.checkDeliver(param, props.url);
handleHide(); // +
uni.$ui.showToast('审核信息提交成功');
//
emits('submit-end', param);
} catch (error) {
console.error('error: ', error);
uni.$ui.showToast('审核信息提交失败, 请稍后重试');
}
}
//
function handleHide() {
score.value = 100;
commit.value = '';
}
</script>
<style scoped lang="scss">
.word-btn {
right: 10px;
bottom: 10px;
width: 30px;
height: 30px;
line-height: 28px;
}
.word-item {
border-bottom: 1px solid #E5E7EB;
}
</style>

2
plugins/p-deliver-check-second/check-form-modal-second.vue

@ -238,8 +238,6 @@ watch(deliverData, () => {
getHistory(); //
async function handleDataRender(data) {
console.log('----------', data)
console.log(typeof data)
maxDuration.value = deliverData.value.initialDuration > deliverData.value.duration ? deliverData.value.initialDuration : deliverData.value.duration;
data.checkerList.forEach(item => {

47
plugins/p-deliver-check-second/p-deliver-check-second.vue

@ -1,50 +1,45 @@
<template>
<view class="p-3">
<!-- 交付物名称 -->
<view class="flex justify-between" @click="checkModal.mode = 'SHOW'">
<view class="flex justify-between">
<view class="relative">
{{ deliverData ? deliverData.deliverName : '' }}审核状态
</view>
<!-- 展开折叠按钮 -->
<!-- <u-icon :name="collapsed ? 'arrow-up' : 'arrow-down'"></u-icon> -->
<u-icon name="arrow-right"></u-icon>
<!-- 折叠按钮 -->
<u-icon name="arrow-right" @click="openDeliverHistory"></u-icon>
</view>
<checkFormModal :data="checkModal" @hide="checkModal.mode = 'HIDE'" @submit-end="$emit('check-success')" />
<!-- <checkFormModal :data="checkModal" @hide="checkModal.mode = 'HIDE'" @submit-end="$emit('check-success')" /> -->
</view>
</template>
<script setup>
import { ref, reactive, inject } from 'vue';
import checkFormModal from './check-form-modal-second.vue';
import { ref, reactive, inject, computed } from 'vue';
import { useStore } from 'vuex';
// import checkFormModal from './check-form-modal-second.vue';
const store = useStore();
const deliverData = inject('deliver');
defineEmits(['check-success']);
const task = inject('task');
// defineEmits(['check-success']);
const domain = computed(() => store.state.domain);
const checkers = computed(() => store.state.role.members); //
const checkModal = reactive({
mode: 'HIDE', // HIDE-> RESOLVE-> REJECT->
deliverRecordId: () => (deliverData.value ? deliverData.value.deliverRecordId : ''), // id
});
// const checkModal = reactive({
// mode: 'HIDE', // HIDE-> RESOLVE-> REJECT->
// deliverRecordId: () => (deliverData.value ? deliverData.value.deliverRecordId : ''), // id
// });
//
// function openDeliverHistory() {
// const { deliverId } = deliverData.value;
// // console.log(deliverId)
// uni.navigateTo({ url: `/pages/submitLog/submitLog?deliverId=${deliverId}` });
// }
function openDeliverHistory() {
const { deliverId } = deliverData.value;
uni.navigateTo({ url: `/pages/submitLog/submitLog?deliverId=${deliverId}&deliverData=${JSON.stringify(deliverData.value)}&task=${JSON.stringify(task)}&url=${domain.value}` });
}
//
// function openMoreRecords() {
// const { deliverRecordId } = deliverData.value;
// uni.navigateTo({ url: `/pages/checkLog/checkLog?deliverRecordId=${deliverRecordId}` });
// }
function open() {
// console.log('open');
}
function close() {
this.show = false
// console.log('close');
}
</script>

67
plugins/p-deliver-upload-second/p-deliver-upload-second.vue

@ -32,9 +32,9 @@
<u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接" class="input"></u-input>
</view>
<view class="mt-3">
<u-button size="mini" :plain="true" type="primary" class="mr-3" @click="paste">粘贴</u-button>
<u-button size="mini" :plain="true" type="primary" class="mr-3" @click="uploadFile">文件</u-button>
<u-button size="mini" :plain="true" type="primary" class="mr-3" @click="uploadPhoto">拍照</u-button>
<u-button size="mini" :plain="true" type="primary" class="mr-3" @click="uploadFile">文件</u-button>
<u-button size="mini" :plain="true" type="primary" class="mr-3" @click="paste">粘贴</u-button>
</view>
</view>
@ -65,27 +65,27 @@
</view>
</u-mask>
<view class="border border-solid border-gray-300 rounded-md mt-3 px-2" @click="collapsed = !collapsed">
<view class="top flex justify-between">
<view class="mr-3 py-2 text-sm">工作量时长</view>
<view class="border border-solid border-gray-300 rounded-md mt-5 p-2 pt-4 pl-1" @click="collapsed = !collapsed">
<view class="relative flex justify-between">
<view class="absolute bg-white text-sm duration-title">工作量时长</view>
<!-- 时长 -->
<view class="flex item-center justify-end flex-1 text-sm">
<u-input v-model="duration" type="text" placeholder="请输入工作量时长" class="input" style="text-align: right;"></u-input>
</view>
</view>
<view class="foot mb-2 flex flex-wrap">
<u-button :type="checkedIndex === 0 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-3" @click="handleSelectTime(0)">
<view class="mr-5 flex flex-wrap items-center">
<u-button :type="checkedIndex === 0 ? 'primary' : 'default'" size="mini" class="m-1" style="padding: 0 5px;" @click="handleSelectTime(0)">
半小时
</u-button>
<u-button :type="checkedIndex === 1 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-3" @click="handleSelectTime(1)">
<u-button :type="checkedIndex === 1 ? 'primary' : 'default'" size="mini" class="m-1" style="padding: 0 5px;" @click="handleSelectTime(1)">
1小时
</u-button>
<u-button :type="checkedIndex === 2 ? 'primary' : 'default'" size="mini" class="my-1 ml-0 mr-3" @click="handleSelectTime(2)">
<u-button :type="checkedIndex === 2 ? 'primary' : 'default'" size="mini" class="m-1" style="padding: 0 5px;" @click="handleSelectTime(2)">
2小时
</u-button>
</view>
<!-- 时长 -->
<view class="flex item-center justify-end flex-1 text-sm">
<u-input v-model="duration" type="text" placeholder="工作量时长" :border="true" class="input"></u-input>
</view>
</view>
</view>
<!-- 插件审核人员选择 -->
@ -99,10 +99,20 @@ import { useStore } from 'vuex';
import { UPLOAD_URL } from '@/config/index';
import { UPLOAD_EXTENSION } from '@/config/deliver';
const deliver = inject('deliver');
const task = inject('task');
const props = defineProps({
deliverData: { type: Object, default: {} },
task: { default: {}, type: Object },
url: { type: String, default: '' }
});
const store = useStore();
const emits = defineEmits(['upload-success', 'edit-success']);
const delivers = inject('deliver');
const deliver = computed(() => (Object.keys(props.deliverData).length ? props.deliverData : delivers.value));
const tasks = inject('task');
const task = computed(() => (Object.keys(props.task).length ? props.task : tasks.value));
const reviewerRef = ref(null);
const submitBtnLoading = ref(false);
const linkValue = ref(''); //
@ -119,8 +129,10 @@ const checkedIndex = ref(2); // 默认选中
const submitState = computed(() => !linkValue.value);
const projectId = computed(() => store.getters['project/projectId']);
const roleId = computed(() => store.state.role.roleId);
const projectIdStorage = uni.$storage.getStorageSync('projectId');
const roleIdStorage = uni.$storage.getStorageSync('roleId');
if (deliver) {
if (Object.keys(deliver.value).length) {
linkValue.value = deliver.value.details[0]; //
duration.value = deliver.value.duration ? deliver.value.duration : deliver.value.initialDuration; //
checkedIndex.value = duration.value === '半小时' ? 0 : duration.value === '1小时' ? 1 : duration.value === '2小时' ? 2 : -1;
@ -163,15 +175,15 @@ async function submit() {
});
const param = {
projectId: projectId.value,
roleId: roleId.value,
projectId: projectId.value || projectIdStorage,
roleId: roleId.value || roleIdStorage,
deliverId: deliver.value.deliverId,
fileList: [linkValue.value],
checkerList,
duration: duration.value,
msgId: task.msgId,
msgId: task.value.msgId,
};
await uni.$u.api.submitDeliverInfo(param);
await uni.$u.api.submitDeliverInfo(param, props.url);
uni.$ui.showToast('提交交付物信息成功');
resetControlState(); //
emits('upload-success');
@ -304,3 +316,14 @@ function handleSelectTime(data) {
duration.value = data === 0 ? '半小时' : data === 1 ? '1小时' : '2小时';
}
</script>
<style scoped lang="scss">
.duration-title {
width: 85px;
height: 20px;
line-height: 20px;
text-align: center;
top: -25px;
left: 10px;
}
</style>

1
store/role/mutations.js

@ -33,6 +33,7 @@ const mutations = {
*/
setMembers(state, data) {
state.members = data || [];
uni.$storage.setStorageSync('checkers', JSON.stringify(data) || '');
},
/**

Loading…
Cancel
Save