Răsfoiți Sursa

齐套性检查调整

zhouqi 1 an în urmă
părinte
comite
108fb75a40

+ 2 - 2
src/api/saleOrder/index.js

@@ -158,7 +158,7 @@ export async function getOrderDetail(code) {
 }
 // 获取多个订单详情
 export async function getByCodeList(data) {
-  const res = await request.post(`/aps/salesorder/getByCodeList/`, data);
+  const res = await request.post(`/aps/salesorder/getByCodeList`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -268,7 +268,7 @@ export async function synchronousDataByJDY(data) {
 }
 // 齐套性检查
 export async function orderHomogeneityInspect(data) {
-  const res = await request.post(`/aps/productionplan/orderHomogeneityInspect`,  data);
+  const res = await request.post(`/aps/salesorder/orderHomogeneityInspect`,  data);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 74 - 180
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -9,185 +9,61 @@
     :title="'齐套性检查'"
   >
     <div class="form-wrapper">
-<!--      <el-form :model="requestData" label-width="0" :show-message="false">-->
-<!--        <el-descriptions title="" :column="2" border>-->
-<!--          <el-descriptions-item label="计划编号">-->
-<!--            {{ formData.code }}</el-descriptions-item-->
-<!--          >-->
-
-<!--          <el-descriptions-item label="产品编码">{{-->
-<!--            formData.productCode-->
-<!--            }}</el-descriptions-item>-->
-
-<!--          <el-descriptions-item label="产品名称">{{-->
-<!--            formData.productName-->
-<!--            }}</el-descriptions-item>-->
-
-<!--          <el-descriptions-item label="牌号|型号">-->
-<!--            {{ formData.brandNo }}|{{ formData.model }}</el-descriptions-item-->
-<!--          >-->
-
-<!--          <el-descriptions-item label="批次号">{{-->
-<!--            formData.batchNo-->
-<!--            }}</el-descriptions-item>-->
-
-<!--          <el-descriptions-item label="工艺路线">{{-->
-<!--            formData.produceRoutingName-->
-<!--            }}</el-descriptions-item>-->
-
-<!--          <el-descriptions-item label="要求生产数量">{{-->
-<!--            formData.requiredFormingNum-->
-<!--            }}</el-descriptions-item>-->
-<!--          <el-descriptions-item label="要求完成日期">{{-->
-<!--            formData.reqMoldTime-->
-<!--            }}</el-descriptions-item>-->
-<!--        </el-descriptions>-->
-<!--      </el-form>-->
-
-<!--      <headerTitle title="剩余拆批" class="mt20"> </headerTitle>-->
-      <div class="optionButton">
-        <el-button type="primary" @click="merge"
-        >合并</el-button>
+      <div v-if="leftShow" :style="{width: leftWidth}">
+        <el-card class="box-card">
+<!--          <div v-for="o in 4" :key="o" class="text item">-->
+<!--            {{'列表内容 ' + o }}-->
+<!--          </div>-->
+        </el-card>
+      </div>
+      <div :style="{width: rightWidth}">
+        <div class="planInfo">
+          <div></div>
+          <div></div>
+        </div>
+        <div>
+          <ele-pro-table
+            ref="table"
+            :needPage="false"
+            :columns="columns"
+            :key="activeName"
+            :init-load="false"
+            :datasource="datasource"
+          >
+            <template v-slot:stockCount="{ row }">
+              <el-link type="primary" :underline="false" @click="stockDetail(row)">
+                {{ row.stockCount }}
+              </el-link>
+            </template>
+            <template v-slot:currentCount="{ row }">
+              <el-link type="primary" :underline="false" @click="currentDetail(row)">
+                {{ row.currentCount }}
+              </el-link>
+            </template>
+            <template v-slot:stockColor="{ row }">
+              <div :class="{'statusRed' : row.stockStatus == '缺料'}">
+                {{row.stockStatus}}
+              </div>
+            </template>
+            <template v-slot:currentColor="{ row }">
+              <div :class="{'statusRed' : row.currentStatus == '缺料'}">
+                {{row.currentStatus}}
+              </div>
+            </template>
+            <template v-slot:finishColor="{ row }">
+              <div :class="{'statusRed' : row.finishStatus == '缺料'}">
+                {{row.finishStatus}}
+              </div>
+            </template>
+            <template v-slot:finishCount="{ row }">
+              <div>
+                <div v-if="row.finishCount > 0">{{row.finishCount}}</div>
+                <div v-else>-</div>
+              </div>
+            </template>
+          </ele-pro-table>
+        </div>
       </div>
-      <el-tabs v-model="activeName" @tab-click="tabClick()" type="card" size="mini">
-        <el-tab-pane label="自制件" name="first"></el-tab-pane>
-        <el-tab-pane label="装配件" name="second"></el-tab-pane>
-      </el-tabs>
-      <el-form ref="form" :model="form" :rules="rules">
-<!--        <ele-pro-table-->
-<!--          ref="table"-->
-<!--          :needPage="false"-->
-<!--          :columns="columns"-->
-<!--          :datasource="form.surplusUnpack"-->
-<!--        >-->
-<!--          <template v-slot:toolbar>-->
-<!--            <el-button-->
-<!--              size="small"-->
-<!--              type="primary"-->
-<!--              icon="el-icon-plus"-->
-<!--              class="ele-btn-icon"-->
-<!--              :disabled="requiredFormingNum == 0 ? true : false"-->
-<!--              @click="openUnpack"-->
-<!--            >-->
-<!--              拆批-->
-<!--            </el-button>-->
-<!--          </template>-->
-
-<!--          <template v-slot:requiredFormingNum="scope">-->
-<!--            <el-form-item-->
-<!--              v-if="requiredFormingNum != 0"-->
-<!--              :prop="'surplusUnpack.' + scope.$index + '.requiredFormingNum'"-->
-<!--              :rules="[-->
-<!--                {-->
-<!--                  required: true,-->
-<!--                  message: '请输入要求生产数量',-->
-<!--                  trigger: 'change'-->
-<!--                },-->
-<!--                {-->
-<!--                  pattern: /^\d+(\.{0,1}\d+){0,1}$/,-->
-<!--                  message: '拆批数超过生产数量',-->
-<!--                  trigger: ['blur', 'change']-->
-<!--                }-->
-<!--              ]"-->
-<!--            >-->
-<!--              <el-input-->
-<!--                disabled-->
-<!--                v-model="requiredFormingNum"-->
-<!--                placeholder="请输入"-->
-<!--              ></el-input>-->
-<!--            </el-form-item>-->
-
-<!--            <el-form-item v-else> 工单已全部拆完 </el-form-item>-->
-<!--          </template>-->
-
-<!--          <template v-slot:splitResidue="scope">-->
-<!--            {{ formData.splitResidue }}-->
-<!--          </template>-->
-
-<!--        </ele-pro-table>-->
-
-<!--        <headerTitle title="拆批" class="mt20"> </headerTitle>-->
-
-        <ele-pro-table
-          ref="table"
-          :needPage="false"
-          :columns="columns"
-          :key="activeName"
-          :init-load="false"
-          :datasource="datasource"
-        >
-          <template v-slot:stockCount="{ row }">
-            <el-link type="primary" :underline="false" @click="stockDetail(row)">
-              {{ row.stockCount }}
-            </el-link>
-          </template>
-          <template v-slot:currentCount="{ row }">
-            <el-link type="primary" :underline="false" @click="currentDetail(row)">
-              {{ row.currentCount }}
-            </el-link>
-          </template>
-          <template v-slot:stockColor="{ row }">
-            <div :class="{'statusRed' : row.stockStatus == '缺料'}">
-              {{row.stockStatus}}
-            </div>
-          </template>
-          <template v-slot:currentColor="{ row }">
-            <div :class="{'statusRed' : row.currentStatus == '缺料'}">
-              {{row.currentStatus}}
-            </div>
-          </template>
-          <template v-slot:finishColor="{ row }">
-            <div :class="{'statusRed' : row.finishStatus == '缺料'}">
-              {{row.finishStatus}}
-            </div>
-          </template>
-          <template v-slot:finishCount="{ row }">
-            <div>
-              <div v-if="row.finishCount > 0">{{row.finishCount}}</div>
-              <div v-else>-</div>
-            </div>
-          </template>
-
-
-
-<!--          <template v-slot:requiredFormingNum="scope">-->
-<!--            <el-form-item-->
-<!--              :prop="'unpackList.' + scope.$index + '.requiredFormingNum'"-->
-<!--              :rules="{-->
-<!--                required: true,-->
-<!--                message: '请输入要求生产数量',-->
-<!--                trigger: 'change'-->
-<!--              }"-->
-<!--            >-->
-<!--              <el-input-number-->
-<!--                type="number"-->
-<!--                @change="changeNum(scope.$index)"-->
-<!--                :min="0"-->
-<!--                v-model="scope.row.requiredFormingNum"-->
-<!--                placeholder="请输入"-->
-<!--              ></el-input-number>-->
-<!--            </el-form-item>-->
-<!--          </template>-->
-
-<!--          <template v-slot:reqMoldTime="scope">-->
-<!--            <el-form-item-->
-<!--              :prop="'unpackList.' + scope.$index + '.reqMoldTime'"-->
-<!--              :rules="{-->
-<!--                required: true,-->
-<!--                message: '请选择开始计划时间',-->
-<!--                trigger: 'change'-->
-<!--              }"-->
-<!--            >-->
-<!--              <el-date-picker-->
-<!--                class="w100"-->
-<!--                v-model="scope.row.reqMoldTime"-->
-<!--                type="date"-->
-<!--                value-format="yyyy-MM-dd"-->
-<!--              ></el-date-picker>-->
-<!--            </el-form-item>-->
-<!--          </template>-->
-        </ele-pro-table>
-      </el-form>
     </div>
     <div slot="footer">
       <el-button plain @click="cancel">取消</el-button>
