Explorar o código

新增计划的流程

695593266@qq.com hai 8 meses
pai
achega
f1393ab890

+ 18 - 6
src/api/productionPlan/index.js

@@ -147,7 +147,10 @@ export async function batchSave(data) {
 
 // 计划分解 (保存并发布)
 export async function issueProductionPlan(data) {
-  const res = await request.post(`/aps/productionplan/issueProductionPlan`, data);
+  const res = await request.post(
+    `/aps/productionplan/issueProductionPlan`,
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -349,11 +352,20 @@ export async function findMaterialInfoByCategory(params) {
 
 // 根据产品ID查询物料信息
 export async function getProductKitting(params) {
-  const res = await request.get(
-    '/aps/productionplan/getProductKitting',
-    {
-      params
-    }
+  const res = await request.get('/aps/productionplan/getProductKitting', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//发布计划是否需要审核
+export async function planIsReview(data) {
+  const res = await request.post(
+    `/aps/productionplan/releaseSaveByApproval`,
+    data
   );
   if (res.data.code == 0) {
     return res.data.data;

+ 17 - 3
src/views/productionPlan/index.vue

@@ -347,7 +347,8 @@
     del,
     updatePriority,
     getPlanStatistics,
-    factoryDelete
+    factoryDelete,
+    planIsReview
   } from '@/api/productionPlan/index.js';
   import productionPlanSearch from './components/productionPlan-search.vue';
   import unpackDialog from './components/unpackDialog.vue';
@@ -363,6 +364,7 @@
   import { debounce } from 'lodash';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import importDialog from '@/components/upload/import-dialog.vue';
+  import { parameterGetByCode } from '@/api/mainData/index';
 
   import {
     findBomCategoryByCategoryId,
@@ -378,7 +380,8 @@
       disassemblePlanPop,
       factoryAdd,
       homogeneityInspectDialog,
-      homogeneityInspectInstallDialog,importDialog
+      homogeneityInspectInstallDialog,
+      importDialog
     },
     props: {
       timeDimensionPlanType: { type: Number, default: 1 },
@@ -439,7 +442,8 @@
         factoryType: 3,
         factoryObj: {},
         cardSpan: 3,
-        columnsVersion: 1
+        columnsVersion: 1,
+        isReview: false
         // homogeneityDialog: false
       };
     },
@@ -882,6 +886,7 @@
         this.$store.state.user.info.clientEnvironmentId;
 
       this.getPlanStatistics();
+      this.getplannedReleaseRequire('planned_release_require');
     },
     methods: {
       handleSele(e) {
@@ -892,6 +897,15 @@
         }
       },
 
+      async getplannedReleaseRequire(code) {
+        parameterGetByCode({ code }).then((res) => {
+          if (res) {
+            this.isReview = res.value == '1' ? true : false;
+            console.log(this.isReview, 'isReview');
+          }
+        });
+      },
+
       async getPlanStatistics() {
         let res = await getPlanStatistics();
         console.log(res);

+ 32 - 6
src/views/saleOrder/components/order-search.vue

@@ -358,7 +358,11 @@
             <!-- <el-button @click="homogeneityInspect" size="mini" type="success">
               齐套性检查</el-button
             > -->
-            <el-dropdown trigger="click" @command="homogeneityInspect" v-if="$hasPermission('aps:saleOrder:homogeneityInspect')">
+            <el-dropdown
+              trigger="click"
+              @command="homogeneityInspect"
+              v-if="$hasPermission('aps:saleOrder:homogeneityInspect')"
+            >
               <el-button size="mini" type="success">齐套性检查</el-button>
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="1"> 自制件 </el-dropdown-item>
@@ -369,7 +373,10 @@
             <el-button
               @click="goProduct"
               size="mini"
-              v-if="activeName != 'second'&&$hasPermission('aps:salesorder:update')"
+              v-if="
+                activeName != 'second' &&
+                $hasPermission('aps:salesorder:update')
+              "
             >
               转生产计划</el-button
             >
@@ -384,7 +391,9 @@
               type="success"
               size="mini"
               @click="toCreate"
-              v-if="activeName == 'first'&&$hasPermission('aps:salesorder:save')"
+              v-if="
+                activeName == 'first' && $hasPermission('aps:salesorder:save')
+              "
               >创建订单</el-button
             >
 
@@ -392,7 +401,9 @@
               class="avatar-uploader"
               action="#"
               :show-file-list="false"
-              v-if="activeName == 'first'&&$hasPermission('aps:saleOrder:upload')"
+              v-if="
+                activeName == 'first' && $hasPermission('aps:saleOrder:upload')
+              "
               :http-request="uploadFile"
               :before-upload="beforeUpload"
               :on-change="handleChange"
@@ -400,7 +411,19 @@
             >
               <el-button type="warning" size="mini">批量导入</el-button>
             </el-upload>
-            <el-button type="info" size="mini" @click="importTemplate('/aps/salesorder/importTemplate','销售订单模板.xlsx')" v-if="$hasPermission('aps:salesorder:download')"> 下载模板 </el-button>
+            <el-button
+              type="info"
+              size="mini"
+              @click="
+                importTemplate(
+                  '/aps/salesorder/importTemplate',
+                  '销售订单模板.xlsx'
+                )
+              "
+              v-if="$hasPermission('aps:salesorder:download')"
+            >
+              下载模板
+            </el-button>
             <el-button
               type="danger"
               size="mini"
@@ -436,7 +459,10 @@
     <!-- 订单组合 -->
     <group-order ref="groupDialog"> </group-order>
 
-    <printTemplateSaleOrder :groupName="groupName" ref="printTemplateSaleOrderRef"></printTemplateSaleOrder>
+    <printTemplateSaleOrder
+      :groupName="groupName"
+      ref="printTemplateSaleOrderRef"
+    ></printTemplateSaleOrder>
   </el-form>
 </template>
 

+ 16 - 2
src/views/saleOrder/salesToProductionNew.vue

@@ -288,6 +288,8 @@
     updateSaleToPlan
   } from '@/api/saleOrder';
 
+  import { planIsReview } from '@/api/productionPlan/index.js';
+
   import { getByCode } from '@/api/system/dictionary-data';
   import { parameterGetByCode } from '@/api/mainData/index';
   import dictMixins from '@/mixins/dictMixins';
@@ -385,7 +387,8 @@
         // selection: [],
         loading: false,
         processingRequired: 0, // 生产类型跟BOM 版本是否必填 1:是 0:否
-        selectionRowShow: false // 工艺路线输入框展示 状态
+        selectionRowShow: false, // 工艺路线输入框展示 状态
+        isReview: false
       };
     },
     computed: {
@@ -433,6 +436,7 @@
       }
       // this.bomListVersion();
       this.mandatoryField();
+      this.getplannedReleaseRequire('planned_release_require');
     },
     methods: {
       async getProducedData() {
@@ -463,6 +467,14 @@
           }
         });
       },
+
+      async getplannedReleaseRequire(code) {
+        parameterGetByCode({ code }).then((res) => {
+          if (res) {
+            this.isReview = res.value == '1' ? true : false;
+          }
+        });
+      },
       // 验证时间是否超期
       changeDate(item, i) {
         console.log(
@@ -970,7 +982,9 @@
                   data.workOrder.productionPlanId = params.id;
                 }
                 console.log(data);
-                await releaseSave(data)
+                const URL = this.isReview ? planIsReview : releaseSave;
+                await URL(data)
+                  // await releaseSave(data)
                   .then((res) => {
                     if (res === 1) {
                       this.$message.success('工单已发布!');