From 371c3996a462ddcb9d220667e152364dc6eca68e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 17 Mar 2022 11:57:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=91=E7=AE=A1?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=8F=B7=E4=BB=A5=E5=8F=8A=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=88=B0=E5=B2=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/hrm/filters.py | 2 +- .../migrations/0009_employee_show_atwork.py | 18 ++++++++++++++++++ hb_server/apps/hrm/models.py | 2 ++ .../sam/migrations/0017_contract_watch_num.py | 18 ++++++++++++++++++ hb_server/apps/sam/models.py | 2 +- hb_server/apps/sam/serializers.py | 4 ++-- 6 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 hb_server/apps/hrm/migrations/0009_employee_show_atwork.py create mode 100644 hb_server/apps/sam/migrations/0017_contract_watch_num.py diff --git a/hb_server/apps/hrm/filters.py b/hb_server/apps/hrm/filters.py index 0fd0be5..185a846 100644 --- a/hb_server/apps/hrm/filters.py +++ b/hb_server/apps/hrm/filters.py @@ -21,7 +21,7 @@ class EmployeeFilterSet(DynamicFieldsFilterMixin, filters.FilterSet): class Meta: model = Employee - fields = ['job_state'] + fields = ['job_state', 'show_atwork'] class NotWorkRemarkFilterSet(filters.FilterSet): diff --git a/hb_server/apps/hrm/migrations/0009_employee_show_atwork.py b/hb_server/apps/hrm/migrations/0009_employee_show_atwork.py new file mode 100644 index 0000000..83650ec --- /dev/null +++ b/hb_server/apps/hrm/migrations/0009_employee_show_atwork.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.9 on 2022-03-17 03:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hrm', '0008_auto_20220222_1112'), + ] + + operations = [ + migrations.AddField( + model_name='employee', + name='show_atwork', + field=models.BooleanField(default=True, verbose_name='是否展示在岗状态'), + ), + ] diff --git a/hb_server/apps/hrm/models.py b/hb_server/apps/hrm/models.py index 091c2b1..b9482fe 100644 --- a/hb_server/apps/hrm/models.py +++ b/hb_server/apps/hrm/models.py @@ -31,8 +31,10 @@ class Employee(CommonAModel): job_state = models.IntegerField('在职状态', choices=jobstate_choices, default=1) face_data = models.JSONField('人脸识别数据', null=True, blank=True) is_atwork = models.BooleanField('当前在岗', default=False) + show_atwork = models.BooleanField('是否展示在岗状态', default=True) last_check_time = models.DateTimeField('打卡时间', null=True, blank=True) not_work_remark = models.CharField('当前未打卡说明', null=True, blank=True, max_length=200) + class Meta: verbose_name = '员工补充信息' verbose_name_plural = verbose_name diff --git a/hb_server/apps/sam/migrations/0017_contract_watch_num.py b/hb_server/apps/sam/migrations/0017_contract_watch_num.py new file mode 100644 index 0000000..906b4fe --- /dev/null +++ b/hb_server/apps/sam/migrations/0017_contract_watch_num.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.9 on 2022-03-17 03:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sam', '0016_sale_iproducts'), + ] + + operations = [ + migrations.AddField( + model_name='contract', + name='watch_num', + field=models.CharField(blank=True, max_length=100, null=True, verbose_name='监管协议号'), + ), + ] diff --git a/hb_server/apps/sam/models.py b/hb_server/apps/sam/models.py index 12ef0a8..26581aa 100644 --- a/hb_server/apps/sam/models.py +++ b/hb_server/apps/sam/models.py @@ -39,7 +39,7 @@ class Contract(CommonAModel): customer = models.ForeignKey(Customer, verbose_name='关联客户', on_delete=models.CASCADE, related_name='contact_customer') sign_date = models.DateField('签订日期') description = models.CharField('描述', max_length=200, blank=True, null=True) - + watch_num = models.CharField('监管协议号', max_length=100, null=True, blank=True) class Meta: verbose_name = '合同信息' verbose_name_plural = verbose_name diff --git a/hb_server/apps/sam/serializers.py b/hb_server/apps/sam/serializers.py index 8b3df60..31d2ab0 100644 --- a/hb_server/apps/sam/serializers.py +++ b/hb_server/apps/sam/serializers.py @@ -32,12 +32,12 @@ class ContractSerializer(serializers.ModelSerializer): class ContractSimpleSerializer(serializers.ModelSerializer): class Meta: model = Contract - fields = ['id', 'name', 'number'] + fields = ['id', 'name', 'number', 'watch_num'] class ContractCreateUpdateSerializer(serializers.ModelSerializer): class Meta: model = Contract - fields = ['name', 'number', 'amount', 'customer', 'sign_date', 'description', 'invoice'] + fields = ['name', 'number', 'amount', 'customer', 'sign_date', 'description', 'invoice', 'watch_num'] class OrderCreateUpdateSerializer(serializers.ModelSerializer): From 0aa096af8c8deab10092e99003671d429a52ef09 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 17 Mar 2022 12:00:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=88=B0=E5=B2=97=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8A=A0=E5=85=A5show=5Fatwork=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/srm/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/srm/views.py b/hb_server/apps/srm/views.py index 631380b..f84f5e9 100644 --- a/hb_server/apps/srm/views.py +++ b/hb_server/apps/srm/views.py @@ -147,7 +147,8 @@ class AtWorkCountView(CreateAPIView): ) ret = ClockRecord.objects.filter( update_time__year = vdata['year'], - update_time__month = vdata['month'] + update_time__month = vdata['month'], + create_by__show_atwork = True ).values( user_id = F('create_by'), number = F('create_by__employee_user__number'), From 4267885e710b75de5df01b1976f643c10df05e45 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Thu, 17 Mar 2022 13:05:15 +0800 Subject: [PATCH 3/6] xigai --- hb_client/.env.production | 2 +- hb_client/src/api/hrm.js | 4 +- hb_client/src/views/bigScreen/index.vue | 4 +- hb_client/src/views/inm/product.vue | 11 + hb_client/src/views/personnel/userupdate.vue | 511 ++++++++++--------- hb_client/src/views/sam/contract.vue | 5 + hb_client/src/views/wpm/productjy.vue | 12 +- 7 files changed, 298 insertions(+), 251 deletions(-) diff --git a/hb_client/.env.production b/hb_client/.env.production index a6efc10..87cb653 100644 --- a/hb_client/.env.production +++ b/hb_client/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # base api -VUE_APP_BASE_API = 'http://49.232.14.174:2222/api' +VUE_APP_BASE_API = 'http://hberp.com/api' #VUE_APP_BASE_API = 'http://127.0.0.1:8000/api' diff --git a/hb_client/src/api/hrm.js b/hb_client/src/api/hrm.js index 3aef7e2..6aca137 100644 --- a/hb_client/src/api/hrm.js +++ b/hb_client/src/api/hrm.js @@ -22,11 +22,11 @@ export function notWork(id, data) { }) } -export function getEmployee(data) { +export function getEmployee(query) { return request({ url: '/hrm/employee/', method: 'get', - data + params: query }) } diff --git a/hb_client/src/views/bigScreen/index.vue b/hb_client/src/views/bigScreen/index.vue index ee5698a..b9b7fbb 100644 --- a/hb_client/src/views/bigScreen/index.vue +++ b/hb_client/src/views/bigScreen/index.vue @@ -422,9 +422,9 @@ getUserList() { let that = this; that.listUser = false; - getEmployee({page: 0,type:'big_screen'}).then((response) => { + getEmployee({page: 0,type:'big_screen',show_atwork:true}).then((response) => { if (response.data) { - let list = response.data.results; + let list = response.data; let data = []; list.forEach(item => { let obj = []; diff --git a/hb_client/src/views/inm/product.vue b/hb_client/src/views/inm/product.vue index 871eaec..9c83387 100644 --- a/hb_client/src/views/inm/product.vue +++ b/hb_client/src/views/inm/product.vue @@ -48,6 +48,14 @@ + + + -