Răsfoiți Sursa

禅道bug 2398 2349 996 1925 2085 2103 2163 修复

jingshuyong 10 luni în urmă
părinte
comite
d1b5c899f1

+ 26 - 4
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -6,7 +6,7 @@
       type == 'add' ? '创建' : type == 'detail' ? '详情' : '编辑'
     }领料申请单`"
     custom-class="ele-dialog-form"
-    :close-on-click-modal="true"
+    :close-on-click-modal="false"
     :close-on-press-escape="false"
     width="80%"
     :maxable="true"
@@ -548,6 +548,9 @@
         let workOrderIds = [];
         list.map((m) => {
           workOrderIds.push(m.id);
+          m.purchaseQuantity = m.purchaseQuantity
+            ? m.purchaseQuantity
+            : m.demandQuantity;
           return {
             ...m
           };
@@ -558,12 +561,19 @@
             res.forEach((m) => {
               if (m.materialList.length > 0) {
                 m.materialList.forEach((p) => {
+                  if (!p.demandQuantity && p.demandQuantity != 0) {
+                    p.demandQuantity = m.formingNum;
+                  }
+                  p.purchaseQuantity = p.purchaseQuantity
+                    ? p.purchaseQuantity
+                    : p.demandQuantity;
                   p.detailId = m.id;
                 });
               }
             });
-
-            this.$refs.table.setData([...this.tableData, ...res]);
+            let listArr = [...this.tableData, ...res];
+            console.log(listArr, 'listArr');
+            this.$refs.table.setData([...listArr]);
 
             this.$nextTick(() => {
               this.$refs.table.toggleRowExpansionAll();
@@ -584,6 +594,8 @@
       },
 
       chooseModal(data, current) {
+        console.log(data, 'data');
+        console.log(current, 'current');
         data.map((m) => {
           m.detailId = current.id;
 
@@ -602,9 +614,19 @@
             } else {
               e.materialList = [...e.materialList, ...data];
             }
+
+            e.materialList &&
+              e.materialList.map((i) => {
+                if (!i.demandQuantity && i.demandQuantity != 0) {
+                  i.demandQuantity = e.formingNum || 0;
+                }
+                i.purchaseQuantity = i.purchaseQuantity
+                  ? i.purchaseQuantity
+                  : i.demandQuantity;
+              });
           }
         });
-
+        console.log(tableList, 'tableList tableList');
         this.$refs.table.setData([...tableList]);
         this.$forceUpdate();
       },

+ 1 - 1
src/views/productionPlan/components/detail/plan.vue

@@ -79,7 +79,7 @@
           productRequirementInfo.productCode
         }}</el-descriptions-item>
         <el-descriptions-item label="牌号">{{
-          productionPlan.batchNo
+          productionPlan.brandNo
         }}</el-descriptions-item>
 
         <el-descriptions-item label="重量单位">{{

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

@@ -9,173 +9,183 @@
       :title="'齐套性检查'"
       :maxable="true"
     >
-      <div class="form-wrapper" v-loading="loading">
-        <div v-show="leftShow" :style="{ width: leftWidth }">
-          <el-tree
-            ref="treeRef"
-            :expand-on-click-node="false"
-            :data="cardList"
-            :props="treeProps"
-            node-key="id"
-            highlight-current
-            @node-click="handleNodeClick"
-          ></el-tree>
-        </div>
-        <div :style="{ width: rightWidth }">
-          <div v-if="!leftShow" class="planInfo">
-            <el-row style="width: 100%">
-              <!-- <el-col
-                :span="planInfo.salesCode ? 6 : planInfo.salesCode.length * 6"
-              >
-                <div style="color: blue; display: flex">
-                  <div>销售单号:</div
-                  ><div v-if="planInfo.salesCode"
-                    ><span v-for="item in planInfo.salesCode"
-                      > {{ item }}</span
-                    ></div
-                  >
-                </div>
-              </el-col> -->
-              
-              <!-- <el-col :span="6"> 批次号:{{ planInfo.batchNo }} </el-col> -->
-              <el-col :span="6"> 名称:{{ planInfo.productName }} </el-col>
-              <el-col :span="5"> 规格:{{ planInfo.specification }} </el-col>
-              <el-col :span="5"> 型号:{{ planInfo.model }} </el-col>
-              <el-col :span="2"> 牌号:{{ planInfo.brandNo }} </el-col>
-              <el-col :span="4"> 计划编号:{{ planInfo.code }} </el-col>
-              <el-col :span="2"> 计划数量:{{ planInfo.productNum }} </el-col>
-            </el-row>
-            <el-row> </el-row>
+      <div v-loading="loading">
+        <el-form label-width="80px" :model="planInfo" class="plan_form">
+          <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
+            <el-col :span="8">
+              <el-form-item label="名称:">
+                <el-input readonly v-model="planInfo.productName"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划编号:">
+                <el-input readonly v-model="planInfo.code"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="规格:">
+                <el-input readonly v-model="planInfo.specification"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="型号:">
+                <el-input readonly v-model="planInfo.model"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="牌号:">
+                <el-input readonly v-model="planInfo.brandNo"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计划数量:">
+                <el-input readonly v-model="planInfo.productNum"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div class="form-wrapper">
+          <div v-show="leftShow" :style="{ width: leftWidth }">
+            <el-tree
+              ref="treeRef"
+              :expand-on-click-node="false"
+              :data="cardList"
+              :props="treeProps"
+              node-key="id"
+              highlight-current
+              @node-click="handleNodeClick"
+            ></el-tree>
           </div>
-          <div>
-            <ele-pro-table
-              ref="table"
-              :needPage="false"
-              :columns="columns"
-              key="checkTable"
-              :init-load="false"
-              :datasource="datasourceList"
-            >
-              <template v-slot:toolbar>
-                <!-- <el-button type="primary" @click="bulkPurchase" size="mini"
+          <div :style="{ width: rightWidth }">
+            <div>
+              <ele-pro-table
+                ref="table"
+                :needPage="false"
+                :columns="columns"
+                key="checkTable"
+                :init-load="false"
+                :datasource="datasourceList"
+              >
+                <template v-slot:toolbar>
+                  <!-- <el-button type="primary" @click="bulkPurchase" size="mini"
                   >采购申请</el-button
                 > -->
-              </template>
-              <template v-slot:toolkit>
-                <el-form
-                  :inline="true"
-                  :model="formInline"
-                  class="demo-form-inline"
-                >
-                  <el-form-item label="BOM类型">
-                    <el-select
-                      size="mini"
-                      v-model="formInline.bomType"
-                      placeholder="BOM类型"
-                      class="select-type"
-                      @change="bomTypeChange"
-                    >
-                      <el-option
-                        v-for="item in bomListType"
-                        :key="item.id"
-                        :label="item.bomName"
-                        :value="item.id"
+                </template>
+                <template v-slot:toolkit>
+                  <el-form
+                    :inline="true"
+                    :model="formInline"
+                    class="demo-form-inline"
+                  >
+                    <el-form-item label="BOM类型">
+                      <el-select
+                        size="mini"
+                        v-model="formInline.bomType"
+                        placeholder="BOM类型"
+                        class="select-type"
+                        @change="bomTypeChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item label="BOM版本">
-                    <el-select
-                      class="select-type"
-                      size="mini"
-                      v-model="formInline.bomId"
-                      placeholder="BOM版本"
-                      @change="bomVChange"
-                    >
-                      <el-option
-                        v-for="item in bomListV"
-                        :key="item.bomId"
-                        :label="item.versions"
-                        :value="item.bomId"
+                        <el-option
+                          v-for="item in bomListType"
+                          :key="item.id"
+                          :label="item.bomName"
+                          :value="item.id"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                    <el-form-item label="BOM版本">
+                      <el-select
+                        class="select-type"
+                        size="mini"
+                        v-model="formInline.bomId"
+                        placeholder="BOM版本"
+                        @change="bomVChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item label="最终状态">
-                    <el-select
-                      class="select-type"
-                      size="mini"
-                      v-model="formInline.finalState"
-                      placeholder="最终状态"
-                      @change="finalChange"
-                    >
-                      <el-option
-                        v-for="item in finalStateList"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
+                        <el-option
+                          v-for="item in bomListV"
+                          :key="item.bomId"
+                          :label="item.versions"
+                          :value="item.bomId"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                    <el-form-item label="最终状态">
+                      <el-select
+                        class="select-type"
+                        size="mini"
+                        v-model="formInline.finalState"
+                        placeholder="最终状态"
+                        @change="finalChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-form>
-              </template>
-              <template v-slot:inventoryQuantity="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  @click="stockDetail(row)"
-                >
-                  {{ row.inventoryQuantity }}
-                </el-link>
-              </template>
-              <template v-slot:inTransitNum="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  @click="currentDetail(row)"
-                >
-                  {{ row.inTransitNum }}
-                </el-link>
-              </template>
-              <template v-slot:inventoryStatusText="{ row }">
-                <div
-                  :class="
-                    row.inventoryStatusText == '缺料'
-                      ? 'statusRed'
-                      : 'statusGreen'
-                  "
-                >
-                  {{ row.inventoryStatusText }}
-                </div>
-              </template>
-              <template v-slot:inTransitStatusText="{ row }">
-                <div
-                  :class="
-                    row.inTransitStatusText == '缺料'
-                      ? 'statusRed'
-                      : 'statusGreen'
-                  "
-                >
-                  {{ row.inTransitStatusText }}
-                </div>
-              </template>
-              <template v-slot:finalStateText="{ row }">
-                <div
-                  :class="
-                    row.finalStateText == '缺料' ? 'statusRed' : 'statusGreen'
-                  "
-                >
-                  {{ row.finalStateText }}
-                </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:action="{ row }">
+                        <el-option
+                          v-for="item in finalStateList"
+                          :key="item.value"
+                          :label="item.label"
+                          :value="item.value"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                  </el-form>
+                </template>
+                <template v-slot:inventoryQuantity="{ row }">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="stockDetail(row)"
+                  >
+                    {{ row.inventoryQuantity }}
+                  </el-link>
+                </template>
+                <template v-slot:inTransitNum="{ row }">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="currentDetail(row)"
+                  >
+                    {{ row.inTransitNum }}
+                  </el-link>
+                </template>
+                <template v-slot:inventoryStatusText="{ row }">
+                  <div
+                    :class="
+                      row.inventoryStatusText == '缺料'
+                        ? 'statusRed'
+                        : 'statusGreen'
+                    "
+                  >
+                    {{ row.inventoryStatusText }}
+                  </div>
+                </template>
+                <template v-slot:inTransitStatusText="{ row }">
+                  <div
+                    :class="
+                      row.inTransitStatusText == '缺料'
+                        ? 'statusRed'
+                        : 'statusGreen'
+                    "
+                  >
+                    {{ row.inTransitStatusText }}
+                  </div>
+                </template>
+                <template v-slot:finalStateText="{ row }">
+                  <div
+                    :class="
+                      row.finalStateText == '缺料' ? 'statusRed' : 'statusGreen'
+                    "
+                  >
+                    {{ row.finalStateText }}
+                  </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:action="{ row }">
                 <el-link
                   type="primary"
                   :underline="false"
@@ -184,7 +194,8 @@
                   采购申请
                 </el-link>
               </template> -->
-            </ele-pro-table>
+              </ele-pro-table>
+            </div>
           </div>
         </div>
       </div>
@@ -297,6 +308,7 @@
             align: 'center'
           },
           {
+            slot: 'inventoryQuantity',
             prop: 'inventoryQuantity',
             label: '库存数量',
             showOverflowTooltip: true,
@@ -529,6 +541,7 @@
           this.planId = data.id;
           const res = await findBomCategoryByCategoryId(data.categoryId);
           if (!res || res.length == 0) {
+            this.loading = false;
             this.bomListD = [];
             this.datasourceList = [];
             return;
@@ -605,4 +618,9 @@
     // display: flex;
     font-size: 16px;
   }
+  .plan_form {
+    .el-col {
+      margin-bottom: 16px;
+    }
+  }
 </style>

+ 301 - 246
src/views/productionPlan/components/unpackDialog.vue

@@ -1,11 +1,19 @@
 <template>
-  <ele-modal width="60vw" :visible.sync="visible" :close-on-click-modal="false" row-key="code"
-    custom-class="ele-dialog-form" :title="'拆分计划'" :maxable="true">
+  <ele-modal
+    width="60vw"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    row-key="code"
+    custom-class="ele-dialog-form"
+    :title="'拆分计划'"
+    :maxable="true"
+  >
     <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>
+            {{ formData.code }}</el-descriptions-item
+          >
 
           <el-descriptions-item label="产品编码">{{
             formData.productCode
@@ -16,7 +24,8 @@
           }}</el-descriptions-item>
 
           <el-descriptions-item label="牌号|型号">
-            {{ formData.brandNo }}|{{ formData.model }}</el-descriptions-item>
+            {{ formData.brandNo }}|{{ formData.model }}</el-descriptions-item
+          >
 
           <el-descriptions-item label="批次号">{{
             formData.batchNo
@@ -32,22 +41,34 @@
           <el-descriptions-item label="要求完成日期">{{
             formData.reqMoldTime
           }}</el-descriptions-item>
-
         </el-descriptions>
       </el-form>
 
       <headerTitle title="剩余拆批" class="mt20"> </headerTitle>
       <el-form ref="form" :model="form" :rules="rules">
-        <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.surplusUnpack">
+        <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
+              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'"
+            <el-form-item
+              v-if="requiredFormingNum != 0"
+              :prop="'surplusUnpack.' + scope.$index + '.requiredFormingNum'"
               :rules="[
                 {
                   required: true,
@@ -59,8 +80,13 @@
                   message: '拆批数超过生产数量',
                   trigger: ['blur', 'change']
                 }
-              ]">
-              <el-input disabled v-model="requiredFormingNum" placeholder="请输入"></el-input>
+              ]"
+            >
+              <el-input
+                disabled
+                v-model="requiredFormingNum"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
 
             <el-form-item v-else> 工单已全部拆完 </el-form-item>
@@ -69,42 +95,67 @@
           <template v-slot:splitResidue="scope">
             {{ formData.splitResidue }}
           </template>
-
         </ele-pro-table>
 
         <headerTitle title="拆批" class="mt20"> </headerTitle>
 
-        <ele-pro-table ref="table" :needPage="false" :columns="columns2" :datasource="form.unpackList">
+        <ele-pro-table
+          ref="table"
+          :needPage="false"
+          :columns="columns2"
+          :datasource="form.unpackList"
+        >
+          <template v-slot:batchNo="{ row }">
+            <el-input v-model="row.batchNo" placeholder="请输入"></el-input>
+          </template>
           <template v-slot:requiredFormingNum="scope">
-            <el-form-item :prop="'unpackList.' + scope.$index + '.requiredFormingNum'" :rules="{
-              required: true,
-              message: '请输入要求生产数量',
-              trigger: 'change'
-            }">
+            <el-form-item
+              :prop="'unpackList.' + scope.$index + '.requiredFormingNum'"
+              :rules="{
+                required: true,
+                message: '请输入要求生产数量',
+                trigger: 'change'
+              }"
+            >
               <!-- @change="changeNum(scope.$index)" @input="(scope.$index)"-->
               <!-- <el-input-number type="number" @input="inputNum"  :min="0" :max="maxNum"
                 v-model="scope.row.requiredFormingNum" placeholder="请输入"></el-input-number> -->
-              <el-input v-model="scope.row.requiredFormingNum" type="number" @input="changeNum(scope.$index)" :min="0"
-                placeholder="请输入内容"></el-input>
-
-
+              <el-input
+                v-model="scope.row.requiredFormingNum"
+                type="number"
+                @input="changeNum(scope.$index)"
+                :min="0"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
           </template>
 
           <template v-slot:reqMoldTime="scope">
-            <el-form-item :prop="'unpackList.' + scope.$index + '.reqMoldTime'" :rules="{
-              required: true,
-              message: '请选择开始计划时间',
-              trigger: 'change'
-            }">
+            <el-form-item
+              :prop="'unpackList.' + scope.$index + '.reqMoldTime'"
+              :rules="{
+                required: true,
+                message: '请选择开始计划时间',
+                trigger: 'change'
+              }"
+            >
               <!-- formData.reqMoldTime -->
-              <el-date-picker class="w100" v-model="scope.row.reqMoldTime" type="date" :picker-options="pickerOptions"
-                value-format="yyyy-MM-dd"></el-date-picker>
+              <el-date-picker
+                class="w100"
+                v-model="scope.row.reqMoldTime"
+                type="date"
+                :picker-options="pickerOptions"
+                value-format="yyyy-MM-dd"
+              ></el-date-picker>
             </el-form-item>
           </template>
 
           <template v-slot:action="{ $index }">
-            <el-popconfirm class="ele-action" title="确定要删除此子单吗?" @confirm="remove($index)">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此子单吗?"
+              @confirm="remove($index)"
+            >
               <template v-slot:reference>
                 <el-link type="danger" :underline="false" icon="el-icon-delete">
                   删除
@@ -123,249 +174,253 @@
 </template>
 
 <script>
-import { deepClone } from '@/utils';
-import { splitWork } from '@/api/productionPlan/index.js';
-export default {
-  components: {},
-  data() {
-    return {
-      visible: false,
-
-      formData: {},
-      requestData: {
-        deviceCode: '',
-        deviceName: '',
-        deviceId: ''
-      },
-      requiredFormingNum: 0,
-
-      pickerOptions: {
-        disabledDate: (time) => {
-          // 根据某个条件动态设置最大日期
-          if (this.formData.reqMoldTime) {
-            const maxDate = new Date(this.formData.reqMoldTime); // 您的逻辑方法
-            return time.getTime() > maxDate.getTime();
-          } else {
-            return false;
-          }
-
-        }
-      },
-
-      form: {
-        surplusUnpack: [],
-        unpackList: []
-      },
-
-      rules: {},
-
-      columns: [
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-          minWidth: 100,
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'joinPlanCode',
-          label: '计划编号',
-          align: 'center',
-          minWidth: 200
+  import { deepClone } from '@/utils';
+  import { splitWork } from '@/api/productionPlan/index.js';
+  export default {
+    components: {},
+    data() {
+      return {
+        visible: false,
+
+        formData: {},
+        requestData: {
+          deviceCode: '',
+          deviceName: '',
+          deviceId: ''
         },
-
-        {
-          prop: 'requiredFormingNum',
-          label: '要求生产数量',
-          align: 'center',
-          slot: 'requiredFormingNum',
-          minWidth: 200
+        requiredFormingNum: 0,
+
+        pickerOptions: {
+          disabledDate: (time) => {
+            // 根据某个条件动态设置最大日期
+            if (this.formData.reqMoldTime) {
+              const maxDate = new Date(this.formData.reqMoldTime); // 您的逻辑方法
+              return time.getTime() > maxDate.getTime();
+            } else {
+              return false;
+            }
+          }
         },
 
-      ],
-
-      columns2: [
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-          minWidth: 100,
-          showOverflowTooltip: true
+        form: {
+          surplusUnpack: [],
+          unpackList: []
         },
-        {
-          prop: 'joinPlanCode',
-          label: '计划编号',
-          align: 'center',
-          minWidth: 200
-        },
-        {
-          prop: 'requiredFormingNum',
-          label: '要求生产数量',
-          align: 'center',
-          slot: 'requiredFormingNum',
-          minWidth: 200
-        },
-        {
-          prop: 'reqMoldTime',
-          label: '要求完成日期',
-          align: 'center',
-          slot: 'reqMoldTime',
-          minWidth: 200
-        },
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 160,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-
-
-    };
-  },
-  methods: {
-    open(row) {
-      this.visible = true;
-      this.formData = deepClone(row);
-
-      console.log(this.formData);
-
-      if (this.formData.splitBatch == 1) {
-        this.columns[2].label = '剩余数量'
-        this.requiredFormingNum = this.formData.splitResidue;
-      } else {
-        this.requiredFormingNum = this.formData.requiredFormingNum;
-      }
-
 
-
-
-      this.form.surplusUnpack = [];
-      this.form.unpackList = [];
-      this.setSurplus();
-    },
-
-    setSurplus() {
-      this.form.surplusUnpack.push({
-        joinPlanCode: this.formData.code,
-        requiredFormingNum: this.formData.splitBatch == 1 ? this.formData.splitResidue : this.formData.requiredFormingNum,
-        batchNo: this.formData.batchNo,
-        isCopy: 1
-      });
+        rules: {},
+
+        columns: [
+          {
+           
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'joinPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 200
+          },
+
+          {
+            prop: 'requiredFormingNum',
+            label: '要求生产数量',
+            align: 'center',
+            slot: 'requiredFormingNum',
+            minWidth: 200
+          }
+        ],
+
+        columns2: [
+          {
+             slot: 'batchNo',
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'joinPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 200
+          },
+          {
+            prop: 'requiredFormingNum',
+            label: '要求生产数量',
+            align: 'center',
+            slot: 'requiredFormingNum',
+            minWidth: 200
+          },
+          {
+            prop: 'reqMoldTime',
+            label: '要求完成日期',
+            align: 'center',
+            slot: 'reqMoldTime',
+            minWidth: 200
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 160,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
+    methods: {
+      open(row) {
+        this.visible = true;
+        this.formData = deepClone(row);
+
+        console.log(this.formData);
+
+        if (this.formData.splitBatch == 1) {
+          this.columns[2].label = '剩余数量';
+          this.requiredFormingNum = this.formData.splitResidue;
+        } else {
+          this.requiredFormingNum = this.formData.requiredFormingNum;
+        }
 
-    openUnpack() {
-      this.form.unpackList.push({
-        joinPlanCode: this.formData.code,
-        batchNo: this.formData.batchNo,
-        requiredFormingNum: '',
-        reqMoldTime: ''
-      });
-    },
+        this.form.surplusUnpack = [];
+        this.form.unpackList = [];
+        this.setSurplus();
+      },
 
-    changeNum(index) {
-      console.log(index, '111111111111');
-
-      let num = this.formData.splitBatch == 1 ? this.formData.splitResidue : this.formData.requiredFormingNum
-      this.form.unpackList.forEach((e) => {
-        if (
-          e.requiredFormingNum != null &&
-          e.requiredFormingNum != undefined
-        ) {
-          num = num - Number(e.requiredFormingNum);
-          if (num >= 0) {
-            this.requiredFormingNum = num;
-          } else {
-            this.$nextTick(() => {
-              this.$set(this.form.unpackList[index], 'requiredFormingNum', 0);
-            });
-            this.$message.error('拆批数超过生产数量');
-
-            return;
-          }
-        }
-      });
-    },
+      setSurplus() {
+        this.form.surplusUnpack.push({
+          joinPlanCode: this.formData.code,
+          requiredFormingNum:
+            this.formData.splitBatch == 1
+              ? this.formData.splitResidue
+              : this.formData.requiredFormingNum,
+          batchNo: this.formData.batchNo,
+          isCopy: 1
+        });
+      },
 
-    remove(index) {
-      this.form.unpackList.splice(index, 1);
-      if (this.form.unpackList.length == 0) {
-        this.requiredFormingNum = this.formData.splitBatch == 1 ? this.formData.splitResidue : this.formData.requiredFormingNum
-      } else {
-        this.changeNum(index);
-      }
-    },
+      openUnpack() {
+        this.form.unpackList.push({
+          joinPlanCode: this.formData.code,
+          batchNo: this.formData.batchNo,
+          requiredFormingNum: '',
+          reqMoldTime: ''
+        });
+      },
 
-    cancel() {
-      this.formData = {};
-      this.visible = false;
-      // this.$refs.form.resetFields();
-    },
+      changeNum(index) {
+        console.log(index, '111111111111');
 
-    confirm() {
-      this.$refs.form.validate(async (value) => {
-        if (value) {
+        let num =
+          this.formData.splitBatch == 1
+            ? this.formData.splitResidue
+            : this.formData.requiredFormingNum;
+        this.form.unpackList.forEach((e) => {
           if (
-            this.form.unpackList.length == 1 &&
-            this.form.unpackList[0].requiredFormingNum ==
-            this.formData.requiredFormingNum
+            e.requiredFormingNum != null &&
+            e.requiredFormingNum != undefined
           ) {
-            this.$message.info('拆批数要大于1');
-            return false;
+            num = num - Number(e.requiredFormingNum);
+            if (num >= 0) {
+              this.requiredFormingNum = num;
+            } else {
+              this.$nextTick(() => {
+                this.$set(this.form.unpackList[index], 'requiredFormingNum', 0);
+              });
+              this.$message.error('拆批数超过生产数量');
+
+              return;
+            }
           }
+        });
+      },
 
-          if (
-            this.form.surplusUnpack.length == 1 &&
-            this.form.unpackList.length == 0
-          ) {
-            this.$message.info('拆批数要大于1');
-            return false;
-          }
+      remove(index) {
+        this.form.unpackList.splice(index, 1);
+        if (this.form.unpackList.length == 0) {
+          this.requiredFormingNum =
+            this.formData.splitBatch == 1
+              ? this.formData.splitResidue
+              : this.formData.requiredFormingNum;
+        } else {
+          this.changeNum(index);
+        }
+      },
 
-          let params = [];
-          // console.log(this.requiredFormingNum,'22222222223333');
-          // if (this.requiredFormingNum != 0) {
-            this.form.surplusUnpack[0].requiredFormingNum =this.requiredFormingNum;
+      cancel() {
+        this.formData = {};
+        this.visible = false;
+        // this.$refs.form.resetFields();
+      },
+
+      confirm() {
+        this.$refs.form.validate(async (value) => {
+          if (value) {
+            if (
+              this.form.unpackList.length == 1 &&
+              this.form.unpackList[0].requiredFormingNum ==
+                this.formData.requiredFormingNum
+            ) {
+              this.$message.info('拆批数要大于1');
+              return false;
+            }
+
+            if (
+              this.form.surplusUnpack.length == 1 &&
+              this.form.unpackList.length == 0
+            ) {
+              this.$message.info('拆批数要大于1');
+              return false;
+            }
+
+            let params = [];
+            // console.log(this.requiredFormingNum,'22222222223333');
+            // if (this.requiredFormingNum != 0) {
+            this.form.surplusUnpack[0].requiredFormingNum =
+              this.requiredFormingNum;
             params = [...this.form.unpackList, ...this.form.surplusUnpack];
-          // } else {
-          //   params = this.form.unpackList;
-          // }
+            // } else {
+            //   params = this.form.unpackList;
+            // }
 
-          // console.log(this.form.surplusUnpack,'2222222222');
+            // console.log(this.form.surplusUnpack,'2222222222');
 
-          // form.surplusUnpack
-          // console.log(params, '拆分参数----------------------');
+            // form.surplusUnpack
+            // console.log(params, '拆分参数----------------------');
 
-          // return;
+            // return;
 
-          const res = await splitWork(params);
-          
-          if (res) {
-            this.$message.success('拆分成功!');
+            const res = await splitWork(params);
 
+            if (res) {
+              this.$message.success('拆分成功!');
 
-            this.$emit('success',[]);
-            this.cancel();
+              this.$emit('success', []);
+              this.cancel();
+            }
           }
-        }
-      });
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.mt20 {
-  margin-top: 20px;
-}
+  .mt20 {
+    margin-top: 20px;
+  }
 
-.el-form-item {
-  margin-bottom: 0 !important;
-}
+  .el-form-item {
+    margin-bottom: 0 !important;
+  }
 </style>

+ 25 - 23
src/views/productionPlan/index.vue

@@ -807,29 +807,30 @@
           this.$message.warning('请至少选择一条计划!');
           return;
         }
-        let flag = false;
-        let type = 0;
-        for (let item of this.selection) {
-          type = item.produceType;
-          for (let ele of this.selection) {
-            if (item.produceType != ele.produceType) {
-              flag = true;
-              break;
-            }
-          }
-        }
-        if (flag) {
-          this.$message.warning('请选择生产类型相同的计划!');
-          return;
-        }
-        console.log(type);
-        if (type == 2) {
-          this.$refs.homogeneityInspectDialog.open(this.selection);
-        } else if (type == 3) {
-          this.$refs.homogeneityInspectInstallDialog.open(this.selection);
-        } else {
-          this.$message.warning('请确认生产类型!');
-        }
+        this.$refs.homogeneityInspectDialog.open(this.selection);
+        // let flag = false;
+        // let type = 0;
+        // for (let item of this.selection) {
+        //   type = item.produceType;
+        //   for (let ele of this.selection) {
+        //     if (item.produceType != ele.produceType) {
+        //       flag = true;
+        //       break;
+        //     }
+        //   }
+        // }
+        // if (flag) {
+        //   this.$message.warning('请选择生产类型相同的计划!');
+        //   return;
+        // }
+        // console.log(type);
+        // if (type == 2) {
+        //   this.$refs.homogeneityInspectDialog.open(this.selection);
+        // } else if (type == 3) {
+        //   this.$refs.homogeneityInspectInstallDialog.open(this.selection);
+        // } else {
+        //   this.$message.warning('请确认生产类型!');
+        // }
       },
       statusFormatter(status) {
         const obj = this.statusOpt[this.activeName].find(
@@ -1028,6 +1029,7 @@
 
       // 拆批
       toUnpack(row) {
+        console.log(1111111111111)
         if (!row.batchNo) {
           return this.$message.error('请先填写批次号!');
         }

+ 2 - 0
src/views/saleOrder/components/EquipmentDialog.vue

@@ -191,6 +191,8 @@
       },
       reset() {
         this.code = null;
+        this.searchKey = null;
+        this.name = null;
         this.reload();
       },
       // 设置选中

+ 2 - 0
src/views/saleOrder/components/order-search.vue

@@ -559,6 +559,7 @@
         this.$refs.groupDialog.open();
       },
       goProduct() {
+        console.log(this.selection,'this.selection 33')
         if (!this.selection.length) {
           return this.$message.warning('请先勾选一个或多个订单!');
         }
@@ -625,6 +626,7 @@
         this.$router.push({
           path: '/saleOrder/salesToProduction',
           query: {
+            orderType,
             selection: JSON.stringify(list),
             produceRoutingId: produceRoutingId,
             produceRoutingName: this.selection[0].produceRoutingName,

+ 162 - 124
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -9,26 +9,44 @@
       :title="'齐套性检查'"
       :maxable="true"
     >
-      <div class="form-wrapper" v-loading="loading">
-        <div v-show="leftShow" :style="{ width: leftWidth }">
-          <el-tree
-            ref="treeRef"
-            :expand-on-click-node="false"
-            :data="cardList"
-            :props="treeProps"
-            node-key="id"
-            highlight-current
-            @node-click="handleNodeClick"
-          ></el-tree>
-        </div>
-        <div :style="{ width: rightWidth }">
-          <div v-if="!leftShow" class="planInfo">
+      <div v-loading="loading">
+        <el-form label-width="80px" :model="orderInfo" class="order_form">
+          <el-row :gutter="20" type="flex" style="flex-wrap: wrap;">
+            <el-col :span="8">
+              <el-form-item label="销售单号:">
+                <el-input readonly v-model="orderInfo.code"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="编号:">
+                <el-input readonly v-model="orderInfo.productCode"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="名称:">
+                <el-input readonly v-model="orderInfo.productName"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="规格:">
+                <el-input readonly v-model="orderInfo.specification"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="型号:">
+                <el-input readonly v-model="orderInfo.model"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="合同数量:">
+                <el-input readonly v-model="orderInfo.contractNum"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div class="form-wrapper">
+          <!-- <div>
             <el-row style="width: 100%">
-              <!--            <el-col :span="planInfo.salesCode ? 6 : planInfo.salesCode.length * 6">-->
-              <!--              <div style="color: blue; display: flex;">-->
-              <!--                <div>销售单号:</div><div v-if="planInfo.salesCode"><span v-for="item in planInfo.salesCode"> {{item}}</span></div>-->
-              <!--              </div>-->
-              <!--            </el-col>-->
               <el-col :span="6"> 销售单号:{{ orderInfo.code }} </el-col>
               <el-col :span="6"> 编号:{{ orderInfo.productCode }} </el-col>
               <el-col :span="6"> 名称:{{ orderInfo.productName }} </el-col>
@@ -36,115 +54,128 @@
               <el-col :span="6"> 型号:{{ orderInfo.model }} </el-col>
               <el-col :span="6"> 合同数量:{{ orderInfo.contractNum }} </el-col>
             </el-row>
+          </div> -->
+          <div v-show="leftShow" :style="{ width: leftWidth }">
+            <el-tree
+              ref="treeRef"
+              :expand-on-click-node="false"
+              :data="cardList"
+              :props="treeProps"
+              node-key="id"
+              highlight-current
+              @node-click="handleNodeClick"
+            ></el-tree>
           </div>
-          <div>
-            <ele-pro-table
-              ref="table"
-              :needPage="false"
-              :columns="columns"
-              key="checkTable"
-              :init-load="false"
-              :datasource="datasourceList"
-            >
-              <template v-slot:toolkit>
-                <el-form
-                  :inline="true"
-                  :model="formInline"
-                  class="demo-form-inline"
-                >
-                  <el-form-item label="BOM类型">
-                    <el-select
-                      size="mini"
-                      v-model="formInline.bomType"
-                      placeholder="BOM类型"
-                      class="select-type"
-                      @change="bomTypeChange"
-                    >
-                      <el-option
-                        v-for="item in bomListType"
-                        :key="item.id"
-                        :label="item.bomName"
-                        :value="item.id"
+          <div :style="{ width: rightWidth }">
+            <div>
+              <ele-pro-table
+                ref="table"
+                :needPage="false"
+                :columns="columns"
+                key="checkTable"
+                :init-load="false"
+                :datasource="datasourceList"
+              >
+                <template v-slot:toolkit>
+                  <el-form
+                    :inline="true"
+                    :model="formInline"
+                    class="demo-form-inline"
+                  >
+                    <el-form-item label="BOM类型">
+                      <el-select
+                        size="mini"
+                        v-model="formInline.bomType"
+                        placeholder="BOM类型"
+                        class="select-type"
+                        @change="bomTypeChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item label="BOM版本">
-                    <el-select
-                      class="select-type"
-                      size="mini"
-                      v-model="formInline.bomId"
-                      placeholder="BOM版本"
-                      @change="bomVChange"
-                    >
-                      <el-option
-                        v-for="item in bomListV"
-                        :key="item.bomId"
-                        :label="item.versions"
-                        :value="item.bomId"
+                        <el-option
+                          v-for="item in bomListType"
+                          :key="item.id"
+                          :label="item.bomName"
+                          :value="item.id"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                    <el-form-item label="BOM版本">
+                      <el-select
+                        class="select-type"
+                        size="mini"
+                        v-model="formInline.bomId"
+                        placeholder="BOM版本"
+                        @change="bomVChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                  <el-form-item label="最终状态">
-                    <el-select
-                      class="select-type"
-                      size="mini"
-                      v-model="formInline.finalState"
-                      placeholder="最终状态"
-                      @change="finalChange"
-                    >
-                      <el-option
-                        v-for="item in finalStateList"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
+                        <el-option
+                          v-for="item in bomListV"
+                          :key="item.bomId"
+                          :label="item.versions"
+                          :value="item.bomId"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                    <el-form-item label="最终状态">
+                      <el-select
+                        class="select-type"
+                        size="mini"
+                        v-model="formInline.finalState"
+                        placeholder="最终状态"
+                        @change="finalChange"
                       >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-form>
-              </template>
-              <template v-slot:inventoryQuantity="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  @click="stockDetail(row)"
-                >
-                  {{ row.inventoryQuantity }}
-                </el-link>
-              </template>
-              <template v-slot:inTransitNum="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  @click="currentDetail(row)"
-                >
-                  {{ row.inTransitNum }}
-                </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>
+                        <el-option
+                          v-for="item in finalStateList"
+                          :key="item.value"
+                          :label="item.label"
+                          :value="item.value"
+                        >
+                        </el-option>
+                      </el-select>
+                    </el-form-item>
+                  </el-form>
+                </template>
+                <template v-slot:inventoryQuantity="{ row }">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="stockDetail(row)"
+                  >
+                    {{ row.inventoryQuantity }}
+                  </el-link>
+                </template>
+                <template v-slot:inTransitNum="{ row }">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="currentDetail(row)"
+                  >
+                    {{ row.inTransitNum }}
+                  </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>
         </div>
       </div>
@@ -456,6 +487,7 @@
           this.salesOrderId = data.id;
           const res = await findBomSalesorderCategoryId(data.categoryId);
           if (!res || res.length == 0) {
+               this.loading = false;
             this.bomListD = [];
             this.datasourceList = [];
             return;
@@ -581,4 +613,10 @@
   .form-wrapper {
     display: flex;
   }
+
+  .order_form{
+    .el-col{
+      margin-bottom: 16px;
+    }
+  }
 </style>

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

@@ -463,28 +463,28 @@
               if (list) {
                 let pre = null;
                 for (let item of list) {
-                  if (!item.productType) {
-                    flag = false;
-                    this.$message.warning(
-                      '产品(' + item.productCode + ')未选择生产类型'
-                    );
-                    return;
-                  }
-                  type = item.productType;
-                  if (!item.bomCategoryId) {
-                    flag = false;
-                    this.$message.warning(
-                      '产品(' + item.productCode + ')未选择BOM版本'
-                    );
-                    return;
-                  }
-                  if (pre) {
-                    if (pre.productType != item.productType) {
-                      flag = false;
-                      this.$message.warning('请选择生产类型相同的订单');
-                      return;
-                    }
-                  }
+                  // if (!item.productType) {
+                  //   flag = false;
+                  //   this.$message.warning(
+                  //     '产品(' + item.productCode + ')未选择生产类型'
+                  //   );
+                  //   return;
+                  // }
+                  // type = item.productType;
+                  // if (!item.bomCategoryId) {
+                  //   flag = false;
+                  //   this.$message.warning(
+                  //     '产品(' + item.productCode + ')未选择BOM版本'
+                  //   );
+                  //   return;
+                  // }
+                  // if (pre) {
+                  //   if (pre.productType != item.productType) {
+                  //     flag = false;
+                  //     this.$message.warning('请选择生产类型相同的订单');
+                  //     return;
+                  //   }
+                  // }
                   pre = item;
                   // JSON.parse(JSON.stringify({}))
                   data.push(item.id);
@@ -495,16 +495,17 @@
             }
           }
           console.log(data2,'data2 333333')
-          if (flag) {
-            // 齐料
-            if (type == 2) {
-              this.$refs.orderHomogeneityInspectDialog.open(data2, first);
-            } else if (type == 3) {
-              this.$refs.orderHomogeneityInspectInstallDialog.open(data);
-            } else {
-              this.$message.warning('请确认生产类型!');
-            }
-          }
+          this.$refs.orderHomogeneityInspectDialog.open(data2, first);
+          // if (flag) {
+          //   // 齐料
+          //   if (type == 2) {
+          //     this.$refs.orderHomogeneityInspectDialog.open(data2, first);
+          //   } else if (type == 3) {
+          //     this.$refs.orderHomogeneityInspectInstallDialog.open(data);
+          //   } else {
+          //     this.$message.warning('请确认生产类型!');
+          //   }
+          // }
         } else {
           this.$message.warning('请至少选择一条计划!');
         }

+ 9 - 1
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -1410,7 +1410,15 @@
         this.changeData();
       },
       addEquipment() {
-        this.$refs.additionalRefs.open(this.form.planType);
+        let query = this.$route.query;
+        let orderType = query.orderType;
+        let arr = this.form.salesOrders;
+        if (arr && arr.length > 0) {
+          if (!orderType && orderType !== '0') {
+            orderType = arr[0].orderType;
+          }
+        }
+        this.$refs.additionalRefs.open(orderType);
       },
       openVersion() {
         this.$refs.versionRefs.open();