Browse Source

refactor: 提交交付物,查看提交记录,修改交付物标题的接口核对完成

deliver
Min5203 4 years ago
parent
commit
7c08530f96
  1. 3
      CHANGELOG.md
  2. 15
      apis/plugin.js
  3. 1
      components/Globals/Globals.vue
  4. 1
      components/Plugin/Plugin.vue
  5. 21
      pages/submitlist/submitlist.vue
  6. 36
      plugins/p-deliver-checker/p-deliver-checker.vue
  7. 79
      plugins/p-deliver/p-deliver.vue
  8. 2
      rest/deliver.http
  9. 3
      store/deliver/actions.js
  10. 11
      store/deliver/getters.js
  11. 12
      store/deliver/index.js
  12. 62
      store/deliver/mutations.js
  13. 6
      store/deliver/state.js
  14. 3
      store/index.js
  15. 1
      store/project/state.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-01-18)
# 1.0.0 (2022-01-19)
### 🌟 新功能
范围|描述|commitId
@ -80,6 +80,7 @@
- | 完善历史记录页面和修改插件的TODO | [3d58c15](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3d58c15)
- | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98)
- | 修改插件名的输入框和查看历史记录 | [99fb88e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/99fb88e)
- | 修改错误单词‘confirmDeleDte’ | [ddbb04c](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ddbb04c)
- | 原有功能提交别的分支 | [eb02b72](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/eb02b72)
- | 重构project init 部分 | [c7bf2df](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/c7bf2df)
- | deliver检查人重构;更新真实数据的检查人 | [ce808c4](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ce808c4)

15
apis/plugin.js

