ysy пре 1 година
родитељ
комит
35b7dba390

+ 58 - 0
src/api/material/inspectionClassify.js

@@ -0,0 +1,58 @@
+import request from '@/utils/request';
+
+
+
+
+// 列表 
+
+export async function getList (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitylevel/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+  
+
+  export async function getById(id) {
+    const res = await request.get(`/qms/qualitylevel/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+
+
+
+
+  // 编辑
+  export async function update (data) {
+    const res = await request.put(`/qms/qualitylevel/update`, data);
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  
+// 删除
+export async function removeItem (data) {
+  const res = await request.delete('/qms/qualitylevel/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 批量保存
+export async function saveBatch (data) {
+  const res = await request.post(`/qms/qualitylevel/saveBatch`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 130 - 150
src/views/material/BOMmanage/components/attribute.vue

@@ -2,7 +2,7 @@
   <div>
     <el-form label-width="100px" ref="form" :model="attributeData">
       <el-row>
-        <el-col :span="8"  label-width="100px">
+        <el-col :span="8" label-width="100px">
           <el-form-item label="名称:" prop="category.name">
             <el-input
               placeholder=""
@@ -12,131 +12,122 @@
           </el-form-item>
         </el-col>
 
- 
-          <el-col :span="8"  label-width="100px">
-            <el-form-item label="编码:" prop="code">
-              <el-input
-                placeholder=""
-                v-model="category.code"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="牌号:" prop="brandNum">
-              <el-input
-                placeholder=""
-                v-model="category.brandNum"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="型号:" prop="modelType">
-              <el-input
-                placeholder=""
-                v-model="category.modelType"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="编码:" prop="code">
+            <el-input
+              placeholder=""
+              v-model="category.code"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="规格:" prop="specification">
-              <el-input
-                placeholder=""
-                v-model="category.specification"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="牌号:" prop="brandNum">
+            <el-input
+              placeholder=""
+              v-model="category.brandNum"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="计量单位:" prop="measuringUnit">
-              <el-input
-                placeholder=""
-                v-model="category.measuringUnit"
-                disabled
-              ></el-input>
-              
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="型号:" prop="modelType">
+            <el-input
+              placeholder=""
+              v-model="category.modelType"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="重量单位:" prop="weightUnit">
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="规格:" prop="specification">
+            <el-input
+              placeholder=""
+              v-model="category.specification"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-              <el-input
-                placeholder=""
-                v-model="category.weightUnit"
-                disabled
-              ></el-input>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="计量单位:" prop="measuringUnit">
+            <el-input
+              placeholder=""
+              v-model="category.measuringUnit"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="重量单位:" prop="weightUnit">
+            <el-input
+              placeholder=""
+              v-model="category.weightUnit"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="包装单位:" prop="packingUnit">
-              <el-input
-                placeholder=""
-                v-model="category.packingUnit"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="包装单位:" prop="packingUnit">
+            <el-input
+              placeholder=""
+              v-model="category.packingUnit"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="毛重:" prop="roughWeight">
-              <el-input
-                placeholder=""
-                v-model="category.roughWeight"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="毛重:" prop="roughWeight">
+            <el-input
+              placeholder=""
+              v-model="category.roughWeight"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="净重:" prop="netWeight">
-              <el-input
-                placeholder=""
-                v-model="category.netWeight"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="净重:" prop="netWeight">
+            <el-input
+              placeholder=""
+              v-model="category.netWeight"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item
-              label="加工类型:"
-              prop="isConsumable"
-              v-if="
-                [1, 23, 9, 28].includes(Number(category.categoryLevelPathId))
-              "
-            >
+        <el-col :span="8" label-width="100px">
+          <el-form-item
+            label="加工类型:"
+            prop="isConsumable"
+            v-if="[1, 23, 9, 28].includes(Number(category.categoryLevelPathId))"
+          >
             <el-input
-                placeholder=""
-                :v-model="category.isConsumable == 1 ? '批量' : '单件'"
-                disabled
-              ></el-input>
-   
-            </el-form-item>
-          </el-col>
+              placeholder=""
+              :v-model="category.isConsumable == 1 ? '批量' : '单件'"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="8" label-width="100px">
-            <el-form-item label="生产类型:" prop="produceType">
-              <el-input
-                placeholder=""
-                :v-model="  category.produceType &&
-                ['自制件', '采购件', '装配件', '外协件'][
-                  category.produceType - 1
-                ]"
-                disabled
-              ></el-input>
-          
-            </el-form-item>
-          </el-col>
-       
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="生产类型:" prop="produceType">
+            <el-select v-model="category.produceType" filterable multiple>
+                <el-option
+                  v-for="item in dictList"
+                  :key="item.value"
+                  :value="item.value"
+                  :label="item.label"
+                ></el-option>
+              </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
 
       <el-row>
@@ -183,26 +174,6 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" label-width="100px">
-          <el-form-item label="状态" prop="name">
-            <el-select
-              style="width: 100%"
-              v-model="attributeData.status"
-              placeholder="请选择"
-            >
-              <el-option
-                v-for="item in statusOptions"
-                :label="item.label"
-                :value="item.value"
-                :key="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-row>
         <el-col :span="8" label-width="100px">
           <el-form-item label="物料库路径" prop="name">
             <el-input
@@ -212,16 +183,10 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" label-width="100px">
-          <el-form-item label="版本" prop="name">
-            <el-input
-              placeholder=""
-              v-model="attributeData.versions"
-            ></el-input>
-          </el-form-item>
-        </el-col>
       </el-row>
 
+
+
       <el-row>
         <el-col :span="20" label-width="100px">
           <el-form-item label="备注" prop="name">
@@ -257,14 +222,15 @@
         </el-col>
       </el-row>
 
-      <!-- <div class="btn_box">
+      <div class="btn_box">
         <el-button type="primary">修改</el-button>
-      </div> -->
+      </div>
     </el-form>
   </div>
 </template>
 
 <script>
+  import { getByCode } from '@/api/system/dictionary-data';
   export default {
     components: {},
     data() {
@@ -295,16 +261,30 @@
           {
             label: 'ABOM',
             value: '3'
-          },
-     
-        ]
+          }
+        ],
+        dictList: [],
       };
     },
 
-    created() {},
+    created() {
+      this.getDictList('productionType');
+    },
 
     beforeDestroy() {},
-    methods: {},
+    methods: {
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+     
+      },
+    },
     props: {
       attributeData: {
         type: Object,

+ 2 - 10
src/views/material/BOMmanage/components/baseInfo.vue

@@ -13,7 +13,7 @@
           </el-col>
 
 
-      <el-row v-if="dataInfo.bomType == 2">
+      <el-row>
         <el-col :span="6" label-width="100px">
           <el-form-item label="BOM编码" prop="type">
             <el-input
@@ -61,15 +61,7 @@
         </el-col>
 
 
-        <el-col :span="6" label-width="100px">
-          <el-form-item label="所属工厂" prop="code">
-            <el-input
-              disabled
-              placeholder="所属工厂"
-              v-model="dataInfo.code"
-            ></el-input>
-          </el-form-item>
-        </el-col>
+   
 
       </el-row>
 

+ 7 - 12
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -157,8 +157,8 @@
             </template>
           </ele-pro-table>
         </el-tab-pane>
-        <el-tab-pane label="质检参数" name="质检参数">
-   
+        <el-tab-pane label="质检参数" name="质检参数">
+             <term></term>
         </el-tab-pane>
         <el-tab-pane label="生产节拍" name="生产节拍">
           <el-form label-width="100px" ref="form" :model="beatParam">
@@ -931,6 +931,7 @@
   import userSearch from './user-search.vue';
   import jobDialog from './jobDialog.vue';
   import standardOutput from './standardOutput.vue';
+  import term from '../qualityTesting/term'
   export default {
     components: {
       userSearch,
@@ -939,7 +940,8 @@
       ProductModal,
       jobDialog,
       ProductModalMultiple,
-      standardOutput
+      standardOutput,
+      term
     },
     mixins: [dictMixins],
     data() {
@@ -1535,11 +1537,6 @@
           this.$refs.table.setData(
             this.tableData.taskParam[this.currentIndex].produceList || []
           );
-        } else if (this.activeName === '质检参数') {
-          // 质检参数
-          this.$refs.qualityTable.setData(
-            this.tableData.taskParam[this.currentIndex].qualityParam || []
-          );
         } else if (this.activeName === '生产节拍') {
           console.log(this.tableData.taskParam[this.currentIndex].beatParam);
           this.beatParam =
@@ -1608,13 +1605,11 @@
         let dom = null;
         if (this.activeName === '工艺参数') {
           dom = this.$refs.table;
-        } else if (this.activeName === '质检参数') {
-          dom = this.$refs.qualityTable;
-        }
+        } 
         dom.setData([...data, ...dom.getData()]);
         this.$set(
           this.tableData.taskParam[this.currentIndex],
-          this.activeName === '工艺参数' ? 'produceList' : 'qualityParam',
+          this.activeName === '工艺参数' ? 'produceList' : '',
           dom.getData()
         );
       },

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

@@ -63,7 +63,7 @@
               >
               <el-button
                 v-if="
-                  currentNodeData.bomType == 2 &&
+                (currentNodeData.bomType == 2  || currentNodeData.bomType == 3) &&
                   currentNodeData.children?.length <= 0
                 "
                 type="danger"
@@ -74,13 +74,14 @@
                 >删除</el-button
               >
               <el-button
+                v-if="currentNodeData.bomType == 1"
                 type="primary"
                 size="mini"
                 icon="el-icon-download"
                 plain
                 >导出</el-button
               >
-              <el-button type="primary" size="mini" icon="el-icon-upload2" plain
+              <el-button     v-if="currentNodeData.bomType == 1"  type="primary" size="mini" icon="el-icon-upload2" plain
                 >导入</el-button
               >
               <el-button

+ 158 - 0
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-list.vue

@@ -0,0 +1,158 @@
+<template>
+  <div>
+    <user-search @search="reload" ref="searchRef"> </user-search>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 365px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 编码列 -->
+
+      <template v-slot:name="{ row }">
+        {{ row.qualityStandard.name }}
+      </template>
+
+      <template v-slot:code="{ row }">
+        <el-link type="primary" :underline="false">
+          {{ row.qualityStandard.code }}
+        </el-link>
+      </template>
+
+      <template v-slot:type="{ row }">
+        {{ getDictValue('质检标准类型', row.qualityStandard.type) }}
+      </template>
+
+      <template v-slot:standardCode="{ row }">
+        {{ row.qualityStandard.standardCode }}
+      </template>
+
+      <template v-slot:status="{ row }">
+        {{ row.qualityStandard.status == 1 ? '启用' : '停用' }}
+      </template>
+
+      <template v-slot:mode="{ row }">
+        {{ getDictValue('质检方式', row.mode) }}
+      </template>
+
+      <template v-slot:version="{ row }">
+        {{ row.qualityStandard.version }}
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import userSearch from './user-search.vue';
+  import {
+    getList,
+    removeItem,
+    saveBatch
+  } from '@/api/material/inspectionClassify';
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    mixins: [dictMixins],
+    components: { userSearch },
+    props: {
+      // 类别id
+
+      rootId: [Number, String]
+    },
+    data() {
+      return {
+        // 当前编辑数据
+        current: null,
+
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center'
+          },
+
+          {
+            prop: 'code',
+            label: '标准编码',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+
+          {
+            prop: 'name',
+            label: '标准名称',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'name'
+          },
+
+          {
+            label: '标准类型',
+            prop: 'type',
+            slot: 'type'
+          },
+
+          {
+            label: '标准代码',
+            prop: 'standardCode'
+          },
+
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            minWidth: 110,
+            slot: 'status'
+          },
+
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            minWidth: 110,
+            slot: 'version'
+          }
+        ]
+      };
+    },
+    created() {
+      this.requestDict('质检方式');
+      this.requestDict('质检标准类型');
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId || 12,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({
+          pageNum: 1,
+          where: where,
+          categoryLevelId: this.categoryLevelId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+
+      clickSearch(info) {
+        this.categoryLevelId = info.id;
+        this.rootCategoryLevelId = info.rootCategoryLevelId;
+        this.reload();
+      }
+    }
+  };
+</script>

+ 84 - 0
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-search.vue

@@ -0,0 +1,84 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form label-width="77px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="质检名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="状态:">
+
+          <el-select clearable  v-model="where.status" placeholder="请选择状态">
+            <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ?{ lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection data-type="Array" v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label-width="50px">
+          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search" size="small">
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" size="small" type="primary">重置</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      name: '',
+      status: ''
+    };
+
+
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
+
+      statusList: [
+        {
+          value: 0,
+          label: '停用'
+        },
+        {
+          value: 1,
+          label: '启用'
+        }
+      ]
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      console.log(this.where);
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>

+ 105 - 0
src/views/material/BOMmanage/qualityTesting/inspectionClassify/index.vue

@@ -0,0 +1,105 @@
+<template>
+  <el-dialog
+    title="质检点"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <div class="ele-body">
+      <el-card shadow="never" v-loading="loading">
+        <ele-split-layout
+          width="266px"
+          allow-collapse
+          :right-style="{ overflow: 'hidden' }"
+        >
+          <div>
+            <div class="ele-border-lighter sys-organization-list">
+              <AssetTree
+                @handleNodeClick="handleNodeClick"
+                @setRootId="setRootId"
+                :id="rootId"
+                ref="treeList"
+              />
+            </div>
+          </div>
+          <template v-slot:content>
+            <user-list
+              v-if="current"
+              :category-id="current.id"
+              :root-id="rootId"
+              ref="searchRef"
+            />
+          </template>
+        </ele-split-layout>
+      </el-card>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import userList from './components/user-list.vue';
+
+  export default {
+    components: {
+      AssetTree,
+      userList
+    },
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current: null,
+        rootId: '12',
+        visible: false
+      };
+    },
+    computed: {},
+    methods: {
+      handleNodeClick(info) {
+        this.current = info;
+        this.$nextTick(() => {
+          console.log(info);
+          this.$refs.searchRef.clickSearch(info);
+        });
+      },
+      // 获取根节点id
+      setRootId(id) {
+        if (id) {
+          this.rootId = id;
+        }
+      },
+
+      open() {
+        this.visible = true;
+      },
+
+      handleClose() {
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 0 - 0
src/views/material/BOMmanage/qualityTesting/spot.vue


+ 20 - 0
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -0,0 +1,20 @@
+<template>
+    <div>
+        质检项
+        <el-button @click="() => this.$refs.termRef.open()">弹出</el-button>
+
+        <termPop ref="termRef"></termPop>
+    </div>
+</template>
+
+<script>
+import termPop from './inspectionClassify/index.vue'
+export default {
+    components: { termPop },
+    data() {
+        return {};
+    },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 1 - 1
src/views/material/product/detail.vue

@@ -474,7 +474,7 @@
             label: item[values[0]]
           };
         });
-        console.log(123, this.dictList);
+     
       },
 
       openCategory() {