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/router/index.js b/hb_client/src/router/index.js
index 1b9cb25..5012c77 100644
--- a/hb_client/src/router/index.js
+++ b/hb_client/src/router/index.js
@@ -213,7 +213,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/wpm/worktask',
name: 'wpm',
- meta: { title: '生产执行', icon: 'execute', perms: ['equipment_set'] },
+ meta: { title: '生产执行', icon: 'execute', perms: ['wpm_manage'] },
children: [
{
path: 'worktask',
@@ -231,20 +231,20 @@ export const asyncRoutes = [
path: 'operationdo/:id',
name: 'operationdo',
component: () => import('@/views/wpm/operationdo'),
- meta: { title: '车间操作跳转界面', icon: 'home', perms: ['index_manage'] },
+ meta: { title: '车间操作执行', icon: 'home'},
hidden: true
},
{
path: 'need',
name: 'need',
component: () => import('@/views/wpm/need'),
- meta: { title: '过程检验', icon: 'processTest', perms: ['wpm_need'] }
+ meta: { title: '过程检验', icon: 'processTest', perms: ['wpm_test'] }
},
{
path: 'productjy',
name: 'productjy',
component: () => import('@/views/wpm/productjy'),
- meta: { title: '成品检验', icon: 'finishedCheck', perms: ['wpm_productjy'] }
+ meta: { title: '成品检验', icon: 'finishedCheck', perms: ['wpm_test'] }
},
{
path: 'firstCheck',
@@ -746,33 +746,33 @@ export const asyncRoutes = [
}
]
},
- {
- path: '/testModel',
- component: Layout,
- redirect: '/testModel/faceLogin/',
- name: 'testModel',
- meta: { title: '测试模块', icon: 'home' },
- children: [
- {
- path: 'faceLogin',
- name: 'faceLogin',
- component: () => import('@/views/testModel/faceLogin'),
- meta: { title: '人脸识别登录', icon: 'home' }
- },
- {
- path: 'caram',
- name: 'caram',
- component: () => import('@/views/testModel/caram'),
- meta: { title: '相机调用', icon: 'home' }
- },
- {
- path: 'markImage',
- name: 'markImage',
- component: () => import('@/views/testModel/markImage'),
- meta: { title: '图片标记', icon: 'home' }
- }
- ]
- },
+ // {
+ // path: '/testModel',
+ // component: Layout,
+ // redirect: '/testModel/faceLogin/',
+ // name: 'testModel',
+ // meta: { title: '测试模块', icon: 'home' },
+ // children: [
+ // {
+ // path: 'faceLogin',
+ // name: 'faceLogin',
+ // component: () => import('@/views/testModel/faceLogin'),
+ // meta: { title: '人脸识别登录', icon: 'home' }
+ // },
+ // {
+ // path: 'caram',
+ // name: 'caram',
+ // component: () => import('@/views/testModel/caram'),
+ // meta: { title: '相机调用', icon: 'home' }
+ // },
+ // {
+ // path: 'markImage',
+ // name: 'markImage',
+ // component: () => import('@/views/testModel/markImage'),
+ // meta: { title: '图片标记', icon: 'home' }
+ // }
+ // ]
+ // },
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
diff --git a/hb_client/src/views/bigScreen/index.vue b/hb_client/src/views/bigScreen/index.vue
index 30c6abd..364deba 100644
--- a/hb_client/src/views/bigScreen/index.vue
+++ b/hb_client/src/views/bigScreen/index.vue
@@ -653,9 +653,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 @@
+
+
+
+ {{scope.row.to_order_.contract_.watch_num}}
+
+
+
+
@@ -113,6 +121,7 @@
{{ this.ordershow }}
{{ this.customershow }}
{{ this.contractshow }}
+ {{ this.watch_num }}
{
if (response.data) {
diff --git a/hb_client/src/views/personnel/userupdate.vue b/hb_client/src/views/personnel/userupdate.vue
index 3afc0d2..8f0cd22 100644
--- a/hb_client/src/views/personnel/userupdate.vue
+++ b/hb_client/src/views/personnel/userupdate.vue
@@ -1,184 +1,218 @@
-
-
-
- 基础信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 基础信息
+
-
-
-
-
-
- 保存
- 返回
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 返回
+
+
+
-
-
- 详细信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 详细信息
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
- 返回
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 返回
+
+
+
+
@@ -221,17 +255,17 @@
}
\ No newline at end of file
diff --git a/hb_client/src/views/sam/contract.vue b/hb_client/src/views/sam/contract.vue
index cef7873..7fe2187 100644
--- a/hb_client/src/views/sam/contract.vue
+++ b/hb_client/src/views/sam/contract.vue
@@ -50,6 +50,8 @@
+
+
@@ -116,6 +118,9 @@
>
+
+
+
diff --git a/hb_client/src/views/wpm/productjy.vue b/hb_client/src/views/wpm/productjy.vue
index db29447..548c097 100644
--- a/hb_client/src/views/wpm/productjy.vue
+++ b/hb_client/src/views/wpm/productjy.vue
@@ -87,18 +87,18 @@
-
- {{scope.row.to_order_.number }}
+
+ {{scope.row.order_.number }}
-
- {{scope.row.to_order_.customer_.name }}
+
+ {{scope.row.customer_.name }}
-
- {{scope.row.to_order_.contract_.name }}
+
+ {{scope.row.contract_.name }}
diff --git a/hb_server/apps/develop/tasks.py b/hb_server/apps/develop/tasks.py
index b9c1991..580f525 100644
--- a/hb_server/apps/develop/tasks.py
+++ b/hb_server/apps/develop/tasks.py
@@ -4,7 +4,7 @@ from rest_framework.response import Response
from celery import shared_task
import os
import subprocess
-from server.settings_pro import DATABASES, BACKUP_PATH, SH_PATH
+from server.settings_pro import DATABASES, BACKUP_PATH, SH_PATH, SD_PWD
@shared_task
def backup_database():
@@ -13,7 +13,8 @@ def backup_database():
"""
import datetime
name = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
- command = 'pg_dump "user={} password={} dbname={}" > {}/hberp_{}.sql'.format(
+ command = 'echo "{}" | sudo -S pg_dump "user={} password={} dbname={}" > {}/hberp_{}.sql'.format(
+ SD_PWD,
DATABASES['default']['USER'],
DATABASES['default']['PASSWORD'],
DATABASES['default']['NAME'],
@@ -30,7 +31,7 @@ def reload_server():
@shared_task
def reload_server_only():
- command = 'sudo service supervisor reload'
+ command = 'echo "{}" | sudo -S service supervisor reload'.format(SD_PWD)
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
return completed
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):
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'),