Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into dev

qihao 2 lat temu
rodzic
commit
c269eb1268

+ 23 - 1
src/api/technology/production/index.js

@@ -51,5 +51,27 @@ export default {
     if (res.data.code == 0) {
       return res.data.message;
     }
-  }
+  },
+
+
+  // 工序质检参数保存
+  saveBatch: async (data) => {
+    const res = await request.post('/main/taskqualityparam/saveBatch', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  },
+
+
+  byTaskId: async (taskId) => {
+    const res = await request.get(
+      `/main/taskqualityparam/listByTaskId/${taskId}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  
+
 };

+ 2 - 0
src/views/material/product/components/MaterialAdd.vue

@@ -445,6 +445,7 @@ export default {
                 this._getCode()
 
                 this.removeSubBomIdList = []
+              
                 if (this.data) {
                     this.tableData = this.data.subDetailList
                     this.$util.assignObject(this.form, {
@@ -452,6 +453,7 @@ export default {
                     });
                     this.isUpdate = true
                 } else {
+                    this.tableData = []
                     this.isUpdate = false
                 }
             } else {

+ 0 - 1
src/views/material/product/components/MaterialModal.vue

@@ -340,7 +340,6 @@ export default {
 
         openEdit(index) {
             this.current = this.form.bomList[index];
-            console.log(this.current);
             this.materialShow = true;
         },
 

+ 41 - 54
src/views/material/product/components/index-data.vue

@@ -2,46 +2,32 @@
   <div>
     <!-- 数据表格 -->
     <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :need-page="true" :selection.sync="selection"
-
-    :current.sync="rowCurrent"
-            highlight-current-row
-
-      height="calc(100vh - 412px)" full-height="calc(100vh - 116px)" tool-class="ele-toolbar-form"
-      cache-key="systemDictDataTable">
+      :current.sync="rowCurrent" highlight-current-row height="calc(100vh - 412px)" full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form" cache-key="systemDictDataTable">
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit({}, 2)">
-          新建  
+          新建
         </el-button>
- 
-            <el-button v-if="rootTreeId == 9"  size="small" type="primary" @click="handleLink('4')"
-                >关联设备</el-button
-              >
-              <el-button v-if="rootTreeId == 9"  size="small"  type="primary" @click="handleLink('5')"
-                >关联模具</el-button
-              >
-              <el-button  v-if="rootTreeId == 9"  size="small" type="primary" @click="handleLink('8')"
-                >关联舟皿</el-button
-              >
-
-              <el-button  v-if="rootTreeId == 4"  size="small" type="primary" @click="handleLink('5')"
-                >关联模具</el-button
-              >
-              <el-button v-if="rootTreeId == 4"   size="small"  type="primary" @click="handleLink('6')"
-                >关联备品备件</el-button
-              >
+
+        <el-button v-if="rootTreeId == 9" size="small" type="primary" @click="handleLink('4')">关联设备</el-button>
+        <el-button v-if="rootTreeId == 9" size="small" type="primary" @click="handleLink('5')">关联模具</el-button>
+        <el-button v-if="rootTreeId == 9" size="small" type="primary" @click="handleLink('8')">关联舟皿</el-button>
+
+        <el-button v-if="rootTreeId == 4" size="small" type="primary" @click="handleLink('5')">关联模具</el-button>
+        <el-button v-if="rootTreeId == 4" size="small" type="primary" @click="handleLink('6')">关联备品备件</el-button>
 
       </template>
       <template v-slot:action="{ row }">
         <el-link type="primary" :underline="false" @click="openEdit(row, 1)">
           复制
         </el-link>
-        <el-link type="primary" :underline="false"  @click="openEdit(row, 0)">
+        <el-link type="primary" :underline="false" @click="openEdit(row, 0)">
           修改
         </el-link>
         <el-popconfirm class="ele-action" title="确定要删除此物料吗?" @confirm="remove(row)">
           <template v-slot:reference>
-            <el-link type="danger" :underline="false" >
+            <el-link type="danger" :underline="false">
               删除
             </el-link>
           </template>
@@ -51,23 +37,24 @@
         <el-link type="primary" v-if="row.isProduct == 1" :underline="false" @click="openParam(row)">
           工艺参数
         </el-link>
-  
 
-        <el-link  type="primary" v-if="row.isProduct == 1" :underline="false" @click="openMaterial(row)">
+
+        <el-link type="primary" v-if="row.isProduct == 1" :underline="false" @click="openMaterial(row)">
           物料BOM
         </el-link>
 
-        
-        <el-link  type="primary" v-if="row.isProduct == 1" :underline="false" @click="openMould(row)" >
+
+        <el-link type="primary" v-if="row.isProduct == 1" :underline="false" @click="openMould(row)">
           模具
         </el-link>
 
 
-        <el-link  type="primary" v-if="row.categoryLevelPathIdParent == 7" :underline="false"  @click="handAllocation(row)" >
+        <el-link type="primary" v-if="row.categoryLevelPathIdParent == 7" :underline="false" @click="handAllocation(row)">
           货位
         </el-link>
 
-        <el-link  type="primary" v-if="row.categoryLevelPathIdParent == 11" :underline="false"  @click="handleAridRegion(row)" >
+        <el-link type="primary" v-if="row.categoryLevelPathIdParent == 11" :underline="false"
+          @click="handleAridRegion(row)">
           干燥区
         </el-link>
 
@@ -81,19 +68,19 @@
     <MaterialModal :visible.sync="materialEdit" :data="current" ref="materialRefs"></MaterialModal>
 
     <!-- 工艺参数 -->
-    <ParamEdit :visible.sync="paramEditShow"  :paramData="current" ref="paramRefs"></ParamEdit>
+    <ParamEdit :visible.sync="paramEditShow" :paramData="current" ref="paramRefs"></ParamEdit>
 
     <!-- 模具 -->
-    <mouldDialog  :visible.sync="mouldShow" :data="current" ref="mouldRefs"></mouldDialog>
+    <mouldDialog :visible.sync="mouldShow" :data="current" ref="mouldRefs"></mouldDialog>
 
     <linkMaterialDialog ref="linkMaterialDialogRef" @success="success" />
 
     <!-- 货位 -->
     <goodsAllocation ref="allocationRef"></goodsAllocation>
-    
+
     <!-- 干燥区 -->
     <aridRegion ref="aridRegionRef"></aridRegion>
-    
+
   </div>
 </template>
 
@@ -232,7 +219,7 @@ export default {
 
       rowCurrent: null,
 
-  
+
 
     };
   },
@@ -295,7 +282,7 @@ export default {
       this.paramEditShow = true;
       this.current = row;
       this.$refs.paramRefs.$refs.form &&
-       this.$refs.paramRefs.$refs.form.clearValidate();
+        this.$refs.paramRefs.$refs.form.clearValidate();
 
     },
 
@@ -303,29 +290,29 @@ export default {
       this.current = row;
       this.mouldShow = true;
       this.$refs.mouldRefs.$refs.form &&
-       this.$refs.mouldRefs.$refs.form.clearValidate();
+        this.$refs.mouldRefs.$refs.form.clearValidate();
     },
 
-    handleLink (type) {
-        if (!this.rowCurrent) {
-          return this.$message.error( this.rootTreeId == 9 ? '请选择产品!' : this.rootTreeId == 4 ? '请选择设备!' : '');
-        }
+    handleLink(type) {
+      if (!this.rowCurrent) {
+        return this.$message.error(this.rootTreeId == 9 ? '请选择产品!' : this.rootTreeId == 4 ? '请选择设备!' : '');
+      }
 
-        this.$refs.linkMaterialDialogRef.open(type, this.rowCurrent);
-      },
+      this.$refs.linkMaterialDialogRef.open(type, this.rowCurrent);
+    },
 
-      success () {
-        this.reload();
-      },
+    success() {
+      this.reload();
+    },
 
 
-      handAllocation(row) {
-        this.$refs.allocationRef.open(row)
-      },
+    handAllocation(row) {
+      this.$refs.allocationRef.open(row)
+    },
 
-      handleAridRegion(row){
-        this.$refs.aridRegionRef.open(row)
-      }
+    handleAridRegion(row) {
+      this.$refs.aridRegionRef.open(row)
+    }
 
 
 

+ 8 - 2
src/views/rulesManagement/components/programRulesDialog.vue

@@ -683,7 +683,9 @@
                       id: item.id,
                       codeNumber: item.codeNumber,
                       name: item.name,
-                      fixCode: item.fixCode
+                      fixCode: item.fixCode,
+                      categoryId: item.category.categoryLevelId,
+                      categoryName: item.category.categoryLevelName
                     };
                   }),
                   ruleMatters: item.ruleItems
@@ -784,7 +786,11 @@
                   name: item.name,
                   id: item.id,
                   fixCode: item.fixCode,
-                  codeNumber: item.codeNumber
+                  codeNumber: item.codeNumber,
+                  category: {
+                    categoryLevelId: item.categoryId,
+                    categoryLevelName: item.categoryName
+                  }
                 };
               }),
               ruleItems: item.ruleMatters

+ 128 - 0
src/views/technology/production/components/sampleParam.vue

@@ -0,0 +1,128 @@
+<template>
+    <el-dialog class="ele-dialog-form" title="抽样质检参数" :visible.sync="visible" :before-close="handleClose"
+        :close-on-click-modal="false" :close-on-press-escape="false" width="1000px">
+
+        <el-button type="primary" size="mini" @click="addItem">添加</el-button>
+
+        <el-table :data="paramList" tooltip-effect="dark" style="width: 100%; margin-top: 10px;" :header-cell-style="{
+            background: '#F0F3F3',
+            border: 'none'
+        }">
+
+
+            <el-table-column label="名称">
+                <template slot-scope="{ row }">
+                    <el-input clearable v-model="row.name" />
+                </template>
+            </el-table-column>
+
+            <el-table-column label="默认值">
+                <template slot-scope="{ row }">
+                    <el-input clearable v-model="row.value" />
+                </template>
+            </el-table-column>
+
+
+            <el-table-column label="类型">
+                <template slot-scope="{ row }">
+                    <el-select v-model="row.type">
+                        <el-option label="物理性能" :value="1" />
+                        <el-option label="金相" :value="2" />
+                    </el-select>
+                </template>
+            </el-table-column>
+
+            <el-table-column label="排序">
+                <template slot-scope="{ row }">
+                    <el-input clearable v-model="row.sort" />
+                </template>
+            </el-table-column>
+
+
+            <el-table-column width="120" label="操作">
+                <template slot-scope="scope">
+                    <el-button size="mini" type="danger" @click="delItem(scope.$index, scope.row)">删除
+                    </el-button>
+                </template>
+            </el-table-column>
+
+
+
+
+        </el-table>
+
+
+        <template v-slot:footer>
+            <el-button @click="handleClose">取消</el-button>
+            <el-button type="primary" :loading="loading" @click="save">
+                保存
+            </el-button>
+        </template>
+
+    </el-dialog>
+</template>
+
+<script>
+import producetask from '@/api/technology/production';
+export default {
+    props: {
+        taskId: String
+    },
+    data() {
+        
+        return {
+            visible: true,
+            loading: false,
+
+            paramList: [
+            ],
+            removeIds: []
+        };
+    },
+
+    created() {
+        this.getDetails()
+    },
+    methods: {
+
+        getDetails() {
+            producetask.byTaskId(this.taskId).then(res => {
+                this.paramList = res
+            })
+        },
+        handleClose() {
+           this.$emit('close')
+
+        },
+
+        addItem() {
+            this.paramList.push({
+                taskId: this.taskId,
+                name: null,
+                value: null,
+                type: null,
+                sort: null
+
+
+            })
+        },
+
+        delItem(index, row) {
+            this.paramList.splice(index, 1)
+            if(row && row.id) {
+           this.removeIds.push(row.id)
+            }
+        },
+
+        save() {
+            let param = {
+                paramList: this.paramList,
+                removeIds: this.removeIds
+            }
+            producetask.saveBatch(param).then(res => {
+                this.handleClose()
+             })
+        }
+    }
+}
+</script>

+ 17 - 4
src/views/technology/production/index.vue

@@ -16,7 +16,7 @@
         </template>
 
         <template v-slot:name="{ row }">
-          <el-link v-if="row.type == 2" type="primary" :underline="false" @click="sampleParam">
+          <el-link v-if="row.type == 2" type="primary" :underline="false" @click="sampleParam(row)">
             {{ row.name }}
           </el-link>
           <span v-else> {{ row.name }}</span>
@@ -51,6 +51,8 @@
       :typeList="typeList" />
     <!-- 配置工艺参数 -->
     <user-setting :visible.sync="showSetting" :data="current" ref="userSetting" />
+
+    <SampleParam v-if="sampleShow" :taskId="taskId" @close="close"></SampleParam>
   </div>
 </template>
 
@@ -58,14 +60,17 @@
 import UserSearch from './components/user-search.vue';
 import UserEdit from './components/user-edit.vue';
 import UserSetting from './components/user-setting.vue';
+import SampleParam from './components/sampleParam.vue'
 import producetask from '@/api/technology/production';
 import control from '@/api/technology/control';
+
 export default {
   name: 'technologyProduction',
   components: {
     UserSearch,
     UserEdit,
-    UserSetting
+    UserSetting,
+    SampleParam
   },
   data() {
     return {
@@ -163,6 +168,9 @@ export default {
           label: '常规质检'
         },
       ],
+
+      sampleShow: false,
+      taskId: null
     };
   },
   methods: {
@@ -251,9 +259,14 @@ export default {
         .catch(() => { });
     },
 
-    sampleParam() {
-      
+    sampleParam(row) {
+      this.taskId = row.id
+      this.sampleShow = true
     },
+
+    close(done) {
+        this.sampleShow = false
+    }
   }
 };
 </script>

+ 5 - 1
vue.config.js

@@ -33,7 +33,11 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://192.168.1.125:18086',
+<<<<<<< HEAD
+        target: 'http://192.168.1.64:18086',
+=======
+        target: 'http://192.168.1.119:18086',
+>>>>>>> e00b2c70b83a354da20fadfcb0334a5f5b41f425
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''