695593266@qq.com пре 11 месеци
родитељ
комит
5fa39b4579

+ 52 - 51
src/views/material/BOMmanage/components/attribute.vue

@@ -1,6 +1,5 @@
 <template>
   <div>
-    
     <el-form
       label-width="100px"
       :rules="rules"
@@ -8,7 +7,6 @@
       :model="attributeData"
     >
       <el-row>
-     
         <el-col :span="8" label-width="100px">
           <el-form-item label="名称:" prop="name">
             <el-input
@@ -84,7 +82,6 @@
             <el-input
               placeholder=""
               v-model="category.packingUnit"
-              
               disabled
             ></el-input>
           </el-form-item>
@@ -95,7 +92,6 @@
             <el-input
               placeholder=""
               v-model="category.roughWeight"
-            
               disabled
             ></el-input>
           </el-form-item>
@@ -129,7 +125,7 @@
           <el-form-item label="生产类型:" prop="produceType">
             <el-select
               v-model="attributeData?.category.produceType"
-               disabled
+              disabled
               filterable
               multiple
               class="ele-block"
@@ -143,7 +139,6 @@
             </el-select>
           </el-form-item>
         </el-col>
-   
 
         <el-col :span="8" label-width="100px">
           <el-form-item label="存货类型:" prop="attributeType">
@@ -187,7 +182,7 @@
             <el-input
               placeholder=""
               v-model="attributeData.materialsName"
-               :disabled="attributeData.approvalStatus != 0"
+              :disabled="attributeData.approvalStatus != 0"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -197,7 +192,7 @@
             <el-input
               placeholder=""
               v-model="attributeData.bomTypeRouting"
-               :disabled="attributeData.approvalStatus != 0"
+              :disabled="attributeData.approvalStatus != 0"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -209,7 +204,7 @@
             <el-input
               placeholder=""
               v-model="attributeData.sourceData"
-               :disabled="attributeData.approvalStatus != 0"
+              :disabled="attributeData.approvalStatus != 0"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -237,21 +232,19 @@
             <el-input
               placeholder=""
               v-model="attributeData.materielPath"
-               :disabled="attributeData.approvalStatus != 0"
+              :disabled="attributeData.approvalStatus != 0"
             ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
 
-
-
       <el-row>
         <el-col :span="20" label-width="100px">
           <el-form-item label="备注" prop="name">
             <el-input
               placeholder=""
               v-model="attributeData.remake"
-               :disabled="attributeData.approvalStatus != 0"
+              :disabled="attributeData.approvalStatus != 0"
               type="textarea"
               :rows="2"
             ></el-input>
@@ -281,19 +274,20 @@
         </el-col>
       </el-row>
       <el-col :span="8" label-width="100px">
-         
-         <el-form-item label="来源版本号" prop="name">
-           <!-- {{ attributeData }} -->
-           <el-input
-             placeholder=""
-             disabled
-             v-model="attributeData.resourceBomVersion"
-           ></el-input>
-         </el-form-item>
-       </el-col>
+        <el-form-item label="来源版本号" prop="name">
+          <!-- {{ attributeData }} -->
+          <el-input
+            placeholder=""
+            disabled
+            v-model="attributeData.resourceBomVersion"
+          ></el-input>
+        </el-form-item>
+      </el-col>
 
       <div class="btn_box" v-if="attributeData.status != 1">
-        <el-button type="primary" @click="handleUpdate" v-if="!isWt">保存</el-button>
+        <el-button type="primary" @click="handleUpdate" v-if="!isWt"
+          >保存</el-button
+        >
       </div>
     </el-form>
   </div>
@@ -314,9 +308,9 @@
         category: {
           name: ''
         },
