diff --git a/hb_client/src/api/sam.js b/hb_client/src/api/sam.js index 67998a3..451942a 100644 --- a/hb_client/src/api/sam.js +++ b/hb_client/src/api/sam.js @@ -57,3 +57,33 @@ export function deleteContract(id, data) { data }) } +//订单 +//合同 +export function getOrderList(query) { + return request({ + url: '/sam/order/', + method: 'get', + params: query + }) +} +export function createOrder(data) { + return request({ + url: '/sam/order/', + method: 'post', + data + }) +} +export function updateOrder(id, data) { + return request({ + url: `/sam/order/${id}/`, + method: 'put', + data + }) +} +export function deleteOrder(id, data) { + return request({ + url: `/sam/order/${id}/`, + method: 'delete', + data + }) +} diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index d2325df..6ab730e 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -175,6 +175,13 @@ export const asyncRoutes = [ component: () => import('@/views/sam/contract'), meta: { title: '合同信息', icon: 'example', perms: ['index_manage'] } } + , + { + path: 'order', + name: 'order', + component: () => import('@/views/sam/order'), + meta: { title: '订单信息', icon: 'example', perms: ['index_manage'] } + } ] } , diff --git a/hb_client/src/views/sam/order.vue b/hb_client/src/views/sam/order.vue new file mode 100644 index 0000000..a316672 --- /dev/null +++ b/hb_client/src/views/sam/order.vue @@ -0,0 +1,317 @@ + + diff --git a/hb_server/apps/em/migrations/0008_auto_20210916_1054.py b/hb_server/apps/em/migrations/0008_auto_20210916_1054.py new file mode 100644 index 0000000..902de86 --- /dev/null +++ b/hb_server/apps/em/migrations/0008_auto_20210916_1054.py @@ -0,0 +1,32 @@ +# Generated by Django 3.2.6 on 2021-09-16 02:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('em', '0007_equipmentrecord'), + ] + + operations = [ + migrations.RemoveField( + model_name='equipmentrecord', + name='nextdate', + ), + migrations.AddField( + model_name='equipment', + name='nextdate', + field=models.DateField(blank=True, null=True, verbose_name='下次应校准或检定日期'), + ), + migrations.AddField( + model_name='equipment', + name='recentlydate', + field=models.DateField(blank=True, null=True, verbose_name='最近一次校准/检定日期'), + ), + migrations.AlterField( + model_name='equipmentrecord', + name='recentlydate', + field=models.DateField(blank=True, null=True, verbose_name='校准/检定日期'), + ), + ] diff --git a/hb_server/apps/em/migrations/0009_auto_20210916_1108.py b/hb_server/apps/em/migrations/0009_auto_20210916_1108.py new file mode 100644 index 0000000..c451677 --- /dev/null +++ b/hb_server/apps/em/migrations/0009_auto_20210916_1108.py @@ -0,0 +1,31 @@ +# Generated by Django 3.2.6 on 2021-09-16 03:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('em', '0008_auto_20210916_1054'), + ] + + operations = [ + migrations.RemoveField( + model_name='equipment', + name='nextdate', + ), + migrations.RemoveField( + model_name='equipment', + name='recentlydate', + ), + migrations.AddField( + model_name='equipmentrecord', + name='nextdate', + field=models.DateField(blank=True, null=True, verbose_name='下次应校准或检定日期'), + ), + migrations.AlterField( + model_name='equipmentrecord', + name='recentlydate', + field=models.DateField(blank=True, null=True, verbose_name='最近一次校准/检定日期'), + ), + ] diff --git a/hb_server/apps/em/views.py b/hb_server/apps/em/views.py index 387dcca..64ad57d 100644 --- a/hb_server/apps/em/views.py +++ b/hb_server/apps/em/views.py @@ -26,7 +26,7 @@ class EquipmentViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet) # Create your views here. class EquipmentrecordViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet): """ - 设备台账-增删改查 + 设备校准-增删改查 """ perms_map = {'get': '*', 'post': 'equipmentrecord_create', 'put': 'equipmentrecord_update', 'delete': 'equipmentrecord_delete'} diff --git a/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py b/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py new file mode 100644 index 0000000..d0899af --- /dev/null +++ b/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.6 on 2021-09-16 02:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('qm', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='analysisitem', + name='rules', + field=models.JSONField(default=list, verbose_name='判定规则'), + ), + ] diff --git a/hb_server/apps/sam/serializers.py b/hb_server/apps/sam/serializers.py index 0d24387..00efa54 100644 --- a/hb_server/apps/sam/serializers.py +++ b/hb_server/apps/sam/serializers.py @@ -2,6 +2,8 @@ from rest_framework import serializers from .models import Contract, Customer, Order +from apps.mtm.serializers import MaterialSimpleSerializer + class CustomerSerializer(serializers.ModelSerializer): class Meta: model = Customer @@ -42,6 +44,7 @@ class OrderCreateUpdateSerializer(serializers.ModelSerializer): class OrderSerializer(serializers.ModelSerializer): contract_ = ContractSimpleSerializer(source='contract', read_only=True) customer_ = CustomerSimpleSerializer(source='customer', read_only=True) + product_ = MaterialSimpleSerializer(source='product', read_only=True) class Meta: model = Order fields = '__all__' diff --git a/hb_server/apps/sam/urls.py b/hb_server/apps/sam/urls.py index fda60b5..4aa607f 100644 --- a/hb_server/apps/sam/urls.py +++ b/hb_server/apps/sam/urls.py @@ -1,12 +1,13 @@ from django.db.models import base from rest_framework import urlpatterns -from apps.sam.views import CustomerViewSet,ContractViewSet +from apps.sam.views import CustomerViewSet,ContractViewSet,OrderViewSet from django.urls import path, include from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register('customer', CustomerViewSet, basename='customer') router.register('contract', ContractViewSet, basename='contract') +router.register('order', OrderViewSet, basename='order') urlpatterns = [ path('', include(router.urls)),