From 42cbd43117d3d298b434e0fda04b3a3131c5e81f Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 15 Feb 2022 11:12:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=89=A9=E6=96=99=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=8C=89=E7=89=A9=E6=96=99=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E5=8F=B7=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/hrm/views.py | 18 ++++++++++++++++++ hb_server/apps/pm/views.py | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/hrm/views.py b/hb_server/apps/hrm/views.py index ed733da..e22ec6b 100644 --- a/hb_server/apps/hrm/views.py +++ b/hb_server/apps/hrm/views.py @@ -126,6 +126,24 @@ class FaceLogin(CreateAPIView): if user: refresh = RefreshToken.for_user(user) # 可设为在岗 + now = timezone.now() + now_local = timezone.localtime() + if 8<=now_local.hour<=17: + ins, created = ClockRecord.objects.get_or_create( + create_by = user, create_time__hour__range = [8,18], + create_time__year=now_local.year, create_time__month=now_local.month, + create_time__day=now_local.day, + defaults={ + 'type':ClockRecord.ClOCK_WORK1, + 'create_by':user, + 'create_time':now + }) + # 设为在岗 + if created: + user.is_atwork = True + user.last_check_time = now + user.save() + return Response({ 'refresh': str(refresh), 'access': str(refresh.access_token), diff --git a/hb_server/apps/pm/views.py b/hb_server/apps/pm/views.py index 28e9c3d..62a7bbb 100644 --- a/hb_server/apps/pm/views.py +++ b/hb_server/apps/pm/views.py @@ -232,7 +232,8 @@ class ResourceViewSet(GenericViewSet): # 计算输入物料 materials = SubprodctionMaterial.objects.filter(subproduction__product__id=i['id'], subproduction__is_deleted=False, is_deleted=False, - type= SubprodctionMaterial.SUB_MA_TYPE_IN).order_by('material__number')\ + type= SubprodctionMaterial.SUB_MA_TYPE_IN).order_by( + 'material__type', 'material__number')\ .values('material__id', 'material__name', 'material__number', 'material__type', 'count', 'material__count', 'material__count_safe') From 74a7f87e9f474bf3ea665e34dcc8826df30fb0c7 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Tue, 15 Feb 2022 13:43:09 +0800 Subject: [PATCH 2/2] zuoyezhidaoshu --- hb_client/src/api/pm.js | 8 ++++ hb_client/src/views/pm/resources.vue | 53 +++++++++++++++++++++++-- hb_client/src/views/qm/unproduct.vue | 3 +- hb_client/src/views/wpm/operationdo.vue | 4 +- 4 files changed, 61 insertions(+), 7 deletions(-) diff --git a/hb_client/src/api/pm.js b/hb_client/src/api/pm.js index 2e25b30..3be5316 100644 --- a/hb_client/src/api/pm.js +++ b/hb_client/src/api/pm.js @@ -97,3 +97,11 @@ export function getprogressList(query) { params: query }) } +//半成品折合 +export function createConvert(data) { + return request({ + url: '/pm/resource/convert/', + method: 'post', + data + }) +} diff --git a/hb_client/src/views/pm/resources.vue b/hb_client/src/views/pm/resources.vue index d9728b6..2ef71c1 100644 --- a/hb_client/src/views/pm/resources.vue +++ b/hb_client/src/views/pm/resources.vue @@ -85,7 +85,7 @@
物料配置 - + 半成品折合
+ + @@ -107,8 +112,16 @@ - - + + diff --git a/hb_client/src/views/wpm/operationdo.vue b/hb_client/src/views/wpm/operationdo.vue index 9ef926c..4831ef4 100644 --- a/hb_client/src/views/wpm/operationdo.vue +++ b/hb_client/src/views/wpm/operationdo.vue @@ -63,7 +63,7 @@ :visible.sync="drawer" direction="rtl" size="70%"> - +