-        attributeData: {
-          baseCount:1,
-        },
+        // attributeData: {
+        //   baseCount:1,
+        // },
 
         statusOptions: [
           {
@@ -350,27 +344,28 @@
           {
             label: '装配',
             value: 3
-          },
+          }
         ],
         lbjtList: [
-        {
-          label: '自制件',
-          value: 1
-        },
-        {
-          label: '采购件',
-          value: 2
-        },
-        {
-          label: '外协件',
-          value: 3
-        }, {
-          label: '受托件',
-          value: 4
-        }
-      ],
+          {
+            label: '自制件',
+            value: 1
+          },
+          {
+            label: '采购件',
+            value: 2
+          },
+          {
+            label: '外协件',
+            value: 3
+          },
+          {
+            label: '受托件',
+            value: 4
+          }
+        ],
         attributeList: [
-        {
+          {
             label: '总装',
             value: 1
           },
@@ -381,7 +376,8 @@
           {
             label: '零件',
             value: 3
-          },{
+          },
+          {
             label: '原材料',
             value: 4
           }
@@ -392,10 +388,11 @@
           dosage: [{ required: true, message: ' ', trigger: 'blur' }],
           baseCount: [{ required: true, message: ' ', trigger: 'blur' }],
           produceType: [{ required: true, message: ' ', trigger: 'blur' }],
-          attributeType:  [{ required: true, message: ' ', trigger: 'blur' }],
-          componentAttribute:[{ required: true, message: ' ', trigger: 'blur' }]
-        },
-
+          attributeType: [{ required: true, message: ' ', trigger: 'blur' }],
+          componentAttribute: [
+            { required: true, message: ' ', trigger: 'blur' }
+          ]
+        }
       };
     },
 
@@ -435,12 +432,16 @@
         type: Object,
         default: {}
       },
-      isWt:{
+      isWt: {
         type: Boolean,
         default: false
       }
     },
 