@ -6,7 +6,8 @@ const defaultwbs = `${apiUrl}/defaultwbs`;
export function setupPlugin(app) {
uni.$u.api = { ...uni.$u.api } || {};
// 获取插件信息
uni.$u.api.getOtherPlugin = param => uni.$u.post(`${apiUrl}/pluginshop/plugin/query?pluginId=${param.pluginId}&styleType=${param.styleType}`);
uni.$u.api.getOtherPlugin = param =>
uni.$u.post(`${apiUrl}/pluginshop/plugin/query?pluginId=${param.pluginId}&styleType=${param.styleType}`);
// 查询子任务
uni.$u.api.findSonTask = param => uni.$u.post(`${defaultwbs}/task/findSonTask`, param);
@ -19,6 +20,16 @@ export function setupPlugin(app) {
// 检查交付物
uni.$u.api.checkDeliver = param => uni.$u.post(`${defaultwbs}/deliver/checkDeliver`, param);
// v4.0
// 根据任务id获取任务的交付物信息
// 根据任务id获取任务的交付物信息(已成功)
uni.$u.api.getDeliverByTaskId = param => uni.$u.post(`${defaultwbs}/deliver/getDeliver`, param);
// 提交交付物信息(已成功)
uni.$u.api.submitDeliverInfo = param => uni.$u.post(`${defaultwbs}/deliver/submitDeliver`, param);
// 查看交付物提交历史记录(已成功)
uni.$u.api.getDeliverHistory = param => uni.$u.post(`${defaultwbs}/deliver/queryRecord`, param);
// 修改交付物标题名称
uni.$u.api.editDeliverName = param => uni.$u.post(`${defaultwbs}/deliver/saveDeliver`, param);
// 检查交付物
uni.$u.api.checkDeliver = param => uni.$u.post(`${defaultwbs}/deliver/checkDeliver`, param);
// 查看检查记录
uni.$u.api.queryCheckLog = param => uni.$u.post(`${defaultwbs}/deliver/queryCheckLog`, param);
}

1
components/Globals/Globals.vue

@ -29,7 +29,6 @@
:style-type="plugin.styleType || 0"
v-for="plugin in pluginArr"
/>
<p-deliver-checker />
</template>
</view>
</template>

1
components/Plugin/Plugin.vue

@ -20,6 +20,7 @@
<p-wbs-import :task="task" v-if="pluginId === '13' || pluginId === '14'" />
<!-- 交付物插件 -->
<p-deliver :task="task" v-if="pluginId === '15'" />
<p-deliver-checker :task="task"/>
</view>
</view>
</template>

21
pages/submitlist/submitlist.vue

@ -44,6 +44,7 @@
<script setup>
import{ref} from 'vue'
import { onLoad } from '@dcloudio/uni-app';
const listRef = ref([
{
plugname:'入职插件V0.8输出',
@ -75,6 +76,26 @@
},
])
onLoad(options => {
// id
(async function getHistory(){
try {
const param = { deliverId : options.deliverId };
const data = await uni.$u.api.getDeliverHistory(param)
// console.log(data.deliverRecordList[32].checkerList)
console.log(data)
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('获取交付物历史失败');
}
}());
});
</script>
<style lang="scss">

36
plugins/p-deliver-checker/p-deliver-checker.vue

@ -3,11 +3,10 @@
<view class="bg-white rounded-md">
<view class="p-3 flex justify-between" @click="iconRef = !iconRef">
<span class="relative p-1">
<u-badge :is-dot="true" is-center></u-badge>
<!-- <u-badge :is-dot="true" is-center></u-badge> -->
{{ nameRef }}
</span>
<u-icon name="arrow-right" v-show="!iconRef"></u-icon>
<u-icon name="arrow-down" v-show="iconRef"></u-icon>
<u-icon :name=" iconRef ? 'arrow-right' : 'arrow-down' " ></u-icon>
</view>
<view class="p-3 pt-0" v-show="iconRef">
<!-- 提交人和时间信息 -->
@ -17,7 +16,10 @@
<!-- 提交的链接信息 -->
<view class="w-64 break-all text-blue-400 py-2"> http://192.168.0.99/gateway/defaultwbs/swagger-ui.html </view>
<!-- 审核人信息 -->
<view class="text-gray-400"> 审核 </view>
<view class="text-gray-400 flex justify-between">
<span>审核</span>
<span class="text-blue-400">更多记录</span>
</view>
<view class="px-2">
<!-- 当前审核人自己 -->
<view class="mt-3">
@ -40,7 +42,7 @@
<view class="u-progress-content">
<view class="progressDot text-white text-center">80</view>
</view>
</u-circle-progress> -->
</u-circle-progress> -->
</view>
</view>
</view>
@ -103,7 +105,7 @@
加油再接再厉
</view> -->
<view class="common-list">
<view v-for="item in rebutWordes" class="h-12 leading-12 w-62 mx-5" @click="rebutRef = item">
<view v-for="item in rebutWords" class="h-12 leading-12 w-62 mx-5" @click="rebutRef = item">
{{item}}
</view>
</view>
@ -120,7 +122,10 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref} from 'vue';
import { useStore } from 'vuex';
const store = useStore();
const nameRef = ref('入职插件V0.8原型输出');
const iconRef = ref(false);
const submitter = ref('黛西');
@ -131,12 +136,13 @@ const score = ref(1); //分数
const adviceRef = ref('') //
const rebutRef = ref('') //
const commonWords = ['加油,再接再厉!','很棒!','不错,很详细!','加油,再接再厉'] //
const rebutWordes = ['不详细','还有需要改进的地方','驳回审批1','驳回审批2'] //
const rebutWords = ['不详细','还有需要改进的地方','驳回审批1','驳回审批2'] //
//
function approved() {
async function approved() {
// console.log('')
approvedModal.value = true;
}
//
function rebut() {
@ -148,6 +154,18 @@ function rebut() {
function confirmAdvice(){
// TODO:
// console.log('')
try {
const param = {
projectId: store.state.project.project.id,
deliverRecordId:store.state.project.deliverRecordId,
type:1,
remark:adviceRef.value,
score:score.value
}
uni.$u.api.checkDeliver(param)
} catch (error) {
console.log('error: ', error);
}
approvedModal.value = false
}
//

79
plugins/p-deliver/p-deliver.vue

@ -58,42 +58,51 @@
</u-mask>
<!-- 插件审核人员选择 -->
<Reviewer/>
<Reviewer />
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { useStore } from 'vuex';
const props = defineProps({ task: { type: Object, default: () => {} } });
const store = useStore();
//
const deliverRef = ref(true); //
const linkValue = ref(''); //
const showMask = ref(false); //
const showEditModal = ref(false); // modal
const newInputRef = ref(props.task.name); //
const newInputRef = ref(''); //
const showDeleteModal = ref(false); // modal
const content = '是否确定删除';
const uBadgeShow = ref(false); // u-badge
const deliver = ref(null);
const deliver = ref();
//
const submitState = computed(() => !linkValue.value);
//
const delivers = computed(() => store.state.role.members);
const checkedDelivers = computed(() => delivers.value.filter(item => item.checked));
getDeliverData()
// id
(async function getDeliverData() {
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;
console.log(deliver.value);
// sessionStorage.setItem('deliverRecordId', deliver.value.deliverRecordId)
store.state.project.deliverRecordId = deliver.value.deliverRecordId
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('获取交付物信息失败');
}
}());
};
//
function validateDeliverForm() {
@ -111,9 +120,30 @@ function validateDeliverForm() {
return true;
}
//
//
function submit() {
//
if (!validateDeliverForm()) return;
//
try {
const checkerList = []
checkedDelivers.value.forEach(item=>{
checkerList.push(item.memberId)
})
const param = {
projectId: store.state.project.project.id,
deliverId: deliver.value.deliverId,
fileList: [linkValue.value],
checkerList
};
uni.$u.api.submitDeliverInfo(param);
} catch (error) {
console.log('error: ', error);
uni.$ui.showToast('提交交付物信息失败');
}
// else {
// //
// uBadgeShow.value = true;
@ -122,7 +152,9 @@ function submit() {
//
function openDeliverHistory() {
uni.navigateTo({ url: '/pages/submitList/submitList' });
const deliverIds = deliver.value.deliverId
// console.log(deliverId)
uni.navigateTo({ url:`/pages/submitList/submitList?deliverId=${deliverIds}`});
}
//
@ -143,7 +175,7 @@ async function uploadFile() {
['.xls', '.xlsx', '.zip', '.exe', '.pdf', '.doc', '.docx', '.ppt', '.pptx'],
'files',
);
// console.log(data[0])
// console.log(data[0]);
linkValue.value = data[0].visitUrl;
} catch (error) {
console.error('error: ', error);
@ -167,18 +199,29 @@ async function uploadPhoto() {
}
//
function confirmEditDeliverName() {
async function confirmEditDeliverName() {
// TODO: task
if (!newInputRef.value) {
// TODO:
uni.$ui.showToast('输入不能为空');
} else {
//
showEditModal.value = false;
showMask.value = false;
uBadgeShow.value = false;
newInputRef.value = '';
}
try {
const param = {
projectId:store.state.project.project.id,
taskId:props.task.id,
deliverName:newInputRef.value
}
await uni.$u.api.editDeliverName(param);
// uni.$ui.showToast('');
getDeliverData()
//
showEditModal.value = false;
showMask.value = false;
uBadgeShow.value = false;
newInputRef.value = '';
} catch (error) {
console.error('error: ', error);
uni.$ui.showToast('修改交付物名称失败');
}
}
//
@ -199,6 +242,8 @@ async function confirmDelete() {
console.error('error: ', error);
}
}
</script>
<style scoped lang="scss"></style>

2
rest/deliver.http

@ -1,6 +1,6 @@
@url=https://test.tall.wiki/gateway/defaultwbs
@type=content-type: application/json
@token=eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NDIzODg5NjMsInN1YiI6IjEyMTc2NDc2ODY1OTgxMzU4MDgiLCJhdXRoSWQiOiIxMTc3MTU4ODQ4ODg1MTY2MDgwIiwiZXhwIjoxNjQyNDc1MzYzfQ.3rZu2gphjGZC9bod_jGxt0RC-DOTPZScN6tdYJPlTxg
@token=eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NDI0MDU2ODcsInN1YiI6IjEyMTc2NDc2ODY1OTgxMzU4MDgiLCJhdXRoSWQiOiIxMTc3MTU4ODQ4ODg1MTY2MDgwIiwiZXhwIjoxNjQyNDkyMDg3fQ.GDHzvVN6kAF3mVanxYTxBBlZP1I08lCD4_zbazLX7AQ
### login
# @name login

3
store/deliver/actions.js

@ -0,0 +1,3 @@
const actions = {};
export default actions;

11
store/deliver/getters.js

@ -0,0 +1,11 @@
const getters = {
/**
* 当前项目的id
* @param {object} project
*/
projectId({ project }) {
return project.id;
},
};
export default getters;

12
store/deliver/index.js

@ -0,0 +1,12 @@
import actions from './actions';
import getters from './getters';
import mutations from './mutations';
import state from './state';
export default {
namespaced: true,
state,
getters,
mutations,
actions,
};

62
store/deliver/mutations.js

@ -0,0 +1,62 @@
const mutations = {
/**
* 设置state projects书籍
* @param {object} state
* @param {array} projects 项目列表
*/
// setProjects(state, projects) {
// if (!projects || !projects.length) {
// state.projects = [];
// } else {
// state.projects = [...projects];
// }
// },
/**
* 设置子项目收缩展开
* @param { object } state
* @param { object } options options:{ index,show }
*/
// setProjectItemShow(state, options) {
// if (options.show) {
// for (var i = 0; i < state.projects.length; i++) {
// if (i === options.index) {
// state.projects[i].show = true;
// } else {
// state.projects[i].show = false;
// }
// }
// } else {
// state.projects[options.index].show = false;
// }
// },
/**
* 设置当前项目信息
* @param { object } state
* @param { object } data
*/
// setProject(state, data) {
// state.project = data || { name: '加载中...' };
// },
/**
* 设置当前项目名称
* @param { object } state
* @param { string } data
*/
setProjectName(state, data) {
state.project.name = data;
},
/**
* 设置小红点
* @param { object } state
* @param { string } data
*/
// setDotList(state, data) {
// state.dotList = data;
// },
};
export default mutations;

6
store/deliver/state.js

@ -0,0 +1,6 @@
/* eslint-disable */
const state = {
deliverRecordId: '',
};
export default state;

3
store/index.js

@ -4,6 +4,7 @@ import role from './role/index.js';
import socket from './socket/index.js';
import task from './task/index.js';
import user from './user/index.js';
import deliver from './user/index.js';
// 不属于具体模块的 应用级的 store内容
const state = {
@ -54,5 +55,5 @@ export default createStore({
state,
getters,
mutations,
modules: { user, socket, project, role, task },
modules: { user, socket, project, role, task, deliver },
});

1
store/project/state.js

@ -3,6 +3,7 @@ const state = {
project: { name: '加载中...' }, // 当前项目信息
projects: [], // 项目列表
dotList: [], // 小红点
deliverRecordId: '',
};
export default state;

Loading…
Cancel
Save