瀏覽代碼

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

5 年之前
父節點
當前提交
25984b1977
共有 4 個文件被更改,包括 183 次插入25 次删除
  1. 13 5
      ys_vue/src/routes.js
  2. 8 6
      ys_vue/src/views/detection/maintenance.vue
  3. 113 0
      ys_vue/src/views/invite.vue
  4. 49 14
      ys_vue/src/views/mold/moldDetail.vue

+ 13 - 5
ys_vue/src/routes.js

@@ -2,6 +2,7 @@ import Login from './views/Login.vue'
 import NotFound from './views/404.vue'
 import Home from './views/Home.vue'
 import message from './views/message.vue'
+import invite from './views/invite.vue'
 
 import map from './views/map/map.vue'
 
@@ -30,7 +31,7 @@ let routes = [
         name: '',
         hidden: true
     },
-    // 地图概览
+    //地图概览
     {
         path: '/',
         component: Home,
@@ -42,7 +43,7 @@ let routes = [
             { path: '/message', component: message, name: '消息中心', hidden: true }
         ]
     },
-    // 运行监测
+    //运行监测
     {
         path: '/',
         component: Home,
@@ -54,7 +55,7 @@ let routes = [
             { path: '/detection/:id', component: maintenance, name: '运行检测详情', hidden: true }
         ]
     },
-    // 项目管理
+    //项目管理
     {
         path: '/',
         component: Home,
@@ -67,7 +68,7 @@ let routes = [
             { path: '/competence', component: competence, name: '权限管理' }
         ]
     },
-    // 模具管理
+    //模具管理
     {
         path: '/',
         component: Home,
@@ -80,7 +81,7 @@ let routes = [
             { path: '/moldDownload', component: moldDownload, name: '文档下载' }
         ]
     },
-    // 基础管理
+    //基础管理
     {
         path: '/',
         component: Home,
@@ -93,6 +94,13 @@ let routes = [
             { path: '/allocation', component: allocation, name: '云模盒管理' }
         ]
     },
