695593266@qq.com hace 11 meses
padre
commit
c1f13a3869

+ 11 - 11
src/api/material/file.js

@@ -16,18 +16,18 @@ export async function getDocTreeListAPI(data) {
  * 查询文件数据
  * @data data
  */
-// export async function filePageAPI(data) {
-//   if (!data.lcyStatus) {
-//     return true
-//   }
-//   const res = await request.post('/fm/file/page', data);
-//   if (res.data.code == 0) {
-//     return res.data.data;
-//   }
-//   return Promise.reject(new Error(res.data.message));
-// }
-
 export async function filePageAPI(data) {
+  if (!data.lcyStatus) {
+    return true;
+  }
+  const res = await request.post('/fm/file/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function newFilePageAPI(data) {
   const res = await request.post('/fm/file/queryIds', data);
   if (res.data.code == 0) {
     return res.data.data;

+ 6 - 1
src/components/addDoc/file-table-listTemplate.vue

@@ -179,7 +179,12 @@
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
         return filePageAPI({
-          ids: "'" + this.parentData?.id + "'"
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          directoryId: this.parentData?.id,
+          isQueryAll: this.isQueryAll
         });
       },
       /* 刷新表格 */

+ 32 - 4
src/views/material/BOMmanage/components/baseInfo.vue

@@ -30,7 +30,10 @@
         </el-col>
         <el-col :span="4" label-width="78px">
           <el-form-item label="版本号:" prop="type">
-           V{{ dataInfo.versions }}.0
+            <span v-if="dataInfo.versions.includes('V')">{{
+              dataInfo.versions
+            }}</span>
+            <span v-else> V{{ dataInfo.versions }}.0</span>
           </el-form-item>
         </el-col>
         <el-col :span="4" label-width="80px">
@@ -57,12 +60,24 @@
           <el-button
             type="text"
             @click="handleEdit"
-            v-if="dataInfo.approvalStatus != 1&& dataInfo.approvalStatus !=2"
+            v-if="
+              dataInfo.approvalStatus != 1 &&
+              dataInfo.approvalStatus != 2 &&
+              dataInfo.parentId == '0'
+            "
           >
             编辑</el-button
           >
         </el-col>
       </el-row>
+
+      <el-button
+        type="primary"
+        size="medium"
+        v-if="dataInfo.parentId != '0' && dataInfo.resourceBomId"
+        @click="bomConfig"
+        >跳转来源版本</el-button
+      >
     </el-form>
 
     <baseInfoSave
@@ -107,14 +122,27 @@
         }
       }
     },
-    
+
+    mounted() {
+      console.log(this.dataInfo, 'baseClose');
+    },
+
     methods: {
       handleEdit() {
         this.baseInfoShow = true;
       },
 
-      baseClose() {
+      baseClose(formData) {
+        if (formData) {
+          this.$set(this.dataInfo, 'code', formData.code);
+          this.$set(this.dataInfo, 'name', formData.name);
+          this.$forceUpdate();
+        }
         this.baseInfoShow = false;
+      },
+
+      bomConfig() {
+        this.$emit('getNewBomData', this.dataInfo);
       }
     }
   };

+ 34 - 36
src/views/material/BOMmanage/components/baseInfoSave.vue

@@ -70,7 +70,11 @@
 </template>
 
 <script>
-  import { saveBomTreeList, bomCategoryUpdate,  hasNewVersion } from '@/api/material/BOM.js';
+  import {
+    saveBomTreeList,
+    bomCategoryUpdate,
+    hasNewVersion
+  } from '@/api/material/BOM.js';
   import { getCode } from '@/api/codeManagement/index.js';
   export default {
     data() {
@@ -139,13 +143,13 @@
         default: false
       }
     },
