From 008b284a6b602d2ea80c70a38aa9819bbc261fcb Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 27 Apr 2021 09:06:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client_mp/common/http.api.js | 3 +++ client_mp/pages/inspectrecord/index.vue | 32 +++++++++++++++++++---- client_mp/pages/login/login.vue | 2 +- client_mp/pages/subtask/subtaskdetail.vue | 2 +- server/apps/quality/serializers.py | 2 +- server/apps/quality/views.py | 1 + 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/client_mp/common/http.api.js b/client_mp/common/http.api.js index 9a52683..437c7b9 100644 --- a/client_mp/common/http.api.js +++ b/client_mp/common/http.api.js @@ -34,6 +34,8 @@ const install = (Vue, vm) => { let checkInspectRecord = (id, params)=> vm.$u.put(`/quality/inspectrecord/${id}/check/`, params); + let startInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/start/`, params);//开始检查 + let upInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/up/`, params);//提交记录 let appointChecker = (params) => vm.$u.post('/quality/inspectrecord/appoint/', params);//检查指派 @@ -50,6 +52,7 @@ const install = (Vue, vm) => { checkInspectRecord, upInspectDept, appointChecker, + startInspectDept }; } diff --git a/client_mp/pages/inspectrecord/index.vue b/client_mp/pages/inspectrecord/index.vue index 4ec49a0..193fe3f 100644 --- a/client_mp/pages/inspectrecord/index.vue +++ b/client_mp/pages/inspectrecord/index.vue @@ -6,10 +6,15 @@ {{initData.state}} + + 开始检查日期: {{initData.start_date}} + 只看我的 + 开始检查 提交结果 查看报告 @@ -48,7 +53,7 @@ v-if="initData.leader==vuex_user.id && mutiSelect">指派给 - + @@ -66,13 +71,13 @@ {{item.result}} - 检查 + 检查 详情 - + @@ -285,7 +290,7 @@ var that = this let checker = that.members[index].member uni.showModal({ - title: '提交', + title: '', content: '确认将' + that.selects.length + '个检查指派给' + that.members[index].member__name + '吗?', success: function(res) { if (res.confirm) { @@ -305,7 +310,7 @@ upReport() { let that = this uni.showModal({ - title: '提交', + title: '', content: '确认提交吗?', success: function(res) { if (res.confirm) { @@ -315,6 +320,23 @@ }).catch(e => {}) } else if (res.cancel) { + } + } + }); + }, + startCheck(){ + let that = this + uni.showModal({ + title: '', + content: '确认开始检查吗?', + success: function(res) { + if (res.confirm) { + that.$u.api.startInspectDept(that.initData.id).then(res => { + that.initData = res.data + that.$u.toast('成功') + }).catch(e => {}) + } else if (res.cancel) { + } } }); diff --git a/client_mp/pages/login/login.vue b/client_mp/pages/login/login.vue index 45b7cb8..63792c9 100644 --- a/client_mp/pages/login/login.vue +++ b/client_mp/pages/login/login.vue @@ -15,7 +15,7 @@ - + 登录 diff --git a/client_mp/pages/subtask/subtaskdetail.vue b/client_mp/pages/subtask/subtaskdetail.vue index c838a67..e22e13b 100644 --- a/client_mp/pages/subtask/subtaskdetail.vue +++ b/client_mp/pages/subtask/subtaskdetail.vue @@ -23,7 +23,7 @@ {{subtask.members.length}} - + diff --git a/server/apps/quality/serializers.py b/server/apps/quality/serializers.py index 9416ab8..038f23a 100644 --- a/server/apps/quality/serializers.py +++ b/server/apps/quality/serializers.py @@ -99,7 +99,7 @@ class InspectDeptSerializer(serializers.ModelSerializer): leader = serializers.SerializerMethodField() class Meta: model = InspectDept - fields = ('dept', 'dept__name', 'state', 'subtask', 'id', 'note', 'leader') + fields = ('dept', 'dept__name', 'state', 'subtask', 'id', 'note', 'leader', 'start_date') @staticmethod def setup_eager_loading(queryset): diff --git a/server/apps/quality/views.py b/server/apps/quality/views.py index 8101edf..feee128 100644 --- a/server/apps/quality/views.py +++ b/server/apps/quality/views.py @@ -263,4 +263,5 @@ class InspectRecordViewSet(PageOrNot, ModelViewSet): serializer = InspectRecordCheckSerializer(instance, data=request.data) serializer.is_valid(raise_exception=True) serializer.save(checker=request.user, checked=True, check_time=timezone.now()) + return Response(status=status.HTTP_200_OK) return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST) \ No newline at end of file