Преглед изворни кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

2213980799@qq.com пре 1 година
родитељ
комит
6b1ef7b424

+ 29 - 0
src/api/material/file.js

@@ -0,0 +1,29 @@
+import request from '@/utils/request';
+
+/**
+ * 查询文件夹分类数据
+ * @data data
+ */
+export async function getDocTreeListAPI(data) {
+  const res = await request.post('/fm/directory/selectTreeList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+/**
+* 查询文件数据
+* @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));
+}

BIN
src/assets/wjj.png


+ 7 - 1
src/views/material/BOMmanage/components/baseInfo.vue

@@ -54,7 +54,13 @@
         </el-col>
 
         <el-col :span="2" label-width="78px">
-          <el-button type="text" @click="handleEdit"> 编辑</el-button>
+          <el-button
+            type="text"
+            @click="handleEdit"
+            v-if="dataInfo.status != 1"
+          >
+            编辑</el-button
+          >
         </el-col>
       </el-row>
     </el-form>

+ 10 - 7
src/views/material/BOMmanage/components/baseInfoSave.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-  :title="title"
+    :title="title"
     v-if="visible"
     :visible.sync="visible"
     :before-close="handleClose"
@@ -70,7 +70,7 @@
 </template>
 
 <script>
-  import { saveBomTreeList , bomCategoryUpdate} from '@/api/material/BOM.js';
+  import { saveBomTreeList, bomCategoryUpdate } from '@/api/material/BOM.js';
   export default {
     data() {
       return {
@@ -123,10 +123,14 @@
         }
       },
 
+      categoryId: {
+        type: String,
+        default: ''
+      },
+
       isEdit: {
         type: Boolean,
         default: false
-
       }
     },
     created() {
@@ -137,8 +141,7 @@
           name: this.categoryObj.name,
           versions: this.categoryObj.versions,
           status: this.categoryObj.status,
-          id: this.categoryObj.id,
- 
+          id: this.categoryObj.id
         };
       } else {
         this.title = '新建BOM';
@@ -161,12 +164,12 @@
           if (valid) {
             let param = {
               ...this.formData,
-              category: this.categoryObj.category,
+              categoryId: this.categoryId,
               bomType: this.categoryObj.bomType
             };
             let URL = this.isEdit ? bomCategoryUpdate : saveBomTreeList;
             URL(param).then((res) => {
-              this.$message.success( this.isEdit ? '修改成功': '保存成功');
+              this.$message.success(this.isEdit ? '修改成功' : '保存成功');
               this.$emit('close', true);
               this.handleClose();
             });

+ 2 - 1
src/views/material/BOMmanage/components/bomTreeDialog.vue

@@ -280,6 +280,7 @@
       chooseStandardList(type, data) {
         if (type == 9 || type == 1) {
           this.category = data[0];
+          this.attributeData.categoryId = data[0].id;
           this.$set(this.attributeData, 'code', data[0].code);
           this.$set(this.attributeData, 'name', data[0].name);
           this.$forceUpdate();
@@ -289,7 +290,7 @@
       async open(type, versions, categoryId, treeId) {
         this.attributeData = {};
         this.attributeData.bomType = type;
-        this.attributeData.categoryId = categoryId;
+      
         this.attributeData.versions = versions;
         this.versions = versions;
 

+ 21 - 22
src/views/material/BOMmanage/components/detailedList.vue

@@ -5,13 +5,12 @@
       ref="table"
       :columns="columns"
       :datasource="datasource"
-      :initLoad="false"
       class="dict-table"
       tool-class="ele-toolbar-actions"
     >
       <template v-slot:toolbar>
         <div class="toolbar_box">
-          <div  v-if="attributeData.status != 1">
+          <div v-if="attributeData.status != 1">
             <el-button type="primary" size="mini" @click="handleAdd"
               >新增</el-button
             >
@@ -100,7 +99,7 @@
       <!-- 表头工具栏 -->
       <template v-slot:action="{ row }">
         <el-link
-         v-if="attributeData.status != 1"
+          v-if="attributeData.status != 1"
           type="danger"
           :underline="false"
           icon="el-icon-delete"
@@ -143,13 +142,13 @@
             showOverflowTooltip: true
           },
           {
-            prop: 'categoryCode',
+            prop: 'code',
             label: '编码',
             showOverflowTooltip: true,
             width: 120
           },
           {
-            prop: 'categoryName',
+            prop: 'name',
             label: '名称',
             width: 150
           },
@@ -252,7 +251,6 @@
 
         gysList: [],
 
-        attrObj: {},
         newTreeId: null,
 
         dictList: []
@@ -278,34 +276,35 @@
     },
 
     watch: {
-      attributeData(val) {
-        this.attrObj = val;
-        this.$refs.table.setData([]);
-        this.$nextTick(() => {
-          this.$refs.table.reload({
-            pageNum: 1
-          });
-        });
+      treeId: {
+        handler(val) {
+          this.newTreeId = val;
+       
+        },
+        deep: true,
+        immediate: true
       },
 
-      treeId(val) {
-        this.newTreeId = val;
+      attributeData: {
+        handler(val) {
+         this.$nextTick(() => {
+          this.reload()
+         })
+        },
+        deep: true,
+        immediate: true
       }
     },
 
     methods: {
       /* 表格数据源 */
       datasource({ where, page, limit }) {
-        if (!this.attrObj.id) {
-          return false;
-        }
-
         return getBomPageCategoryId({
           ...where,
           pageNum: page,
           size: limit,
-          id: this.attrObj.id,
-          bomType: this.attrObj.bomType
+          id: this.attributeData.id,
+          bomType: this.attributeData.bomType
         });
       },
 

+ 11 - 0
src/views/material/BOMmanage/components/routing.vue

@@ -59,6 +59,17 @@
       },
 
     },
+    watch: {
+      attributeData: {
+        handler(val) {
+         this.$nextTick(() => {
+          this.reload()
+         })
+        },
+        deep: true,
+        immediate: true
+      }
+    },
     data() {
       return {
         tableData: [],

+ 156 - 175
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -176,11 +176,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="beatUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -199,11 +207,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="materielUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.materielUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.materielUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -222,11 +238,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="beatTimeUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatTimeUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatTimeUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -244,12 +268,20 @@
               </el-col>
 
               <el-col :span="8" label-width="100px">
-                <el-form-item label="单位" prop="name">
-                  <el-input
+                <el-form-item label="单位" prop="beatPrepareUnit">
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatPrepareUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatPrepareUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -267,12 +299,20 @@
               </el-col>
 
               <el-col :span="8" label-width="100px">
-                <el-form-item label="单位" prop="name">
-                  <el-input
+                <el-form-item label="单位" prop="beatRestUnit">
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatRestUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatRestUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -358,11 +398,19 @@
               </el-col>
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="type">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder="单位"
                     v-model="normalHours.unit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ normalHours.unit }}</div>
                 </el-form-item>
               </el-col>
@@ -639,9 +687,6 @@
           </ele-pro-table>
         </el-tab-pane>
         <el-tab-pane label="替代料" name="替代料">
-
-
-
           <ele-pro-table
             ref="replaceMaterialTable"
             :columns="columns1"
@@ -805,85 +850,6 @@
                 >删除</el-link
               >
             </template>
-            <template v-slot:type="{ row }">
-              <div v-if="isView">{{ row.type }}</div>
-              <el-input
-                v-else
-                v-model="row.type"
-                placeholder="请输入"
-              ></el-input>
-            </template>
-
-            <template v-slot:code="{ row }">
-              <div v-if="isView">{{ row.code }}</div>
-              <el-input
-                v-else
-                v-model="row.code"
-                placeholder="请输入"
-              ></el-input>
-            </template>
-
-            <template v-slot:versions="{ row }">
-              <div v-if="isView">{{ row.versions }}</div>
-              <el-input
-                v-else
-                v-model="row.versions"
-                placeholder="请输入"
-              ></el-input>
-            </template>
-
-            <template v-slot:status="{ row }">
-              <div v-if="isView">{{
-                statusOption.filter((item) => item.value == row.status)[0].label
-              }}</div>
-              <div v-else>
-                <template>
-                  <el-select v-model="row.status" placeholder="请选择">
-                    <el-option
-                      v-for="item in statusOption"
-                      :label="item.label"
-                      :value="item.value"
-                      :key="item.value"
-                    >
-                    </el-option>
-                  </el-select>
-                </template>
-              </div>
-            </template>
-
-            <template v-slot:path="{ row }">
-              <div v-if="isView">附件</div>
-              <div v-else
-                ><div class="downLoad">
-                  <fileUpload
-                    v-model="jobFiledList"
-                    :show-file-list="false"
-                    module="main"
-                    @input="uploadedJobSuccess($event, row)"
-                    :showLib="false"
-                    :limit="1"
-                  />
-                  <div v-if="row.path">
-                    <el-button
-                      style="margin-left: 10px"
-                      size="mini"
-                      type="primary"
-                      @click="downloadFile(row.path)"
-                      >下载</el-button
-                    >
-                  </div></div
-                >
-              </div>
-            </template>
-
-            <template v-slot:remark="{ row }">
-              <div v-if="isView">{{ row.remark }}</div>
-              <el-input
-                v-else
-                v-model="row.remark"
-                placeholder="请输入"
-              ></el-input>
-            </template>
           </ele-pro-table>
         </el-tab-pane>
 
@@ -922,9 +888,20 @@
       @selection="chooseStandardList"
     ></standardOutput>
 
+    <fileIndex v-if="fileShow" @close="fileClose"></fileIndex>
+
     <div class="btns">
-      <el-button type="primary" size="small" @click="save">{{
-        isView ? '确定' : '保存'
+      <el-button
+        type="primary"
+        size="small"
+        v-if="!isView"
+        @click="save('save')"
+      >
+        保存</el-button
+      >
+
+      <el-button type="primary" size="small" @click="save('close')">{{
+        isView ? '确定' : '保存并关闭'
       }}</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
@@ -939,11 +916,13 @@
   import { workingProcedureUpdate } from '@/api/material/BOM';
   import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
   import ProductModal from '@/components/select/bom/ProductModal.vue';
+  import { getByCode } from '@/api/system/dictionary-data';
   import ProductModalMultiple from './ProductModalMultiple.vue';
   import userSearch from './user-search.vue';
   import jobDialog from './jobDialog.vue';
   import standardOutput from './standardOutput.vue';
   import term from '../qualityTesting/term';
+  import fileIndex from '../file/index.vue';
   export default {
     components: {
       userSearch,
@@ -953,7 +932,8 @@
       jobDialog,
       ProductModalMultiple,
       standardOutput,
-      term
+      term,
+      fileIndex
     },
     mixins: [dictMixins],
     data() {
@@ -985,6 +965,9 @@
           { label: '否', value: 0 },
           { label: '是', value: 1 }
         ],
+
+        dictList: [], //单位下拉
+
         // 表格列配置
         columns1: [],
         defaultColumns1: [
@@ -1178,66 +1161,42 @@
         // 表格选中数据
         jobColumns1: [
           {
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            slot: 'type',
-            prop: 'type',
-            label: '类型',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            slot: 'code',
-            prop: 'code',
             label: '编码',
-            showOverflowTooltip: true,
+            prop: 'code',
+            width: 180,
             align: 'center',
-            minWidth: 110
+            showOverflowTooltip: true
           },
+
           {
-            slot: 'name',
             prop: 'name',
-            label: '名称',
-            showOverflowTooltip: true,
+            label: '文档名称',
             align: 'center',
-            minWidth: 110
-          },
-          {
-            slot: 'path',
-            prop: 'path',
-            label: '附件',
+            slot: 'name',
             showOverflowTooltip: true,
-            align: 'center',
             minWidth: 200
           },
+
           {
-            slot: 'versions',
-            prop: 'versions',
-            label: '版本',
-            showOverflowTooltip: true,
+            prop: 'storagePath',
+            label: '文件名称',
             align: 'center',
-            minWidth: 110
-          },
-          {
-            slot: 'status',
-            prop: 'status',
-            label: '状态',
+
             showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
           },
+
           {
-            prop: 'createName',
-            label: '创建人',
-            showOverflowTooltip: true,
+            prop: 'version',
+            label: '版本',
             align: 'center',
-            minWidth: 110
+            showOverflowTooltip: true,
+            minWidth: 100
           },
+
           {
             prop: 'createTime',
             label: '创建时间',
@@ -1307,28 +1266,38 @@
         beatParam: {},
         normalHours: {},
         qualityParam: [],
-        qualityPointParam: []
+        qualityPointParam: [],
+
+        fileShow: false
       };
     },
     created() {
       this.requestDict('工种类型');
+      this.getDictList('time_unit');
     },
     methods: {
       addFile() {
-        let userInfo = JSON.parse(localStorage.getItem('info'));
-        this.tableData.taskParam[this.currentIndex]['fileParam'].push({
-          code: '',
-          type: '',
-          name: '',
-          versions: '',
-          name: '',
-          status: 1,
-          createName: userInfo.name,
-          createTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
-        });
-        this.$refs.fileTable.setData(
-          this.tableData.taskParam[this.currentIndex]['fileParam']
+        this.fileShow = true;
+      },
+      fileClose(val) {
+   
+        if (val == false) {
+          this.fileShow = false;
+        } else {
+          this.fileShow = false;
+
+          this.$refs.fileTable.setData([
+          ...val,
+          ...this.$refs.fileTable.getData()
+        ]);
+        this.$set(
+          this.tableData.taskParam[this.currentIndex],
+          'fileParam',
+          this.$refs.fileTable.getData()
         );
+
+         
+        }
       },
       addJob() {
         this.$refs.jobRef.open();
@@ -1552,11 +1521,10 @@
           this.$refs.table.setData(
             this.tableData.taskParam[this.currentIndex].produceList || []
           );
-        }  else  if (this.activeName === '质检项参数') {
-           this.qualityParam =  this.tableData.taskParam[this.currentIndex].qualityParam  || []
-        } 
-        
-        else if (this.activeName === '生产节拍') {
+        } else if (this.activeName === '质检项参数') {
+          this.qualityParam =
+            this.tableData.taskParam[this.currentIndex].qualityParam || [];
+        } else if (this.activeName === '生产节拍') {
           console.log(this.tableData.taskParam[this.currentIndex].beatParam);
           this.beatParam =
             this.tableData.taskParam[this.currentIndex].beatParam || {};
@@ -1726,7 +1694,7 @@
         this.$refs.table.setSelectedRows([]);
         this.selection = [];
       },
-      save() {
+      save(type) {
         if (this.isView) {
           this.handleClose();
         } else {
@@ -1751,15 +1719,15 @@
           this.tableData.taskParam[this.currentIndex].baseCountUnit =
             this.baseCountUnit;
 
-            this.tableData.taskParam[this.currentIndex].baseCount2 =
+          this.tableData.taskParam[this.currentIndex].baseCount2 =
             this.baseCount2;
           this.tableData.taskParam[this.currentIndex].baseCountUnit2 =
             this.baseCountUnit2;
 
-            if(this.$refs.qualityParamRef) {
-              this.tableData.taskParam[this.currentIndex].qualityParam =  this.$refs.qualityParamRef.getDate()  || []
-             
-            }
+          if (this.$refs.qualityParamRef) {
+            this.tableData.taskParam[this.currentIndex].qualityParam =
+              this.$refs.qualityParamRef.getDate() || [];
+          }
 
           workingProcedureUpdate({
             id: this.tableData.id,
@@ -1770,9 +1738,22 @@
           }).then(() => {
             this.$message.success('保存成功');
             this.$emit('chooseProcess');
-            this.handleClose();
+            if (type === 'close') {
+              this.handleClose();
+            }
           });
         }
+      },
+
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+
+        this.dictList = res.reduce((acc, curr) => {
+          let key = Object.keys(curr)[0]; // 获取当前对象的键
+          let value = curr[key]; // 获取当前对象的值
+          acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
+          return acc;
+        }, []); // 初始值为空数组 []
       }
     }
   };

+ 88 - 20
src/views/material/BOMmanage/components/workingStep.vue

@@ -331,11 +331,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="beatUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -354,11 +362,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="materielUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.materielUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.materielUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -377,11 +393,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="beatTimeUnit">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatTimeUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatTimeUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -400,11 +424,19 @@
 
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="name">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatPrepareUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatPrepareUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -422,12 +454,20 @@
               </el-col>
 
               <el-col :span="8" label-width="100px">
-                <el-form-item label="单位" prop="name">
-                  <el-input
+                <el-form-item label="单位" prop="beatRestUnit">
+                  <el-select
                     v-if="!isView"
-                    placeholder=""
                     v-model="beatParam.beatRestUnit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                    <el-option
+                      v-for="item in dictList"
+                      :key="item.value"
+                      :value="item.value"
+                      :label="item.label"
+                    ></el-option>
+                  </el-select>
                   <div v-else>{{ beatParam.beatRestUnit }}</div>
                 </el-form-item>
               </el-col>
@@ -513,11 +553,19 @@
               </el-col>
               <el-col :span="8" label-width="100px">
                 <el-form-item label="单位" prop="type">
-                  <el-input
+                  <el-select
                     v-if="!isView"
-                    placeholder="单位"
                     v-model="standardParam.unit"
-                  ></el-input>
+                    filterable
+                    class="ele-block"
+                  >
+                  <el-option
+                    v-for="item in dictList"
+                    :key="item.value"
+                    :value="item.value"
+                    :label="item.label"
+                  ></el-option>
+               </el-select>
                   <div v-else>{{ standardParam.unit }}</div>
                 </el-form-item>
               </el-col>
@@ -898,6 +946,8 @@
   import { getFile } from '@/api/system/file';
   import fileUpload from '@/components/upload/fileUpload';
   import { workingStepUpdate, getStepDetailById } from '@/api/material/BOM';
+  import { getByCode } from '@/api/system/dictionary-data';
+
   import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
   import ProductModal from '@/components/select/bom/ProductModal.vue';
   import userSearch from './user-search.vue';
@@ -922,6 +972,8 @@
           { label: '否', value: 0 },
           { label: '是', value: 1 }
         ],
+
+        dictList: [], //单位下拉
         // 表格列配置
         columns1: [],
         statusList: [
@@ -1084,6 +1136,11 @@
     },
 
     watch: {},
+
+    created() {
+      this.getDictList('time_unit');
+    },
+
     methods: {
       determineChoose(title, row, idx) {
         let type = '';
@@ -1287,7 +1344,18 @@
             this.handleClose();
           });
         }
-      }
+      },
+
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: Number(values[0]),
+            label: item[values[0]]
+          };
+        });
+      },
     }
   };
 </script>

