From b104a9382834de28854a1720ae39f03f72f14516 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 22 Dec 2021 08:35:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E6=93=8D=E4=BD=9Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/views.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 4d62249..b2c6911 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -339,6 +339,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet): """ obj = self.get_object() serializer = ScrapSerializer(data=request.data) + serializer.is_valid(raise_exception=True) vdata = serializer.validated_data if obj.act_state == WProduct.WPR_ACT_STATE_NOTOK: pass @@ -363,21 +364,29 @@ class WProductViewSet(ListModelMixin, GenericViewSet): # return WorkflowSimpleSerializer(instance=wfs, many=True).data @action(methods=['get'], detail=True, perms_map={'get':'*'}) - def bhg_wf(self, request, pk=None): + def wf_bhg(self, request, pk=None): """ 发起不合格审理单 """ obj = self.get_object() if obj.act_state != WProduct.WPR_ACT_STATE_NOTOK: raise exceptions.APIException('非检验不合格产品不可发起不合格审理') - ret = { + workflow = Workflow.objects.filter(name='不合格品审理单', is_deletd=False).first() + if workflow: + exist_data = { 'sys_wproduct':obj.id, 'sys_name':obj.material.name, 'sys_specification':obj.material.specification, 'sys_finder':request.user.id, 'sys_process':obj.step.process.id, - } - return Response(ret) + } + ret = {'workflow':workflow.id} + ret['exist_data'] = exist_data + return Response(ret) + else: + raise exceptions.APIException('未找到对应工作流程') + + From 5fed3d5ad869f8a2f1bc642c10d5eda9c618ddf5 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 22 Dec 2021 09:02:51 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E6=93=8D=E4=BD=9Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wpm/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index b2c6911..ae855e7 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -343,7 +343,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet): vdata = serializer.validated_data if obj.act_state == WProduct.WPR_ACT_STATE_NOTOK: pass - elif obj.step.process == 1: # 如果是冷加工可直接报废 + elif obj.step.process.id == 1: # 如果是冷加工可直接报废 if vdata.get('scrap_reason', None): obj.scrap_reason = vdata['scrap_reason'] else: From feffb4eacaa1f39c3e5c60771b7fdd800d5f964c Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Wed, 22 Dec 2021 09:46:15 +0800 Subject: [PATCH 3/9] baofei --- hb_client/src/api/wpm.js | 4 +- hb_client/src/views/wpm/need.vue | 58 +++ hb_client/src/views/wpm/operation.vue | 20 +- hb_client/src/views/wpm/worktask.vue | 581 ++++++++++++++------------ 4 files changed, 392 insertions(+), 271 deletions(-) diff --git a/hb_client/src/api/wpm.js b/hb_client/src/api/wpm.js index f3b876d..12858d8 100644 --- a/hb_client/src/api/wpm.js +++ b/hb_client/src/api/wpm.js @@ -298,11 +298,11 @@ export function testInit(data) { } //不合格半成品报废 -export function scrap(id) { +export function scrap(id,data) { return request({ url: `/wpm/wproduct/${id}/scrap/`, method: 'post', - + data }) } diff --git a/hb_client/src/views/wpm/need.vue b/hb_client/src/views/wpm/need.vue index 5d73c0f..c4af2cc 100644 --- a/hb_client/src/views/wpm/need.vue +++ b/hb_client/src/views/wpm/need.vue @@ -43,6 +43,11 @@ @click="checkRecord(scope,'1')" >检验记录 + 报废 + @@ -53,6 +58,32 @@ :limit.sync="listQuery.page_size" @pagination="getList" /> + + + + + + + + + + + + + + @@ -491,6 +522,7 @@ data() { return { testitem: defaultetestitem, + formbcp:{}, form: {remark: "", warehouse: ""}, wproductList: { count: 0, @@ -556,6 +588,12 @@ label: "不合格", }, ], + scrapreason: [ + { lable: "气泡", value: 10 }, + { lable: "破点", value: 20 }, + { lable: "划伤", value: 30 }, + { lable: "其他", value: 40 }, + ], recordList: [], options: [], listLoading: true, @@ -571,6 +609,7 @@ page: 0, }, recordVisible:false, + dialogFormVisiblebcp:false, innerIndex:null, origintest:null, mutipID: [], @@ -612,6 +651,25 @@ this.listLoading = false; }); }, + //待检半成品报废 + handleScrapbcp(scope){ + this.dialogFormVisiblebcp=true; + this.bcpbf=scope.row.id; + + }, + //确定报废半成品 + scrapesubmit(){ + + console.log(this.formbcp); + scrap(this.bcpbf,this.formbcp).then((response) => { + if (response.data) { + this.$message.success("该半成品已报废!"); + this.dialogFormVisiblebcp=false; + this.getList(); + } + + }); + }, //复检半成品列表 getList2() { this.listQuery2.act_state = 6; diff --git a/hb_client/src/views/wpm/operation.vue b/hb_client/src/views/wpm/operation.vue index b627aff..684e367 100644 --- a/hb_client/src/views/wpm/operation.vue +++ b/hb_client/src/views/wpm/operation.vue @@ -128,7 +128,7 @@ export default { watch: {}, created() { this.id = this.$route.params.id; - this. getProcessList() + this.getProcessList() }, methods: { @@ -147,19 +147,23 @@ handleoperation(scope) }); }, +getList(){ + getoperationList(this.listQuery).then((response) => { + if (response.data) { + this.operationList = response.data; + } + + }); +}, //选项卡切换 handleClick(tab) { this.process = tab.name; this.listQuery.step__process = tab.name; - this.steps = []; - getoperationList(this.listQuery).then((response) => { - if (response.data) { - this.operationList = response.data; - } - this.listLoading = false; - }); + this.getList(); + }, + //操作记录删除 handleDelete(scope) { this.$confirm("确认该操作删除?", "警告", { diff --git a/hb_client/src/views/wpm/worktask.vue b/hb_client/src/views/wpm/worktask.vue index 22ed361..d6438a9 100644 --- a/hb_client/src/views/wpm/worktask.vue +++ b/hb_client/src/views/wpm/worktask.vue @@ -18,20 +18,22 @@ @current-change="handleCurrentChange" > - - + + + + + - - - - - - - - - + @@ -90,13 +88,19 @@ @@ -111,12 +115,11 @@ /> -
半成品
- 显示全部 + + - - + + @@ -162,12 +175,11 @@ scope.row.step_.name }} - + - + + +
+
@@ -191,7 +207,7 @@ max-height="300" > - + @@ -218,48 +234,74 @@
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - > - - - - - - - - - + - + - + - - + - - - + + + - + - - - - - + + - - +
生产所需领料表