695593266@qq.com 6 месяцев назад
Родитель
Сommit
2469f88529

+ 67 - 0
src/api/requirementListPlan/index.js

@@ -0,0 +1,67 @@
+import request from '@/utils/request';
+
+// 获取需求列表计划
+export async function getRequirementListPlan(data) {
+  const res = await request.get('/aps/materialrequirements/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-详情分页
+export async function getRequirementListPlanDetailPage(data) {
+  const res = await request.get('/aps/materialrequirements/detailPage', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-详情
+export async function getRequirementListPlanDetail(id) {
+  const res = await request.get(`/aps/materialrequirements/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-保存
+export async function saveRequirementListPlan(data) {
+  const res = await request.post('/aps/materialrequirements/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-修改
+export async function updateRequirementListPlan(data) {
+  const res = await request.put('/aps/materialrequirements/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-删除
+export async function deleteRequirementListPlan(data) {
+  const res = await request.delete(`/aps/materialrequirements/delete`, {
+    data
+  });
+
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取需求计划-导出
+export async function dowloadRequirementListPlan(data) {
+  const res = await request.get('/aps/materialrequirements/export', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 55 - 62
src/views/materialRequirement/requirementListPlan/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <seek-page :seekList="seekList" @search="search"></seek-page>
+      <seek-page :seekList="seekList" @search="reload"></seek-page>
 
       <ele-pro-table
         ref="table"
@@ -32,6 +32,10 @@
 
 <script>
   import dictMixins from '@/mixins/dictMixins';
+  import {
+    getRequirementListPlan,
+    deleteRequirementListPlan
+  } from '@/api/requirementListPlan';
   export default {
     mixins: [dictMixins],
     data() {
@@ -63,76 +67,62 @@
             fixed: 'left'
           },
           {
-            prop: 'type',
-            label: '需求单号',
+            prop: 'code',
+            label: '需求单号',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'code'
           },
           {
-            prop: 'type',
+            prop: 'topCategoryCode',
             label: '顶级产品编号',
             width: 120,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'topCategoryCode'
           },
           {
-            prop: 'type',
+            prop: 'topCategoryName',
             label: '顶级产品名称',
             width: 120,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: '计划状态',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'topCategoryName'
           },
+
           {
-            prop: 'type',
+            prop: 'planCode',
             label: '计划编号',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'planCode'
           },
           {
-            prop: 'type',
+            prop: 'batchNo',
             label: '批次号',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
-          },
-          {
-            prop: 'type',
-            label: '生产工单号',
-            width: 100,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'batchNo'
           },
+
           {
-            prop: 'type',
+            prop: 'categoryCode',
             label: '编码',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'categoryCode'
           },
           {
-            prop: 'type',
+            prop: 'categoryName',
             label: '名称',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'categoryName'
           },
           {
             prop: 'type',
@@ -143,44 +133,44 @@
             slot: 'type'
           },
           {
-            prop: 'type',
+            prop: 'modelType',
             label: '型号',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'modelType'
           },
           {
-            prop: 'type',
+            prop: 'specification',
             label: '规格',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'specification'
           },
           {
-            prop: 'type',
+            prop: 'categorySize',
             label: '尺寸',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'categorySize'
           },
           {
-            prop: 'type',
+            prop: 'quantity',
             label: '计划数量',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'quantity'
           },
           {
-            prop: 'type',
+            prop: 'measuringUnit',
             label: '计量单位',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'measuringUnit'
           },
           {
             prop: 'type',
@@ -199,12 +189,12 @@
             slot: 'type'
           },
           {
-            prop: 'type',
+            prop: 'brandNum',
             label: '牌号',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'brandNum'
           },
           {
             prop: 'type',
@@ -238,14 +228,6 @@
             showOverflowTooltip: true,
             slot: 'type'
           },
-          {
-            prop: 'type',
-            label: '投料控制清单号',
-            width: 120,
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'type'
-          },
           {
             prop: 'type',
             label: '创建人',
@@ -255,12 +237,12 @@
             slot: 'type'
           },
           {
-            prop: 'type',
+            prop: 'createTime',
             label: '创建时间',
             width: 100,
             align: 'center',
             showOverflowTooltip: true,
-            slot: 'type'
+            slot: 'createTime'
           }
         ];
       },
@@ -269,37 +251,37 @@
         return [
           {
             label: '计划编号:',
-            value: 'name',
+            value: 'planCode',
             type: 'input',
             labelWidth: 100
           },
           {
             label: '批次号:',
-            value: 'name',
+            value: 'batchNo',
             type: 'input',
             labelWidth: 80
           },
           {
             label: '编码:',
-            value: 'name',
+            value: 'categoryCode',
             type: 'input',
             labelWidth: 50
           },
           {
-            label: '需求单号:',
-            value: 'name',
+            label: '需求单号:',
+            value: 'code',
             type: 'input',
             labelWidth: 100
           },
           {
             label: '顶级产品编号:',
-            value: 'name',
+            value: 'topCategoryCode',
             type: 'input',
             labelWidth: 100
           },
           {
             label: '顶级产品名称:',
-            value: 'name',
+            value: 'topCategoryName',
             type: 'input',
             labelWidth: 100
           },
@@ -329,7 +311,18 @@
     },
 
     methods: {
-      search() {},
+      async datasource({ page, limit, where }) {
+        const res = await getRequirementListPlan({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
+
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
 
       fullscreenChange(fullscreen) {
         if (fullscreen) {

+ 2 - 2
vue.config.js

@@ -37,12 +37,12 @@ module.exports = {
         // target: 'http://192.168.158:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.144:18086',
-        target: 'http://192.168.1.251:18186',
+        // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.102:18086',
         // target: 'http://aiot.zoomwin.com.cn:51001/api',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
 
         // target: 'http://192.168.1.116:18086',