+    mounted() {
+      console.log(this.attributeData, 'attributeData');
+    },
+
     watch: {
       attributeData(val) {
         console.log(val);

+ 21 - 0
src/views/material/BOMmanage/components/baseInfo.vue

@@ -86,14 +86,18 @@
       :categoryObj="dataInfo"
       :isEdit="true"
     ></baseInfoSave>
+
+    <!-- <BomDetailsPop ref="bomDrawer"></BomDetailsPop>; -->
   </div>
 </template>
 
 <script>
   import baseInfoSave from './baseInfoSave.vue';
+  // import BomDetailsPop from '../../BOMmanage/detailsPop.vue';
   export default {
     components: {
       baseInfoSave
+      // BomDetailsPop
     },
     data() {
       return {
@@ -110,6 +114,10 @@
           {
             label: '草稿',
             value: 0
+          },
+          {
+            label: '审核不通过',
+            value: 3
           }
         ]
       };
@@ -143,6 +151,19 @@
 
       bomConfig() {
         this.$emit('getNewBomData', this.dataInfo);
+        // let rowData = {
+        //   categoryId: this.dataInfo.categoryId,
+        //   categoryName: this.dataInfo.name,
+        //   code: this.dataInfo.code,
+        //   versions: this.dataInfo.resourceBomVersion,
+        //   rootPathIdParent: this.dataInfo.categoryLevelPathIdParent,
+        //   isProduct: this.dataInfo,
+        //   bomType: Number(this.dataInfo.bomType),
+        //   isTemp: this.dataInfo.isTemp
+        // };
+        // this.open(rowData);
+        // this.$refs.bomDrawer.open(rowData);
+        // console.log(this.$refs, 'refs');
       }
     }
   };

+ 6 - 1
src/views/material/BOMmanage/components/detailedList.vue

@@ -205,7 +205,11 @@
       <!-- 表头工具栏 -->
       <template v-slot:action="{ row, $index }">
         <el-link
-          v-if="attributeData.status != 1 && !isWt"
+          v-if="
+            attributeData.approvalStatus != 1 &&
+            attributeData.approvalStatus != 2 &&
+            !isWt
+          "
           type="danger"
           :underline="false"
           icon="el-icon-delete"
@@ -604,6 +608,7 @@
 
     mounted() {
       console.log(this.attributeData, 'attributeData');
+      console.log(this.isWt, 'isWt');
     },
 
     methods: {

+ 199 - 177
src/views/material/BOMmanage/components/routing.vue

@@ -3,11 +3,24 @@
     <el-card shadow="never">
       <!-- 数据表格 -->
 
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        row-key="id"
+      >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button v-if="attributeData.status != 1&&!isWt" size="small" type="primary" icon="el-icon-plus"
-            class="ele-btn-icon" @click="add">新增</el-button>
+          <el-button
+            v-if="attributeData.status != 1 && !isWt"
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="add"
+            >新增</el-button
+          >
         </template>
         <!-- 状态列 -->
         <template v-slot:status="{ row }">
@@ -15,11 +28,27 @@
         </template>
 
         <template v-slot:routeType="{ row }">
-          {{ row.routeType == 2 ? '委外' : row.routeType == 1 ? '生产' : row.routeType == 3 ? '质检' : '' }}
+          {{
+            row.routeType == 2
+              ? '委外'
+              : row.routeType == 1
+              ? '生产'
+              : row.routeType == 3
+              ? '质检'
+              : ''
+          }}
         </template>
 
         <template v-slot:action="{ row, $index }">
-          <el-link type="danger" @click="handleDel(row)" v-if="attributeData.status != 1">删除</el-link>
+          <el-link
+            type="danger"
+            @click="handleDel(row)"
+            v-if="
+              attributeData.approvalStatus != 1 &&
+              attributeData.approvalStatus != 2
+            "
+            >删除</el-link
+          >
         </template>
       </ele-pro-table>
     </el-card>
@@ -28,191 +57,184 @@
 </template>
 
 <script>
-import { getMbomPage } from '@/api/material/BOM';
-import routingDialog from './routingDialog.vue';
-import route from '@/api/technology/route';
-
-import { workingProcedureUpdate } from '@/api/material/BOM';
-export default {
-  name: 'technologyRoute',
-  components: {
-    routingDialog
-  },
-  props: {
-    taskParam: Object,
-    resourceBomId: String,
-
-    attributeData: {
-      type: Object,
-      default: {}
+  import { getMbomPage } from '@/api/material/BOM';
+  import routingDialog from './routingDialog.vue';
+  import route from '@/api/technology/route';
+
+  import { workingProcedureUpdate } from '@/api/material/BOM';
+  export default {
+    name: 'technologyRoute',
+    components: {
+      routingDialog
     },
-    
-    isWt:{
-      type:Array,
-      default:false
-    }
+    props: {
+      taskParam: Object,
+      resourceBomId: String,
 
-  },
-  watch: {
-    attributeData: {
-      handler(val) {
-        this.$nextTick(() => {
-          this.reload()
-        })
+      attributeData: {
+        type: Object,
+        default: {}
       },
-      deep: true,
-      immediate: true
-    }
-  },
-  data() {
-    return {
-      tableData: [],
-      selection: [],
-      versionList: [],
-      where: {},
-      // 表格列配置
-      columns: [
-        {
-          prop: 'code',
-          label: '工艺路线编码',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110,
-          slot: 'code'
-        },
-        {
-          prop: 'name',
-          label: '工艺路线名称',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-
-        {
-          prop: 'version',
-          label: '工艺路线版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-
-        {
-          prop: 'produceVersionName',
-          label: '工艺类型',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          slot: 'status',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-
-        {
-          slot: 'routeType',
-          label: '类型',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'action',
-          label: '操作',
-          align: 'center',
-          slot: 'action'
-        }
-      ],
-
-      // 表格选中数据
-      selection: [],
-      // 当前编辑数据
-      current: null,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      detailEdit: false,
-
-      statusList: [
-        { label: '草稿', value: -1 },
-        { label: '失效', value: 0 },
-        { label: '生效', value: 1 }
-      ],
-      loading: false
-    };
-  },
-  methods: {
-    add() {
-
-      console.log(this.taskParam, this.tableData);
-
-      this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
-    },
-    search(e) {
 
-
-      this.reload(this.where);
+      isWt: {
+        type: Boolean,
+        default: false
+      }
     },
-    /* 表格数据源 */
-    async datasource({ page, limit, where }) {
-      let data = await getMbomPage({
-        ...where,
-        bomCategoryId: this.resourceBomId,
-        pageNum: page,
-        size: limit
-      });
-      if (data?.length > 0) {
-        this.tableData = data[0];
-        return data[0].processRoute.list || [];
-      } else {
-        this.tableData = {};
-        return [];
+    watch: {
+      attributeData: {
+        handler(val) {
+          this.$nextTick(() => {
+            this.reload();
+          });
+        },
+        deep: true,
+        immediate: true
       }
     },
+    data() {
+      return {
+        tableData: [],
+        selection: [],
+        versionList: [],
+        where: {},
+        // 表格列配置
+        columns: [
+          {
+            prop: 'code',
+            label: '工艺路线编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '工艺路线名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
 
-    handleDel(row) {
-
-      // route.getProcessById([row.id]).then((data) => {
-
+          {
+            prop: 'version',
+            label: '工艺路线版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
 
-      // })
+          {
+            prop: 'produceVersionName',
+            label: '工艺类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
 
-      // console.log(row,'41444444',this.tableData.processRoute.list);
-      // return
-      this.$confirm('是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        workingProcedureUpdate({
-          id: this.tableData.id,
-          categoryId: this.taskParam.categoryId,
-          bomCategoryId: this.taskParam.id,
-          categoryCode: this.taskParam.categoryCode,
-          isRouting:1,
-          processRoute: {
-            list: this.tableData.processRoute.list.filter(
-              (item) => item.id !== row.id
-            )
+          {
+            slot: 'routeType',
+            label: '类型',
+            align: 'center',
+            showOverflowTooltip: true
           },
-        }).then((data) => {
-          this.$message.success('删除成功');
-          this.reload();
-        });
-      })
-      .catch(() => console.info("操作取消"));
-    },
-    checkStatus(row) {
-      let obj = this.statusList.find((it) => it.value == row.status);
-      return obj.label;
+          {
+            prop: 'action',
+            label: '操作',
+            align: 'center',
+            slot: 'action'
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        detailEdit: false,
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
+        loading: false
+      };
     },
-    /* 刷新表格 */
-    reload(where) {
+    methods: {
+      add() {
+        console.log(this.taskParam, this.tableData);
 
-      this.$refs.table.reload({ page: 1, where: where });
+        this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
+      },
+      search(e) {
+        this.reload(this.where);
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+        let data = await getMbomPage({
+          ...where,
+          bomCategoryId: this.resourceBomId,
+          pageNum: page,
+          size: limit
+        });
+        if (data?.length > 0) {
+          this.tableData = data[0];
+          return data[0].processRoute.list || [];
+        } else {
+          this.tableData = {};
+          return [];
+        }
+      },
+
+      handleDel(row) {
+        // route.getProcessById([row.id]).then((data) => {
+
+        // })
+
+        // console.log(row,'41444444',this.tableData.processRoute.list);
+        // return
+        this.$confirm('是否删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            workingProcedureUpdate({
+              id: this.tableData.id,
+              categoryId: this.taskParam.categoryId,
+              bomCategoryId: this.taskParam.id,
+              categoryCode: this.taskParam.categoryCode,
+              isRouting: 1,
+              processRoute: {
+                list: this.tableData.processRoute.list.filter(
+                  (item) => item.id !== row.id
+                )
+              }
+            }).then((data) => {
+              this.$message.success('删除成功');
+              this.reload();
+            });
+          })
+          .catch(() => console.info('操作取消'));
+      },
+      checkStatus(row) {
+        let obj = this.statusList.find((it) => it.value == row.status);
+        return obj.label;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      }
     }
-  }
-};
+  };
 </script>

+ 75 - 3
src/views/material/BOMmanage/detailsPop.vue

@@ -227,7 +227,7 @@
               版本号: &nbsp; &nbsp;
               <el-select
                 size="mini"
-                style="width: 72%; margin: 6px 0"
+                style="width: 70%; margin: 6px 0"
                 v-model="searchObj.versions"
                 placeholder="请选择bom版本"
                 @change="getTreeData"
@@ -241,6 +241,25 @@
                 >
                 </el-option>
               </el-select>
+              <br />
+              属性类型:
+              <el-select
+                size="mini"
+                style="width: 70%; margin: 6px 0"
+                v-model="searchObj.componentAttribute"
+                filterable
+                multiple
+                placeholder="请选择属性类型"
+                @change="getTreeData"
+                :disabled="isWt"
+              >
+                <el-option
+                  v-for="item in sxtList"
+                  :key="item.value"
+                  :value="item.value"
+                  :label="item.label"
+                ></el-option>
+              </el-select>
             </div>
 
             <el-tree
@@ -413,6 +432,7 @@
   import workmanship from './components/workmanship.vue';
 
   export default {
+    name: 'bomDetailsPop',
     components: {
       baseInfo,
       baseInfoSave,
@@ -448,6 +468,7 @@
           versions: '',
           categoryId: '',
           isProduct: false,
+          componentAttribute: [],
           isTemp: 0
         },
 
@@ -469,6 +490,25 @@
           3: '审核不通过'
         },
 
+        sxtList: [
+          {
+            label: '自制件',
+            value: 1
+          },
+          {
+            label: '采购件',
+            value: 2
+          },
+          {
+            label: '外协件',
+            value: 3
+          },
+          {
+            label: '受托件',
+            value: 4
+          }
+        ],
+
         isWt: false
       };
     },
@@ -495,6 +535,15 @@
         }
         this.drawer = true;
 
+        if (
+          this.currentNodeData.bomType == 2 ||
+          this.currentNodeData.bomType == 3
+        ) {
+          this.searchObj.componentAttribute = [1];
+        } else {
+          this.searchObj.componentAttribute = [];
+        }
+
         this.getTreeData();
         this.getVersion();
       },
@@ -503,6 +552,7 @@
         this.searchObj = {
           versions: '',
           categoryId: '',
+          componentAttribute: [],
           isProduct: false,
           isTemp: 0
         };
@@ -515,7 +565,7 @@
           categoryId: data.categoryId,
           categoryName: data.name,
           code: data.code,
-          versions: data.versions,
+          versions: data.resourceBomVersion,
           rootPathIdParent: data.categoryLevelPathIdParent,
           isProduct: true,
           bomType: Number(data.bomType),
@@ -531,8 +581,18 @@
 
       bomChange(e) {
         this.searchObj.versions = '';
+        this.searchObj.componentAttribute = [];
         this.currentNodeData.bomType = e;
 
+        if (
+          this.currentNodeData.bomType == 2 ||
+          this.currentNodeData.bomType == 3
+        ) {
+          this.searchObj.componentAttribute = [1];
+        } else {
+          this.searchObj.componentAttribute = [];
+        }
+
         this.getTreeData();
         this.getVersion();
       },
@@ -541,11 +601,23 @@
         try {
           this.treeLoading = true;
 
+          let componentAttribute = '';
+
+          console.log(this.searchObj.componentAttribute);
+
+          if (
+            this.searchObj.componentAttribute &&
+            this.searchObj.componentAttribute.length != 0
+          ) {
+            componentAttribute = this.searchObj.componentAttribute.join(',');
+          }
+
           const res = await getBomTreeList({
             categoryId: this.searchObj.categoryId,
             versions: this.searchObj.versions,
             bomType: this.currentNodeData.bomType,
-            isTemp: this.searchObj.isTemp || 0
+            isTemp: this.searchObj.isTemp || 0,
+            componentAttribute
           });
           this.treeLoading = false;
           if (res?.code === '0') {