+    //邀请
+    {
+        path: '/invite/:id',
+        component: invite,
+        name: '邀请',
+        hidden: true
+    },
     {
         path: '/404',
         component: NotFound,

+ 8 - 6
ys_vue/src/views/detection/maintenance.vue

@@ -158,6 +158,7 @@
             :http-request="maintain"
             :limit="1"
             :auto-upload="false"
+            before-upload="beforeUpload"
           >
             <el-button size="small" type="primary">上传</el-button>
           </el-upload>
@@ -250,14 +251,15 @@ export default {
     backToDetection() {
       this.$router.go(-1);
     },
-    //暂未用到的上传格式和大小限制
+    //上传格式和大小限制
     beforeUpload(file) {
-      const isJPG = file.type === "image/png";
-      const isLt2M = file.size / 1024 / 1024 < 2;
-      if (!isJPG) {
-        this.$message.error("上传头像图片只能是 PNG 格式!");
+      const isJPG = file.type === "image/jpg";
+      const isPNG = file.type === "image/jpg";
+      const isLt5M = file.size / 1024 / 1024 < 5;
+      if (!isJPG || !isPNG) {
+        this.$message.error("上传头像图片只能是 JPG 或 PNG 格式!");
       }
-      if (!isLt2M) {
+      if (!isLt5M) {
         this.$message.error("上传头像图片大小不能超过 2MB!");
       }
       return isJPG && isLt2M;

+ 113 - 0
ys_vue/src/views/invite.vue

@@ -0,0 +1,113 @@
+<template>
+  <div class="main">
+    <div class="title">云模管理平台</div>
+    <p class="hello">王二小您好!</p>
+    <p class="invite">
+      陈晨 邀您参与
+      <span class="impoortant">南京火石闪信网络公司</span>的
+      <span class="impoortant">face水杯</span>项目
+    </p>
+    <div class="info">
+      <p class="info1">您的账户信息</p>
+      <p class="info2">
+        手机号
+        <span>16651112436</span>
+      </p>
+      <p class="info3">
+        初始密码
+        <span>000000</span>
+      </p>
+    </div>
+    <button @click="join">立即加入</button>
+  </div>
+</template>
+
+<script>
+import util from "../common/js/util";
+export default {
+  data() {
+    return {
+      id: ""
+    };
+  },
+  methods: {
+    join() {
+      this.$router.push("/login");
+    }
+  },
+  created() {},
+  mounted() {
+    //获取传入的值
+    this.id = this.$route.params.id;
+    console.log(this.id);
+  }
+};
+</script>
+
+<style scoped>
+* {
+  margin: 0;
+  padding: 0;
+}
+.main {
+  margin: 80px auto;
+  width: 300px;
+  color: #555;
+}
+.title {
+  text-align: center;
+  font-size: 20px;
+  color: #999;
+  line-height: 50px;
+  border-bottom: #ddd 1px solid;
+  margin-bottom: 5px;
+  padding: 0 10px;
+}
+.impoortant {
+  color: #1e72ff;
+}
+.hello {
+  line-height: 40px;
+  padding: 0 10px;
+}
+.invite {
+  line-height: 22px;
+  padding: 0 10px;
+}
+.info {
+  background-color: #eee;
+  margin: 20px 0;
+  padding: 10px;
+  border-radius: 3px;
+}
+.info1 {
+  padding-left: 10px;
+  border-left: #1e72ff 1px solid;
+  line-height: 18px;
+}
+.info2 {
+  line-height: 20px;
+  padding: 10px 0;
+}
+.info3 {
+  line-height: 20px;
+}
+.info2 span {
+  position: relative;
+  left: 40px;
+  color: #999;
+}
+.info3 span {
+  position: relative;
+  left: 25px;
+  color: #999;
+}
+button {
+  background-color: #1e72ff;
+  border: 0;
+  color: white;
+  border-radius: 5px;
+  width: 100%;
+  height: 40px;
+}
+</style>

+ 49 - 14
ys_vue/src/views/mold/moldDetail.vue

@@ -86,7 +86,7 @@
 
             <!-- 上传 模具0 时 -->
             <el-dropdown trigger="click" style="float: right;" v-show="activeTab == 0 && update == 1">
-                <el-button size="small" type="primary" :loading="uploading[0]">
+                <el-button size="mini" type="primary" :loading="uploading[0]">
                     上传
                     <i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
@@ -99,13 +99,13 @@
             </el-dropdown>
             
             <!-- 上传 零件1 时 -->
-            <el-button size="small" type="primary" style="float:right;" v-show="activeTab == 1 && update == 1" @click.native="fileType = 0;centerDialog4Visible = true;">
+            <el-button size="mini" type="primary" style="float:right;" v-show="activeTab == 1 && update == 1" @click.native="fileType = 0;centerDialog4Visible = true;">
                 上传
             </el-button>
 
             <!-- 零件1 新建零件 -->
             <el-dropdown trigger="click" style="float: right; margin-right: 10px;" v-show=" activeTab == 1 && update == 1">
-                <el-button size="small" type="primary">
+                <el-button size="mini" type="primary">
                     新建零件
                     <i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
@@ -129,13 +129,13 @@
                 :limit="5"
                 style="float:right;"
             >
-                <el-button size="small" type="primary" :loading="uploading[1]">上传</el-button>
+                <el-button size="mini" type="primary" :loading="uploading[1]">上传</el-button>
             </el-upload>
 
-            <!-- 更新4 --><!-- 目前还没加入权限 -->
+            <!-- 更新4 -->
             <el-button
                 v-show="activeTab == 4 && user.id == moldDetail.managerId"
-                size="small"
+                size="mini"
                 type="primary"
                 style="float: right;"
                 @click="updateRequest"
@@ -144,7 +144,7 @@
             <!-- 上传 报废5 时 -->
             <el-button
                 v-show="activeTab == 5 && update == 1"
-                size="small"
+                size="mini"
                 type="primary"
                 style="float: right;"
                 @click="centerDialog2Visible = true;"
@@ -333,9 +333,18 @@
                 <el-tab-pane label="模具更新" name="4">
                     <el-table :data="documents.update" highlight-current-row v-loading="listLoading" style="width: 100%;">
                         <el-table-column type="index" width="40"></el-table-column>
-                        <el-table-column label="申请人" sortable></el-table-column>
-                        <el-table-column label="申请时间" width="200" sortable></el-table-column>
-                        <el-table-column label="状态" width="120" sortable></el-table-column>
+                        <el-table-column prop="uploadtor" label="申请人" sortable></el-table-column>
+                        <el-table-column prop="indate" label="申请时间" width="200" sortable></el-table-column>
+                        <el-table-column label="状态" width="120" sortable>
+                            <template slot-scope="scope">
+                                <span v-if="scope.row.state == -2">生产方审核不通过</span>
+                                <span v-else-if="scope.row.state == -1">资产方审核不通过</span>
+                                <span v-else-if="scope.row.state == 0">待双方审核</span>
+                                <span v-else-if="scope.row.state == 1">待生产方审核</span>
+                                <span v-else-if="scope.row.state == 2">待资产方审核</span>
+                                <span v-else-if="scope.row.state == 3">审核通过</span>
+                            </template>
+                        </el-table-column>
                         <el-table-column label="操作" width="200" sortable>
                             <template slot-scope="scope">
                                 <el-button size="small" @click="updateApproval(scope.row.id, true)" type="primary">通过</el-button>
@@ -384,7 +393,7 @@
         <!-- 操作记录 -->
         <el-col :span="24" class="title">
             {{activeTab == 4?"更新":"操作"}}记录
-            <el-button v-if="user.id == moldDetail.managerId" size="small" type="primary" style="float: right;" @click="centerDialog5Visible = true">导出</el-button>
+            <el-button v-if="user.id == moldDetail.managerId" size="mini" type="primary" style="float: right;" @click="centerDialog5Visible = true">导出</el-button>
             </el-col>
             <el-table :data="operations" highlight-current-row v-loading="listLoading" style="width: 100%;">
                 <el-table-column type="index" width="40"></el-table-column>
@@ -787,7 +796,6 @@
                         for(var i in res.data){
                             this.setList(res.data[i].list,i);
                         }
-
                         //顺便再把下面操作记录读取一下
                         this.getOperationRecord(this.activeTab);
                     } else {
@@ -934,7 +942,7 @@
                 var fileObj = params.file;
                 var form = new FormData();
                 form.append("file", fileObj);
-                form.append("blongType", this.activeTab);
+                form.append("belongType", this.activeTab);
                 form.append("mouldId", this.detailId);
                 if (this.activeTab == 0 || this.activeTab == 1) {
                     form.append("dwgType", this.fileType);
@@ -1226,7 +1234,34 @@
 
             //更新申请
             updateRequest(){
-                console.log("发起了申请,但什么都没有发生")
+                this.$confirm('要申请更新模具吗?', '申请', {
+                    type: 'info'
+                }).then(() => {
+                    this.http.post( this.port.mold.moldFileUpload, {
+                        belongType: 4,
+                        mouldId: this.detailId
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "申请成功",
+                                type: "success"
+                            });
+                            this.getDocument();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                })
             },
 
             //更新批准