From cf1759c7444b16e24ba7672c8642d0ff30ee9ce0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 08:43:28 +0800 Subject: [PATCH 01/22] =?UTF-8?q?is=5Fmtestok=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0021_fifoitemproduct_iproduct.py | 19 +++++++++++ hb_server/apps/inm/models.py | 21 +++++++----- .../0009_alter_saleproduct_is_mtestok.py | 18 ++++++++++ hb_server/apps/sam/models.py | 2 +- hb_server/apps/sam/views.py | 33 +++++++++++++++++-- 5 files changed, 81 insertions(+), 12 deletions(-) create mode 100644 hb_server/apps/inm/migrations/0021_fifoitemproduct_iproduct.py create mode 100644 hb_server/apps/sam/migrations/0009_alter_saleproduct_is_mtestok.py diff --git a/hb_server/apps/inm/migrations/0021_fifoitemproduct_iproduct.py b/hb_server/apps/inm/migrations/0021_fifoitemproduct_iproduct.py new file mode 100644 index 0000000..9d9ea22 --- /dev/null +++ b/hb_server/apps/inm/migrations/0021_fifoitemproduct_iproduct.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.9 on 2021-12-07 00:42 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('inm', '0020_iproduct_is_saled'), + ] + + operations = [ + migrations.AddField( + model_name='fifoitemproduct', + name='iproduct', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='inm.iproduct', verbose_name='关联库存产品'), + ), + ] diff --git a/hb_server/apps/inm/models.py b/hb_server/apps/inm/models.py index 5c485d0..9059a91 100644 --- a/hb_server/apps/inm/models.py +++ b/hb_server/apps/inm/models.py @@ -84,15 +84,6 @@ class FIFOItem(BaseModel): fifo = models.ForeignKey(FIFO, verbose_name='关联出入库', on_delete=models.CASCADE) subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='关联子生产计划', on_delete=models.CASCADE, null=True, blank=True) -class FIFOItemProduct(BaseModel): - """ - 出入库产品 - """ - fifoitem = models.ForeignKey(FIFOItem, verbose_name='关联出入库具体产品', on_delete=models.CASCADE) - wproduct = models.ForeignKey('wpm.wproduct', on_delete=models.CASCADE, verbose_name='关联的动态产品', db_constraint=False, null=True, blank=True) - number = models.CharField('物品编号', max_length=50) - material = models.ForeignKey(Material, verbose_name='物料类型', on_delete=models.CASCADE) - class IProduct(BaseModel): """ 具体产品条目 @@ -104,4 +95,16 @@ class IProduct(BaseModel): wproduct = models.ForeignKey('wpm.wproduct', on_delete=models.CASCADE, verbose_name='关联的动态产品', db_constraint=False, null=True, blank=True) is_saled = models.BooleanField('是否售出', default=False) +class FIFOItemProduct(BaseModel): + """ + 出入库产品 + """ + fifoitem = models.ForeignKey(FIFOItem, verbose_name='关联出入库具体产品', on_delete=models.CASCADE) + wproduct = models.ForeignKey('wpm.wproduct', on_delete=models.CASCADE, verbose_name='关联的动态产品', db_constraint=False, null=True, blank=True) + number = models.CharField('物品编号', max_length=50) + material = models.ForeignKey(Material, verbose_name='物料类型', on_delete=models.CASCADE) + iproduct = models.ForeignKey(IProduct, verbose_name='关联库存产品', null=True, blank=True, on_delete=models.SET_NULL) + + + diff --git a/hb_server/apps/sam/migrations/0009_alter_saleproduct_is_mtestok.py b/hb_server/apps/sam/migrations/0009_alter_saleproduct_is_mtestok.py new file mode 100644 index 0000000..d034dfa --- /dev/null +++ b/hb_server/apps/sam/migrations/0009_alter_saleproduct_is_mtestok.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.9 on 2021-12-07 00:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sam', '0008_alter_saleproduct_number'), + ] + + operations = [ + migrations.AlterField( + model_name='saleproduct', + name='is_mtestok', + field=models.BooleanField(blank=True, null=True, verbose_name='是否军检合格'), + ), + ] diff --git a/hb_server/apps/sam/models.py b/hb_server/apps/sam/models.py index bb0fb8e..e82137a 100644 --- a/hb_server/apps/sam/models.py +++ b/hb_server/apps/sam/models.py @@ -90,7 +90,7 @@ class SaleProduct(BaseModel): number = models.CharField('物品编号', max_length=50) iproduct = models.ForeignKey('inm.iproduct', verbose_name='关联库存产品', on_delete=models.CASCADE, related_name='sale_iproduct') is_mtested = models.BooleanField('是否军检', default=False) - is_mtestok = models.BooleanField('是否军检合格', default=True) + is_mtestok = models.BooleanField('是否军检合格', null=True, blank=True) remark = models.TextField('备注', null=True, blank=True) class Meta: diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 624aa2d..f6e51c1 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -1,7 +1,9 @@ from django.db import transaction +from django.db.models.aggregates import Count from rest_framework import exceptions, serializers from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModelMixin, RetrieveModelMixin -from apps.inm.models import FIFO +from apps.inm.models import FIFO, FIFOItem, FIFOItemProduct, IProduct +from apps.inm.signals import update_inm from apps.sam.serializers import ContractCreateUpdateSerializer, ContractSerializer, CustomerCreateUpdateSerializer, CustomerSerializer, OrderCreateUpdateSerializer, OrderSerializer, SaleCreateSerializer, SaleListSerializer, SaleProductCreateSerializer, SaleProductListSerializer, SaleProductMtestSerializer from apps.sam.models import Contract, Customer, Order, Sale, SaleProduct from rest_framework.viewsets import GenericViewSet, ModelViewSet @@ -75,7 +77,7 @@ class OrderViewSet(CreateUpdateCustomMixin, ModelViewSet): return Response(serializer.data) -class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, CreateModelMixin, GenericViewSet): +class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, CreateModelMixin, DestroyModelMixin, GenericViewSet): """ 销售记录 """ @@ -136,7 +138,34 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C pass else: raise exceptions.APIException('存在未军检产品') + # 创建出库条目 + ips = IProduct.objects.filter(sale_iproduct__sale=obj) + items = ips.values('warehouse', 'material', 'batch').annotate(total=Count('id')) + for i in items: + fifoitem = FIFOItem() + fifoitem.is_tested = True + fifoitem.is_testok = True + fifoitem.warehouse = i['warehouse'] + fifoitem.material = i['material'] + fifoitem.count = i['total'] + fifoitem.batch = i['batch'] + fifoitem.fifo = fifo + fifoitem.save() + items_p = ips.filter(warehouse=i['warehouse'], batch=i['batch']) + ips = [] + for i in items_p: + # 创建入库明细半成品 + ip = {} + ip['fifoitem'] = fifoitem + ip['number'] = i.number + ip['material'] = i.material + ip['iproduct'] = i + ips.append(FIFOItemProduct(**ip)) + FIFOItemProduct.objects.bulk_create(ips) # 更新库存 + update_inm(fifo) + # 更新成品库情况 + ips.update(is_saled=True) return Response() class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet): From 03437e1e4d0e981f9f9aa5b1115ed4ad327209f3 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 08:47:09 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=86=9B=E6=A3=80mtest=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/sam/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index f6e51c1..e4902a8 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -201,6 +201,7 @@ class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, Ge if obj.is_mtested: raise exceptions.APIException('已进行军检') obj.remark = request.data.get('remark', None) + obj.is_mtested = True obj.is_mtestok = request.data.get('is_mtestok') obj.save() return Response() \ No newline at end of file From 439566b4e5b0015dd3d1a57c15a295681c99018d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 10:24:37 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=AE=A1=E6=A0=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/inm/signals.py | 11 ++++++----- hb_server/apps/sam/views.py | 11 +++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hb_server/apps/inm/signals.py b/hb_server/apps/inm/signals.py index 79d5a19..e659c0c 100644 --- a/hb_server/apps/inm/signals.py +++ b/hb_server/apps/inm/signals.py @@ -36,7 +36,7 @@ def update_inm(instance:FIFO, type:int=1): ips2.append(IProduct(**ip)) IProduct.objects.bulk_create(ips2) - elif instance.type in [FIFO.FIFO_TYPE_DO_OUT]: # 生产领料 + elif instance.type in [FIFO.FIFO_TYPE_DO_OUT, FIFO.FIFO_TYPE_SALE_OUT]: # 生产领料 销售出库 # 更新相关表 for i in FIFOItem.objects.filter(fifo=instance): material = i.material @@ -49,8 +49,9 @@ def update_inm(instance:FIFO, type:int=1): o2.save() material.count = material.count - i.count material.save() - - # 删除IProduct - numbers = FIFOItemProduct.objects.filter(fifoitem=i).values_list('number', flat=True) - IProduct.objects.filter(number__in=numbers).delete() + + # 删除IProduct + if instance.type == FIFO.FIFO_TYPE_DO_OUT: + numbers = FIFOItemProduct.objects.filter(fifoitem=i).values_list('number', flat=True) + IProduct.objects.filter(number__in=numbers).delete() diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index e4902a8..1f7b0b3 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -2,7 +2,8 @@ from django.db import transaction from django.db.models.aggregates import Count from rest_framework import exceptions, serializers from rest_framework.mixins import CreateModelMixin, DestroyModelMixin, ListModelMixin, RetrieveModelMixin -from apps.inm.models import FIFO, FIFOItem, FIFOItemProduct, IProduct +from apps.mtm.models import Material +from apps.inm.models import FIFO, FIFOItem, FIFOItemProduct, IProduct, WareHouse from apps.inm.signals import update_inm from apps.sam.serializers import ContractCreateUpdateSerializer, ContractSerializer, CustomerCreateUpdateSerializer, CustomerSerializer, OrderCreateUpdateSerializer, OrderSerializer, SaleCreateSerializer, SaleListSerializer, SaleProductCreateSerializer, SaleProductListSerializer, SaleProductMtestSerializer from apps.sam.models import Contract, Customer, Order, Sale, SaleProduct @@ -142,16 +143,18 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C ips = IProduct.objects.filter(sale_iproduct__sale=obj) items = ips.values('warehouse', 'material', 'batch').annotate(total=Count('id')) for i in items: + warehouse = WareHouse.objects.get(id=i['warehouse']) + material = Material.objects.get(id=i['material']) fifoitem = FIFOItem() fifoitem.is_tested = True fifoitem.is_testok = True - fifoitem.warehouse = i['warehouse'] - fifoitem.material = i['material'] + fifoitem.warehouse = warehouse + fifoitem.material = material fifoitem.count = i['total'] fifoitem.batch = i['batch'] fifoitem.fifo = fifo fifoitem.save() - items_p = ips.filter(warehouse=i['warehouse'], batch=i['batch']) + items_p = ips.filter(warehouse=warehouse, batch=i['batch']) ips = [] for i in items_p: # 创建入库明细半成品 From 8e3ab103dd324baf2bb42a12e93e1fa29827df2e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 10:29:34 +0800 Subject: [PATCH 04/22] =?UTF-8?q?sale=20commit=20=E6=8F=90=E4=BA=A4bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/sam/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 1f7b0b3..8269505 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -165,10 +165,10 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C ip['iproduct'] = i ips.append(FIFOItemProduct(**ip)) FIFOItemProduct.objects.bulk_create(ips) + # 更新成品库情况 + IProduct.objects.filter(sale_iproduct__sale=obj).update(is_saled=True) # 更新库存 update_inm(fifo) - # 更新成品库情况 - ips.update(is_saled=True) return Response() class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet): From 6ee7c46d7d9b52177c7755d6bd8da7890c8a455d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 10:32:48 +0800 Subject: [PATCH 05/22] sale audit bug --- hb_server/apps/sam/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 8269505..55d3c21 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -155,7 +155,7 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C fifoitem.fifo = fifo fifoitem.save() items_p = ips.filter(warehouse=warehouse, batch=i['batch']) - ips = [] + ipxs = [] for i in items_p: # 创建入库明细半成品 ip = {} @@ -163,10 +163,10 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C ip['number'] = i.number ip['material'] = i.material ip['iproduct'] = i - ips.append(FIFOItemProduct(**ip)) - FIFOItemProduct.objects.bulk_create(ips) + ipxs.append(FIFOItemProduct(**ip)) + FIFOItemProduct.objects.bulk_create(ipxs) # 更新成品库情况 - IProduct.objects.filter(sale_iproduct__sale=obj).update(is_saled=True) + ips.update(is_saled=True) # 更新库存 update_inm(fifo) return Response() From b743675190520c04b8c600d12ac7caa6fa597faf Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 10:36:14 +0800 Subject: [PATCH 06/22] sale submit bug --- hb_server/apps/sam/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 55d3c21..2fe48f5 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -157,7 +157,7 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C items_p = ips.filter(warehouse=warehouse, batch=i['batch']) ipxs = [] for i in items_p: - # 创建入库明细半成品 + # 创建出库明细半成品 ip = {} ip['fifoitem'] = fifoitem ip['number'] = i.number @@ -169,6 +169,9 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C ips.update(is_saled=True) # 更新库存 update_inm(fifo) + # 变更审核状态 + obj.is_audited = True + obj.save() return Response() class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet): From 7a97e5e99bdb58999fe7cd806142fd23924edc7a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Dec 2021 10:42:17 +0800 Subject: [PATCH 07/22] =?UTF-8?q?sale=20audit=20=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=92=8C=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/sam/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hb_server/apps/sam/views.py b/hb_server/apps/sam/views.py index 2fe48f5..e3098ef 100644 --- a/hb_server/apps/sam/views.py +++ b/hb_server/apps/sam/views.py @@ -131,6 +131,7 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C fifo.is_audited = True fifo.auditor = request.user fifo.inout_date = timezone.now() + fifo.create_by = request.user fifo.save() # 出库条目 spds = SaleProduct.objects.filter(sale=obj) @@ -172,6 +173,11 @@ class SaleViewSet(CreateUpdateCustomMixin, ListModelMixin, RetrieveModelMixin, C # 变更审核状态 obj.is_audited = True obj.save() + # 变更订单状态 + if obj.order: + order = obj.order + order.delivered_count = order.delivered_count + obj.count + order.save() return Response() class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, GenericViewSet): From 447886c609735333c4d7c1e95d8350a4b0927aed Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Tue, 7 Dec 2021 15:05:41 +0800 Subject: [PATCH 08/22] junjian --- hb_client/src/api/sam.js | 80 ++++- hb_client/src/router/index.js | 17 +- hb_client/src/views/inm/fifo.vue | 2 +- hb_client/src/views/sam/contract.vue | 1 - hb_client/src/views/sam/order.vue | 4 + hb_client/src/views/sam/sales.vue | 404 ++++++++++++++++++++++++ hb_client/src/views/sam/salesdetail.vue | 192 +++++++++++ hb_client/src/views/wpm/operationdo.vue | 7 + 8 files changed, 703 insertions(+), 4 deletions(-) create mode 100644 hb_client/src/views/sam/sales.vue create mode 100644 hb_client/src/views/sam/salesdetail.vue diff --git a/hb_client/src/api/sam.js b/hb_client/src/api/sam.js index cc378cd..0672a32 100644 --- a/hb_client/src/api/sam.js +++ b/hb_client/src/api/sam.js @@ -73,6 +73,13 @@ export function createOrder(data) { data }) } +export function getOrder(id) { + return request({ + url: `/sam/order/${id}/`, + method: 'get' + }) +} + export function updateOrder(id, data) { return request({ url: `/sam/order/${id}/`, @@ -93,4 +100,75 @@ export function getordertoplan() { url: '/sam/order/toplan/', method: 'get', }) -} \ No newline at end of file +} +//销售记录列表 +export function getSaleList(query) { + return request({ + url: '/sam/sale/', + method: 'get', + params: query + }) +} + +//销售记录创建 +export function createSale(data) { + return request({ + url: '/sam/sale/', + method: 'post', + data + }) +} + + +export function deleteSale(id, data) { + return request({ + url: `/sam/sale/${id}/`, + method: 'delete', + data + }) +} + + +export function getSale(id) { + return request({ + url: `/sam/sale/${id}/`, + method: 'get' + }) +} + +//销售记录列表 +export function getSaleproductList(query) { + return request({ + url: '/sam/sale_product/', + method: 'get', + params: query + }) +} + +//删除销售记录关联产品 +export function deleteSaleproduct(id, data) { + return request({ + url: `/sam/sale_product/${id}/`, + method: 'delete', + data + }) +} + +//军检 +export function saleMtest(id, data) { + return request({ + url: `/sam/sale_product/${id}/mtest/`, + method: 'POST', + data + }) +} +//审核 +export function saleAudit(id) { + return request({ + url: `/sam/sale/${id}/audit/`, + method: 'POST', + + }) +} + + diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 2aa5dcb..bb1f9c7 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -262,7 +262,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/sam/customer', name: 'sam', - meta: { title: '合同管理', icon: 'example', perms: ['equipment_set'] }, + meta: { title: '销售管理', icon: 'example', perms: ['equipment_set'] }, children: [ { path: 'customer', @@ -284,6 +284,21 @@ export const asyncRoutes = [ component: () => import('@/views/sam/order'), meta: { title: '订单信息', icon: 'example', perms: ['index_manage'] } } + , + { + path: 'sales', + name: 'sales', + component: () => import('@/views/sam/sales'), + meta: { title: '销售信息', icon: 'example', perms: ['index_manage'] } + } + , + { + path: 'salesdetail/:id', + name: 'salesdetail', + component: () => import('@/views/sam/salesdetail'), + meta: { title: '销售详情', perms: ['vendor_manage'] }, + hidden: true + } ] } , diff --git a/hb_client/src/views/inm/fifo.vue b/hb_client/src/views/inm/fifo.vue index 8147c52..b0e0a92 100644 --- a/hb_client/src/views/inm/fifo.vue +++ b/hb_client/src/views/inm/fifo.vue @@ -49,7 +49,7 @@ - diff --git a/hb_client/src/views/sam/sales.vue b/hb_client/src/views/sam/sales.vue index f5fe5f9..75a1ebc 100644 --- a/hb_client/src/views/sam/sales.vue +++ b/hb_client/src/views/sam/sales.vue @@ -98,6 +98,7 @@ @@ -142,7 +144,7 @@
- +
@@ -224,7 +226,7 @@ export default { if (response.data) { response.data.forEach((item) => { this.iproductoptions.push({ - label: item.material_.name, + label: item.number+"__"+item.material_.name+"__"+(item.is_mtested==true?"已军检":"未军检") , key: item.id }) }); @@ -275,7 +277,7 @@ export default { if (response.data) { response.data.forEach((item) => { this.iproductoptions.push({ - label: item.material_.name, + label: item.number+"__"+item.material_.name+"__"+(item.is_mtested==true?"已军检":"未军检") , key: item.id }) }); @@ -292,7 +294,7 @@ export default { if (response.data) { response.data.forEach((item) => { this.iproductoptions.push({ - label: item.material_.name, + label: item.number+"__"+item.material_.name+"__"+(item.is_mtested==true?"已军检":"未军检") , key: item.id }) }); @@ -399,6 +401,10 @@ export default { diff --git a/hb_client/src/views/sam/salesdetail.vue b/hb_client/src/views/sam/salesdetail.vue index b766830..88e0b1a 100644 --- a/hb_client/src/views/sam/salesdetail.vue +++ b/hb_client/src/views/sam/salesdetail.vue @@ -60,11 +60,7 @@ > diff --git a/hb_client/src/views/wpm/need.vue b/hb_client/src/views/wpm/need.vue index 4ed28d8..3d8e4c4 100644 --- a/hb_client/src/views/wpm/need.vue +++ b/hb_client/src/views/wpm/need.vue @@ -157,6 +157,54 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + @@ -268,6 +316,9 @@ }, wproductList2: { count: 0, + }, + wproductList3: { + count: 0, }, listQuery: { page: 1, @@ -280,6 +331,10 @@ listQuery2: { page: 1, page_size: 20, + }, + listQuery3: { + page: 1, + page_size: 20, }, formLabelWidth:'', formLabelWidthL:'', @@ -291,6 +346,7 @@ 40: "库存中", 50: "不合格", 60: "待成品检验", + 26:"待夹层检验", }, choice: [ { @@ -331,6 +387,7 @@ this.getList(); this.getList2(); this.getList1(); + this.getList3(); // this.getLists(); }, methods: { @@ -361,7 +418,7 @@ getList1() { this.listQuery1.act_state = 30; - this.listQuery1.material__type = 1; + this.listQuery1.material__type = 2; getwproductList(this.listQuery1).then((response) => { if (response.data) { this.wproductList1 = response.data; @@ -369,7 +426,17 @@ }); }, + //夹层半成品列表 + getList3() { + this.listQuery3.act_state = 26; + getwproductList(this.listQuery3).then((response) => { + if (response.data) { + this.wproductList3 = response.data; + } + + }); + }, //半成品批量入库 handleCreate() { this.dialogFormVisibles = true; @@ -383,7 +450,7 @@ _this.mutipID = [] this.$refs.multipleTable.selection.forEach((item) => { _this.mutipID.push(item.id); - alert(_this.mutipID); + }); console.log(_this.mutipID); @@ -475,6 +542,7 @@ this.getList(); this.getList1(); this.getList2(); + this.getList3(); } }); diff --git a/hb_client/src/views/wpm/operationdo.vue b/hb_client/src/views/wpm/operationdo.vue index d3da9da..ace3ea3 100644 --- a/hb_client/src/views/wpm/operationdo.vue +++ b/hb_client/src/views/wpm/operationdo.vue @@ -50,6 +50,20 @@ 取消
+ + + + + + + + @@ -161,10 +175,10 @@ :model="tableForm" :visible.sync="dialogVisibleForm" :close-on-click-modal="false" - :title="tableForm.name" + :title="fieldList.name" > - + + + - + + + - + +
+ 取消 + 提交 +
+
@@ -404,7 +435,12 @@ stripe style="width: 100%" max-height="400" - > + ref="multipleTables" + > + + @@ -440,7 +476,7 @@ - + +
+ 取消 + 提交 +
@@ -493,9 +533,12 @@ import { deleteOperationwproduct, gettoolList, createTool, + createInputs, + recordInit, + createOutputs } from "@/api/wpm"; -import { getrffieldList } from "@/api/mtm"; +import { getrffieldList,gettechdocList } from "@/api/mtm"; import checkPermission from "@/utils/permission"; import { getprogressList } from "@/api/pm"; import Pagination from "@/components/Pagination"; // secondary package based on el-pagination @@ -505,9 +548,11 @@ export default { inject: ["reload"], data() { return { + techdocList:"", operationList: { count: 0, }, + drawer:false, listQuery: { page: 1, page_size: 20, @@ -633,7 +678,12 @@ export default { //作业指导书 readbook(){ - + this.drawer=true; + gettechdocList({operation:this.id,page:0}).then((response) => { + if (response.data) { + this.techdocList= response.data; + } + }); }, //是否使用边角料 @@ -719,9 +769,7 @@ export default { handlerecord(scope) { this.tableForm = Object.assign({}, scope.row); // copy obj this.formID = scope.row.id; - this.listQueryfield.form = scope.row.form_.id; - this.listQueryfield.page = 0; - getrffieldList(this.listQueryfield).then((response) => { + recordInit( this.formID).then((response) => { if (response.data) { this.fieldList = response.data; } @@ -784,6 +832,40 @@ export default { } }); }, + +//车间领料批量提交 + handlepicks() { + + + let _this = this; + + this.pickDatas=[], + this.$refs.multipleTable.selection.forEach((item) => { + if(item.pick_count>0) + { + this.pickDatas.push({ + "operation" :this.id, + "wmaterial":item.id, + "count": item.pick_count, + + }); + } + + + }); + + + createInputs(this.pickDatas).then((res) => { + if (res.code >= 200) { + this.dialogTablepick = false; + this.$message.success("提交成功!"); + _this.getinputLists(); + + } + }); + }, + + //操作产出物料列表 getoutputLists() { getoutputList({ operation: this.id, page: 0 }).then((response) => { @@ -816,6 +898,38 @@ export default { } }); }, + //车间产出物料批量提交 + handleoutputs() { + + + this.outputDatas=[], + this.$refs.multipleTables.selection.forEach((item) => { + if(item.output_count>0) + { + this.outputDatas.push({ + "operation" :this.id, + "subproduction_progress":item.id, + "count": item.output_count, + + }); + } + + + }); + + createOutputs(this.outputDatas).then((res) => { + if (res.code >= 200) { + this.dialogTableoutput = false; + + this.$message.success("提交成功!"); + this.getoutputLists(); + + + } + }); + }, + + //提交本次操作 handlesubmit() { submitOperation(this.id).then((res) => { diff --git a/hb_client/src/views/wpm/productjy.vue b/hb_client/src/views/wpm/productjy.vue index 37fd54b..638bb83 100644 --- a/hb_client/src/views/wpm/productjy.vue +++ b/hb_client/src/views/wpm/productjy.vue @@ -440,7 +440,7 @@ export default { _this.mutipID=[] this.$refs.multipleTable.selection.forEach((item) => { _this.mutipID.push( item.id ); - alert(_this.mutipID); + }); console.log(_this.mutipID); diff --git a/hb_client/src/views/wpm/worktask.vue b/hb_client/src/views/wpm/worktask.vue index 12da811..58efbcd 100644 --- a/hb_client/src/views/wpm/worktask.vue +++ b/hb_client/src/views/wpm/worktask.vue @@ -703,6 +703,7 @@ export default { 50: "不合格", 60: "待成品检验", 8:"操作准备中", + 26:"待夹层检验", }, state_: { 0: "制定中",