From aec826efc678ca0f32282c26e3f65e9d60945069 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Wed, 22 Sep 2021 13:58:32 +0800 Subject: [PATCH 1/3] tijiaozigongxu --- hb_client/package.json | 2 +- hb_client/src/router/index.js | 7 + hb_client/src/views/mtm/step.vue | 4 +- hb_client/src/views/sam/contract.vue | 6 +- hb_client/src/views/sam/order.vue | 4 + hb_client/src/views/sam/review.vue | 284 +++++++++++++++++++++++++++ hb_server/apps/mtm/serializers.py | 2 +- 7 files changed, 304 insertions(+), 5 deletions(-) create mode 100644 hb_client/src/views/sam/review.vue diff --git a/hb_client/package.json b/hb_client/package.json index d8201b2..0a17f55 100644 --- a/hb_client/package.json +++ b/hb_client/package.json @@ -20,7 +20,7 @@ "axios": "^0.21.1", "cache-loader": "^4.1.0", "compression-webpack-plugin": "^5.0.1", - "d3": "^5.16.0", + "d3": "^5.14.2", "dagre-d3": "^0.6.4", "element-ui": "^2.15.5", "file-saver": "^2.0.2", diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 87508ea..9685b0e 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -176,6 +176,13 @@ export const asyncRoutes = [ meta: { title: '合同信息', icon: 'example', perms: ['index_manage'] } } , + { + path: 'review', + name: 'review', + component: () => import('@/views/sam/review'), + meta: { title: '合同评审', icon: 'example', perms: ['index_manage'] } + } + , { path: 'order', name: 'order', diff --git a/hb_client/src/views/mtm/step.vue b/hb_client/src/views/mtm/step.vue index d614d5d..48f3c4d 100644 --- a/hb_client/src/views/mtm/step.vue +++ b/hb_client/src/views/mtm/step.vue @@ -6,7 +6,7 @@ font-weight: 700; ">子工序列表 - 新增子工序 过程记录表 - 新增 {{ scope.row.number }} - + {{ scope.row.amount }} + + {{ scope.row.invoice }} + + {{ scope.row.customer_.name }} diff --git a/hb_client/src/views/sam/order.vue b/hb_client/src/views/sam/order.vue index a316672..79e731b 100644 --- a/hb_client/src/views/sam/order.vue +++ b/hb_client/src/views/sam/order.vue @@ -53,6 +53,9 @@ {{ scope.row.product_.name }} + + + {{ scope.row.product_.specification }} {{ scope.row.count }} @@ -117,6 +120,7 @@ + diff --git a/hb_client/src/views/sam/review.vue b/hb_client/src/views/sam/review.vue new file mode 100644 index 0000000..abd14b4 --- /dev/null +++ b/hb_client/src/views/sam/review.vue @@ -0,0 +1,284 @@ + + + + + + 搜索 + 重置 + + + 新增客户 + + + + + + + {{ scope.row.name }} + + + + {{ scope.row.number }} + + + {{ scope.row.amount }} + + + {{ scope.row.invoice }} + + + + {{ scope.row.customer_.name }} + + + {{ scope.row.sign_date }} + + + {{ scope.row.description }} + + + {{ scope.row.create_time }} + + + + + 编辑 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确认 + + + + + diff --git a/hb_server/apps/mtm/serializers.py b/hb_server/apps/mtm/serializers.py index 68b214b..004d3d3 100644 --- a/hb_server/apps/mtm/serializers.py +++ b/hb_server/apps/mtm/serializers.py @@ -25,7 +25,7 @@ class MaterialDetailSerializer(serializers.ModelSerializer): class MaterialSimpleSerializer(serializers.ModelSerializer): class Meta: model = Material - fields = ['id', 'name', 'number', 'unit'] + fields = ['id', 'name', 'number', 'unit','specification'] class ProcessSerializer(serializers.ModelSerializer): instruction_ = FileSimpleSerializer(source='instruction', read_only=True) From cf5ab840b4f9ec9d526bac21b72a9090b022c626 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Wed, 22 Sep 2021 13:59:08 +0800 Subject: [PATCH 2/3] tijiao --- hb_server/apps/sam/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hb_server/apps/sam/models.py b/hb_server/apps/sam/models.py index 247e3e9..4683844 100644 --- a/hb_server/apps/sam/models.py +++ b/hb_server/apps/sam/models.py @@ -31,10 +31,17 @@ class Contract(CommonAModel): """ 合同信息 """ + state_choices = ( + (0, '完好'), + (1, '限用'), + (2, '在修'), + (3, '禁用') + ) name = models.CharField('合同名称', max_length=100) number = models.CharField('合同编号', max_length=100, unique=True) amount = models.IntegerField('合同金额', default=0) invoice = models.IntegerField('开票金额', default=0) + #state = models.CharField('合同状态', choices= state_choices, max_length=20, default=1) 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) From 11142df98cc2f24c6ca75658d12031d03d349510 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 22 Sep 2021 14:27:57 +0800 Subject: [PATCH 3/3] workflow --- hb_client/src/App.vue | 10 +++ hb_client/src/api/workflow.js | 33 +++++++- hb_client/src/views/workflow/ticket.vue | 100 ++++++++++++++++++++---- 3 files changed, 126 insertions(+), 17 deletions(-) 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/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/views/workflow/ticket.vue b/hb_client/src/views/workflow/ticket.vue index 7039ed0..a4c6f0c 100644 --- a/hb_client/src/views/workflow/ticket.vue +++ b/hb_client/src/views/workflow/ticket.vue @@ -7,7 +7,11 @@ {{ scope.row.title }} - {{ scope.row.act_state }} + + 已提交 + 已完成 + 审批中 + {{ scope.row.create_time }} @@ -15,6 +19,7 @@ 查看流程图 + 工单详情 @@ -35,20 +40,50 @@ + + + + + + + + + 流水号:{{ticketDetail.sn}} + 开始时间:{{}} + 请假类型:{{ticketDetail.workflow_.name}} + 创建人:{{}} + 请假原因:{{ticketDetail.workflow_.name}} + + + 标题:{{ticketDetail.title}} + 结束时间:{{}} + 创建时间:{{ticketDetail.create_time}} + 请假天数:{{ticketDetail.ticket_data.days}} + + + + {{item.name}} + + - +