diff --git a/hb_client/src/App.vue b/hb_client/src/App.vue
index bf20ea3..b06679a 100644
--- a/hb_client/src/App.vue
+++ b/hb_client/src/App.vue
@@ -27,3 +27,13 @@ export default {
}
}
+
diff --git a/hb_client/src/api/user.js b/hb_client/src/api/user.js
index 8edf3ab..ac708c3 100644
--- a/hb_client/src/api/user.js
+++ b/hb_client/src/api/user.js
@@ -30,6 +30,14 @@ export function getUserList(query) {
})
}
+export function getOrganizationList(query) {
+ return request({
+ url: '/system/organization/',
+ method: 'get',
+ params: query
+ })
+}
+
export function getUser(id) {
return request({
url: `/system/user/${id}/`,
diff --git a/hb_client/src/api/workflow.js b/hb_client/src/api/workflow.js
index 724227a..74be8dd 100644
--- a/hb_client/src/api/workflow.js
+++ b/hb_client/src/api/workflow.js
@@ -35,6 +35,14 @@ export function getWfStateList(id) {
method: 'get'
})
}
+//工单流转step
+export function getWfFlowSteps(id) {
+ return request({
+ url: `/wf/ticket/${id}/flowsteps/`,
+ method: 'get'
+ })
+}
+
//流转状态创建
export function createWfState(data) {
return request({
@@ -43,6 +51,15 @@ export function createWfState(data) {
data
})
}
+//处理工单
+export function ticketHandle(id,data) {
+ return request({
+ url: `/wf/ticket/${id}/handle/`,
+ method: 'post',
+ data
+ })
+}
+
//流转状态更新
export function updateWfState(id, data) {
return request({
@@ -121,7 +138,7 @@ export function deleteWfTransition(id, data) {
data
})
}
-//工单详情
+//工单列表
export function getTickets(query) {
return request({
url: `/wf/ticket/`,
@@ -129,3 +146,17 @@ export function getTickets(query) {
params:query
})
}
+//工单详情
+export function getTicketDetail(id) {
+ return request({
+ url: `/wf/ticket/${id}/`,
+ method: 'get'
+ })
+}
+//工单详情
+export function getTicketTransitions(id) {
+ return request({
+ url: `/wf/ticket/${id}/transitions/`,
+ method: 'get'
+ })
+}
diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js
index b88f42e..27e100a 100644
--- a/hb_client/src/router/index.js
+++ b/hb_client/src/router/index.js
@@ -271,42 +271,34 @@ export const asyncRoutes = [
}
]
},
- {
- path: '/workflow',
- component: Layout,
- redirect: '/workflow/index',
- name: 'workflow',
- meta: { title: '工作流管理', icon: 'example', perms: ['workflow_set'] },
- children: [
- {
- path: 'index',
- name: 'index',
- component: () => import('@/views/workflow/index'),
- meta: { title: '工作流配置', icon: 'example', perms: ['workflow_manage'] }
- },
-
+ {
+ path: '/workflow',
+ component: Layout,
+ redirect: '/workflow/index',
+ name: 'workflow',
+ meta: { title: '工作流', icon: 'example', perms: ['workflow_set'] },
+ children: [
{
- path: 'configuration',
- name: 'configuration',
- component: () => import('@/views/workflow/configuration'),
- meta: { title: '人员信息详情', icon: 'example', perms: ['configuration_manage'] },
- hidden: true
+ path: 'index',
+ name: 'index',
+ component: () => import('@/views/workflow/index'),
+ meta: { title: '工作流配置', icon: 'example', perms: ['workflow_manage'] }
},
{
path: 'ticket',
name: 'ticket',
component: () => import('@/views/workflow/ticket'),
- meta: { title: '工单列表', icon: 'example', perms: ['ticket_manage'] },
- hidden: true
- },{
- path: 'test',
- name: 'test',
- component: () => import('@/views/workflow/test'),
- meta: { title: '工单', icon: 'example', perms: ['test_manage'] },
+ meta: { title: '工单管理', icon: 'example', perms: ['workflow_manage'] },
+ },
+ {
+ path: 'configuration',
+ name: 'configuration',
+ component: () => import('@/views/workflow/configuration'),
+ meta: { title: '人员信息详情', icon: 'example', perms: ['workflow_manage'] },
hidden: true
},
- ]
- },
+ ]
+ },
{
path: '/system',
component: Layout,
diff --git a/hb_client/src/views/workflow/customfield.vue b/hb_client/src/views/workflow/customfield.vue
index 76b154f..b9bda45 100644
--- a/hb_client/src/views/workflow/customfield.vue
+++ b/hb_client/src/views/workflow/customfield.vue
@@ -148,9 +148,10 @@ export default {
hasJsonFlag:true, // json是否验证通过
hasJsonFlag1:true, // json是否验证通过
hasJsonFlag2:true, // json是否验证通过
- customfieldList: {
- count:0
- },
+ // customfieldList: {
+ // count:0
+ // },
+ customfieldList:[],
options: [{
value: 'string',
label: '文本'
diff --git a/hb_client/src/views/workflow/state.vue b/hb_client/src/views/workflow/state.vue
index e103b8c..8c7062c 100644
--- a/hb_client/src/views/workflow/state.vue
+++ b/hb_client/src/views/workflow/state.vue
@@ -76,7 +76,7 @@
@@ -113,8 +113,7 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
取消
@@ -133,6 +150,7 @@
diff --git a/hb_client/src/views/workflow/transitions.vue b/hb_client/src/views/workflow/transitions.vue
index 68c7c5b..345b8e5 100644
--- a/hb_client/src/views/workflow/transitions.vue
+++ b/hb_client/src/views/workflow/transitions.vue
@@ -23,7 +23,7 @@
-
+
-
+
@@ -139,9 +139,11 @@ export default {
return {
wftransition: defaultwftransition,
condition_expression:false,
- wftransitionList: {
+ /*wftransitionList: {
count:0
- },
+ },*/
+ wftransitionList:[],
+ lable:'',
options_:[],
options: [{
value: 1,
diff --git a/hb_daq/default.aproj b/hb_daq/default.aproj
index c3e936d..0aec0ec 100644
--- a/hb_daq/default.aproj
+++ b/hb_daq/default.aproj
@@ -1,5 +1,5 @@
-
+
diff --git a/hb_daq/main.aardio b/hb_daq/main.aardio
index ab39ff1..98024af 100644
--- a/hb_daq/main.aardio
+++ b/hb_daq/main.aardio
@@ -76,6 +76,7 @@ if(!atom){
mainForm.onMinimize = function(lParam){
var tray = win.util.tray(mainForm) //创建托盘图标
tray.tip = "数据采集";
+ tray.pop("数据采集已最小化运行" )
mainForm.show(false); //隐藏窗口
return true;//阻击默认消息传递,取消最小化过程
}
@@ -159,7 +160,7 @@ http.beginRequest( mainForm.serverUrl.text + "/api/em/daq/", "POST" );
var res = web.json.parse(html)
if(res['code']==200){
import fsys
- var theDir = fsys.createDir(mainForm.backupPath.text+"\"+number, false)
+ var theDir = fsys.createDir(mainForm.backupPath.text+"\\"+number, false)
fsys.move(fullpath, theDir) //移动到备份文件库
mainForm.listbox.add("采集成功!")
}else{
@@ -195,7 +196,7 @@ mainForm.listview.onnotify = function(id,code,ptr){
mainForm.add.oncommand = function(id,event){
-var frmChild = mainForm.loadForm("\dlg\add.aardio");
+var frmChild = mainForm.loadForm("\\dlg\\add.aardio");
frmChild.doModal();
}
diff --git a/hb_server/apps/mtm/migrations/0017_auto_20210928_1355.py b/hb_server/apps/mtm/migrations/0017_auto_20210928_1355.py
new file mode 100644
index 0000000..4c07d85
--- /dev/null
+++ b/hb_server/apps/mtm/migrations/0017_auto_20210928_1355.py
@@ -0,0 +1,34 @@
+# Generated by Django 3.2.6 on 2021-09-28 05:55
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('mtm', '0016_auto_20210917_0900'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='recordform',
+ name='material',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='关联物料'),
+ ),
+ migrations.AlterField(
+ model_name='material',
+ name='processes',
+ field=models.JSONField(blank=True, default=list, null=True, verbose_name='工艺流程'),
+ ),
+ migrations.AlterField(
+ model_name='recordform',
+ name='step',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mtm.step', verbose_name='关联子工序'),
+ ),
+ migrations.AlterField(
+ model_name='recordform',
+ name='type',
+ field=models.IntegerField(choices=[(1, '生产记录'), (2, '检验记录')], default=1, verbose_name='表格类型'),
+ ),
+ ]
diff --git a/hb_server/apps/mtm/models.py b/hb_server/apps/mtm/models.py
index e3f77ed..a9b1675 100644
--- a/hb_server/apps/mtm/models.py
+++ b/hb_server/apps/mtm/models.py
@@ -29,7 +29,7 @@ class Material(CommonAModel):
specification = models.CharField('型号', max_length=100, null=True, blank=True)
type = models.CharField('物料类型', choices= type_choices, max_length=20, default=1)
sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True)
- processes = models.JSONField('工艺流程', default=list, blank=True)
+ processes = models.JSONField('工艺流程', default=list, blank=True, null=True)
unit = models.CharField('基准计量单位', choices=unit_choices, default='块', max_length=10)
class Meta:
@@ -80,11 +80,12 @@ class RecordForm(CommonAModel):
"""
type_choices=(
(1, '生产记录'),
+ (2, '检验记录')
)
name = models.CharField('表格名称', max_length=100, unique=True)
type = models.IntegerField('表格类型', choices=type_choices, default=1)
- step = models.ForeignKey(Step, verbose_name='关联子工序', on_delete=models.CASCADE)
-
+ step = models.ForeignKey(Step, verbose_name='关联子工序', on_delete=models.CASCADE, null=True, blank=True)
+ material = models.ForeignKey(Material, verbose_name='关联物料', on_delete=models.CASCADE, null=True, blank=True)
class Meta:
verbose_name = '记录表格'
verbose_name_plural = verbose_name
@@ -194,3 +195,4 @@ class TechDoc(CommonAModel):
class Meta:
verbose_name = '技术文件'
verbose_name_plural = verbose_name
+
\ No newline at end of file
diff --git a/hb_server/apps/mtm/views.py b/hb_server/apps/mtm/views.py
index 317575c..974bdba 100644
--- a/hb_server/apps/mtm/views.py
+++ b/hb_server/apps/mtm/views.py
@@ -147,7 +147,7 @@ class RecordFormViewSet(OptimizationMixin, CreateUpdateModelAMixin, ModelViewSet
"""
perms_map = {'*':'*'}
queryset = RecordForm.objects.all()
- filterset_fields = ['step', 'type']
+ filterset_fields = ['step', 'type', 'material']
search_fields = ['name']
def get_serializer_class(self):
diff --git a/hb_server/apps/wf/serializers.py b/hb_server/apps/wf/serializers.py
index eedf40c..cddfaff 100644
--- a/hb_server/apps/wf/serializers.py
+++ b/hb_server/apps/wf/serializers.py
@@ -78,4 +78,8 @@ class TicketFlowSerializer(serializers.ModelSerializer):
model = TicketFlow
fields = '__all__'
-
\ No newline at end of file
+
+class TicketHandleSerializer(serializers.Serializer):
+ transition = serializers.IntegerField(label="流转id")
+ ticket_data = serializers.JSONField(label="表单数据json")
+ suggestion = serializers.CharField(label="处理意见", required = False)
\ No newline at end of file
diff --git a/hb_server/apps/wf/services.py b/hb_server/apps/wf/services.py
index 06ce023..cd691d9 100644
--- a/hb_server/apps/wf/services.py
+++ b/hb_server/apps/wf/services.py
@@ -167,7 +167,7 @@ class WfService(object):
elif participant_type in [State.PARTICIPANT_TYPE_MULTI, State.PARTICIPANT_TYPE_DEPT, State.PARTICIPANT_TYPE_ROLE]:
if user.id not in participant:
return dict(permission=False, msg="非当前处理人")
- current_participant_count = len(participant.split(','))
+ current_participant_count = len(participant)
if current_participant_count >1 and state.distribute_type == State.STATE_DISTRIBUTE_TYPE_ACTIVE:
return dict(permission=False, msg="需要先接单再处理")
if ticket.in_add_node:
diff --git a/hb_server/apps/wf/views.py b/hb_server/apps/wf/views.py
index 40732c8..3740fec 100644
--- a/hb_server/apps/wf/views.py
+++ b/hb_server/apps/wf/views.py
@@ -2,7 +2,7 @@ from django.core.exceptions import AppRegistryNotReady
from rest_framework.response import Response
from rest_framework import serializers
from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModelMixin, RetrieveModelMixin, UpdateModelMixin
-from apps.wf.serializers import CustomFieldSerializer, StateSerializer, TicketCreateSerializer, TicketFlowSerializer, TicketSerializer, TransitionSerializer, WorkflowSerializer
+from apps.wf.serializers import CustomFieldSerializer, StateSerializer, TicketCreateSerializer, TicketFlowSerializer, TicketHandleSerializer, TicketSerializer, TransitionSerializer, WorkflowSerializer
from django.shortcuts import get_object_or_404, render
from rest_framework.viewsets import GenericViewSet, ModelViewSet
from rest_framework.decorators import action, api_view
@@ -99,6 +99,8 @@ class TicketViewSet(OptimizationMixin, CreateUpdateCustomMixin, CreateModelMixin
def get_serializer_class(self):
if self.action == 'create':
return TicketCreateSerializer
+ elif self.action == 'handle':
+ return TicketHandleSerializer
return super().get_serializer_class()
def create(self, request, *args, **kwargs):