Browse Source

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

5 years ago
parent
commit
7dd817ca88

+ 0 - 1
ys_vue/src/main.js

@@ -76,7 +76,6 @@ router.beforeEach((to, from, next) => {
                         }
                         
                         if(children[j].name == "权限管理"){
-                            console.log((user.parentId == 0 || user.parentId == 1) && user.isManager == 0)
                             if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
                                 children[j].hidden = true
                             }

+ 2 - 0
ys_vue/src/port.js

@@ -37,10 +37,12 @@ export default {
         addMold: '/mould/addOrUpdate', //添加/修改模具设备
         molds: '/mould/list', //模具列表
         modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
+
         moldDetail: '/mould/detail', //模具详情
         moldFileList: '/mouldfile/list', //获取模具文档*
         moldFileListAll: '/mouldfile/allList', //获取全部模具文档
         moldFileUpload: '/mouldfile/uploadFile', //上传模具文档*
+        moldFileDowload: '/mouldfile/dowloadFile', //模具文档的下载
         moldFileCheck: '/mouldfile/check', //审批模具文档 
         moldFileDelete: '/mouldfile/delFile', //项目文档的删除
         moldOperationList: '/mouldoperationdynamics/list', //项目文档的删除

+ 118 - 42
ys_vue/src/views/mold/moldDetail.vue

@@ -68,7 +68,7 @@
         </el-col>
         <el-col :span="6" class="detail">
           穴数:
-          <span class="info">N/A</span>
+          <span class="info">{{moldDetail.waterGap}}</span>
         </el-col>
         <el-col :span="12" class="detail">
           所属项目:
@@ -76,7 +76,10 @@
         </el-col>
         <el-col :span="24" class="detail">
           生产方:
-          <span class="info">{{moldDetail.factoryName}}</span>
+          <span class="info" v-for="(item, index) in customCompany">
+            {{item.companyName}}
+            <span v-if="index != customCompany.length-1">、</span>
+          </span>
         </el-col>
       </el-col>
 
@@ -124,9 +127,10 @@
           size="small"
           type="primary"
           style="float:right;"
-          @click="centerDialog2Visible = true"
+          @click="centerDialog2Visible = true;"
         >上传</el-button>
       </el-col>
+
       <el-col :span="24">
         <el-tabs v-model="activePage" @tab-click="handleClick">
           <!-- 模具文档 -->
@@ -156,7 +160,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -191,7 +195,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -226,7 +230,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -261,7 +265,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -296,7 +300,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -331,7 +335,7 @@
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
                   <a :href="scope.row.fileUrl" :download="scope.row.fileName">
-                    <el-button size="small" @click="download(scope.row.id)">下载</el-button>
+                    <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
                 </template>
@@ -367,7 +371,7 @@
     </el-dialog>
 
     <!-- 模具报废上传弹窗 -->
-    <el-dialog title="模具报废上传" :visible.sync="centerDialog2Visible" width="30%" center>
+    <el-dialog title="模具报废上传" :visible.sync="centerDialog2Visible" width="30%" :before-close="clearFileRecord" center>
       <p>申请单</p>
       <el-upload
         ref="upload1"
@@ -403,7 +407,7 @@
     >
       <el-form
         :model="editForm"
-        label-width="120px"
+        label-width="100px"
         :rules="formRules"
         ref="editForm"
         :inline="true"
@@ -413,29 +417,13 @@
           <el-input v-model="editForm.modelName" autocomplete="off" placeholder="请输入模具名称"></el-input>
         </el-form-item>
         <el-form-item label="初始模次">
-          <el-input v-model="editForm.modelNo" autocomplete="off" placeholder="请输入模具编号"></el-input>
+          <el-input v-model="editForm.initialModulus" autocomplete="off" placeholder="请输入初始模次"></el-input>
         </el-form-item>
         <el-form-item label="模次寿命">
-          <el-input v-model="editForm.modelNo" autocomplete="off" placeholder="请输入模具编号"></el-input>
+          <el-input v-model="editForm.settingLife" autocomplete="off" placeholder="请输入模次寿命"></el-input>
         </el-form-item>
         <el-form-item label="RIFD码">
-          <el-input v-model="editForm.modelNo" autocomplete="off" placeholder="请输入模具编号"></el-input>
-        </el-form-item>
-        <el-form-item label="生产方" prop="equipmentId">
-          <el-select
-            v-model="editForm.equipmentId"
-            clearable
-            filterable
-            placeholder="请选择生产方"
-            style="width:202px"
-          >
-            <el-option
-              v-for="item in boxes"
-              :key="item.id"
-              :label="item.equipmentNo"
-              :value="item.id"
-            ></el-option>
-          </el-select>
+          <el-input v-model="editForm.rfid" autocomplete="off" placeholder="请输入RIFD码"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -454,6 +442,20 @@ export default {
       detailId: this.$route.params.id,
       user: JSON.parse(sessionStorage.getItem("user")),
       moldDetail: {},
+      customCompany: [],
+
+      formRules: {
+        modelName: [
+          { required: true, message: "请输入模具名称", trigger: "blur" }
+        ]
+      },
+
+      //权限
+      update: 0,
+      download: 0,
+      view: 0,
+      approve: 0,
+
       //6种文档
       documents: {
         mould: [],
@@ -482,18 +484,16 @@ export default {
       activeArticleId: null,
       activeFileName: null,
 
-      editFormVisible: false, //新增界面是否显示
+      editFormVisible: false, //修改界面是否显示
       editLoading: false,
-      //新增界面数据
+      //修改界面数据
       editForm: {
-        projectName: "",
-        customerCompany: [],
-        managerId: "",
-        ownerApproverId: "",
-        customerApproverId: "",
-        modelIds: [],
-        assets: [],
-        produce: []
+        id: 0,
+        modelName: "",
+        initialModulus: "",
+        settingLife: "",
+        rfid: "",
+        flag: 1
       }
     };
   },
@@ -522,7 +522,6 @@ export default {
         res => {
           if (res.code == "ok") {
             var detail = res.data.vo;
-            console.log(detail);
             if (detail.endTime == null) {
               detail.diffTime = "";
             } else {
@@ -532,6 +531,12 @@ export default {
               );
             }
             this.moldDetail = detail;
+            this.customCompany = res.data.customCompany;
+
+            this.update = res.data.update;
+            this.download = res.data.download;
+            this.view = res.data.view;
+            this.approve = res.data.approve;
           } else {
             this.$message({
               message: res.msg,
@@ -548,6 +553,55 @@ export default {
       );
     },
 
+    //打开编辑
+    edit() {
+      this.editFormVisible = true;
+      this.editForm = {
+        id: this.moldDetail.id,
+        modelName: this.moldDetail.modelName,
+        initialModulus: this.moldDetail.initialModulus,
+        settingLife: this.moldDetail.settingLife,
+        rfid: this.moldDetail.rfid,
+        flag: 1
+      };
+    },
+
+    addSubmit() {
+      this.$refs.editForm.validate(valid => {
+        if (valid) {
+          this.editLoading = true;
+          this.http.post(
+            this.port.mold.addMold,
+            this.editForm,
+            res => {
+              this.editLoading = false;
+              if (res.code == "ok") {
+                this.editFormVisible = false;
+                this.$message({
+                  message: "创建成功",
+                  type: "success"
+                });
+                this.getDetail();
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: "error"
+                });
+              }
+            },
+            error => {
+              this.editLoading = false;
+              this.editFormVisible = false;
+              this.$message({
+                message: error,
+                type: "error"
+              });
+            }
+          );
+        }
+      });
+    },
+
     //获取文档
     getDocument() {
       this.http.post(
@@ -588,6 +642,13 @@ export default {
       this.centerDialogVisible = true;
     },
 
+    //清理报废文档上传窗口中的文件
+    clearFileRecord() {
+        this.centerDialog2Visible = false;
+        this.$refs.upload1.clearFiles();
+        this.$refs.upload2.clearFiles();
+    },
+
     //审批文件
     check(adoption) {
       this.http.post(
@@ -629,6 +690,7 @@ export default {
         this.$refs.upload1.submit();
         this.$refs.upload2.submit();
         this.centerDialog2Visible = false;
+        this.clearFileRecord();
       } else {
         this.$message({
           message: "必须各上传一个文件",
@@ -674,6 +736,20 @@ export default {
       );
     },
 
+    //文件下载
+    dowloadfile(id) {
+      this.http.post(
+        this.port.mold.moldFileDowload,
+        {
+          id: id
+        },
+        res => {
+          this.getOperationRecord(this.activePage);
+        },
+        error => {}
+      );
+    },
+
     //文件删除
     deleteFile(fileId) {
       this.http.post(
@@ -736,7 +812,7 @@ export default {
     this.allDetail.height = height - 170 + "px";
     const that = this;
     window.onresize = function temp() {
-      that.allDetail.height = window.innerHeight - 210;
+      that.allDetail.height = window.innerHeight - 170;
     };
   },
   mounted() {

+ 13 - 13
ys_vue/src/views/mold/moldList.vue

@@ -112,17 +112,17 @@
 
                 formRules: {
                     modelNo: [
-                    { required: true, message: "请输入模具编号", trigger: "blur" }
+                        { required: true, message: "请输入模具编号", trigger: "blur" }
                     ],
                     modelName: [
-                    { required: true, message: "请输入模具名称", trigger: "blur" }
+                        { required: true, message: "请输入模具名称", trigger: "blur" }
                     ],
                     equipmentId: [
-                    {
-                        required: true,
-                        message: "请选择云模盒编号",
-                        trigger: ["blur", "change"]
-                    }
+                        {
+                            required: true,
+                            message: "请选择云模盒编号",
+                            trigger: ["blur", "change"]
+                        }
                     ]
                 },
                 listLoading: false,
@@ -243,12 +243,12 @@
 
             //添加界面
             showAdd() {
-            this.addFormVisible = true;
-            this.addForm = {
-                modelNo: "",
-                modelName: "",
-                equipmentId: ""
-            };
+                this.addFormVisible = true;
+                this.addForm = {
+                    modelNo: "",
+                    modelName: "",
+                    equipmentId: ""
+                };
             },
 
             addSubmit() {

+ 1 - 1
ys_vue/src/views/project/projectDetail.vue

@@ -661,7 +661,7 @@
             this.allDetail.height = height - 170 + "px";
             const that = this;
             window.onresize = function temp() {
-                that.allDetail.height = window.innerHeight - 210;    
+                that.allDetail.height = window.innerHeight - 170;    
             };
         },
         mounted() {