-   async  created() {
+    async created() {
       if (this.isEdit) {
         this.title = '编辑BOM';
         this.formData = {
           code: this.categoryObj.code,
           name: this.categoryObj.name,
-          versions: 'V'+this.categoryObj.versions+'.0',
+          versions: 'V' + this.categoryObj.versions + '.0',
           status: this.categoryObj.status,
           id: this.categoryObj.id
         };
@@ -166,9 +170,9 @@
       },
 
       handleSave() {
-        this.$refs.form.validate(async (valid)  => {
+        this.$refs.form.validate(async (valid) => {
           if (valid) {
-            if(!this.isEdit) {
+            if (!this.isEdit) {
               let isHas = await this.hasVersionFn();
               if (!isHas) return;
             }
@@ -181,8 +185,8 @@
             let URL = this.isEdit ? bomCategoryUpdate : saveBomTreeList;
             URL(param).then((res) => {
               this.$message.success(this.isEdit ? '修改成功' : '保存成功');
-              this.$emit('close', true);
-              this.handleClose();
+              this.$emit('close', this.formData);
+              // this.handleClose();
             });
           } else {
             return false;
@@ -190,37 +194,31 @@
         });
       },
 
-
-       hasVersionFn() {
-         return new Promise((resolve) => {
-        let param = {
-          categoryId: this.categoryId,
-          bomType: this.categoryObj.bomType
-        };
-        hasNewVersion(param).then((res) => {
-           if(res.data == 1) {
-                this.$confirm('已经草稿版本存在,是否覆盖?', '提示', {
-                  confirmButtonText: '覆盖',
-                  cancelButtonText: '取消',
-                  type: 'warning'
+      hasVersionFn() {
+        return new Promise((resolve) => {
+          let param = {
+            categoryId: this.categoryId,
+            bomType: this.categoryObj.bomType
+          };
+          hasNewVersion(param).then((res) => {
+            if (res.data == 1) {
+              this.$confirm('已经草稿版本存在,是否覆盖?', '提示', {
+                confirmButtonText: '覆盖',
+                cancelButtonText: '取消',
+                type: 'warning'
+              })
+                .then(() => {
+                  resolve(true);
                 })
-                  .then(() => {
-                    resolve(true);
-                  })
-                  .catch(() => {
-                    resolve(false);
-                  });
-
-
-           } else {
-            resolve(true);
-           }
-
-
+                .catch(() => {
+                  resolve(false);
+                });
+            } else {
+              resolve(true);
+            }
+          });
         });
-      });
-      },
-
+      }
     }
   };
 </script>

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

@@ -1,12 +1,12 @@
 <template>
   <div class="ele-body">
     <BOMSearch @search="reload" :statusOpt="statusOpt" />
+    <!-- :header-cell-style="headerCellStyle" -->
     <ele-pro-table
       ref="table"
       :key="tableKey"
       :columns="columns"
       :pagination="pagination"
-      :header-cell-style="headerCellStyle"
       :datasource="datasource"
       class="dict-table"
       tool-class="ele-toolbar-actions"
@@ -144,7 +144,7 @@
           </el-select>
         </div>
 
-        <div v-else v-if="row.resourceBomVersion">
+        <div v-else-if="row.resourceBomVersion">
           {{ 'V' + row.resourceBomVersion + '.0' }}
         </div>
       </template>
@@ -602,6 +602,10 @@
     //   }
     // },
 
+    mounted() {
+      console.log(this.attributeData, 'attributeData');
+    },
+
     methods: {
       rootCategoryLevelIdText(v) {
         console.log(v, '111111');

+ 3 - 2
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -777,7 +777,7 @@
   import fileIndex from '../file/index.vue';
   import fileBrowse from '../file/fileBrowse.vue';
   import replaceMaterialPop from './replaceMaterialPop.vue';
-  import { filePageAPI } from '@/api/material/file';
+  import { newFilePageAPI } from '@/api/material/file';
   import { getBomGetById, getDetailList } from '@/api/material/BOM.js';
   import mbomDatailList from './mbomDatailList.vue';
   export default {
@@ -1492,6 +1492,7 @@
             this.$refs.fileTable.setData([]);
           } else {
             let fileId = this.tableData.taskParam[this.currentIndex].fileParam;
+            console.log('111111');
             if (fileId.length > 0) {
               this.fileParamDatasource(fileId);
             }
@@ -1721,7 +1722,7 @@
       //工艺文件表格回显
       fileParamDatasource(fileParam) {
         let fileId = fileParam.map((item) => item.id).join(',');
-        filePageAPI({
+        newFilePageAPI({
           // pageNum: 1,
           // size: 999,
           // directoryId: null,

+ 2 - 6
src/views/material/BOMmanage/details.vue

@@ -21,9 +21,7 @@
               v-model="currentNodeData.bomType"
               @change="bomChange"
             >
-              <el-radio-button :label="1"
-                >PBOM
-              </el-radio-button>
+              <el-radio-button :label="1">PBOM </el-radio-button>
               <el-radio-button
                 v-if="isProduct || [1, 9].includes(rootPathIdParent)"
                 :label="2"
@@ -172,9 +170,7 @@
               <el-tab-pane
                 label="工序配置"
                 name="工序配置"
-                v-if="
-                  [1, 9].includes(rootPathIdParent) 
-                "
+                v-if="[1, 9].includes(rootPathIdParent)"
               >
                 <workmanship
                   ref="workmanshipRef"

+ 47 - 11
src/views/material/BOMmanage/detailsPop.vue

@@ -44,7 +44,10 @@
               size="mini"
               icon="el-icon-plus"
               @click="handleAdd"
-              v-if="$hasPermission('main:categoryparam:saveBom')"
+              v-if="
+                $hasPermission('main:categoryparam:saveBom') &&
+                currentNodeData.parentId == '0'
+              "
             >
               新建
             </el-button>
@@ -57,14 +60,17 @@
               v-if="
                 (currentNodeData.approvalStatus == 0 ||
                   currentNodeData.approvalStatus == 3) &&
-                $hasPermission('main:categoryparam:deleteBom')
+                $hasPermission('main:categoryparam:deleteBom') &&
+                currentNodeData.parentId == '0'
               "
             >
               删除
             </el-button>
 
             <el-button
-              v-if="currentNodeData.bomType == 1"
+              v-if="
+                currentNodeData.bomType == 1 && currentNodeData.parentId == '0'
+              "
               type="primary"
               size="mini"
               icon="el-icon-download"
@@ -74,7 +80,9 @@
 
             <el-button
               @click="uploadFile"
-              v-if="currentNodeData.bomType == 1"
+              v-if="
+                currentNodeData.bomType == 1 && currentNodeData.parentId == '0'
+              "
               type="primary"
               size="mini"
               icon="el-icon-upload2"
@@ -88,7 +96,9 @@
               icon="el-icon-refresh"
               plain
               @click="transformation('P')"
-              v-if="currentNodeData.bomType == 4"
+              v-if="
+                currentNodeData.bomType == 4 && currentNodeData.parentId == '0'
+              "
               >转换PBOM</el-button
             >
 
@@ -98,7 +108,9 @@
               icon="el-icon-refresh"
               plain
               @click="transformation('E')"
-              v-if="currentNodeData.bomType == 1"
+              v-if="
+                currentNodeData.bomType == 1 && currentNodeData.parentId == '0'
+              "
               >转换EBOM</el-button
             >
 
@@ -111,7 +123,8 @@
               v-if="
                 currentNodeData.bomType == 1 &&
                 (searchObj.isProduct ||
-                  ['1', '9'].includes(searchObj.rootPathIdParent))
+                  ['1', '9'].includes(searchObj.rootPathIdParent)) &&
+                currentNodeData.parentId == '0'
               "
               >转换MBOM</el-button
             >
@@ -125,7 +138,8 @@
               v-if="
                 currentNodeData.bomType == 1 &&
                 (searchObj.isProduct ||
-                  ['1', '9'].includes(searchObj.rootPathIdParent))
+                  ['1', '9'].includes(searchObj.rootPathIdParent)) &&
+                currentNodeData.parentId == '0'
               "
               >转换ABOM</el-button
             >
@@ -135,8 +149,9 @@
               size="mini"
               @click="handSubmit"
               v-if="
-                currentNodeData.approvalStatus == 0 ||
-                currentNodeData.approvalStatus == 3
+                (currentNodeData.approvalStatus == 0 ||
+                  currentNodeData.approvalStatus == 3) &&
+                currentNodeData.parentId == '0'
               "
             >
               提交发布
@@ -242,7 +257,10 @@
 
           <template v-slot:content v-if="isNotData">
             <!-- 基本信息 -->
-            <baseInfo :dataInfo="currentNodeData" />
+            <baseInfo
+              :dataInfo="currentNodeData"
+              @getNewBomData="getNewBomData"
+            />
 
             <!-- table -->
             <el-tabs
@@ -459,6 +477,8 @@
       open(row) {
         this.searchObj = row;
 
+        console.log(row, 'rowrowrowrowrow');
+
         if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
           this.isWt = row.isWt;
           this.isFullscreen = false;
@@ -484,6 +504,20 @@
         this.drawer = false;
       },
 
+      getNewBomData(data) {
+        let rowData = {
+          categoryId: data.categoryId,
+          categoryName: data.name,
+          code: data.code,
+          versions: data.versions,
+          rootPathIdParent: data.categoryLevelPathIdParent,
+          isProduct: true,
+          bomType: Number(data.bomType),
+          isTemp: data.isTemp
+        };
+        this.open(rowData);
+      },
+
       handleFull() {
         this.isFullscreen = !this.isFullscreen;
         this.$forceUpdate();
@@ -545,6 +579,8 @@
             this.searchObj.versions = this.currentNodeData.versions;
 
             this.$forceUpdate();
+
+            console.log(this.currentNodeData, 'this.currentNodeData');
           });
         } else {
           this.currentNodeData = {

+ 10 - 5
src/views/material/BOMmanage/file/fileBrowse.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog
+  <ele-modal
     title="详情"
     :visible.sync="visible"
     v-if="visible"
@@ -7,6 +7,7 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
+    :maxable="true"
     width="80%"
   >
     <div>
@@ -22,7 +23,7 @@
     <div slot="footer">
       <el-button @click="handleClose"> 关闭 </el-button>
     </div>
-  </el-dialog>
+  </ele-modal>
 </template>
 
 <script>
@@ -32,7 +33,6 @@
 
     data() {
       return {
-  
         fileUrl: '',
         visible: false
       };
@@ -43,8 +43,13 @@
       setFileUrl(row) {
         console.log(row);
         let file = row.storagePath[0];
-       let fileNames=file.storePath.split('/')
-        let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
+        let fileNames = file.storePath.split('/');
+        let url =
+          window.location.origin +
+          '/api/main/file/getFile?objectName=' +
+          file.storePath +
+          '&fullfilename=' +
+          fileNames[fileNames.length - 1];
         this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
         this.visible = true;
       },

+ 8 - 1
src/views/material/BOMmanage/file/index.vue

@@ -232,7 +232,14 @@
 
       datasource({ page, limit, where }) {
         return filePageAPI({
-          ids: "'" + this.parentData?.id + "'"
+          // ids: "'" + this.parentData?.id + "'"
+          ...where,
+          pageNum: page,
+          size: limit,
+          directoryId: this.parentData?.id,
+          lcyStatus: '3',
+          fileType: 0,
+          isQueryAll: 1
         });
       },
       /* 刷新表格 */

+ 26 - 3
src/views/material/BOMmanage/qualityTesting/inspectionTemplate.vue

@@ -84,6 +84,11 @@
           ><i></i
         ></el-radio>
       </template>
+
+      <template v-slot:type="{ row, _index }">
+        <span>{{ getQualityType(row) }}</span>
+      </template>
+
       <template v-slot:status="{ row }">
         {{ row.status ? '启用' : '停用' }}
       </template>
@@ -153,8 +158,7 @@
             label: '质检类型',
             slot: 'type',
             align: 'center',
-            minWidth: 150,
-            planList: this.typeList
+            minWidth: 150
           },
           {
             label: '状态',
@@ -179,6 +183,8 @@
       this.getInspectionType();
     },
 
+    computed: {},
+
     methods: {
       datasource({ page, where, limit }) {
         console.log(1111);
@@ -191,6 +197,19 @@
         });
       },
 
+      getQualityType(row) {
+        if (row.type) {
+          let label = '';
+          this.typeList.forEach((item) => {
+            if (item.value == row.type) {
+              label = item.label;
+            }
+            return label;
+          });
+        }
+        return '';
+      },
+
       // 多选
       selectionChangeHandle(val) {
         this.selection = val;
@@ -218,7 +237,11 @@
         this.radio = row.id;
       },
       reset() {
-        this.where = { ...this.defaultWhere };
+        this.where = {
+          qualitySchemeTemplateCode: '',
+          qualitySchemeTemplateName: '',
+          type: ''
+        };
         this.reload();
       },
       async getInspectionType() {