From 938ebf1e281c19b94c3dcb3710322f1a2b3a875f Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Tue, 25 Jan 2022 09:56:14 +0800 Subject: [PATCH 01/14] denglijiekou --- hb_client/src/router/index.js | 8 ++--- hb_client/src/views/dashboard/index.vue | 4 +-- .../em/{detection.vue => monitoring.vue} | 36 ++++++++----------- hb_client/src/views/qm/processtest.vue | 27 +++++++------- hb_client/src/views/qm/product.vue | 9 +---- hb_client/src/views/qm/producttest.vue | 7 +--- hb_client/src/views/qm/unproduct.vue | 7 +--- hb_client/src/views/wpm/operationdo.vue | 32 +++++++++-------- 8 files changed, 53 insertions(+), 77 deletions(-) rename hb_client/src/views/em/{detection.vue => monitoring.vue} (95%) diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 61be661..7d95558 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -263,10 +263,10 @@ export const asyncRoutes = [ meta: { title: '生产设备', icon: 'example', perms: ['em_equipment'] } }, { - path: 'detection ', - name: 'detection ', - component: () => import('@/views/em/detection'), - meta: { title: '监视和测量设备', icon: 'example', perms: ['em_detection'] } + path: 'monitoring ', + name: 'monitoring ', + component: () => import('@/views/em/monitoring'), + meta: { title: '监视和测量设备', icon: 'example', perms: ['em_monitoring'] } }, { path: 'record', diff --git a/hb_client/src/views/dashboard/index.vue b/hb_client/src/views/dashboard/index.vue index 1fbc573..b50b02a 100644 --- a/hb_client/src/views/dashboard/index.vue +++ b/hb_client/src/views/dashboard/index.vue @@ -820,9 +820,7 @@ this.getStatisticsData(); this.getNoticeData(); }, - updated() { - this.drawChart() - } + } diff --git a/hb_client/src/views/em/detection.vue b/hb_client/src/views/em/monitoring.vue similarity index 95% rename from hb_client/src/views/em/detection.vue rename to hb_client/src/views/em/monitoring.vue index c45bf3c..7ea762e 100644 --- a/hb_client/src/views/em/detection.vue +++ b/hb_client/src/views/em/monitoring.vue @@ -7,7 +7,7 @@ > - + @@ -70,7 +70,7 @@ - + @@ -89,7 +89,7 @@ scope.row.keeper_.username }} - + @@ -199,9 +199,9 @@ > @@ -226,9 +226,9 @@ > @@ -307,8 +307,7 @@ - + diff --git a/hb_client/src/views/pm/plan.vue b/hb_client/src/views/pm/plan.vue index 5f411f2..3b75c6c 100644 --- a/hb_client/src/views/pm/plan.vue +++ b/hb_client/src/views/pm/plan.vue @@ -64,7 +64,7 @@ - + diff --git a/hb_client/src/views/pm/resources.vue b/hb_client/src/views/pm/resources.vue index f6b28df..d9728b6 100644 --- a/hb_client/src/views/pm/resources.vue +++ b/hb_client/src/views/pm/resources.vue @@ -110,10 +110,15 @@ - - + + + + + - @@ -143,6 +148,31 @@ + + @@ -200,12 +230,12 @@ export default { "6":'辅助工具', }, - state_:{ - 0:'完好', - 1:'限用', - 2:'在修', - 3:'禁用', - }, + state_: { + 10: '完好', + 20: '限用', + 30: '在修', + 40: '禁用', + }, listQuery: { page: 1, page_size: 20, diff --git a/hb_client/src/views/qm/product.vue b/hb_client/src/views/qm/product.vue index 9468158..367c35a 100644 --- a/hb_client/src/views/qm/product.vue +++ b/hb_client/src/views/qm/product.vue @@ -2,9 +2,56 @@
- + + 申请 + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + 合格 + 军检 - + + + + + - + @@ -96,7 +190,7 @@ diff --git a/hb_client/src/views/personnel/userupdate.vue b/hb_client/src/views/personnel/userupdate.vue new file mode 100644 index 0000000..bba0d14 --- /dev/null +++ b/hb_client/src/views/personnel/userupdate.vue @@ -0,0 +1,283 @@ + + + \ No newline at end of file diff --git a/hb_client/src/views/system/user.vue b/hb_client/src/views/system/user.vue index af18416..84d08fa 100644 --- a/hb_client/src/views/system/user.vue +++ b/hb_client/src/views/system/user.vue @@ -130,7 +130,7 @@ - + @@ -320,7 +320,13 @@ export default { }); }, handleEdit(scope) { - this.$router.push({name:"userupdate",params:{id:scope.row.employee_user}}) + this.user = Object.assign({}, scope.row); // copy obj + + this.dialogType = "update"; + this.dialogVisible = true; + this.$nextTick(() => { + this.$refs["Form"].clearValidate(); + }); }, handleDelete(scope) { this.$confirm("确认删除?", "警告", { @@ -343,7 +349,7 @@ export default { async confirm(form) { this.$refs[form].validate(valid => { if (valid) { - const isEdit = this.dialogType === "edit"; + const isEdit = this.dialogType === "update"; if (isEdit) { updateUser(this.user.id, this.user).then(res => { this.getList(); From 81de7a534973976c5750ca2591ee59d9172116d0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 27 Jan 2022 10:57:14 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=B4=A6=E6=88=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/system/serializers.py | 8 ++++---- hb_server/apps/system/views.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hb_server/apps/system/serializers.py b/hb_server/apps/system/serializers.py index 209061c..d59d538 100644 --- a/hb_server/apps/system/serializers.py +++ b/hb_server/apps/system/serializers.py @@ -137,14 +137,14 @@ class UserListSerializer(DynamicFieldsSerializerMixin, serializers.ModelSerializ """ 用户列表序列化 """ - dept_name = serializers.StringRelatedField(source='dept') - roles_name = serializers.StringRelatedField(source='roles', many=True) + dept_ = OrganizationSimpleSerializer(source='dept', read_only=True) + roles_ = RoleSerializer(source='roles', many=True) class Meta: model = User fields = ['id', 'name', 'phone', 'email', 'position', 'username', 'is_active', 'date_joined', - 'dept_name', 'dept', 'roles', 'avatar', - 'roles_name', 'is_atwork', 'last_check_time'] + 'dept_', 'dept', 'roles', 'avatar', + 'roles_', 'is_atwork', 'last_check_time'] @staticmethod def setup_eager_loading(queryset): diff --git a/hb_server/apps/system/views.py b/hb_server/apps/system/views.py index 9ef7c28..3664054 100644 --- a/hb_server/apps/system/views.py +++ b/hb_server/apps/system/views.py @@ -261,7 +261,7 @@ class UserViewSet(ModelViewSet): # 根据请求类型动态变更serializer if self.action == 'create': return UserCreateSerializer - elif self.action == 'list': + elif self.action in ['list', 'retrieve']: return UserListSerializer return UserModifySerializer