+ 14 - 2
src/views/material/BOMmanage/components/workmanship.vue

@@ -144,7 +144,7 @@
                 >
                   <template v-slot:reference>
                     <el-link
-                     v-if="attributeData.status != 1"
+                
                       type="danger"
                       :underline="false"
                       icon="el-icon-delete"
@@ -159,7 +159,7 @@
         </template>
 
         <!-- 操作列 -->
-        <template v-slot:action="{ row }">
+        <template v-slot:action="{ row }"  v-if="attributeData.status != 1">
           <el-link
             type="primary"
             :underline="false"
@@ -253,6 +253,18 @@
         default: {}
       },
     },
+
+    watch: {
+      attributeData: {
+        handler(val) {
+         this.$nextTick(() => {
+          this.reload()
+         })
+        },
+        deep: true,
+        immediate: true
+      }
+    },
     data() {
       return {
         // 表格列配置

+ 20 - 5
src/views/material/BOMmanage/detailsPop.vue

@@ -234,10 +234,7 @@
               @tab-click="handleClick"
             >
               <el-tab-pane label="属性" name="属性">
-                <attribute
-                  v-if="activeName == '属性'"
-                  :attributeData="currentNodeData"
-                ></attribute>
+                <attribute :attributeData="currentNodeData"></attribute>
               </el-tab-pane>
 
               <el-tab-pane
@@ -253,6 +250,7 @@
                 name="明细表"
               >
                 <detailedList
+                  v-if="activeName == '明细表'"
                   :attributeData="currentNodeData"
                   :treeId="treeId"
                 ></detailedList>
@@ -282,7 +280,7 @@
                 <workmanship
                   v-if="activeName == '工序配置'"
                   ref="workmanshipRef"
-                    :attributeData="currentNodeData"
+                  :attributeData="currentNodeData"
                   :taskParam="currentNodeData"
                 ></workmanship>
               </el-tab-pane>
@@ -311,6 +309,7 @@
       v-if="baseInfoShow"
       @close="baseClose"
       :categoryObj="currentNodeData"
+      :categoryId="searchObj.categoryId"
     ></baseInfoSave>
 
     <importDialog
@@ -431,6 +430,11 @@
     methods: {
       open(row) {
         this.searchObj = row;
+
+        if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
+          this.currentNodeData.bomType = row.bomType;
+
+        }
         this.drawer = true;
         this.getTreeData();
         this.getVersion();
@@ -443,6 +447,7 @@
           isProduct: false,
           isTemp: 0
         };
+        this.activeName = '属性';
         this.drawer = false;
       },
 
@@ -454,13 +459,16 @@
       bomChange(e) {
         this.searchObj.versions = '';
         this.currentNodeData.bomType = e;
+
         this.getTreeData();
         this.getVersion();
       },
 
+
       async getTreeData() {
         try {
           this.treeLoading = true;
+          
           const res = await getBomTreeList({
             categoryId: this.searchObj.categoryId,
             versions: this.searchObj.versions,
@@ -574,6 +582,12 @@
           if (data.code == '0') {
             this.loadingInstance.close();
             this.$message.success('转换成功');
+
+ 
+             let _type = tt == 'P' ? 1 : tt == 'M' ? 2 : tt == 'A' ? 3 : 4;
+            this.currentNodeData.bomType = _type;
+            this.getTreeData();
+            this.getVersion();
           }
         });
       },
@@ -586,6 +600,7 @@
         if (val) {
           this.getVersion('add');
         }
+        this.activeName = '属性';
         this.baseInfoShow = false;
       },
 

+ 315 - 0
src/views/material/BOMmanage/file/index.vue

@@ -0,0 +1,315 @@
+<template>
+  <el-dialog
+    title="工艺文件"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <div>
+      <el-card shadow="never" v-loading="loading">
+        <ele-split-layout
+          width="240px"
+          allow-collapse
+          :right-style="{ overflow: 'hidden' }"
+        >
+          <div>
+            <div class="ele-border-lighter sys-organization-list">
+              <el-tree
+                ref="treeRef"
+                :data="fileTreeList"
+                highlight-current
+                :draggable="true"
+                node-key="id"
+                :props="{ label: 'name', children: 'sonDirectoryList' }"
+                :expand-on-click-node="false"
+                :default-expand-all="true"
+                @node-click="onNodeClick"
+                :allow-drop="allowDrop"
+              >
+                <span class="custom-tree-node" slot-scope="{ node, data }">
+                  <div class="tree_lab">
+                    <img src="@/assets/wjj.png" />
+                    <span>{{ node.label }}</span></div
+                  >
+                </span>
+              </el-tree>
+            </div>
+          </div>
+          <template v-slot:content>
+            <!-- 数据表格 -->
+            <ele-pro-table
+              ref="table"
+              :columns="columns"
+              :datasource="datasource"
+              :initLoad="false"
+              height="calc(60vh)"
+              tool-class="ele-toolbar-form"
+              :needPage="false"
+              row-key="id"
+              :selection.sync="selection"
+              highlight-current-row
+            >
+            </ele-pro-table>
+          </template>
+        </ele-split-layout>
+      </el-card>
+    </div>
+
+    <div slot="footer">
+      <el-button type="primary" @click="handleSave"> 选择 </el-button>
+      <el-button @click="handleClose"> 取消 </el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { getDocTreeListAPI, filePageAPI } from '@/api/material/file';
+  import { mapGetters } from 'vuex';
+
+  export default {
+    components: {},
+    mixins: [],
+
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+
+        visible: true,
+        fileTreeList: [],
+        fileType: 0, //0:公共文档 1:个人文档 2:文档模板
+        parentData: {},
+
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
+
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'checkOutUserName',
+            label: '检出人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'checkOutStatus',
+            label: '检出状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '已检出' : '';
+            }
+          },
+          {
+            prop: 'checkOutTime',
+            label: '检出时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'updateUserName',
+            label: '修改人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          }
+        ]
+      };
+    },
+    computed: {
+      ...mapGetters(['user'])
+    },
+    mounted() {
+      this.query();
+    },
+    methods: {
+      query() {
+        this.loading = true;
+        let query = {
+          type: this.fileType,
+          currentUserId: this.user.info.userId
+        };
+        getDocTreeListAPI(query).then((res) => {
+          this.fileTreeList = res;
+          if (res.length > 0) {
+            this.$nextTick(() => {
+              this.parentData = res[0];
+              this.$refs.treeRef.setCurrentKey(res[0].id);
+              this.reload();
+            });
+          }
+        });
+        this.loading = false;
+      },
+
+      datasource({ page, limit, where }) {
+        return filePageAPI({
+          ...where,
+          pageNum: page,
+          size: limit,
+          directoryId: this.parentData?.id,
+          lcyStatus: 1,
+          fileType: 0
+        });
+      },
+      /* 刷新表格 */
+      reload() {
+        this.$refs.table.reload({
+          pageNum: 1
+        });
+      },
+
+      allowDrop(draggingNode, dropNode, type) {
+        //拖拽限制
+        return dropNode.parent.id == draggingNode.parent.id && type != 'inner';
+      },
+
+      /* 选择数据 */
+      onNodeClick(row) {
+        if (row) {
+          this.parentData = row;
+          this.$nextTick(() => {
+            this.reload();
+          });
+        }
+      },
+
+      handleClose() {
+        this.$emit('close', false);
+      },
+      handleSave() {
+        if(this.selection.length == 0) return this.$message.warning('请选择一条数据')
+        this.$emit('close', JSON.parse(JSON.stringify(this.selection)));
+      },
+
+      /* 表格操作按钮事件 */
+      handleOperation(type, data) {
+        switch (type) {
+          case 'checkOut':
+            this.checkOut(data);
+            break;
+          case 'checkIn':
+            this.checkIn(data);
+            break;
+          default:
+            break;
+        }
+      },
+
+      // 检出文档
+      checkOut(row) {
+        let query = {
+          id: row.id,
+          userId: this.user.info.userId
+        };
+        checkOutAPI(query).then((res) => {
+          this.$message({
+            type: 'success',
+            message: res.msg,
+            duration: 1000
+          });
+          this.reload();
+        });
+      },
+
+      // 归还文档
+      checkIn(row) {
+        let query = {
+          id: row.id,
+          userId: this.user.info
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .tree_lab {
+    display: flex;
+    align-items: center;
+    img {
+      width: 20px;
+      height: 20px;
+    }
+  }
+</style>

+ 3 - 2
src/views/material/BOMmanage/index.vue

@@ -285,12 +285,13 @@
       },
       handelDetail(row) {
         let rowData = {
-          categoryId: row.id,
+          categoryId: row.categoryId,
           code: row.code,
           versions: row.versions,
           rootPathIdParent: row.categoryLevelPathIdParent,
           isProduct:true,
-          isTemp: 1
+          bomType: Number(this.activeName),
+          isTemp: row.isTemp
         };
         this.$refs.bomDrawer.open(rowData);