Browse Source

feat: 时间轴时间、交付物新原型

tall1
xuesinan 4 years ago
parent
commit
c57f9863b8
  1. 1
      CHANGELOG.md
  2. 13
      src/components/Plugin/Plugin.vue
  3. 2
      src/components/TimeLine/component/TimeBox.vue
  4. 6
      src/config/time.js
  5. 2
      src/plugins/p-deliver-check/p-deliver-check.vue
  6. 120
      src/plugins/p-deliver-check/p-deliver-check1.vue
  7. 2
      src/plugins/p-delivery-history/p-delivery-history.vue
  8. 12
      src/plugins/p-delivery-history/p-delivery-history1.vue
  9. 35
      src/plugins/p-upload-deliverable/p-upload-deliverable1.vue
  10. 2
      src/store/task/getters.js

1
CHANGELOG.md

@ -48,6 +48,7 @@
- | 项目创建分享链接 | eb2c4ba
- | 项目列表, 项目url | 32e005b
- | 项目api url设置 | 6cd5245
- | 新建任务 | ab24b33
- | 新建任务 | 131ce0f
- | 新建任务 | 9ab680e
- | 新建任务 | 59897c2

13
src/components/Plugin/Plugin.vue

@ -42,7 +42,8 @@
</template>
<script>
import { mapGetters, mapState, mapActions } from 'vuex';
import { mapGetters, mapState } from 'vuex';
// import { mapGetters, mapState, mapActions } from 'vuex';
export default {
name: 'Plugin',
@ -74,15 +75,15 @@ export default {
},
async created() {
if (this.pluginId === '5') {
// id
await this.getAllMembers({ projectId: this.projectId });
}
// if (this.pluginId === '5') {
// // id
// await this.getAllMembers({ projectId: this.projectId });
// }
await this.getPlugin();
},
methods: {
...mapActions('role', ['getAllMembers']),
// ...mapActions('role', ['getAllMembers']),
//
async getPlugin() {
const { pluginId, styleType } = this;

2
src/components/TimeLine/component/TimeBox.vue

@ -7,7 +7,7 @@
<TimeStatus :task="task" />
<view class="flex items-center justify-between flex-1 ml-2 task-column">
<view v-if="task.process !== 4">{{ $moment(+task.planStart).format(startTimeFormat) }}</view>
<view v-else>{{ $moment(+task.planStart).format('D日') }}</view>
<view v-else>{{ $moment(+task.planStart).format('M月D日') }}</view>
<!-- 任务功能菜单 -->
<TaskTools v-if="task.process !== 4" :task="task" />

6
src/config/time.js

@ -5,9 +5,9 @@ export default {
{ id: 1, value: '秒', format: 'x', cycle: 'YY-M-D HH:mm:ss', granularity: 'second' },
{ id: 2, value: '分', format: 'ss', cycle: 'YY-M-D HH:mm', granularity: 'minute' },
{ id: 3, value: '时', format: 'mm', cycle: 'YY-M-D HH时', granularity: 'hour' },
{ id: 4, value: '天', format: 'D日 HH:mm', cycle: 'YY-M-D', granularity: 'day' },
{ id: 5, value: '周', format: 'D日 HH:mm', cycle: '', granularity: 'week' },
{ id: 6, value: '月', format: 'D日 H:m', cycle: 'YYYY年', granularity: 'month' },
{ id: 4, value: '天', format: 'M月D日 HH:mm', cycle: 'YY-M-D', granularity: 'day' },
{ id: 5, value: '周', format: 'M月D日 HH:mm', cycle: '', granularity: 'week' },
{ id: 6, value: '月', format: 'M月D日 H:m', cycle: 'YYYY年', granularity: 'month' },
{ id: 7, value: '季度', format: '', cycle: 'YYYY年', granularity: 'quarter' },
{ id: 8, value: '年', format: 'YYYY', cycle: '', granularity: 'year' },
{ id: 9, value: '年代', format: '', cycle: '', granularity: '' },

2
src/plugins/p-deliver-check/p-deliver-check.vue

@ -1,5 +1,5 @@
<template>
<!-- 上传交付物 -->
<!-- 交付物审核 -->
<view class="px-3 py-6 bg-white">
<u-input :auto-height="autoHeight" :border="border" :height="height" :type="type" placeholder="输入备注" v-model="remark" />
<view class="flex flex-row-reverse text-xs text-gray-400 mt-2">{{ wordNum }}/140</view>

120
src/plugins/p-deliver-check/p-deliver-check1.vue

@ -0,0 +1,120 @@
<template>
<!-- 交付物审核 -->
<view class="examine-popup pt-6 bg-white">
<view class="text-center pb-6 font-semibold text-lg text-black">{{ auditStatus === 1 ? '审核通过' : '审核驳回' }}</view>
<view class="px-6">
<u-input :auto-height="autoHeight" :border="border" :height="height" :type="type" placeholder="输入备注" v-model="remark" />
<view class="flex flex-row-reverse text-xs text-gray-400 mt-2">{{ wordNum }}/140</view>
<!-- 评分 -->
<view class="flex justify-between mt-3" v-if="auditStatus === 1">
<u-input :border="border" :type="type1" @input="changeNumber" maxlength="100" placeholder="输入分数" v-model="score" />
<slider :value="score" @change="sliderChange" max="100" min="0" show-value style="width: 50%" />
</view>
</view>
<view class="examine-btn flex justify-center mt-5">
<u-button @click="submit">提交</u-button>
<u-button @click="$emit('closeScore')">取消</u-button>
</view>
</view>
</template>
<script>
export default {
name: 'p-deliver-check',
props: {
auditStatus: {
type: Number,
default: 1,
},
},
data() {
return {
remark: '',
type: 'textarea',
border: true,
height: 100,
autoHeight: true,
wordNum: 0,
score: 0,
type1: 'number',
};
},
watch: {
remark(val) {
this.wordNum = val.length;
},
score(val) {
this.score1 = val;
},
},
methods: {
//
submit() {
this.$emit('submit', this.remark, this.score);
},
sliderChange(e) {
this.score = e.detail.value;
},
changeNumber(e) {
if (e > 100) {
this.score = 100;
}
},
},
};
</script>
<style lang="scss" scoped>
.examine-popup {
width: 85vw;
border-radius: 8px;
overflow: hidden;
.examine-btn {
border-top: 1px solid rgba(0, 0, 0, 0.1);
uni-button {
width: 50%;
height: 55px;
border-radius: 0;
border: none;
}
uni-button:after {
border: none;
width: 200%;
height: 200%;
}
uni-button:first-child {
border-right: 1px solid rgba(0, 0, 0, 0.1);
}
}
uni-slider {
margin-right: 0;
}
uni-slider ::v-deep .uni-slider-handle,
uni-slider ::v-deep .uni-slider-thumb {
width: 10px !important;
height: 10px !important;
margin-top: -5px !important;
margin-left: -5px !important;
}
uni-slider ::v-deep .uni-slider-thumb {
box-shadow: 0 0 2px rgba(0, 0, 0, 1);
}
}
</style>

2
src/plugins/p-delivery-history/p-delivery-history.vue

@ -46,7 +46,7 @@
<script>
import { mapGetters } from 'vuex';
import UniPopup from '../../components/uni-popup/uni-popup.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check1.vue';
export default {
name: 'p-delivery-history',

12
src/plugins/p-delivery-history/p-delivery-history1.vue

@ -39,8 +39,8 @@
<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 :maskClick="false" background-color="#fff" ref="popup" type="center">
<PDeliverCheck :auditStatus="auditStatus" @closeScore="closeScore" @submit="submit"></PDeliverCheck>
</uni-popup>
</view>
</template>
@ -48,7 +48,7 @@
<script>
import { mapGetters } from 'vuex';
import UniPopup from '../../components/uni-popup/uni-popup.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue';
import PDeliverCheck from '../p-deliver-check/p-deliver-check1.vue';
export default {
name: 'p-delivery-history',
@ -60,6 +60,7 @@ export default {
show: false,
options: null,
loading: true, //
auditStatus: 1, // 1 2
};
},
@ -84,12 +85,13 @@ export default {
showScore(checkId, status) {
// refuni-popup , type ['top','left','bottom','right','center']
this.$refs.popup.open('bottom');
this.$refs.popup.open();
this.options = { checkId, status };
this.auditStatus = status;
},
closeScore() {
this.$refs.popup.close('bottom');
this.$refs.popup.close();
},
async submit(remark, score) {

35
src/plugins/p-upload-deliverable/p-upload-deliverable1.vue

@ -76,12 +76,12 @@
<!-- <ChooseChecker ref="checker" :checkerList="checkerList" @setCheckerList="setCheckerList"></ChooseChecker> -->
<view class="submit-delivery">
<u-button @click="submit" size="mini" type="primary" v-if="currStatus === 0">提交</u-button>
<template v-if="currStatus === 1">
<text class="mr-2">待审核</text>
<!-- <u-icon @click="changeShowHistory" name="arrow-right" v-if="!showHistory"></u-icon>
<u-button @click="submit" size="mini" type="primary" v-if="currStatus === -1">提交</u-button>
<text class="mr-2" v-if="currStatus === 0">待审核</text>
<text class="mr-2" v-if="currStatus === 1">已通过</text>
<text class="mr-2 text-red-500" v-if="currStatus === 2">已驳回</text>
<!-- <u-icon @click="changeShowHistory" name="arrow-right" v-if="!showHistory"></u-icon>
<u-icon @click="changeShowHistory" name="arrow-down" v-else></u-icon> -->
</template>
</view>
<!-- <view class="mt-2 flex justify-between">
@ -113,7 +113,7 @@ export default {
list: [],
examinePerpol: '请选择审核人',
isShowMembers: false, //
currStatus: 0, //
currStatus: -1, //
history: [],
};
},
@ -184,7 +184,7 @@ export default {
const params = { content, checkerList, projectId, taskSubId: task.id };
await this.$u.api.saveDeliver(params);
this.$t.ui.showToast('交付物提交成功');
this.currStatus = 1;
this.currStatus = 0;
this.isShowMembers = false;
// this.content = '';
// this.checkerList = [];
@ -202,10 +202,27 @@ export default {
const data = await this.$u.api.queryDeliverOfTask(params);
console.log('1111111', data);
if (data.length > 0) {
let flag = -1;
data.forEach(item => {
item.checkerList.forEach(v => {
if (v.status === 0) {
this.currStatus = 1;
if (flag === 2) {
this.currStatus = 2; //
}
if (flag < 2 && v.status === 0) {
this.currStatus = 0; //
flag = 0;
}
if (flag === 1 && v.status === 1) {
this.currStatus = 1; //
flag = 1;
}
if (v.status === 2) {
this.currStatus = 2; //
flag = 2;
}
});
});

2
src/store/task/getters.js

@ -11,7 +11,7 @@ const getters = {
// 计算任务开始时间的格式
startTimeFormat(state, { unitConfig }) {
return unitConfig.format || 'D日 HH:mm';
return unitConfig.format || 'M月D日 HH:mm';
},
// 计算颗粒度 对应的 dayjs add 的单位

Loading…
Cancel
Save