@@ -320,9 +196,21 @@
           },
         ],
         ids: [],
-        activeName: 'first',
+        leftShow: false,
+        leftWidth: '0%',
+        rightWidth: '100%',
       };
     },
+    watch: {
+      leftShow(newVal, oldVal){
+        if(newVal){
+          this.leftWidth = '30%';
+          this.rightWidth = '70%';
+        }
+      }
+    },
+    mounted() {
+    },
     methods: {
       reload(where) {
         this.$nextTick(() => {
@@ -346,7 +234,7 @@
       open(ids) {
          this.visible = true;
          this.ids = ids;
-         this.reload({planIds: ids});
+         // this.reload({planIds: ids});
       },
       cancel() {
         this.formData = {};
@@ -392,4 +280,10 @@
   .statusRed{
     color: red;
   }
+  .planInfo{
+
+  }
+  .form-wrapper{
+    display: flex;
+  }
 </style>

+ 24 - 1
src/views/productionPlan/components/productionPlan-search.vue

@@ -181,6 +181,25 @@
         </el-form-item>
       </el-col>
 
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 6 } : { span: 6 }">
+        <el-form-item label="加工方式:">
+          <el-select
+                  size="mini"
+                  clearable
+                  v-model="where.productType"
+                  placeholder="请选择"
+                  class="w100"
+          >
+            <el-option
+                    v-for="item in productTypeList"
+                    :label="item.name"
+                    :value="item.code"
+                    :key="item.code"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+
       <el-col v-bind="styleResponsive ? { lg: 6, md: 6 } : { span: 6 }">
         <div class="ele-form-actions">
           <el-button
@@ -229,7 +248,11 @@
         deliveryVal: 'deliveryTime',
         shapeVal: 'reqMoldTime',
         where: { ...defaultWhere },
-        treeData: []
+        treeData: [],
+        productTypeList: [
+          { code: 2, name: '加工(MBOM)' },
+          { code: 3, name: '装配(ABOM)' },
+        ],
       };
     },
     computed: {

+ 10 - 11
src/views/productionPlan/index.vue

@@ -282,7 +282,7 @@
 
         factoryShow: false,
         factoryType: 1,
-        factoryObj: {}
+        factoryObj: {},
       };
     },
     computed: {
@@ -605,18 +605,17 @@
     },
     methods: {
       homogeneityInspect(){
+        if(this.selection.length == 0){
+          this.$message.warning('请至少选择一条计划!');
+          return;
+        }
+        // for(let item of this.selection){
+        //   for(let )
+        // }
         if(this.selection.length > 0){
-          let ids = [];
-          this.selection.map(ele => {
-            if(ele.id){
-              ids.push(ele.id);
-            }
-
-          })
-          console.log(ids);
-          this.$refs.homogeneityInspectDialog.open(ids);
+          this.$refs.homogeneityInspectDialog.open(this.selection);
         } else {
-          this.$message.warning('请至少选择一条计划!');
+
         }
       },
       statusFormatter(status) {

+ 14 - 7
src/views/saleOrder/components/create-order.vue

@@ -174,15 +174,15 @@
 
 
 
-        <el-table-column label="加工方式" width="140" align="center" prop="produceType">
+        <el-table-column label="加工方式" width="140" align="center" prop="productType">
           <template slot-scope="scope">
             <el-form-item
               label-width="0px"
-              :prop="'productInfoList.' + scope.$index + '.produceType'"
+              :prop="'productInfoList.' + scope.$index + '.productType'"
 
             >
 
-              <el-select v-model="scope.row.produceType"   @change="changeProduceType(scope.row, scope.$index)" :key="scope.$index" >
+              <el-select v-model="scope.row.productType"   @change="changeProductType(scope.row, scope.$index)" :key="scope.$index" >
                   <el-option
                     v-for="item of producedList"
                     :key="scope.$index  + item.code"
@@ -385,7 +385,7 @@ export default {
         deliveryRequirements: 1,
         orderType: 1,
         orderLibraryType: 2,
-        produceType: 2,
+        productType: 2,
         bomCategoryId: '',
         produceRoutingId: '',
         deliveryTime: dayjs(
@@ -460,6 +460,13 @@ export default {
     },
     getDetail(code) {
       getOrderDetail(code).then((res) => {
+        if(res.productInfoList){
+          for(let item of res.productInfoList){
+            if(item.productType){
+              item.productType = parseInt(item.productType);
+            }
+          }
+        }
         this.disabledList = res.productInfoList;
         this.form = res;
       });
@@ -693,9 +700,9 @@ export default {
     },
 
 
-    changeProduceType(row, index) {
+    changeProductType(row, index) {
       let param = {
-        bomType:  row.produceType,
+        bomType:  row.productType,
         categoryId: row.categoryId
       }
       bomListByPlan(param).then(res => {
@@ -721,7 +728,7 @@ export default {
     },
 
     homogeneityInspect(row){
-      if(!row.produceType){
+      if(!row.productType){
         this.$message.warning('请选择加工方式');
         return;
       }

+ 17 - 4
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -45,6 +45,10 @@
 <!--      </el-form>-->
 
 <!--      <headerTitle title="剩余拆批" class="mt20"> </headerTitle>-->
+      <el-tabs v-model="activeName" @tab-click="tabClick()" type="card" size="mini">
+        <el-tab-pane label="自制件" name="first"></el-tab-pane>
+        <el-tab-pane label="装配件" name="second"></el-tab-pane>
+      </el-tabs>
       <el-form ref="form" :model="form" :rules="rules">
 <!--        <ele-pro-table-->
 <!--          ref="table"-->
@@ -172,7 +176,6 @@
   import { orderHomogeneityInspect } from '@/api/saleOrder/index.js';
   import stockDetailDialog from '../../productionPlan/components/stockDetailDialog.vue';
   import currentDetailDialog from '../../productionPlan/components/currentDetailDialog.vue';
-  import {homogeneityInspect} from "@/api/productionPlan";
   export default {
     components: {
       stockDetailDialog,
@@ -181,7 +184,8 @@
     data() {
       return {
         visible: false,
-
+        activeName: 'first',
+        bomIdList: [],
         formData: {},
         requestData: {
           deviceCode: '',
@@ -266,6 +270,14 @@
       };
     },
     methods: {
+      tabClick(){
+        if(this.activeName == 'first'){
+          this.reload({bomIdList: this.bomIdList, productType: 1});
+        }
+        if(this.activeName == 'second'){
+          this.reload({bomIdList: this.bomIdList, productType: 2});
+        }
+      },
         reload(where) {
           this.$nextTick(() => {
             this.$refs.table.reload({ page: 1, where });
@@ -273,7 +285,7 @@
         },
         /* 表格数据源 */
         datasource({ page, limit, where }) {
-          return homogeneityInspect({
+          return orderHomogeneityInspect({
             pageNum: page,
             size: limit,
             ...where,
@@ -287,7 +299,8 @@
        },
       open(data) {
          this.visible = true;
-         this.reload(data);
+         this.bomIdList = data;
+         this.reload({bomIdList: data});
       },
       cancel() {
         this.formData = {};

+ 33 - 4
src/views/saleOrder/index.vue

@@ -365,7 +365,7 @@
       this.requestDict('生产状态');
     },
     methods: {
-      check(){
+      async check(){
         if(this.selection.length > 0){
           let codeList = [];
           this.selection.map(ele => {
@@ -373,9 +373,38 @@
               codeList.push(ele.code);
             }
           })
-          // getByCodeList(codeList).then(res => {
-          //   console.log(res);
-          // })
+          let res = await getByCodeList(codeList)
+          console.log(res);
+          let flag = true;
+          let data = [];
+          if(res){
+            for(let ele of res){
+              let list = ele.productInfoList;
+              if(list){
+                for(let item of list){
+                  if(!item.productType){
+                    flag = false;
+                    this.$message.warning('产品(' + item.productCode + ')未选择加工方式');
+                    break;
+                  }
+                  if(!item.bomCategoryId){
+                    flag = false;
+                    this.$message.warning('产品(' + item.productCode + ')未选择BOM版本');
+                    break;
+                  }
+                  // JSON.parse(JSON.stringify({}))
+                  data.push({bomId: item.bomCategoryId, planNum: item.contractNum})
+                }
+              }
+              if(!flag){
+                break;
+              }
+            }
+          }
+          if(flag){
+            // 齐料
+            this.$refs.orderHomogeneityInspectDialog.open(data);
+          }
         } else {
           this.$message.warning('请至少选择一条计划!');
         }