695593266@qq.com hai 11 meses
pai
achega
dc1cd5461c
Modificáronse 3 ficheiros con 124 adicións e 21 borrados
  1. 106 9
      src/views/materialPlan/components/producePlan.vue
  2. 16 10
      src/views/workOrder/index.vue
  3. 2 2
      vue.config.js

+ 106 - 9
src/views/materialPlan/components/producePlan.vue

@@ -89,6 +89,61 @@
         </template>
 
         <template v-slot:bomId="{ row }">
+          <el-select
+            v-if="row.bomType == '1'"
+            v-model="row.bomId"
+            placeholder="请选择"
+            style="width: 100%"
+            :disabled="type == 'detail'"
+            @change="changeVersions(row)"
+          >
+            <!-- <el-option
+              v-for="item in row.bomCategoryList"
+              :key="item.bomType == row.bomType ? item.id : ''"
+              :label="
+                item.bomType == row.bomType ? 'V' + item.versions + '.0' : ''
+              "
+              :value="item.bomType == row.bomType ? item.id : ''"
+              v-if="item.id !== ''"
+            >
+            </el-option> -->
+            <el-option
+              v-for="item in getPBOMData(row)"
+              :key="item.id"
+              :label="'V' + item.versions + '.0'"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+          <el-select
+            v-if="row.bomType == '2'"
+            v-model="row.bomId"
+            placeholder="请选择"
+            style="width: 100%"
+            :disabled="type == 'detail'"
+            @change="changeVersions(row)"
+          >
+            <!-- <el-option
+              v-for="item in row.bomCategoryList"
+              :key="item.bomType == row.bomType ? item.id : ''"
+              :label="
+                item.bomType == row.bomType ? 'V' + item.versions + '.0' : ''
+              "
+              :value="item.bomType == row.bomType ? item.id : ''"
+              v-if="item.id !== ''"
+            >
+            </el-option> -->
+            <el-option
+              v-for="item in getMBOMData(row)"
+              :key="item.id"
+              :label="'V' + item.versions + '.0'"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </template>
+
+        <!-- <template v-slot:bomId="{ row }">
           <el-select
             v-model="row.bomId"
             placeholder="请选择"
@@ -104,6 +159,24 @@
             >
             </el-option>
           </el-select>
+        </template> -->
+
+        <template v-slot:bomType="{ row }">
+          <el-select
+            v-model="row.bomType"
+            placeholder="请选择"
+            style="width: 100%"
+            :disabled="type == 'detail'"
+            @change="changeType(row, row.bomType)"
+          >
+            <el-option
+              v-for="item in bomTypeList"
+              :key="item.id"
+              :label="item.label"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
         </template>
 
         <template v-slot:action="{ row, $index }" v-if="type != 'detail'">
@@ -402,8 +475,8 @@
           timeList: []
         },
         bomTypeList: [
-          { id: 1, label: 'PBOM' },
-          { id: 2, label: 'MBOM' }
+          { id: '1', label: 'PBOM' },
+          { id: '2', label: 'MBOM' }
         ],
         batchVisible: false,
         multipleSelection: [],
@@ -436,6 +509,8 @@
           }
         ],
         expandedRowKeys: [],
+        bomType: 1,
+
         rules: {
           demandType: [
             {
@@ -558,13 +633,12 @@
             align: 'center'
           },
 
-          // {
-          //   prop: 'bomId',
-          //   label: '选择BOM类型',
-          //   slot: 'bomType',
-          //   align: 'center',
-          //   minWidth: 110
-          // },
+          {
+            label: '选择BOM类型',
+            slot: 'bomType',
+            align: 'center',
+            minWidth: 110
+          },
           {
             prop: 'bomId',
             label: '选择BOM版本',
@@ -876,6 +950,29 @@
         this.$refs.table.setData([...tableList]);
         this.$forceUpdate();
       },
+
+      changeType(row, value) {
+        // console.log(1121313123);
+        if (value == '1') {
+          this.getPBOMData(row);
+          // this.changeVersions(row)
+        } else if (value == '2') {
+          this.getMBOMData(row);
+          // this.changeVersions(row)
+        }
+      },
+      getPBOMData(row) {
+        const data = row.bomCategoryList.filter((item) => item.bomType == '1');
+
+        return data;
+        // console.log('PBOM', row);
+      },
+
+      getMBOMData(row) {
+        const data = row.bomCategoryList.filter((item) => item.bomType == '2');
+
+        return data;
+      },
       remove2(row) {
         const data = this.$refs.table.getData() ?? [];
         this.formData.materialRemoveIds.push(row.categoryId);

+ 16 - 10
src/views/workOrder/index.vue

@@ -91,16 +91,22 @@
             拆单
           </el-link>
 
-          <!-- <el-link type="primary" :underline="false" icon="el-icon-truck" @click="toRelease(row)" v-if="
-            row.isSplit != 1 &&
-            (clientEnvironmentId != '4' && row.status == 8) ||
-            (clientEnvironmentId == '4' &&
-              !row.productName.includes('板材') &&
-              row.status == 8)
-          ">
-            派单
-          </el-link> -->
           <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            @click="toRelease(row)"
+            v-if="
+              (row.isSplit != 1 &&
+                clientEnvironmentId != '4' &&
+                row.status == 8) ||
+              (clientEnvironmentId == '4' &&
+                !row.productName.includes('板材') &&
+                row.status == 8)
+            "
+          >
+          </el-link>
+          <!-- <el-link
             type="primary"
             :underline="false"
             icon="el-icon-truck"
@@ -115,7 +121,7 @@
             "
           >
             派单
-          </el-link>
+          </el-link> -->
         </template>
       </ele-pro-table>
     </el-card>

+ 2 - 2
vue.config.js

@@ -35,8 +35,8 @@ module.exports = {
         // target: 'http://192.168.1.103:18086',
         // target: 'http://192.168.1.158:18086',
         // 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:18086',
+        // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.125:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域