From 385856fa1f985b9a6f6cea3fbb2db8fdf8f2089a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 16 Apr 2021 13:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=A3=80=E6=9F=A5=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client_mp/pages.json | 18 +++++ client_mp/pages/home/home.vue | 94 +++++++++++++--------- client_mp/pages/subtask/my.vue | 68 ++++++++++++++++ client_mp/pages/subtask/subtaskdetail.vue | 22 +++++ client_mp/uview-ui/libs/css/style.vue.scss | 1 + server/apps/quality/serializers.py | 4 +- 6 files changed, 166 insertions(+), 41 deletions(-) create mode 100644 client_mp/pages/subtask/my.vue create mode 100644 client_mp/pages/subtask/subtaskdetail.vue diff --git a/client_mp/pages.json b/client_mp/pages.json index e5c7e81..f1dda24 100644 --- a/client_mp/pages.json +++ b/client_mp/pages.json @@ -98,6 +98,24 @@ } } + ,{ + "path" : "pages/subtask/my", + "style" : + { + "navigationBarTitleText": "我的巡查任务", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/subtask/subtaskdetail", + "style" : + { + "navigationBarTitleText": "任务详情", + "enablePullDownRefresh": false + } + + } ], "subPackages": [{ "root": "pages/componentsC", diff --git a/client_mp/pages/home/home.vue b/client_mp/pages/home/home.vue index 274ae4a..5072e60 100644 --- a/client_mp/pages/home/home.vue +++ b/client_mp/pages/home/home.vue @@ -2,11 +2,20 @@ - - - + + + + + {{item.name}} + + + + + + + {{item.state}} @@ -54,23 +63,27 @@ indicatorPos: 'bottomCenter', effect3d: true, test: '', - myinspecttaskList:[], - list: [{ - groupName: '最近任务', - list: [{ - path: '/pages/example/js', - title: '员工台账', - }, - { - path: '/pages/example/components', - title: '放射源台账', - } - ] - }], - title: '素胚勾勒出青花,笔锋浓转淡', - subTitle: '2020-05-15', - thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', - headstyle:{"padding-top":"12rpx","padding-bottom":"12rpx"} + myinspecttaskList: [], + grids: [{ + name: '巡查任务', + icon: 'calendar', + path: '/pages/subtask/my' + }, + { + name: '能力共享', + icon: 'share', + path: '' + }, + { + name: '手册/资料', + icon: 'file-text', + path: '' + } + ], + headstyle: { + "padding-top": "12rpx", + "padding-bottom": "12rpx" + } } }, computed: { @@ -81,7 +94,7 @@ }, }, onLoad() { - + }, onShow() { this.getMyInspectTask(); @@ -93,9 +106,11 @@ }).catch(e => {}) }, getMyInspectTask() { - this.$u.api.getMyInspectTask({state:'执行中'}).then(res => { - this.myinspecttaskList = res.data - }).catch(e=>{}) + this.$u.api.getMyInspectTask({ + state: '执行中' + }).then(res => { + this.myinspecttaskList = res.data + }).catch(e => {}) }, openPage(path) { this.$u.route({ @@ -108,29 +123,32 @@ click() { }, - taskClick(index){ - console.log(index) + taskClick(index) { + uni.navigateTo({ + url:"/pages/subtask/subtaskdetail?id="+index + }) + }, + clickGrid(val){ + uni.navigateTo({ + url:val.path + }) } } } - + diff --git a/client_mp/pages/subtask/my.vue b/client_mp/pages/subtask/my.vue new file mode 100644 index 0000000..9f5b6fd --- /dev/null +++ b/client_mp/pages/subtask/my.vue @@ -0,0 +1,68 @@ + + + + + + diff --git a/client_mp/pages/subtask/subtaskdetail.vue b/client_mp/pages/subtask/subtaskdetail.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/client_mp/pages/subtask/subtaskdetail.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/client_mp/uview-ui/libs/css/style.vue.scss b/client_mp/uview-ui/libs/css/style.vue.scss index 1ab3707..0821c94 100644 --- a/client_mp/uview-ui/libs/css/style.vue.scss +++ b/client_mp/uview-ui/libs/css/style.vue.scss @@ -1,5 +1,6 @@ page { color: $u-main-color; + background-color: #ededed; font-size: 28rpx; } diff --git a/server/apps/quality/serializers.py b/server/apps/quality/serializers.py index 99351b0..d032421 100644 --- a/server/apps/quality/serializers.py +++ b/server/apps/quality/serializers.py @@ -97,11 +97,9 @@ class InspectRecordCheckSerializer(serializers.ModelSerializer): fields = ['id', 'result', 'note', 'imgs'] def validate_result(self, result): - if not self.obj.checker in [None, self.request.user]: - raise serializers.ValidationError('您无权操作') if result: if result == '发现': - if not (self.note or self.imgs): + if not (self.data.note or self.data.imgs): raise serializers.ValidationError('发现问题请填写说明或上传图片') else: raise serializers.ValidationError('未填写检查结果')