Ver Fonte

Merge branch 'master' of http://47.100.37.243:10080/wutt/childrenLibraryBMS

há 5 anos atrás
pai
commit
033caa6e2b

+ 14 - 0
lib_vue/index.html

@@ -13,6 +13,20 @@
                 background: #fff!important;
             }
 
+            .el-tooltip__popper {
+                max-width:200px!important;
+            }
+
+            .el-table .cell {
+                text-overflow: -o-ellipsis-lastline;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                display: -webkit-box;
+                -webkit-line-clamp: 4;
+                line-clamp: 4;
+                -webkit-box-orient: vertical;
+            }
+
             /* 地图弹窗样式 */
             .window {
                 background: #fff;

+ 74 - 39
lib_vue/src/main.js

@@ -43,52 +43,87 @@ router.beforeEach((to, from, next) => {
     if (!user && to.path != '/login') {
         next({ path: '/login' })
     } else {
-        if(user){
-            for(var i in routes){
-                if(routes[i].name == "基础管理" && user.parentId != 0){
-                    routes[i].hidden = true
-                } else if(routes[i].name == "基础管理"){
-                    routes[i].hidden = false
+        if(user) {
+            for(var i in routes) {
+                if(routes[i].name == "图书管理" || routes[i].name == "系统管理") {
+                    if(user.roleType == 0) {
+                        routes[i].hidden = false
+                    } else {
+                        routes[i].hidden = true
+                    }
                 }
-                
-                if(routes[i].name == "项目管理" && user.parentId > 1){
-                    var children = routes[i].children;
-                    for(var j in children){
-
-                        if(children[j].name == "人员管理"){
-                            if(user.isManager == 0){
-                                children[j].hidden = true
-                            } else {
-                                children[j].hidden = false
-                            }
-                        }
-
-                        if(children[j].name == "权限管理"){
-                            if(user.isManager == 0){
-                                children[j].hidden = true
-                            } else {
-                                children[j].hidden = false
-                            }
-                        }
+
+                if(routes[i].name == "机构详情") {
+                    if(user.roleType == 0) {
+                        routes[i].hidden = true
+                    } else {
+                        routes[i].hidden = false
                     }
-                } else if(routes[i].name == "项目管理") {
-                    var children = routes[i].children;
-                    for(var j in children){
-                        if(children[j].name != "项目详情"){
-                            children[j].hidden = false
-                        }
-                        
-                        if(children[j].name == "权限管理"){
-                            if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
-                                children[j].hidden = true
-                            }
-                        }
+                }
+
+                if(routes[i].name == "培训机构") {
+                    if(user.roleType == 0) {
+                        routes[i].hidden = false
+                    } else {
+                        routes[i].hidden = true
                     }
                 }
             }
         }
-        next()
     }
+
+
+    // let user = JSON.parse(sessionStorage.getItem('user'));
+    // if (!user && to.path != '/login') {
+    //     next({ path: '/login' })
+    // } else {
+    //     if(user){
+    //         for(var i in routes){
+    //             if(routes[i].name == "基础管理" && user.parentId != 0){
+    //                 routes[i].hidden = true
+    //             } else if(routes[i].name == "基础管理"){
+    //                 routes[i].hidden = false
+    //             }
+                
+    //             if(routes[i].name == "项目管理" && user.parentId > 1){
+    //                 var children = routes[i].children;
+    //                 for(var j in children){
+
+    //                     if(children[j].name == "人员管理"){
+    //                         if(user.isManager == 0){
+    //                             children[j].hidden = true
+    //                         } else {
+    //                             children[j].hidden = false
+    //                         }
+    //                     }
+
+    //                     if(children[j].name == "权限管理"){
+    //                         if(user.isManager == 0){
+    //                             children[j].hidden = true
+    //                         } else {
+    //                             children[j].hidden = false
+    //                         }
+    //                     }
+    //                 }
+    //             } else if(routes[i].name == "项目管理") {
+    //                 var children = routes[i].children;
+    //                 for(var j in children){
+    //                     if(children[j].name != "项目详情"){
+    //                         children[j].hidden = false
+    //                     }
+                        
+    //                     if(children[j].name == "权限管理"){
+    //                         if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
+    //                             children[j].hidden = true
+    //                         }
+    //                     }
+    //                 }
+    //             }
+    //         }
+    //     }
+    //     next()
+    // }
+    next()
 })
 
 new Vue({

+ 9 - 104
lib_vue/src/port.js

@@ -18,113 +18,18 @@ export default {
         list: '/book/list',
         detail: '/book/detail',
         add: '/book/addOrUpdateBook',
+        delete: '/book/del',
         uploadFile: '/book/addBookPage',
-        delete: '/book/deleteBookPage',
         fileList: '/book/bookPageList',
     },
-    map: { 
-        mapList: '/company/getCoutomCompanyAndMouldsByUser', // 生产方公司和公司下所属的模具
-        newMap: '/mould/listMap' // 获取地图
+    user: {
+        reserList: '/userappointment/list',
+        reserEdit: '/userappointment/acceptAndUpdateDate',
     },
-    project: {
-        addUser: '/user/add',  // 添加或修改用户
-        userList: '/user/list',  // 用户列表
-        delUser: '/user/delete',  // 删除用户
-
-        addProject: '/project/add', // 添加或修改项目
-        projectList: '/project/list', // 项目列表
-        projectDetail: '/project/detail', // 项目详情
-        projects: '/project/projectList', // 筛选模具列表时作为筛选条件所加载的项目列表
-        projectByUser: '/project/getProjectListByUserAndCompany',// 获取创建人员分配项目时根据当前人和公司获取项目列表
-
-        uploadFile: '/projectfile/uploadFile', //项目文档的上传
-        dowloadFile: '/projectfile/dowloadFile', //项目文档的下载
-        fileList: '/projectfile/list', //项目文档列表
-        delFile: '/projectfile/delFile', //项目文档的删除
-        operList: '/projectoperationdynamics/list', //项目操作记录列表
-
-        getUserList: '/user/getUserList', //获取用户列表
-        getUserById: '/user/getUserListByCompanyIds', // 给项目分配参与人的时候根据公司id获取公司下的人员
-
-        inviteUser: '/invitationrecord/inviteUser', //添加邀请记录并产生链接
-
-        powerList: '/power/list', // 权限列表
-        powerUpdate: '/power/update', //修改权限
-    },
-    //模具
-    mold: {
-        addMold: '/mould/addOrUpdate', //添加/修改模具设备
-        molds: '/mould/list', //模具列表
-        modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
-        delMold: '/mould/delMould', //删除模具
-
-        moldDetail: '/mould/detail', //模具详情
-        moldFileList: '/mouldfile/list', //获取模具文档
-        moldFileListAll: '/mouldfile/allList', //获取全部模具文档
-        moldFileUpload: '/mouldfile/uploadFile', //上传模具文档
-        moldFileDowload: '/mouldfile/dowloadFile', //模具文档的下载
-        moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
-
-        moldFileDowloadFile: '/mouldfile/downloadfileList', //批量下载
-        moldFileCheck: '/mouldfile/check', //审批模具文档 
-        exportOperationExcel: '/mouldfile/downloadFileListExcel', //下载操作记录
-
-        chooseModelList: '/mould/chooseModelList', //编辑项目时显示的模具列表
-
-        moldFileDelete: '/mouldfile/delFile', //项目文档的删除
-        moldOperationList: '/mouldoperationdynamics/list', //项目操作记录列表
-
-        partList: '/part/list', //零件列表
-        addPart: '/part/addOrUpdate', //单个零件添加
-        importPart: '/part/importAppLogin',//零件的excel导入
-        partUpload: '/mouldfile/uploadPartFileList', //零件文档的批量上传
-
-        download: '/mouldfile/download',
-
-        moldMaintain: '/mouldmaintain/maintain', //维护
-        moldMaintainList: '/mouldmaintain/list', //获取列表
-        moldMaintainListGet: '/mould/maintainMouldList', //主页获取保养模具列表
-        moldDiscardListGet: '/mould/scrapMouldList', //主页获取报废模具列表
-        moldChange: '/mould/changeMouldEquipment', //处理告警
-        moldChangeRequirement: '/mouldequipment/getEquipmentListByOldMouldAndUser' //处理告警所需的设备
-    },
-    //基础管理
-    base: {
-        addCompany: '/company/add', // 添加资产方
-        companyList: '/company/list', // 资产方列表
-        delCompany: '/company/delete', // 删除资产方
-
-        getCompanyList: '/company/getCompanyList', // 管理员创建人员时显示公司
-        
-        getCompanys: '/company/getCompanys', // 云模盒所属公司
-
-        addCompanyListToProject: '/company/addCompanyListToProject', // 编辑项目时获取生产方公司
-
-        relationList: '/company/relationList', // 获取关联公司列表
-
-        //ownerComps: '/company/ownerRelateCompany', // 返回当前公司的关联公司列表
-
-        getProduceCompany: '/company/getProduceCompany', // 根据项目id获取生产方列表
-        
-        getInfo: '/company/getProduceCompanyByCurrentUser', // 根据当前人登录人所能看到的公司进行筛选
-
-        addFactory: '/factory/add',  // 添加生产方
-        factoryList: '/factory/list',   // 生产方列表
-        delFactory: '/factory/delete',  // 删除生产方
-
-        editMould: '/mouldequipment/addOrUpdate', // 添加 / 修改云模盒
-        mouldeList: '/mouldequipment/getEquipmentList', // 云模盒列表
-        enableMould: '/mouldequipment/use', // 启用云模盒
-
-        moulds: '/mouldequipment/getMouldEquipmentList', // 创建模具时获取资产方的云模盒列表
-        importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
-        
-        setPacket: '/mouldequipment/use',// 云平台下行配置数据包接口
-        openingAndClosingTimesChart: '/mouldhistory/openingAndClosingTimesChart', //获取云模盒的每日开合次数图表 (时间/次数)
-        openingAndClosingTimesChartCycle: '/mouldhistory/openingAndClosingTimesChartCycle', //获取云模盒的每日开合次数周期 (时间/次数)
-
-    },
-    file: {
-        view: '/pdffile/getPdfFile' // 文件预览
+    system: {
+        list: '/institutional/accountList',
+        addAccount: '/institutional/addAccount',
+        delAccount: '/institutional/delAccount',
+        agencyList: '/institutional/createAccountforlist',
     }
 }

+ 14 - 3
lib_vue/src/routes.js

@@ -28,7 +28,7 @@ let routes = [
     {
         path: '/',
         component: Home,
-        name: '',
+        name: '培训机构',
         iconCls: 'iconfont iconpeixunjigou',
         leaf: true,//只有一个节点
         children: [
@@ -36,11 +36,22 @@ let routes = [
             { path: '/agency/:id', component: agencyDetail, name: '机构详情', hidden: true }
         ]
     },
+    //培训机构
+    {
+        path: '/',
+        component: Home,
+        name: '机构详情',
+        iconCls: 'iconfont iconpeixunjigou',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/agencyDetail', component: agencyDetail, name: '机构详情', hidden: true }
+        ]
+    },
     //课程管理
     {
         path: '/',
         component: Home,
-        name: '',
+        name: '课程管理',
         iconCls: 'iconfont iconkecheng',
         leaf: true,//只有一个节点
         children: [
@@ -52,7 +63,7 @@ let routes = [
     {
         path: '/',
         component: Home,
-        name: '',
+        name: '图书管理',
         iconCls: 'iconfont iconic_local_library_px',
         leaf: true,//只有一个节点
         children: [

+ 10 - 2
lib_vue/src/views/Login.vue

@@ -53,8 +53,16 @@
                         this.http.post(this.port.manage.login, this.ruleForm , res => {
                             this.logining = false;
                             if (res.code == "ok") {
-                                sessionStorage.setItem('user', JSON.stringify(res.data.user));
-                                this.$router.push({ path: '/agency' });
+                                var user = res.data.user;
+                                if(res.data.institutionalInformation != null) {
+                                    user.ageId = res.data.institutionalInformation.id 
+                                }
+                                sessionStorage.setItem('user', JSON.stringify(user));
+                                if(res.data.user.roleType == 0) {
+                                    this.$router.push({ path: '/agency' });
+                                } else {
+                                    this.$router.push({ path: '/agencyDetail'});
+                                }
                             } else {
                                 this.$message({
                                     message: res.msg,

+ 5 - 8
lib_vue/src/views/agency/agencyDetail.vue

@@ -6,9 +6,7 @@
                 <el-container>
                     <el-aside width="335px;">
                         <div class="agencyHead_img">
-                            <!-- <el-image class="agencyHead_imgbox" :src="detail.briefIntroductionPic"> -->
-                                <img class="agencyHead_imgbox" :src="detail.briefIntroductionPic">
-                            <!-- </el-image> -->
+                            <img class="agencyHead_imgbox" :src="detail.briefIntroductionPic">
                         </div>
                     </el-aside>
                     <el-container>
@@ -66,15 +64,15 @@
                 </el-col>
                 <el-col :span="24" class="agencyBody_detail">
                     收费标准:
-                    <span class="info">{{detail.chargingStandard==null?'暂无':detail.chargingStandard}}</span>
+                    <span class="info">{{detail.chargingStandard==null||detail.chargingStandard==''?'暂无':detail.chargingStandard}}</span>
                 </el-col>
                 <el-col :span="24" class="agencyBody_detail">
                     机构位置:
-                    <span class="info">{{detail.address==null?'暂无':detail.address}}</span>
+                    <span class="info">{{detail.address==null||detail.address==''?'暂无':detail.address}}</span>
                 </el-col>
                 <el-col :span="24" class="agencyBody_detail">
                     联系方式:
-                    <span class="info">{{detail.phone==null?'暂无':detail.phone}}</span>
+                    <span class="info">{{detail.phone==null||detail.phone==''?'暂无':detail.phone}}</span>
                 </el-col>
             </el-col>
 
@@ -165,7 +163,7 @@
         data() {
             return {
                 //基础信息
-                detailId: this.$route.params.id,
+                detailId: this.$route.params.id==null?JSON.parse(sessionStorage.getItem('user')).ageId:this.$route.params.id,
                 user: JSON.parse(sessionStorage.getItem('user')),
                 detail: {},
 
@@ -590,7 +588,6 @@
 
     .agencyHead {
         margin: 20px 0 0 0;
-        padding: 0 20px;
     }
 
     .agencyHead_img {

+ 1 - 0
lib_vue/src/views/agency/agencyList.vue

@@ -167,6 +167,7 @@
                         this.addLoading = true;
                         this.http.post(this.port.agency.add, {
                             name: this.addForm.name,
+                            phone: this.addForm.phone,
                             address: this.addForm.address,
                             lng: this.addForm.address==''?null:this.addForm.yLng,
                             lat: this.addForm.address==''?null:this.addForm.xLat,

Diff do ficheiro suprimidas por serem muito extensas
+ 168 - 924
lib_vue/src/views/book/bookDetail.vue


+ 4 - 5
lib_vue/src/views/book/bookList.vue

@@ -18,14 +18,14 @@
 		<!--列表-->
 		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
 			<el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="cover" label="图书封面" width="180">
+			<el-table-column prop="cover" label="图书封面" width="100">
                 <template slot-scope="scope">
-                    <img :src="scope.row.cover">
+                    <el-image style="width: 70px; height: 99px" :src="scope.row.cover" lazy></el-image>
 				</template>
             </el-table-column>
             <el-table-column prop="name" label="图书名称" width="200" sortable></el-table-column>
             <el-table-column prop="author" label="图书作者" sortable></el-table-column>
-            <el-table-column prop="descrip" label="图书简介" width="300" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column prop="descrip" label="图书简介" width="300"></el-table-column>
 			<el-table-column label="操作" width="160" align="center">
 				<template slot-scope="scope">
                     <el-button type="primary" size="small" @click="toDetail(scope.row.id)">详情</el-button>
@@ -59,7 +59,7 @@
                 <el-form-item label="图书简介" prop="descrip">
 					<el-input v-model="addForm.descrip" type="textarea" :rows="5" placeholder="请输入图书简介"></el-input>
 				</el-form-item>
-                <el-form-item label="机构图片">
+                <el-form-item label="图书封面">
                     <el-upload class="avatar-uploader" ref="upload" accept="image/*" list-type="picture-card"
                         :limit="1" action="action" :auto-upload="false" :http-request="uploadFile" :file-list='addForm.file'>
                         <i slot="default" class="el-icon-plus"></i>
@@ -228,7 +228,6 @@
                             type: "success"
                         });
                         this.addFormVisible = false;
-                        this.$refs.upload.clearFiles();
                         this.getList();
                     } else {
                         this.$message({

+ 0 - 173
lib_vue/src/views/detection/detection.vue

@@ -1,173 +0,0 @@
-<template>
-    <section>
-        <!--工具条-->
-        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-            <el-form :inline="true" :model="filters">
-                <el-col :span="2">
-                    <el-form-item>
-                        <el-select v-model="filters.value" placeholder="请选择查询条件">
-                        <el-option label="编号" value="0"></el-option>
-                        <el-option label="名称" value="1"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-form-item>
-                    <el-input v-model="filters.name" placeholder="请输入关键字进行搜索" style="width: 300px;" clearable></el-input>
-                </el-form-item>
-                <el-form-item>
-                    <el-button type="primary" @click="getMoulds(filters.name)">查询</el-button>
-                </el-form-item>
-            </el-form>
-        </el-col>
-
-        <!--列表-->
-        <el-table :data="moulds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
-            <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="100" sortable></el-table-column>
-            <el-table-column label="模具名称" width="200" sortable>
-                <template slot-scope="scope">
-                    <a style="color: #409EFF; cursor: pointer" @click="toMould(scope.row.id)">{{scope.row.modelName}}</a>
-                </template>
-            </el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="180" sortable></el-table-column>
-            <el-table-column prop="projectName" label="所属项目" width="200" sortable></el-table-column>
-            <el-table-column prop="factoryName" label="制造工厂" width="200" sortable></el-table-column>
-            <el-table-column prop="area" label="位置" width="200" sortable></el-table-column>
-            <el-table-column prop="runTimes" label="运行次数" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="ocCycle" label="每模平均周期" align="center" width="140" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" align="center" width="80" sortable></el-table-column>
-            <el-table-column prop="lastOpenTime" label="最后开模时间" align="center" width="150" sortable></el-table-column>
-            <el-table-column label="模具状态" align="center" width="100" sortable>
-                <template slot-scope="scope">
-                    <span v-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>
-                    <span v-else-if="scope.row.state == 4">已报废</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="云模盒报警" align="center" width="160">
-                <template slot-scope="scope">
-                    <span v-if="scope.row.stage == 0">正常</span>
-                    <span v-else-if="scope.row.stage == 1">温度过高</span>
-                    <span v-else-if="scope.row.stage == 2">电量过低</span>
-                    <span v-else-if="scope.row.stage == 3">安装被拆</span>
-                    <span v-else>不明</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="模具保养" align="center" width="100">
-                <template slot-scope="scope">
-                    <span v-if="scope.row.isMaintain == 1">需要</span>
-                    <span v-else>正常</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="处理" align="center" width="85">
-                <template slot-scope="scope">
-                    <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">详情</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <!--工具条-->
-        <el-col :span="24" class="toolbar">
-            <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100 , 200]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;"
-            ></el-pagination>
-        </el-col>
-    </section>
-</template>
-
-<script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      moulds: [],
-      filters: {
-        name: "",
-        value: "0"
-      },
-      listLoading: false,
-      total: 0,
-      tableHeight: 0,
-      page: 1,
-      size: 20
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getMoulds();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getMoulds();
-    },
-    //跳转到运行监测详情
-    toMaintenance(id) {
-      this.$router.push("/detection/" + id);
-    },
-    //跳转到模具详情
-    toMould(id) {
-      this.$router.push("/moldList/" + id + "/0");
-    },
-    //获取模具信息
-    getMoulds(keyWord) {
-      this.listLoading = true;
-      if (keyWord == null) {
-        var type = 0;
-      } else {
-        var type = this.filters.value;
-      }
-      var params = {
-        pageNum: this.page,
-        pageSize: this.size,
-        projectId: -1,
-        searchType: type,
-        keyName: keyWord,
-        type: 0
-      };
-      this.http.post(
-        this.port.mold.molds,
-        params,
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            this.moulds = res.data.list;
-            this.total = res.data.total;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
-        },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 210;
-  },
-  mounted() {
-    this.getMoulds();
-  }
-};
-</script>
-
-<style scoped>
-</style>

+ 0 - 726
lib_vue/src/views/detection/maintenance.vue

@@ -1,726 +0,0 @@
-<template>
-    <section>
-        <!--工具条-->
-        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-            <el-form :inline="true">
-                <el-form-item>
-                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
-                </el-form-item>
-                <el-form-item class="divLine"></el-form-item>
-                <el-form-item>{{mouldName}}</el-form-item>
-                <el-form-item class="state" style="float: right;">当前状态:
-                    <span v-if="mouldState == 0">静止</span>
-                    <span v-else-if="mouldState == 1">运动</span>
-                    <span v-else-if="mouldState == 2">告警</span>
-                    <span v-else-if="mouldState == 3">待报废</span>
-                    <span v-else-if="mouldState == 4">已报废</span>
-                </el-form-item>
-            </el-form>
-        </el-col>
-        
-        <el-col :span="24" :style="allDetail">
-            <!-- 模具处理 -->
-            <el-col :span="24" class="title">模具处理</el-col>
-            <el-col :span="6" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
-                当前保养状态:
-                <span v-if="requirement" style="color: #ff4949;">需要</span>
-                <span v-else style="color: black;">正常</span>
-                <el-button size="small" type="primary" @click="showMaintenance" style="margin-left: 16px;"
-                    v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement">立即处理
-                </el-button>
-            </el-col>
-            <el-col :span="8" :offset="2" style="line-height: 32px;">
-                云模盒告警:{{warningInfo}}
-                <el-button size="small" type="primary" @click="warningFormVisible = true" style="margin-left: 16px;"
-                    v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0">立即处理
-                </el-button>
-            </el-col>
-
-            <!-- 开合周期 -->
-            <el-col :span="24" class="title">开合周期</el-col>
-            <el-col :span="24">
-                <el-col :span="11">
-                    <div style="padding:0 20px">
-                        <b style="font-size:20px;text-align:center;margin-bottom:20px;">开合次数表</b>
-                        <el-date-picker v-model="openNum" style="float:right;width:125px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change='changeOpen(1)' size="mini" :clearable="false" type="date" placeholder="选择日期"></el-date-picker>
-                    </div>
-                    <div id="myChart1" :style="{ height: '300px'}"></div>
-                </el-col>
-                <el-col :span="11" :offset="2">
-                    <div style="padding:0 20px">
-                        <b style="font-size:20px;text-align:center;margin-bottom:20px;">开合周期表</b>
-                        <el-date-picker v-model="openCycle" style="float:right;width:210px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change='changeOpen(2)' size="mini" :clearable="false" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
-                    </div>
-                    <div id="myChart2" :style="{ height: '300px'}"></div>
-                </el-col>
-            </el-col>
-
-            <!-- 操作记录 -->
-            <el-col :span="24" class="title">处理记录</el-col>
-            <!-- 列表 -->
-            <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
-                <el-table-column type="index" width="60"></el-table-column>
-                <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
-                <el-table-column prop="maintainType" label="保养方案" sortable>
-                    <template slot-scope="scope">
-                        <span v-if="scope.row.maintainType == 0">喷漆</span>
-                        <span v-else-if="scope.row.maintainType == 1">检查</span>
-                        <span v-else="scope.row.maintainType == 2">易损件</span>
-                    </template>
-                </el-table-column>
-                <el-table-column prop="fileName" label="保养照片" width="200" sortable>
-                    <template slot-scope="scope" v-if="scope.row.fileUrl != null">
-                        <!-- <a style="color: #409EFF; cursor: pointer; text-decoration: none;"
-                            :href="scope.row.fileUrl" :download="scope.row.fileName"> -->
-                            <!-- 大图加载 -->
-                            <div class="demo-image__preview">
-                                <el-image style="width: 100px; height: 100px"
-                                    :src="scope.row.fileUrl" :preview-src-list="scope.row.fileUrl"></el-image>
-                            </div>
-                        <!-- </a> -->
-                    </template>
-                </el-table-column>
-                <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
-            </el-table>
-
-            <!--工具条-->
-            <el-col :span="24" class="toolbar">
-                <el-pagination
-                    @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"
-                    :page-sizes="[20 , 50 , 80 , 100 , 200]"
-                    :page-size="20"
-                    layout="total, sizes, prev, pager, next"
-                    :total="total"
-                    style="float:right;"
-                ></el-pagination>
-            </el-col>
-        </el-col>
-
-        <!--新增界面-->
-        <el-dialog title="处理保养" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="maintenanceForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-                <el-form-item label="保养类型" prop="type">
-                    <!-- 保养类型选择 -->
-                    <el-select v-model="type.value" filterable placeholder="请选择保养类型" style="width:202px">
-                        <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-
-                <!-- 保养类型为1时 选择易损件ID -->
-                <el-form-item v-if="type.value == 1" label="易损件" prop="vulnerable">
-                    <el-select v-model="vulnerable.value" clearable filterable placeholder="请选择易损件" style="width:202px">
-                        <el-option v-for="item in vulnerable" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-
-                <!-- 保养类型为0时 选择保养动作 -->
-                <el-form-item v-else label="动作" prop="action">
-                    <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
-                        <el-option v-for="item in action" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-
-                <el-form-item label="保养照片">
-                    <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
-                        <el-button size="small" type="primary">上传</el-button>
-                    </el-upload>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
-            </div>
-        </el-dialog>
-
-        <!--告警处理界面-->
-        <el-dialog title="告警处理" v-if="warningFormVisible" :visible.sync="warningFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="warningForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-                <el-form-item label="告警类型">
-                    <el-input placeholder="请选择告警类型" v-model="warningInfo" :disabled="true"></el-input>
-                </el-form-item>
-                <el-form-item label="云模盒设置" prop="action">
-                    <el-select v-model="warningForm.equipmentId" filterable placeholder="请选择云模盒" style="width:202px">
-                        <el-option v-for="item in equipments" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click.native="warningFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
-            </div>
-        </el-dialog>
-    </section>
-</template>
-
-<script>
-    import util from "../../common/js/util";
-    export default {
-        data() {
-            return {
-                user: JSON.parse(sessionStorage.getItem("user")),
-                detail: '',
-                //本页模具ID
-                mouldId: null,
-                //模具名字
-                mouldName: null,
-                //模具状态
-                mouldState: 0,
-                //记录
-                records: [],
-                //警告信息
-                warningInfo: "",
-                stage: 0,
-                //告警时需要更换的设备的列表
-                equipments: [],
-                //标题栏过滤器
-                filters: {
-                    name: "",
-                    value: ""
-                },
-                listLoading: false,
-                page: 1,
-                size: 20,
-                total: 0,
-                tableHeight: 0,
-                //活跃页面
-                activePage: 0,
-                formRules: {},
-                //保养界面 种类
-                type: [{ label: "动作", value: 0 }, { label: "易损件", value: 1 }],
-                //保养界面 动作
-                action: [{ label: "喷漆", value: 0 }, { label: "检查", value: 1 }],
-                //易损件 假数据
-                vulnerable: [],
-                //是否需要保养 提示
-                requirement: false,
-                prompt: true,
-                //保养详情界面显示
-                maintenanceFormVisible: false,
-                maintenanceLoading: false,
-                //告警详情界面显示
-                warningFormVisible: false,
-                warningLoading: false,
-                //保养详情界面数据
-                maintenanceForm: {
-                    username: "",
-                    account: "",
-                    mobile: "",
-                    teamName: "",
-                    companyId: "",
-                    roleType: "",
-                    flag: 0
-                },
-                //告警处理截面数据
-                warningForm: {
-                    mouldId: null,
-                    equipmentId: null
-                },
-                imageUrl: "",
-                openNum: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
-                openCycle: [util.formatDate.format(new Date(), 'yyyy-MM-dd') , util.formatDate.format(new Date(), 'yyyy-MM-dd')],
-                allDetail: {
-                    overflow: 'auto',
-                    padding: '0px 5px',
-                    height: 0
-                },
-                echarts1: {},
-                echarts2: {},
-            };
-        },
-        methods: {
-            //分页
-            handleCurrentChange(val) {
-                this.page = val;
-                this.getList();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-                this.getList();
-            },
-
-            //标签页面切换时
-            handleClick(tab, event) {
-                this.activeTab = tab.name;
-                //应该是取得对应的消息 目前还没写
-            },
-
-            selsChange: function(sels) {
-                this.sels = sels;
-            },
-
-            backToDetection() {
-                this.$router.go(-1);
-            },
-
-            //上传格式和大小限制
-            beforeUpload(file) {
-                const isJPG = file.type === "image/jpg";
-                const isJPEG = file.type === "image/jpeg";
-                const isPNG = file.type === "image/png";
-                var rightType = isJPG || isPNG || isJPEG;
-                const isLt5M = file.size / 1024 / 1024 < 5;
-                if (!rightType) {
-                    this.$message.error("上传的图片只能是 JPG 或 PNG 格式!");
-                }
-                if (!isLt5M) {
-                    this.$message.error("上传的图片大小不能超过 5MB!");
-                }
-                return rightType && isLt5M;
-            },
-
-            //显示保养界面
-            showMaintenance: function() {
-                this.maintenanceFormVisible = true;
-            },
-
-            //获取记录
-            getList() {
-                this.listLoading = true;
-                this.http.post( this.port.mold.moldMaintainList, { 
-                    mouldId: this.mouldId, 
-                    pageSize: this.size, 
-                    pageNum: this.page 
-                },
-                res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        this.records = res.data.list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                        message: res.msg,
-                        type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //模具详情 获取模具名字用的
-            getDetail() {
-                this.http.post( this.port.mold.moldDetail, {
-                    id: this.mouldId
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.detail = res.data.vo;
-                        this.getEcharts1();
-                        this.getEcharts2();
-                        this.mouldName = res.data.vo.modelName;
-                        this.mouldState = res.data.vo.state;
-                        this.requirement = res.data.vo.isMaintain == 1;
-                        this.stage = res.data.vo.stage;
-                        if(this.stage == 0){
-                            this.warningInfo = "正常";
-                        }else if(this.stage == 1){
-                            this.warningInfo = "温度过高";
-                        }else if(this.stage == 2){
-                            this.warningInfo = "电量过低";
-                        }else if(this.stage == 3){
-                            this.warningInfo = "温度过高、电量过低";
-                        }else{
-                            this.warningInfo = "状况不明";
-                        }
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
-            maintainConfirm() {
-                if (this.$refs.upload.uploadFiles.length == 1) {
-                    this.$refs.upload.submit();
-                } else {
-                    this.$message({
-                    message: "必须上传照片",
-                    type: "error"
-                    });
-                }
-            },
-
-            //模具保养
-            maintain(params) {
-                if (this.type.value != null) {
-                    var fileObj = params.file;
-                    var form = new FormData();
-                    form.append("file", fileObj);
-                    form.append("mouldId", this.mouldId);
-                    form.append("maintainType", this.type.value);
-                    if (this.type.value == 0) {
-                        if (this.action.value == null) {
-                            return;
-                        }
-                        form.append("ways", this.action.value);
-                    } else {
-                        if (this.vulnerable.value == null) {
-                            return;
-                        }
-                        form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
-                    }
-                    this.http.uploadFile( this.port.mold.moldMaintain, form,
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: "保养完成",
-                                type: "success"
-                            });
-                            this.maintenanceFormVisible = false;
-                            this.requirement = false;
-                            this.$refs.upload.clearFiles();
-                            this.getList();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
-                        this.listLoading = false;
-                        this.$message({
-                            message: error,
-                            type: "error"
-                        });
-                    });
-                }
-            },
-
-            //获取告警时可以更换的设备列表
-            getAlternativeEquipment() {
-                this.http.post( this.port.mold.moldChangeRequirement, {
-                    mouldId: this.mouldId
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.equipments = [];
-                        res.data.forEach(item => {
-                            this.equipments.push({ label: item.equipmentNo, value: item.id });
-                        });
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //告警处理
-            warningArrangement() {
-                if (this.warningForm.equipmentId == null) {
-                    this.$message({
-                    message: "请选择云模盒",
-                    type: "error"
-                    });
-                } else {
-                    this.http.post( this.port.mold.moldChange, this.warningForm,
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: "告警处理完毕",
-                                type: "success"
-                            });
-                            this.warningFormVisible = false;
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
-                        this.$message({
-                            message: error,
-                            type: "error"
-                        });
-                    });
-                }
-            },
-
-            // 绘制折线图
-            getEcharts1() {
-                this.http.post( this.port.base.openingAndClosingTimesChart, {
-                    equipmentNo: this.detail.equipmentNo,//"898602B5191730002945",
-                    time: this.openNum
-                },
-                res => {
-                    if (res.code == "ok") {
-                        var option = {
-                            tooltip: {
-                                trigger: 'axis'
-                            },
-                            // grid: {
-                            //     left: '3%',
-                            //     right: '4%',
-                            //     bottom: '6%',
-                            //     containLabel: true
-                            // },
-                            xAxis: {
-                                type: 'category',
-                                boundaryGap: false,
-                                data: []
-                            },
-                            yAxis: {
-                                name: '次数(‰)',
-                                type: 'value'
-                            },
-                            dataZoom: [{
-                                type: 'inside',
-                                start: 0,
-                                end: 10
-                            }, {
-                                start: 0,
-                                end: 10,
-                                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
-                                handleSize: '80%',
-                                handleStyle: {
-                                    color: '#fff',
-                                    shadowBlur: 3,
-                                    shadowColor: 'rgba(0, 0, 0, 0.6)',
-                                    shadowOffsetX: 2,
-                                    shadowOffsetY: 2
-                                }
-                            }],
-                            series: [
-                                {
-                                    name:'开合次数',
-                                    type:'line',
-                                    data:[],
-                                    itemStyle : { 
-                                        normal : { 
-                                            color: "#009ad6", //改变折线点的颜色
-                                            lineStyle:{ 
-                                                color: "#009ad6" //改变折线颜色
-                                            } 
-                                        } 
-                                    }
-                                }
-                            ]
-                        },
-                        list = res.data, 
-                        xData = [], 
-                        sData = [];
-
-                        for(var i in list) {
-                            xData.push(i);
-                            sData.push(list[i])
-                        }
-                        option.xAxis.data = xData;
-                        option.series[0].data = sData;
-
-                        this.drawEchart(1,JSON.stringify(option))
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-            
-            getEcharts2() {
-                this.http.post( this.port.base.openingAndClosingTimesChartCycle, {
-                    equipmentNo: this.detail.equipmentNo,//"898602B5191730002945",
-                    startTime: this.openCycle[0],
-                    endTime: this.openCycle[1]
-                },
-                res => {
-                    if (res.code == "ok") {
-                        var option = {
-                            tooltip: {
-                                trigger: 'axis'
-                            },
-                            grid: {
-                                left: '3%',
-                                right: '4%',
-                                bottom: '3%',
-                                containLabel: true
-                            },
-                            xAxis: {
-                                type: 'category',
-                                boundaryGap: false,
-                                data: []
-                            },
-                            yAxis: {
-                                name: '秒(s)',
-                                type: 'value'
-                            },
-                            series: [{
-                                name:'最大开盒周期',
-                                type:'line',
-                                stack: '开盒周期',
-                                data:[],
-                                itemStyle : { 
-                                    normal : { 
-                                        color: "#d93a49", //改变折线点的颜色
-                                        lineStyle:{ 
-                                            color: "#d93a49" //改变折线颜色
-                                        } 
-                                    } 
-                                }
-                            },
-                            {
-                                name:'最小开盒周期',
-                                type:'line',
-                                stack: '开盒周期',
-                                data:[],
-                                itemStyle : { 
-                                    normal : { 
-                                        color: "#009ad6", //改变折线点的颜色
-                                        lineStyle:{ 
-                                            color: "#009ad6" //改变折线颜色
-                                        } 
-                                    } 
-                                }
-                            },
-                            {
-                                name:'平均开盒周期',
-                                type:'line',
-                                stack: '开盒周期',
-                                data:[],
-                                itemStyle : { 
-                                    normal : { 
-                                        color: "#7fb80e", //改变折线点的颜色
-                                        lineStyle:{ 
-                                            color: "#7fb80e" //改变折线颜色
-                                        } 
-                                    } 
-                                }
-                            }]
-                        },
-                        list = res.data, 
-                        xData = [], 
-                        avg = [] , max = [] , min = [];
-
-                        for(var i in list) {
-                            xData.push(list[i].time);
-                            max.push(list[i].maxCycle/1000);
-                            min.push(list[i].minCycle/1000);
-                            avg.push(list[i].avgCycle/1000);
-                        }
-                        option.xAxis.data = xData;
-                        option.series[0].data = max;
-                        option.series[1].data = min;
-                        option.series[2].data = avg;
-
-            
-                        this.drawEchart(2,JSON.stringify(option));
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-            
-
-            drawEchart(type,option) {
-                let myChart = this.echarts.init(document.getElementById("myChart" + type));
-                if(type == 1) {
-                    this.echarts1 = myChart;
-                } else {
-                    this.echarts2 = myChart;
-                }
-                myChart.setOption(JSON.parse(option));
-            },
-
-            changeOpen(type) {
-                if(type == 1) {
-                    this.getEcharts1();
-                } else if(type == 2) {
-                    this.getEcharts2();
-                }
-            },
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 370;
-            this.allDetail.height = height - 170 + "px";
-            const that = this;
-            window.onresize = function temp() {
-                that.allDetail.height = window.innerHeight - 170;
-            };
-        },
-        mounted() {
-            this.mouldId = this.$route.params.id; //传到当前页面的模具编号
-            this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
-            this.getList();
-            this.getDetail();
-            this.getAlternativeEquipment();
-
-            const that = this
-            window.onresize = function temp() {
-                that.echarts1.resize();
-                that.echarts2.resize();
-            };
-        }
-    };
-</script>
-
-<style scoped>
-    .title {
-        padding-left: 10px;
-        padding-bottom: 0px;
-        margin: 20px 0;
-        font-size: 16px;
-        line-height: 24px;
-        border-left: 1px #20a0ff solid;
-    }
-
-    .toolbar .el-form-item {
-        font-size: 14px;
-        vertical-align: middle;
-    }
-
-    .back {
-        font-size: 16px;
-    }
-
-    .divLine {
-        width: 2px;
-        background: #c3c3c3;
-        height: 100%;
-    }
-
-    .projectTitle {
-        font-size: 18px;
-        color: #333;
-    }
-</style>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 1776
lib_vue/src/views/mold/moldDetail.vue


+ 0 - 250
lib_vue/src/views/mold/moldDownload.vue

@@ -1,250 +0,0 @@
-<template slot-scope="scope">
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <el-form :inline="true" :model="filters">
-        <el-form-item>
-          <el-input v-model="filters.name" placeholder="请输入模具名称进行搜索"></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="getFileList(filters.name)">查询</el-button>
-        </el-form-item>
-        <el-form-item style="float: right;">
-          <el-dropdown>
-            <el-button type="primary">
-              下载
-              <i class="el-icon-arrow-down el-icon--right"></i>
-            </el-button>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="download(0)">全部下载</el-dropdown-item>
-              <el-dropdown-item @click.native="download(1)" divided>模具3D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(2)">模具2D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(3)">零件3D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(4)">零件2D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(5)">保养方案</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </el-form-item>
-      </el-form>
-    </el-col>
-
-    <!--列表-->
-    <el-table :data="documents" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;" @selection-change="selectionChanged">
-        <el-table-column type="selection" width="50"></el-table-column>
-        <el-table-column type="index" width="60"></el-table-column>
-        <el-table-column label="模具名称">
-            <template slot-scope="scope">
-                <router-link :to="'/moldList/' + scope.row.id + '/0'" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
-            </template>
-        </el-table-column>
-        <el-table-column width="250" label="模具3D图档">
-            <template slot-scope="scope">
-            <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
-            <span v-else-if="scope.row.mould3DFilesState">已通过</span>
-            <span v-else>未通过</span>
-            </template>
-        </el-table-column>
-        <el-table-column width="250" label="模具2D图档">
-            <template slot-scope="scope">
-            <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
-            <span v-else-if="scope.row.mould2DFilesState">已通过</span>
-            <span v-else>未通过</span>
-            </template>
-        </el-table-column>
-        <el-table-column width="250" label="零件3D图档">
-            <template slot-scope="scope">
-            <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
-            <span v-else-if="scope.row.sparepart3DFilesState">已通过</span>
-            <span v-else>未通过</span>
-            </template>
-        </el-table-column>
-        <el-table-column width="250" label="零件2D图档">
-            <template slot-scope="scope">
-            <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
-            <span v-else-if="scope.row.sparepart2DFilesState">已通过</span>
-            <span v-else>未通过</span>
-            </template>
-        </el-table-column>
-        <el-table-column width="250" label="保养方案">
-            <template slot-scope="scope">
-            <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
-            <span v-else-if="scope.row.maintainFilesState">已通过</span>
-            <span v-else>未通过</span>
-            </template>
-        </el-table-column>
-    </el-table>
-
-    <!--工具条-->
-    <el-col :span="24" class="toolbar">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[20 , 50 , 80 , 100 , 200]"
-        :page-size="20"
-        layout="total, sizes, prev, pager, next"
-        :total="total"
-        style="float:right;"
-      ></el-pagination>
-    </el-col>
-  </section>
-</template>
-
-<script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      documents: [],
-      filters: {
-        name: "",
-        value: ""
-      },
-      listLoading: false,
-      page: 1,
-      size: 20,
-      total: 0,
-      tableHeight: 0,
-      selectedArray: []
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getFileList();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getFileList();
-    },
-    //获取列表
-    getFileList(keyword) {
-      this.http.post(
-        this.port.mold.moldFileDowloadList,
-        {
-          keyName: keyword,
-          pageSize: this.size,
-          pageNum: this.page
-        },
-        res => {
-          if (res.code == "ok") {
-            this.documents = res.data.list;
-            this.total = res.data.total;
-            //对于拿到的所有数据
-            this.documents.forEach(file => {
-              var mould2DFilesState = true;
-              var mould3DFilesState = true;
-              var sparepart2DFilesState = true;
-              var sparepart3DFilesState = true;
-              var maintainFilesState = true;
-              //看看每种文档中的所有文件
-              file.mould2DFiles.forEach(item => {
-                if (item.state != 3) {
-                  mould2DFilesState = false;
-                }
-              });
-              file.mould3DFiles.forEach(item => {
-                if (item.state != 3) {
-                  mould3DFilesState = false;
-                }
-              });
-              file.sparepart2DFiles.forEach(item => {
-                if (item.state != 3) {
-                  sparepart2DFilesState = false;
-                }
-              });
-              file.sparepart3DFiles.forEach(item => {
-                if (item.state != 3) {
-                  sparepart3DFilesState = false;
-                }
-              });
-              file.maintainFiles.forEach(item => {
-                if (item.state != 3) {
-                  maintainFilesState = false;
-                }
-              });
-              //把计算好的状态装进这个模具对象中
-              file.mould2DFilesState = mould2DFilesState;
-              file.mould3DFilesState = mould3DFilesState;
-              file.sparepart2DFilesState = sparepart2DFilesState;
-              file.sparepart3DFilesState = sparepart3DFilesState;
-              file.maintainFilesState = maintainFilesState;
-            });
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
-        },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //点击复选时
-    selectionChanged(row) {
-      this.selectedArray = [];
-      row.forEach(item => {
-        this.selectedArray.push(item.id);
-      });
-    },
-    //下载
-    download(type) {
-      if (this.selectedArray.length == 0) {
-        this.$message("请选择要下载的文档");
-      } else {
-        this.downloadPost(type);
-      }
-    },
-    //具体的下载
-    downloadPost(type) {
-        var user = sessionStorage.getItem('user') , token = "";
-        if(user != null){
-            token = JSON.parse(user).headImgurl
-        }
-        this.http.get(
-            this.port.mold.moldFileDowloadFile + 
-                "?ids="+ this.selectedArray.join(",") + 
-                "&dwgType=" + type +
-                "&token=" + token
-            ,
-            res => {
-                this.listLoading = false;
-                if (res.code == "ok") {
-                    let a = document.createElement('a')
-                    a.setAttribute('download', res.data.split("/")[2]);
-                    a.setAttribute("href", res.data);
-                    a.click();
-                } else {
-                    this.$message({
-                        message: res.msg,
-                        type: "error"
-                    });
-                }
-            },
-            error => {
-            this.listLoading = false;
-            this.$message({
-                message: error,
-                type: "error"
-            });
-            }
-        );
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 210;
-  },
-  mounted() {
-    this.getFileList();
-  }
-};
-</script>
-
-<style scoped>
-</style>

+ 0 - 459
lib_vue/src/views/mold/moldList.vue

@@ -1,459 +0,0 @@
-<template>
-    <section>
-        <!--工具条-->
-        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-            <el-form :inline="true" :model="filters">
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.projectId" clearable placeholder="请选择项目">
-                        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="2">
-                    <el-form-item>
-                        <el-select v-model="filters.searchType" placeholder="请选择查询条件">
-                        <el-option label="编号" value="0"></el-option>
-                        <el-option label="名称" value="1"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入编号或名称进行搜索"></el-input>
-                </el-form-item>
-                <el-form-item>
-                    <el-button type="primary" @click="getMoldList">查询</el-button>
-                </el-form-item>
-                <el-form-item style="float: right" v-if="user.parentId == 1 && user.subordinateType == 0">
-                    <el-button type="primary" @click="showAdd">新建</el-button>
-                </el-form-item>
-            </el-form>
-        </el-col>
-
-        <!--列表-->
-        <el-table :data="molds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
-            <el-table-column type="index" width="40"></el-table-column>
-            <el-table-column prop="modelName" label="模具名称" width="140" sortable>
-                <template slot-scope="scope">
-                    <el-link :underline="false" type="primary" @click="toDetail(scope.row)">{{scope.row.modelName}}</el-link>
-                </template>
-            </el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="120" sortable></el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="120" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="diffTime" label="倒计时" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="projectName" label="所属项目" width="140" sortable></el-table-column>
-            <el-table-column prop="companyName" label="所属资产方" width="300" sortable></el-table-column>
-            <el-table-column prop="produceCompany" label="所属生产方" width="200" sortable></el-table-column>
-            <el-table-column prop="initialModulus" label="初始模次" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="settingLife" label="模次寿命" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="holes" label="穴数" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="rfid" label="对应RFID码" width="120" align="center" sortable></el-table-column>
-            <el-table-column label="状态" width="100" align="center" sortable>
-                <template slot-scope="scope">
-                    <span v-if="scope.row.state == 1" style="color:#00CD66;">运行</span>
-                    <span v-else style="color:#999999;">静止</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="操作" width="150" align="center" sortable v-if="user.parentId == 1 && user.subordinateType == 0">
-                <template slot-scope="scope">
-                    <el-button size="small" type="danger" @click="handleDel(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <!--工具条-->
-        <el-col :span="24" class="toolbar">
-            <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;"
-            ></el-pagination>
-        </el-col>
-
-        <!--新增界面-->
-        <el-dialog title="新建模具" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-                <el-form-item label="模具名称" prop="modelName">
-                    <el-input v-model="addForm.modelName" autocomplete="off" placeholder="请输入模具名称" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="模具编号" prop="modelNo">
-                    <el-input v-model="addForm.modelNo" autocomplete="off" placeholder="请输入模具编号" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="云模盒编号" prop="equipmentId">
-                    <el-select v-model="addForm.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-form-item>
-                <el-form-item label="初始模次" prop="initialModulus">
-                    <el-input v-model="addForm.initialModulus" autocomplete="off" placeholder="请输入初始模次" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="模次寿命" prop="settingLife">
-                    <el-input v-model="addForm.settingLife" autocomplete="off" placeholder="请输入模次寿命" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="RIFD码" prop="rfid">
-                    <el-input v-model="addForm.rfid" autocomplete="off" placeholder="请输入RIFD码" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="穴数" prop="holes">
-                    <el-input v-model="addForm.holes" autocomplete="off" placeholder="请输入穴数" style="width:202px"></el-input>
-                </el-form-item>
-                <el-form-item label="所属生产方" prop="produceCompanyId">
-                    <el-select v-model="addForm.produceCompanyId" clearable filterable placeholder="请选择所属生产方" style="width:202px">
-                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="保养次数" prop="maintainCount">
-                    <el-select v-model="addForm.maintainCount" clearable multiple allow-create filterable default-first-option placeholder="请选择保养次数" style="width:515px">
-                        <el-option v-for="item in maintainCount" :key="item" :label="item" :value="item"></el-option>
-                    </el-select>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
-            </div>
-        </el-dialog>
-    </section>
-</template>
-
-<script>
-    import util from "../../common/js/util";
-    export default {
-        data() {
-            const checkInitialModulus = (rule, value, callback) => {
-                if (!value) {
-                    return callback(new Error('请输入初始模次'));
-                } else {
-                    if((/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(value) == false){
-                        callback(new Error("请填写大于0的数字"));
-                    }else{
-                        if (value > 100000000) {
-                            callback(new Error("请填写小于等于1亿的数字"));
-                        }else{
-                            callback();
-                        }
-                    }
-                }
-            };
-            const checkSettingLife = (rule, value, callback) => {
-                if (!value) {
-                    return callback(new Error('请输入模次寿命'));
-                } else {
-                    if((/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(value) == false){
-                        callback(new Error("请填写大于0的数字"));
-                    }else{
-                        if (value > 100000000) {
-                            callback(new Error("请填写小于等于1亿的数字"));
-                        }else{
-                            callback();
-                        }
-                    }
-                }
-            };
-            return {
-                user: JSON.parse(sessionStorage.getItem("user")),
-                molds: [],
-                filters: {
-                    keyName: "",
-                    searchType: "编号",
-                    projectId: ""
-                },
-                team: [{label:'资产方',value:0},{label:'生产方',value:1}],
-
-                formRules: {
-                    modelNo: [
-                        { required: true, message: "请输入模具编号", trigger: "blur" }
-                    ],
-                    modelName: [
-                        { required: true, message: "请输入模具名称", trigger: "blur" }
-                    ],
-                    equipmentId: [
-                        { required: true, message: "请选择云模盒编号", trigger: ["blur", "change"] }
-                    ],
-                    initialModulus: [
-                        // { required: true, message: "请输入初始模次", trigger: "blur" }
-                        { required: true, validator: checkInitialModulus, trigger: 'blur'}
-                    ],
-                    settingLife: [
-                        // { required: true, message: "请输入模次寿命", trigger: "blur" }
-                        { required: true, validator: checkSettingLife, trigger: 'blur'}
-                    ],
-                    rfid: [
-                        { required: true, message: "请输入RIFD码", trigger: "blur" }
-                    ],
-                    holes: [
-                        { required: true, message: "请输入穴数", trigger: "blur" }
-                    ],
-                    produceCompanyId: [
-                        { required: true, message: "请选择所属生产方", trigger: ["blur", "change"] }
-                    ],
-                    maintainCount: [
-                        { required: true, message: "请输入保养次数", trigger: ["blur", "change"] }
-                    ]
-                },
-                listLoading: false,
-                total: 0,
-                size: 20,
-                tableHeight: 0,
-
-                boxes: [],
-                companys: [],
-                projects: [],
-
-                maintainCount: [5000,10000,15000,20000,25000],
-
-                addLoading: false,
-                addFormVisible: false,
-                addForm: {
-                    modelNo: "",
-                    modelName: "",
-                    equipmentId: "",
-                    initialModulus: "",
-                    settingLife: "",
-                    maintainCount: [],
-                    rfid: "",
-                    holes: "",
-                    produceCompanyId: ""
-                }
-            };
-        },
-        methods: {
-            //获取模具
-            getMoulds(){
-                this.http.post( this.port.base.moulds, {
-                    belongCompanyId: this.user.companyId
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.boxes = res.data;
-                    } else {
-                        this.$message({
-                        message: res.msg,
-                        type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-            getMsg() {
-                //获取模具
-                this.getMoulds();
-                //新版获取公司
-                this.http.post(this.port.base.relationList, {
-                    companyType: 1
-                }, res => {
-                    if (res.code == "ok") {
-                        this.companys = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                });
-                
-            },
-            getPro() {
-                //获取项目
-                this.http.post( this.port.project.projects, {},
-                res => {
-                    if (res.code == "ok") {
-                        this.projects = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-            //分页
-            handleCurrentChange(val) {
-                this.page = val;
-                this.getMoldList();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-                this.getMoldList();
-            },
-
-            //获取模具列表
-            getMoldList() {
-                this.listLoading = true;
-                this.http.post( this.port.mold.molds, {
-                    keyName: this.filters.keyName,
-                    pageNum: this.page,
-                    pageSize: this.size,
-                    projectId: this.filters.projectId == "" ? -1 : this.filters.projectId,
-                    searchType: this.filters.searchType == "编号"? 0:1
-                },
-                res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list
-                        for(var i in list){
-                            if(list[i].endTime == null){
-                                list[i].diffTime = "";
-                            } else {
-                                list[i].diffTime = util.formatDate.dateDiff(
-                                    // util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
-                                    list[i].endTime,
-                                    util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
-                                );
-                            }
-                        }
-                        this.molds = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //详情
-            toDetail(row) {
-                this.$router.push("/moldList/" + row.id + "/0");
-            },
-
-            //删除
-			handleDel: function (row) {
-                this.$confirm('确认删除该模具吗?', '提示', {
-					type: 'warning'
-				}).then(() => {
-                    this.http.post(this.port.mold.delMold, {
-                        id: row.id
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            this.getMoldList();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-				});
-            },
-
-            //添加界面
-            showAdd() {
-                this.getMoulds();
-                this.addFormVisible = true;
-                this.addForm = {
-                    modelNo: "",
-                    modelName: "",
-                    equipmentId: "",
-                    initialModulus: "",
-                    settingLife: "",
-                    maintainCount: [],
-                    rfid: "",
-                    holes: "",
-                    produceCompanyId: ""
-                };
-            },
-
-            addSubmit() {
-                this.$refs.addForm.validate(valid => {
-                    if (valid) {
-                        this.addLoading = true;
-                        var maintainCount = this.addForm.maintainCount , str = "";
-                        for(var i in maintainCount) {
-                            if(i == maintainCount.length-1){
-                                str += maintainCount[i]
-                            } else {
-                                str += maintainCount[i] + ","
-                            }
-                        }
-                        this.addForm.maintainCount = str;
-                        this.http.post( this.port.mold.addMold, this.addForm,
-                        res => {
-                            this.addLoading = false;
-                            if (res.code == "ok") {
-                                this.addFormVisible = false;
-                                this.$message({
-                                    message: "创建成功",
-                                    type: "success"
-                                });
-                                this.getMoldList();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: "error"
-                                });
-                            }
-                        },
-                        error => {
-                            this.addLoading = false;
-                            this.addFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: "error"
-                            });
-                        });
-                    }
-                });
-            },
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 210;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 210;
-            };
-        },
-        mounted() {
-            var user = JSON.parse(sessionStorage.getItem("user"));
-            if(user.parentId == 1 && user.subordinateType == 0){
-                this.getMsg();
-            }
-            this.getPro()
-            this.getMoldList();
-        }
-    };
-</script>
-
-<style scoped>
-</style>

+ 0 - 296
lib_vue/src/views/project/competence.vue

@@ -1,296 +0,0 @@
-<template>
-	<section>
-		<!--工具条-->
-		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-			<el-form :inline="true" :model="filters">
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.projectId" clearable filterable placeholder="请选择项目">
-                            <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-				<el-form-item>
-					<el-input v-model="filters.keyName" placeholder="请输入姓名进行搜索"></el-input>
-				</el-form-item>
-				<el-form-item>
-					<el-button type="primary" @click="getPowerList">查询</el-button>
-				</el-form-item>
-			</el-form>
-		</el-col>
-
-		<!--列表-->
-		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-			<el-table-column type="index" width="60">
-			</el-table-column>
-			<el-table-column prop="username" label="姓名" width="150" sortable>
-			</el-table-column>
-			<el-table-column prop="companyName" label="所属公司" sortable>
-			</el-table-column>
-			<el-table-column prop="projectName" label="项目名称" width="220" sortable>
-			</el-table-column>
-			<el-table-column prop="addr" label="上传" align="center" width="150">
-                <template slot-scope="scope">
-                    <el-checkbox :value="scope.row.update==1?true:false"></el-checkbox>
-                </template>
-			</el-table-column>
-            <el-table-column prop="addr" label="下载" align="center" width="150">
-                <template slot-scope="scope">
-                    <el-checkbox :value="scope.row.download==1?true:false"></el-checkbox>
-                </template>
-			</el-table-column>
-            <el-table-column prop="addr" label="浏览" align="center" width="150">
-                <template slot-scope="scope">
-                    <el-checkbox :value="scope.row.view==1?true:false"></el-checkbox>
-                </template>
-			</el-table-column>
-            <el-table-column prop="addr" label="审批" align="center" width="150">
-                <template slot-scope="scope">
-                    <el-checkbox :value="scope.row.approve==1?true:false"></el-checkbox>
-                </template>
-			</el-table-column>
-			<el-table-column label="操作" width="150" align="center">
-				<template slot-scope="scope">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-				</template>
-			</el-table-column>
-		</el-table>
-
-		<!--工具条-->
-		<el-col :span="24" class="toolbar">
-            <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;">
-            </el-pagination>
-		</el-col>
-
-		<!--编辑界面-->
-		<el-dialog title="编辑权限" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="editForm" label-width="80px" ref="editForm">
-				<el-col :span="24">
-                    <el-form-item label="权限配置">
-                        <el-row>
-                            <el-col :span="6" v-for="(item,index) in roleList" :key="item.val" style="text-align:center;">
-                                <el-checkbox v-model="editForm[item.label]" :disabled="index==3?true:false" :checked="editForm[item.label]">{{item.name}}</el-checkbox>
-                            </el-col>
-                        </el-row>
-                    </el-form-item>
-                </el-col>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
-			</div>
-		</el-dialog>
-	</section>
-</template>
-
-<script>
-	import util from '../../common/js/util'
-	export default {
-		data() {
-			return {
-				filters: {
-                    keyName: '',
-                    projectId: '',
-                },
-                user: JSON.parse(sessionStorage.getItem('user')),
-
-                projects: [],
-
-				list: [],
-				total: 0,
-                page: 1,
-                size: 20,
-                listLoading: false,
-                tableHeight: 0,
-
-				editFormVisible: false,//编辑界面是否显示
-                editLoading: false,
-                roleList: [
-                    {name:'上传',val:0,label:'uploadPower',uploadPower:false},
-                    {name:'下载',val:1,label:'dowloadPower',dowloadPower:false},
-                    {name:'浏览',val:2,label:'viewPower',viewPower:false},
-                    {name:'审批',val:3,label:'approvalPower',approvalPower:false}
-                ],
-				//编辑界面数据
-				editForm: {
-                    id: 0,
-                    projectId: 0,
-                    uploadPower: false,
-                    dowloadPower:false,
-                    viewPower:false,
-                    approvalPower:false,
-				}
-			}
-		},
-		methods: {
-            getMsg() {
-                this.http.post(this.port.project.projects, {}, res => {
-                    if (res.code == "ok") {
-                        this.projects = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-            //分页
-			handleCurrentChange(val) {
-				this.page = val;
-				this.getPowerList();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-				this.getPowerList();
-            },
-
-			//获取权限列表
-			getPowerList() {
-				this.listLoading = true;
-                this.http.post(this.port.project.powerList, {
-                    projectId: this.filters.projectId,
-                    keyName: this.filters.keyName,
-                    pageNum: this.page,
-                    pageSize: this.size
-                }, res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list;
-                        for(var i in list){
-                            list[i].update = 0;
-                            list[i].download = 0;
-                            list[i].view = 0;
-                            list[i].approve = 0;
-
-                            var powers = list[i].powers;
-                            for(var j in powers){
-                                if(powers[j].powerType == 0){
-                                    list[i].update = 1;
-                                } else if(powers[j].powerType == 1){
-                                    list[i].download = 1;
-                                } else if(powers[j].powerType == 2){
-                                    list[i].view = 1;
-                                } else if(powers[j].powerType == 3){
-                                    list[i].approve = 1;
-                                }
-                            }
-                        }
-                        this.list = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-            
-			//显示编辑界面
-			handleEdit: function (index, row) {
-				this.editFormVisible = true;
-				this.editForm = {
-                    id: row.userId,
-                    projectId: row.projectId,
-                    uploadPower: row.update==1?true:false,
-                    dowloadPower: row.download==1?true:false,
-                    viewPower: row.view==1?true:false,
-                    approvalPower: row.approve==1?true:false
-                };
-			},
-			//编辑
-			editSubmit: function () {
-                var str = "";
-
-                if(this.editForm.uploadPower) {
-                    str += "0,"
-                }
-                if(this.editForm.dowloadPower) {
-                    str += "1,"
-                }
-                if(this.editForm.viewPower) {
-                    str += "2,"
-                }
-                if(this.editForm.approvalPower) {
-                    str += "3,"
-                }
-
-                str = str.substring(0,str.length-1)
-
-				this.editLoading = true;
-                this.http.post(this.port.project.powerUpdate, {
-                    id: this.editForm.id,
-                    projectId: this.editForm.projectId,
-                    powers: str
-                }, res => {
-                    this.editLoading = false;
-                    this.editFormVisible = false;
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: '修改成功',
-                            type: 'success'
-                        });
-                        this.getPowerList();
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.editLoading = false;
-                    this.editFormVisible = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-			}
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 210;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 210;    
-            };
-        },
-		mounted() {
-            this.getMsg();
-			this.getPowerList();
-		}
-	}
-
-</script>
-
-<style>
-    .el-table__row .el-checkbox__inner:hover {
-        border-color: #DCDFE6;
-    }
-
-    .el-table__row .el-checkbox , .el-table__row .el-checkbox__input {
-        cursor: inherit;
-    }
-</style>

+ 0 - 354
lib_vue/src/views/project/project.vue

@@ -1,354 +0,0 @@
-<template>
-	<section>
-		<!--工具条-->
-		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-			<el-form :inline="true" :model="filters">
-				<el-form-item>
-					<el-input v-model="filters.keyName" placeholder="请输入项目名称"></el-input>
-				</el-form-item>
-				<el-form-item>
-					<el-button type="primary" v-on:click="getProject">查询</el-button>
-				</el-form-item>
-				<el-form-item style="float:right;" v-if="user.parentId == 1 && user.subordinateType == 0">
-					<el-button type="primary" @click="handleAdd">新增</el-button>
-				</el-form-item>
-			</el-form>
-		</el-col>
-
-		<!--列表-->
-		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-			<el-table-column type="index" width="60">
-			</el-table-column>
-			<el-table-column prop="projectName" label="项目名称" width="250" sortable>
-                <template slot-scope="scope">
-                    <el-link :underline="false" type="primary" @click="toDetail(scope.row)">{{scope.row.projectName}}</el-link>
-				</template>
-			</el-table-column>
-            <el-table-column prop="ownerCompanyName" label="资产方公司" sortable>
-			</el-table-column>
-            <el-table-column prop="customCompaniesStr" label="生产方公司" width="450">
-			</el-table-column>
-            <el-table-column prop="manager" label="项目经理" width="100" align="center" sortable>
-			</el-table-column>
-			<el-table-column prop="indate" label="创建时间" width="250" align="center" sortable>
-			</el-table-column>
-			<!-- <el-table-column label="操作" width="250" align="center">
-				<template slot-scope="scope">
-                    <el-button size="small" type="primary" @click="toDetail(scope.row.id)">详情</el-button>
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
-				</template>
-			</el-table-column> -->
-		</el-table>
-
-		<!--工具条-->
-		<el-col :span="24" class="toolbar">
-			<el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;">
-            </el-pagination>
-		</el-col>
-
-        <!--新增界面-->
-		<el-dialog title="新增项目" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="addForm" label-width="120px" :rules="formRules" ref="addForm">
-                <el-col :span="24">
-                    <el-form-item label="项目名称" prop="projectName">
-                        <el-input v-model="addForm.projectName" autocomplete="off" placeholder="请输入项目名称" style="width:510px"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="24">
-                    <el-form-item label="项目模具" prop="mold">
-                        <el-select v-model="addForm.mold" @change="companyChange" clearable filterable multiple placeholder="请选择项目模具" value-key='id' style="width:510px">
-                            <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item">
-                                <span style="float: left">{{ item.modelName }}</span>
-                                <span style="float: right; color: #8492a6; font-size: 6px;margin-right:17px;">{{ item.produceCompany }}</span>
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="24">
-                    <el-form-item label="项目经理" prop="managerId">
-                        <el-select v-model="addForm.managerId" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
-                            <!-- <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
-                            </el-option> -->
-                            <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
-                                <span style="float: left">{{ item.username }}</span>
-                                <span style="float: right; color: #8492a6; font-size: 13px;">{{ item.companyName }}</span>
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
-			</div>
-		</el-dialog>
-	</section>
-</template>
-
-<script>
-	import util from '../../common/js/util'
-
-	export default {
-		data() {
-			return {
-				filters: {
-					keyName: ''
-                },
-                user: JSON.parse(sessionStorage.getItem('user')),
-                charger: [],
-                molds: [],
-
-				list: [],
-				total: 0,
-                page: 1,
-                size: 20,
-                listLoading: false,
-                tableHeight: 0,
-
-                formRules: {
-					projectName: [
-						{ required: true, message: '请输入项目名称', trigger: 'blur' }
-                    ],
-                    mold: [
-                        { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
-                    ],
-                    managerId: [
-                        { required: true, message: '请选择项目经理', trigger: ['blur','change'] }
-                    ]
-                },
-                
-                addFormVisible: false, //新增界面是否显示
-				addLoading: false,
-				//新增界面数据
-				addForm: {
-					projectName: '',
-                    mold: [],
-                    managerId: ''
-				}
-
-			}
-		},
-		methods: {
-            //获取基础数据
-            getMsg(){
-                this.http.post(this.port.project.getUserById, {
-                    companyIds: this.user.companyId,
-                    id: this.user.id
-                } , res => {
-                    if (res.code == "ok") {
-                        this.charger = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-
-                //获取模具
-                this.getMoulds();
-            },
-
-            //获取模具
-            getMoulds(){
-                this.http.post(this.port.mold.modelList, {
-                    parentId: this.user.parentId,
-                    id: this.user.id
-                }, res => {
-                    if (res.code == "ok") {
-                        this.molds = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-			//分页
-			handleCurrentChange(val) {
-				this.page = val;
-				this.getProject();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-				this.getProject();
-            },
-            
-			//获取项目列表
-			getProject() {
-				this.listLoading = true;
-				this.http.post(this.port.project.projectList, {
-                    keyName: this.filters.keyName,
-                    pageNum: this.page,
-                    pageSize: this.size,
-                }, res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list;
-                        for(var i in list){
-                            var customCompaniesStr = "";
-                            for(var j in list[i].customCompanies){
-                                if(j == list[i].customCompanies.length -1){
-                                    customCompaniesStr += list[i].customCompanies[j].companyName;
-                                } else {
-                                    customCompaniesStr += list[i].customCompanies[j].companyName + "、";
-                                }
-                            }
-                            list[i].customCompaniesStr = customCompaniesStr;
-                        }
-                        this.list = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-            //详情
-            toDetail(row) {
-                this.$router.push('/project/' + row.id);
-            },
-
-            //选择公司切换人员
-            companyChange() {
-                var param = {} ,
-                    str = this.user.companyId;
-                for(var i in this.addForm.mold){
-                    str += "," + this.addForm.mold[i].produceCompanyId;
-                }
-                param.companyIds = str;
-                param.id = this.user.id
-                this.http.post(this.port.project.getUserById, param , res => {
-                    if (res.code == "ok") {
-                        this.charger = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-            //显示新增界面
-			handleAdd() {
-                //重新获取一下模具
-                this.getMoulds();
-				this.addFormVisible = true;
-				this.addForm = {
-					projectName: '',
-                    mold: [],
-                    managerId: ''
-				};
-            },
-
-            //新增
-			addSubmit() {
-				this.$refs.addForm.validate((valid) => {
-					if (valid) {
-                        var cId = "",
-                            cName = "",
-                            mId = "";
-
-                        for(var i in this.addForm.mold){
-                            if(cId.indexOf(this.addForm.mold[i].produceCompanyId) == -1){
-                                cId += this.addForm.mold[i].produceCompanyId + ",";
-                                cName += this.addForm.mold[i].produceCompanyName + ",";
-                            }
-                            mId += this.addForm.mold[i].id + ","
-                        }
-
-                        cId = cId.substring(0,cId.length-1);
-                        cName = cName.substring(0,cName.length-1);
-                        mId = mId.substring(0,mId.length-1);
-
-                        this.addLoading = true;
-                        this.http.post(this.port.project.addProject, {
-                            projectName: this.addForm.projectName,
-                            customerCompanyIds: cId,
-                            customerCompanyNames: cName,
-                            manager: this.addForm.managerId.username,
-                            managerId: this.addForm.managerId.id,
-                            modelIds: mId,
-                            flag: 0
-                        } , res => {
-                            this.addLoading = false;
-                            if (res.code == "ok") {
-                                this.addFormVisible = false;
-                                this.$message({
-                                    message: '创建成功',
-                                    type: 'success'
-                                });
-                                this.getProject();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.addLoading = false;
-                            this.addFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-			},
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 210;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 210;    
-            };
-        },
-		mounted() {
-            this.getMsg();
-			this.getProject();
-		}
-	}
-
-</script>
-
-<style scoped>
-
-</style>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 1139
lib_vue/src/views/project/projectDetail.vue


+ 0 - 547
lib_vue/src/views/project/staff.vue

@@ -1,547 +0,0 @@
-<template>
-	<section>
-		<!--工具条-->
-		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-			<el-form :inline="true" :model="filters">
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
-                            <el-option v-for="item in allCompanies" :key="item.id" :label="item.companyName" :value="item.id">
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.flag" placeholder="请选择查询条件">
-                            <el-option label="姓名" value="0"></el-option>
-                            <el-option label="手机号" value="1"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-form-item>
-                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或手机号进行搜索" style="width:250px;"></el-input>
-                </el-form-item>
-				<el-form-item>
-					<el-button type="primary" @click="getUsers">查询</el-button>
-				</el-form-item>
-				<el-form-item style="float:right;" v-if="user.subordinateType == 0 || user.isManager == 1">
-					<el-button type="primary" @click="handleAdd">新增</el-button>
-				</el-form-item>
-			</el-form>
-		</el-col>
-
-		<!--列表-->
-		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
-			<el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="username" label="姓名" width="120" sortable></el-table-column>
-			<el-table-column prop="account" label="手机号" width="180" sortable></el-table-column>
-			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
-            <el-table-column prop="projects" label="参与项目" sortable>
-                <template slot-scope="scope">
-                    <span class="info" v-for="(item, index) in scope.row.projects">
-                        {{item.projectName}}
-                        <span v-if="scope.row.projects != null && index != scope.row.projects.length-1">、</span>
-                    </span>
-                </template>
-			</el-table-column>
-            <el-table-column prop="roleName" label="备注" width="180" sortable></el-table-column>
-            <el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
-			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
-			<el-table-column label="操作" align="left" width="230">
-				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || (user.parentId == 1 && user.subordinateType == 0)">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
-                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">邀请</el-button>
-				</template>
-			</el-table-column>
-		</el-table>
-
-		<!--工具条-->
-		<el-col :span="24" class="toolbar">
-            <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;">
-            </el-pagination>
-		</el-col>
-
-        <!--新增界面-->
-		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
-				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
-				</el-form-item>
-                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" label="参与项目" prop="projectIds">
-					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable placeholder="请选择参与项目" style="width:202px">
-                        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
-                        </el-option>
-                    </el-select>
-				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
-                        <el-option v-for="item in company" :key="item.id" :label="item.companyName" :value="item.id">
-                        </el-option>
-                    </el-select>
-				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
-				</el-form-item>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
-			</div>
-		</el-dialog>
-
-		<!--编辑界面-->
-		<el-dialog title="编辑人员" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="editForm" label-width="80px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="editForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
-				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="editForm.account" disabled autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
-				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-                    <el-input v-model="editForm.companyId" disabled autocomplete="off" placeholder="请选择所属公司"></el-input>
-				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="editForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
-				</el-form-item>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-                 <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
-			</div>
-		</el-dialog>
-
-        <!--邀请界面-->
-		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
-                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
-            </el-input>
-		</el-dialog>
-	</section>
-</template>
-
-<script>
-	import util from '../../common/js/util'
-
-	export default {
-		data() {
-            var checkPhone = (rule, value, callback) => {
-                if (!value) {
-                    return callback(new Error('请输入联系方式'));
-                } else {
-                    const reg = /^1[0-9]\d{9}$/
-                    if (reg.test(value)) {
-                        callback();
-                    } else {
-                        return callback(new Error('请输入正确的联系方式'));
-                    }
-                }
-            };
-			return {
-				filters: {
-                    keyName: '',
-                    roleName: '',
-                    flag: '姓名',
-                    companyId: ''
-                },
-                
-                user: JSON.parse(sessionStorage.getItem('user')),
-                company: [],
-                projects: [],
-                //搜索用 涉及到的所有公司
-                allCompanies: [],
-
-				list: [],
-				total: 0,
-                page: 1,
-                size: 20,
-                listLoading: false,
-                tableHeight: 0,
-
-                formRules: {
-                    username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
-                    ],
-                    account: [
-                        { required: true, validator: checkPhone, trigger: 'blur'}
-                    ],
-                    teamName: [
-						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
-                    ],
-                    projectIds: [
-						{ required: true, message: '请选择参与项目', trigger: ["blur",'change'] }
-					],
-                    companyId: [
-						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
-					]
-                },
-
-                //新增界面是否显示
-                addFormVisible: false,
-				addLoading: false,
-				//新增界面数据
-				addForm: {
-					username: '',
-                    account: '',
-                    projectIds: '',
-                    companyId: '',
-                    roleName: '',
-                    flag: 0
-				},
-
-                //编辑界面是否显示
-				editFormVisible: false,
-				editLoading: false,
-				//编辑界面数据
-				editForm: {
-					id: 0,
-					username: '',
-                    account: '',
-                    companyId: '',
-                    roleName: '',
-                    flag: 1
-                },
-                
-                //邀请
-                inviteVisible: false,
-                inviteLink: ''
-			}
-		},
-		methods: {
-            //获取基础数据
-            getMsg(){
-                if(this.user.parentId == 1 && this.user.subordinateType == 0) {
-                    this.company = [];
-                    this.allCompanies = [];
-                    this.http.post(this.port.base.getCompanyList, {
-                        id: this.user.id,
-                        parentId: this.user.parentId
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.company = res.data;
-                            this.allCompanies = res.data;
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-                } else if(this.user.parentId > 1 && this.user.isManager == 1) {
-                    this.http.post(this.port.project.projectByUser, {}, 
-                    res => {
-                        if (res.code == "ok") {
-                            this.projects = res.data;
-                            //再获取一下公司列表
-                            this.getAllCompanies();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    });
-                }
-            },  
-
-            //新版获取所有公司
-            getAllCompanies(){
-                this.allCompanies = [];
-                this.http.post(this.port.base.getInfo, {}, res => {
-                    if (res.code == "ok") {
-                        this.allCompanies = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                });
-            },
-
-            //分页
-			handleCurrentChange(val) {
-				this.page = val;
-				this.getUsers();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-				this.getUsers();
-            },
-
-			//获取用户列表
-			getUsers() {
-				this.listLoading = true;
-                this.http.post(this.port.project.userList, {
-                    keyName: this.filters.keyName,
-                    currentPage: this.page,
-                    pageSize: this.size,
-                    companyId: this.filters.companyId==''?-1:this.filters.companyId,
-                    flag: this.filters.flag=='姓名'?0:this.filters.flag
-                }, res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        this.list = res.data.list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-            
-            //显示新增界面
-			handleAdd() {
-                this.addFormVisible = true;
-				this.addForm = {
-                    parentId: this.user.id,
-					username: '',
-                    account: '',
-                    mobile: '',
-                    projectIds: '',
-					companyId: '',
-                    roleName: '',
-                    flag: 0
-				};
-            },
-
-            //新增
-			addSubmit() {
-				this.$refs.addForm.validate((valid) => {
-					if (valid) {
-						this.addLoading = true;
-                        this.http.post(this.port.project.addUser, this.addForm , res => {
-                            this.addLoading = false;
-                            if (res.code == "ok") {
-                                this.addFormVisible = false;
-                                this.$message({
-                                    message: '创建成功',
-                                    type: 'success'
-                                });
-                                this.getUsers();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.addLoading = false;
-                            this.addFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-			},
-
-			//删除
-			handleDel(index, row) {
-                this.$confirm('确认删除该人员吗?', '提示', {
-					type: 'warning'
-				}).then(() => {
-                    this.http.post(this.port.project.delUser, {
-                        id: row.id
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            this.getUsers();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-				});
-            },
-            
-			//显示编辑界面
-			handleEdit(index, row) {
-                this.editFormVisible = true;
-				this.editForm = {
-                    id: row.id,
-                    parentId: this.user.id,
-					username: row.username,
-                    account: row.account,
-					companyId: row.companyName,
-                    roleName: row.roleName,
-                    flag: 1
-                };
-            },
-            
-			//编辑
-			editSubmit() {
-				this.$refs.editForm.validate((valid) => {
-					if (valid) {
-                        this.editLoading = true;
-                        this.http.post(this.port.project.addUser, {
-                            id: this.editForm.id,
-                            parentId: this.editForm.parentId,
-                            username: this.editForm.username,
-                            roleName: this.editForm.roleName,
-                            flag: 1
-                        } , res => {
-                            this.editLoading = false;
-                            if (res.code == "ok") {
-                                this.editFormVisible = false;
-                                this.$message({
-                                    message: '修改成功',
-                                    type: 'success'
-                                });
-                                this.getUsers();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.editLoading = false;
-                            this.editFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-            },
-            
-            //修改
-            choseProject() {
-                if(this.addForm.projectIds == ""){
-                    this.company = [];
-                    this.addForm.companyId = null;
-                }else{
-                    this.http.post(this.port.base.getProduceCompany, {
-                        projectId: this.addForm.projectIds
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.company = res.data;
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-                }
-            },
-
-            //邀请
-            invite(index, row) {
-                this.http.post(this.port.project.inviteUser, {
-                    inviteeId: row.id,
-                    projectId: row.projects[0].id,
-                    operatorId: this.user.id
-                } , res => {
-                    if (res.code == "ok") {
-                        this.inviteVisible = true;
-                        this.inviteLink = res.data.addressUrl;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-            //复制链接
-            copyLink() {
-                //this.inviteVisible = false;
-                this.$message({
-                    message: "复制成功!",
-                    type: 'success'
-                });
-            },
-
-            onError(e) {
-                //this.inviteVisible = false;
-                this.$message({
-                    message: "复制失败!",
-                    type: 'error'
-                });
-            }
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 210;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 210;    
-            };
-        },
-		mounted() {
-            this.getMsg();
-			this.getUsers();
-        }
-	}
-</script>
-
-<style scoped>
-    .el-input-group__append button.el-button {
-        background-color: #409EFF;
-        border-color: #409EFF;
-        color: #fff;
-    }
-</style>

+ 0 - 639
lib_vue/src/views/system/allocation.vue

@@ -1,639 +0,0 @@
-<template>
-    <section>
-        <!--工具条-->
-        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-            <el-form :inline="true" :model="filters">
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
-                            <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id">
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入关键字进行搜索"></el-input>
-                </el-form-item>
-                <el-form-item>
-                    <el-button type="primary" @click="getMoulds">查询</el-button>
-                </el-form-item>
-                <el-form-item style="float: right;">
-                    <a class="download" href="/upload/云模盒批量导入模板.xlsx" download="云模盒批量导入模板.xlsx">
-                        <el-button type="primary">
-                            下载模板
-                        </el-button>
-                    </a>
-                </el-form-item>
-                <el-form-item style="float: right;">
-                    <el-upload ref="upload" action="customize" :show-file-list="false" :http-request="uploadFile" :limit="1">
-                        <el-button type="primary" :loading="uploading">批量导入</el-button>
-                    </el-upload>
-                </el-form-item>
-                <el-form-item style="float: right;">
-                    <el-button type="primary" @click="showAllocation">新建</el-button>
-                </el-form-item>
-                <!-- <el-form-item style="float: right;">
-                    <el-button type="primary" @click="issued">下发</el-button>
-                </el-form-item> -->
-            </el-form>
-        </el-col>
-
-        <!--列表-->
-        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
-            <!-- <el-table-column type="selection" width="50"></el-table-column> -->
-            <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="180" sortable></el-table-column>
-            <el-table-column prop="sim" label="SIM卡号" width="120" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.hillNumber}}<span v-if="scope.row.hillNumber">%</span></template>
-            </el-table-column>
-            <el-table-column prop="alarmBattery" label="报警电池电量" width="130" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.alarmBattery}}<span v-if="scope.row.alarmBattery">%</span></template>
-            </el-table-column>
-            <el-table-column prop="alarmDegree" label="热报警度数" width="120" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.alarmDegree}}<span v-if="scope.row.alarmDegree">℃</span></template>
-            </el-table-column>
-            <el-table-column prop="useLife" label="使用年限" width="100" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.useLife}}年</template>
-            </el-table-column>
-            <el-table-column prop="diffTime" label="倒计时" width="100" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.diffTime}}</template>
-            </el-table-column>
-            <el-table-column prop="modelName" label="模具名称" width="130" sortable></el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="120" align="center" sortable></el-table-column>
-            <el-table-column prop="companyName" label="公司名称" width="180" sortable></el-table-column>
-            <el-table-column prop="agent" label="代理商" width="120" sortable></el-table-column>
-            <el-table-column label="云模盒状态" align="center" width="120" sortable>
-                <template slot-scope="scope">
-                    <span v-if="scope.row.isUse == 0">未启用</span>
-                    <span v-else>已启用</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="操作" align="center" width="160">
-                <template slot-scope="scope">
-                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 0" type="primary" @click="openEnable(scope.$index)">启用</el-button>
-                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 1" type="danger" @click="disableEquipment(scope.$index)">停用</el-button>
-                    <!--  :disabled="scope.row.isUse == 1" -->
-                    <el-button size="small" :style="scope.row.modelNo != null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">修改</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <!--工具条-->
-        <el-col :span="24" class="toolbar">
-        <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :page-sizes="[20 , 50 , 80 , 100]"
-            :page-size="20"
-            layout="total, sizes, prev, pager, next"
-            :total="total"
-            style="float:right;"
-        ></el-pagination>
-        </el-col>
-
-        <!--新增界面-->
-        <el-dialog title="新建云模盒" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
-                <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
-                </el-form-item>
-                <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px">
-                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="使用年限" prop="useLife">
-                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
-                </el-form-item>
-                <el-form-item label="代理商" prop="agent">
-                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button type="primary" @click="addMould()">提交</el-button>
-            </div>
-        </el-dialog>
-
-        <!--修改界面-->
-        <el-dialog title="修改云模盒" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
-                <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
-                </el-form-item>
-                <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px" :disabled="newAllocation.usage">
-                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="使用年限" prop="useLife">
-                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
-                </el-form-item>
-                <el-form-item label="代理商" prop="agent">
-                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click.native="editFormVisible = false">取消</el-button>
-                <el-button type="primary" @click="editMould(newAllocation.id)">提交</el-button>
-            </div>
-        </el-dialog>
-
-        <!-- 启用弹窗 -->
-        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="450px">
-            <!-- <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
-                <el-form-item label="某个参数">
-                    <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
-                </el-form-item>
-            </el-form>
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="operateDialogVisible = false">取消</el-button>
-                <el-button type="primary" @click="enable">启用</el-button>
-            </span> -->
-            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
-                <el-form-item label="报警电池电量" prop="alarmBattery">
-                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
-                    %
-                </el-form-item>
-                <el-form-item label="热报警度数" prop="alarmDegree">
-                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
-                    ℃
-                </el-form-item>
-            </el-form>
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="operateDialogVisible = false">取消</el-button>
-                <el-button type="primary" @click="enable">启用</el-button>
-            </span>
-        </el-dialog>
-
-        <!-- 下发弹窗 -->
-        <el-dialog title="下发" :visible.sync="issuedVisible" width="450px">
-            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
-                <el-form-item label="报警电池电量" prop="alarmBattery">
-                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
-                    %
-                </el-form-item>
-                <el-form-item label="热报警度数" prop="alarmDegree">
-                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
-                    ℃
-                </el-form-item>
-            </el-form>
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="issuedVisible = false">取消</el-button>
-                <el-button type="primary" @click="saveIssued">下发</el-button>
-            </span>
-        </el-dialog>
-    </section>
-</template>
-
-<script>
-    import util from "../../common/js/util";
-    export default {
-        data() {
-            return {
-                allocations: [],
-                companies: {},
-                newAllocation: {
-                    equipmentNo: "", //设备编号
-                    useLife: "", //使用年限
-                    equipmentName: "", //设备名称
-                    id: "", //设备id
-                    belongCompanyId: "", //所属公司ID
-                    agent: "", //代理商
-                    usage: true //是否可以修改公司
-                },
-                filters: {
-                    keyName: "",
-                    companyId: ""
-                },
-                formRules: {
-                    equipmentNo: [
-                        { required: true, message: "请输入云模盒编号", trigger: "blur" }
-                    ],
-                    useLife: [
-                        { required: true, message: '请输入使用年限'},
-                        { type: 'number', message: '使用年限必须为数字值'}
-                    ],
-                    belongCompanyId: [
-                        { required: true, message: "请选择所属公司", trigger: ["blur", "change"] }
-                    ],
-                    agent: [
-                        { required: true, message: "请输入代理商", trigger: "blur" }
-                    ],
-                    alarmBattery: [
-                        { required: true, message: '请输入报警电池电量'},
-                        { type: 'number', message: '报警电池电量必须为数字值'}
-                    ],
-                    alarmDegree: [
-                        { required: true, message: '请输入热报警度数'},
-                        { type: 'number', message: '热报警度数必须为数字值'}
-                    ],
-                },
-
-                listLoading: false,
-                addLoading: false,
-                editLoading: false,
-                uploading: false,
-
-                total: 0,
-                page: 1,
-                size: 20,
-                tableHeight: 0,
-
-                addFormVisible: false,
-                editFormVisible: false,
-                operateDialogVisible: false,
-                activeIndex: 0,
-
-                issuedVal: {
-                    alarmBattery: 30,
-                    alarmDegree: 80,
-                },
-                issuedVisible: false,
-                multipleSelection: [],
-            };
-        },
-        methods: {
-            getMsg() {
-                //获取公司下拉列表
-                this.http.post( this.port.base.getCompanys, {},
-                res => {
-                    if (res.code == "ok") {
-                        this.companies = res.data;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //分页
-            handleCurrentChange(val) {
-                this.page = val;
-                this.getMoulds();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-                this.getMoulds();
-            },
-
-            //读取云模盒信息
-            getMoulds() {
-                this.listLoading = true;
-                this.http.post(this.port.base.mouldeList,{
-                    pageNum: this.page,
-                    pageSize: this.size,
-                    keyName: this.filters.keyName,
-                    companyId: this.filters.companyId
-                },
-                res => {
-                    this.listLoading = false;
-                    if (res.code == "ok") {
-                        var list = res.data.list
-                        for(var i in list){
-                            if(list[i].endTime == null){
-                                list[i].diffTime = "";
-                            } else {
-                                list[i].diffTime = util.formatDate.dateDiff(
-                                    //util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
-                                    list[i].endTime,
-                                    util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
-                                );
-                            }
-                        }
-                        this.allocations = list;
-                        this.total = res.data.total;
-                    } else {
-                        this.$message({
-                        message: res.msg,
-                        type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.listLoading = false;
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //添加界面
-            showAllocation() {
-                this.addFormVisible = true;
-                this.newAllocation = {
-                    id: "",
-                    useLife: "",
-                    equipmentNo: "",
-                    belongCompanyId: "",
-                    agent: ""
-                };
-            },
-           
-            //添加模具
-            addMould() {
-                this.$refs.newAllocation.validate(valid => {
-                    if (valid) {
-                    this.addLoading = true;
-                    this.http.post(
-                        this.port.base.editMould,
-                        {
-                            equipmentNo: this.newAllocation.equipmentNo,
-                            belongCompanyId: this.newAllocation.belongCompanyId,
-                            useLife: this.newAllocation.useLife,
-                            agent: this.newAllocation.agent
-                        },
-                        res => {
-                            this.addLoading = false;
-                            if (res.code == "ok") {
-                                this.addFormVisible = false;
-                                this.$message({
-                                    message: "添加成功",
-                                    type: "success"
-                                });
-                                this.getMoulds();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: "error"
-                                });
-                            }
-                        },
-                        error => {
-                            this.addLoading = false;
-                            this.addFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: "error"
-                            });
-                        }
-                    );
-                    }
-                });
-            },
-
-             //修改界面
-            showEdit(index, row, usageBoolean) {
-                this.editFormVisible = true;
-                this.newAllocation = {
-                    id: row.id,
-                    useLife: row.useLife,
-                    equipmentNo: row.equipmentNo,
-                    belongCompanyId: row.belongCompanyId,
-                    agent: row.agent,
-                    usage: usageBoolean
-                };
-            },
-
-            //编辑模具
-            editMould() {
-                this.$refs.newAllocation.validate(valid => {
-                    if (valid) {
-                        this.editLoading = true;
-                        this.http.post( this.port.base.editMould, {
-                            id: this.newAllocation.id,
-                            equipmentNo: this.newAllocation.equipmentNo,
-                            equipmentName: this.newAllocation.equipmentName,
-                            belongCompanyId: this.newAllocation.belongCompanyId,
-                            useLife: this.newAllocation.useLife,
-                            agent: this.newAllocation.agent
-                        },
-                        res => {
-                            this.editLoading = false;
-                            if (res.code == "ok") {
-                                this.editFormVisible = false;
-                                this.$message({
-                                    message: "修改成功",
-                                    type: "success"
-                                });
-                                this.getMoulds();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: "error"
-                                });
-                            }
-                        },
-                        error => {
-                            this.editLoading = false;
-                            this.editFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: "error"
-                            });
-                        });
-                    }
-                });
-            },
-
-            //打开启用窗口
-            openEnable(index) {
-                this.operateDialogVisible = true;
-                this.issuedVal.alarmBattery = this.allocations[this.activeIndex].alarmBattery;
-                this.issuedVal.alarmDegree = parseInt(this.allocations[this.activeIndex].alarmDegree);
-                this.activeIndex = index;
-            },
-
-            //启用设备
-            enable() {
-                // if(this.allocations[this.activeIndex].belongCompanyId == null){
-                //     this.$message({
-                //         message: "输入所属公司后才能启用模具",
-                //         type: "error"
-                //     });
-                // }else{
-                this.allocations[this.activeIndex].isUse = 1;
-                this.operateDialogVisible = false;
-                // this.http.post( this.port.base.enableMould, {
-                //     id: this.allocations[this.activeIndex].id,
-                //     isUse: 1
-                // },
-                var str = this.allocations[this.activeIndex].equipmentNo;
-                this.http.post( this.port.base.setPacket, {
-                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
-                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
-                    isUse: 1,
-                    equipmentNo: str
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: "设备已启用",
-                            type: "success"
-                        });
-                        this.getMoulds();
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //停用云模盒
-            disableEquipment(index) {
-                // if(this.allocations[index].belongCompanyId == null){
-                //     this.$message({
-                //         message: "输入所属公司后才能启用模具",
-                //         type: "error"
-                //     });
-                // }else{
-                this.allocations[index].isUse = 0;
-                // this.http.post( this.port.base.enableMould, {
-                //     id: this.allocations[index].id,
-                //     isUse: 0
-                // },
-                var str = this.allocations[this.activeIndex].equipmentNo;
-                this.http.post( this.port.base.setPacket, {
-                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
-                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
-                    isUse: 0,
-                    equipmentNo: str
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: "设备已停用",
-                            type: "success"
-                        });
-                        this.getMoulds();
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //导入云模盒
-            uploadFile(params) {
-                var fileObj = params.file;
-                var form = new FormData();
-                form.append("file", fileObj);
-                this.uploading = true;
-                this.http.uploadFile( this.port.base.importMouldEquipmentExcel,  form,
-                res => {
-                    this.uploading = false;
-                    this.$refs.upload.clearFiles();
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: "上传成功",
-                            type: "success"
-                        });
-                        this.getMoulds();
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.uploading = false;
-                    this.$refs.upload.clearFiles();
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
-
-            //列表选择
-            handleSelectionChange(val) {
-                this.multipleSelection = val;
-            },
-
-            //下发云模盒
-            issued() {
-                this.issuedVisible = true;
-            },
-
-            saveIssued() {
-                if(this.multipleSelection.length == 0) {
-                    this.$message({
-                        message: "请选择要下发的云模盒",
-                        type: "error"
-                    });
-                } else {
-                    var str = '';
-                    for(var i in this.multipleSelection) {
-                        str += this.multipleSelection[i].equipmentNo + ',';
-                    }
-                    str = str.substring(0,str.length-1)
-                    this.http.post( this.port.base.setPacket, {
-                        lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
-                        hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
-                        equipmentNo: str
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: "下发成功",
-                                type: "success"
-                            });
-                            this.issuedVisible = false;
-                            this.getMoulds();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
-                        this.$message({
-                            message: error,
-                            type: "error"
-                        });
-                    });
-                }
-            }
-
-        },
-        created() {
-            let height = window.innerHeight;
-            this.tableHeight = height - 210;
-            const that = this;
-            window.onresize = function temp() {
-                that.tableHeight = window.innerHeight - 210;    
-            };
-        },
-        mounted() {
-            this.getMsg();
-            //获取模具列表
-            this.getMoulds();
-        }
-    };
-</script>
-
-<style scoped>
-    .download {
-        color: #fff;
-        text-decoration: none;
-    }
-</style>

+ 54 - 414
lib_vue/src/views/system/manage.vue

@@ -4,13 +4,13 @@
 		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
 			<el-form :inline="true" :model="filters">
                 <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入生产方名称进行搜索" clearable></el-input>
+                    <el-input v-model="filters.keyName" size="small" placeholder="请输入机构名称" clearable></el-input>
                 </el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click.native="getFactory">查询</el-button>
+					<el-button type="primary" size="small" @click.native="getFactory">查询</el-button>
 				</el-form-item>
 				<el-form-item style="float:right;">
-					<el-button type="primary" @click.native="handleAdd">新增</el-button>
+					<el-button type="primary" size="small" @click.native="handleAdd">新增</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
@@ -18,22 +18,11 @@
 		<!--列表-->
 		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="companyName" label="生产方名称" width="250" sortable></el-table-column>
-            <el-table-column prop="administrator" label="生产方管理员" width="150" sortable>
-            </el-table-column>
-            <el-table-column prop="relateCompanyList" label="关联资产方" width="400" sortable>
-                <template slot-scope="scope">
-                    <span class="info" v-for="(item, index) in scope.row.relateCompanyList">
-                        {{item.companyName}}
-                        <span v-if="index != scope.row.relateCompanyList.length-1">、</span>
-                    </span>
-                </template>
-            </el-table-column>
-            <el-table-column prop="companyAddress" label="生产方地址" sortable></el-table-column>
+			<el-table-column prop="account" label="账号" sortable></el-table-column>
+            <el-table-column prop="roleName" label="机构名称" sortable></el-table-column>
 			<el-table-column label="操作" width="150">
 				<template slot-scope="scope">
-					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">删除</el-button>
+					<el-button type="danger" size="small" @click.native.native="toDelete(scope.row.id)">删除</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -52,91 +41,40 @@
 		</el-col>
 
         <!--新增界面-->
-		<el-dialog :title="addTitle" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog title="新增机构账号" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
-				<el-form-item label="生产方名称" prop="companyName" v-show="addState">
-					<el-input v-model="addForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
+				<el-form-item label="账号" prop="account">
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入账号"></el-input>
 				</el-form-item>
-                <el-form-item label="关联资产方" v-show="addState">
-                    <el-select v-model="addForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
-                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
+                <el-form-item label="教育机构" prop="id">
+                    <el-select v-model="addForm.id" clearable filterable placeholder="请选择教育机构" style="width:533px">
+                        <el-option v-for="item in agency" :key="item.id" :label="item.name" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="生产方地址" prop="companyAddress" v-show="addState">
-					<el-input v-model.lazy="addForm.companyAddress" autocomplete="off" @change="changeFactoryArea('addContainer')" placeholder="请输入生产方地址"></el-input>
-				</el-form-item>
-                <div id="addContainer" class="formMap" v-show="addState"></div>
-                <el-form-item label="姓名" prop="username" v-show="!addState">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
-				</el-form-item>
-				<el-form-item label="手机号" prop="account" v-show="!addState">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号"></el-input>
-				</el-form-item>
-                <el-form-item label="角色" v-show="!addState">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
-				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                 <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
+                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
 				<el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button v-if="addState" type="primary" @click.native="toNext(0)">下一步</el-button>
-                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">上一步</el-button>
-				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
-			</div>
-		</el-dialog>
-
-		<!--编辑界面-->
-		<el-dialog title="编辑生产方" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm">
-				<el-form-item label="生产方名称" prop="companyName">
-					<el-input v-model="editForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
-				</el-form-item>
-                <el-form-item label="关联资产方">
-                    <el-select v-model="editForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
-                        <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
-                        </el-option>
-                    </el-select>
-				</el-form-item>
-                <el-form-item label="生产方地址" prop="companyAddress">
-					<el-input v-model="editForm.companyAddress" autocomplete="off" :change="changeFactoryArea('editContainer')" placeholder="请输入生产方地址"></el-input>
-				</el-form-item>
-                <div id="editContainer" class="formMap"></div>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
 			</div>
 		</el-dialog>
 	</section>
 </template>
 
 <script>
-    import Vue from 'vue';
 	import util from '../../common/js/util'
 
 	export default {
 		data() {
-            var checkPhone = (rule, value, callback) => {
-                if (!value) {
-                    return callback(new Error('请输入联系方式'));
-                } else {
-                    const reg = /^1[0-9]\d{9}$/
-                    if (reg.test(value)) {
-                        callback();
-                    } else {
-                        return callback(new Error('请输入正确的联系方式'));
-                    }
-                }
-            };
 			return {
 				filters: {
                     keyName: ''
                 },
-
                 user: JSON.parse(sessionStorage.getItem('user')),
-                companys:[],
-				list: [],
+                list: [],
+                agency: [],
+                
 				total: 0,
                 page: 1,
                 size: 20,
@@ -144,77 +82,45 @@
                 tableHeight: 0,
                 
                 formRules: {
-					companyName: [
-						{ required: true, message: '请输入生产方名称', trigger: 'blur' }
+					account: [
+						{ required: true, message: '请输入机构账号', trigger: 'blur' }
                     ],
-                    companyAddress: [
-                        { required: true, message: '请输入生产方地址', trigger: 'blur' }
-                    ],
-                    username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
-                    ],
-                    account: [
-                        { required: true, validator: checkPhone, trigger: 'blur'}
+                    id: [
+                        { required: true, message: '请选择所属机构', trigger: ['blur','change'] }
                     ]
                 },
 
-                // 地图
-                map: '',
-                marker: '',
-
                 // 新增界面
 				addFormVisible: false,
                 addLoading: false,
-                addState: true,
-                addTitle: '新增生产方',
 				addForm: {
-                    companyName: '',
-                    companyType: 1,
-                    companyAddress: '',
-                    yLng: 116.397511,
-                    xLat: 39.907545,
-                    companyIds: [],
-                    username: '',
                     account: '',
-                    companyId: '',
-                    roleName: "系统管理员",
-                    flag: 0
+                    id: 0,
 				},
-                
-                // 编辑界面
-				editFormVisible: false,
-				editLoading: false,
-				editForm: {
-					id: 0,
-					companyName: '',
-                    companyType: 1,
-                    companyAddress: '',
-                    yLng: 0,
-                    xLat: 0,
-                    companyIds: [],
-                    flag: 1
-				}
 			}
 		},
 		methods: {
             //  分页
 			handleCurrentChange(val) {
 				this.page = val;
-				this.getFactory();
+				this.getList();
             },
 
             handleSizeChange(val) {
                 this.size = val;
-				this.getFactory();
+				this.getList();
             },
 
             //获取基础数据
-            getMsg() {
-                this.http.post(this.port.base.relationList, {
-                    companyType: 0
+            getList() {
+                this.http.post(this.port.system.list, {
+                    // keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
                 }, res => {
                     if (res.code == "ok") {
-                        this.companys = res.data;
+                        this.list = res.data.list;
+                        this.total = res.data.total;
                     } else {
                         this.$message({
                             message: res.msg,
@@ -229,19 +135,16 @@
                 })
             },
 
-			//获取列表
-			getFactory() {
-				this.listLoading = true;
-                this.http.post(this.port.base.companyList, {
-                    keyName: this.filters.keyName,
-                    pageNum: this.page,
-                    pageSize: this.size,
-                    companyType: 1
-                }, res => {
-                    this.listLoading = false;
+            //显示新增界面
+			handleAdd() {
+                this.http.post(this.port.system.agencyList, {} , 
+                res => {
                     if (res.code == "ok") {
-                        this.list = res.data.list;
-                        this.total = res.data.total;
+                        this.agency = res.data;
+                        this.addForm = {
+                            account: '',
+                        };
+                        this.addFormVisible = true;
                     } else {
                         this.$message({
                             message: res.msg,
@@ -249,123 +152,30 @@
                         });
                     }
                 }, error => {
-                    this.listLoading = false;
                     this.$message({
                         message: error,
                         type: 'error'
                     });
                 })
             },
-            
-            //地址输入切换
-            changeFactoryArea(mapId) {
-                if(mapId == "addContainer"){
-                    this.markLocation(this.addForm.companyAddress, mapId);
-                } else {
-                    this.markLocation(this.editForm.companyAddress, mapId);
-                }
-                
-            },
-
-            toNext(i) {
-                if(i == 0) {
-                    this.addState = false;
-                     this.addTitle = '新增生产方管理员';
-                }
-            },
-
-            toPart(i) {
-                if(i == 0) {
-                    this.addState = true;
-                    this.addTitle = '新增生产方';
-                }
-                var _this = this
-                setTimeout(function(){ _this.setMap('addContainer'); }, 100);
-            },
-
-            //显示新增界面
-			handleAdd() {
-                this.addFormVisible = true;
-                this.addState = true;
-                this.addTitle = '新增生产方';
-				this.addForm = {
-                    companyName: '',
-                    companyAddress: '',
-                    yLng: 116.397511,
-                    xLat: 39.907545,
-                    companyIds: [],
-                    username: '',
-                    account: '',
-                    companyId: '',
-                    roleName: "系统管理员",
-                    flag: 0
-                };
-            },
 
             //新增
 			addSubmit() {
 				this.$refs.addForm.validate((valid) => {
 					if (valid) {
                         this.addLoading = true;
-                        var str = "";
-                        for(var i in this.addForm.companyIds){
-                            if(i == this.addForm.companyIds.length-1){
-                                str += this.addForm.companyIds
-                            } else {
-                                str += this.addForm.companyIds + ","
-                            }
-                        }
-                        this.http.post(this.port.base.addCompany, {
-                            companyName: this.addForm.companyName,
-                            companyType: 1,
-                            companyAddress: this.addForm.companyAddress,
-                            yLng: this.addForm.yLng,
-                            xLat: this.addForm.xLat,
-                            companyIds: str,
-                            flag: 0
-                        } , res => {
-                            this.addLoading = false;
-                            if (res.code == "ok") {
-                                this.addPeo(res.data.id);
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.addLoading = false;
-                            this.addFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-            },
-
-            //添加人员
-            addPeo(companyId) {
-                this.$refs.addForm.validate((valid) => {
-					if (valid) {
-                        this.http.post(this.port.project.addUser, {
-                            username: this.addForm.username,
+                        this.http.post(this.port.system.addAccount, {
                             account: this.addForm.account,
-                            companyId: companyId,
-                            roleName: this.addForm.roleName,
-                            parentId: this.user.id,
-                            addType: 0,
-                            flag: 0
+                            id: this.addForm.id,
                         } , res => {
                             this.addLoading = false;
+                            this.addFormVisible = false;
                             if (res.code == "ok") {
-                                this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
-                                    type: 'success'
+                                    message: "添加成功",
+                                    type: "success"
                                 });
-                                this.getFactory();
+                                this.getList();
                             } else {
                                 this.$message({
                                     message: res.msg,
@@ -383,21 +193,21 @@
 					}
 				});
             },
-            
-			//删除
-			handleDel(index, row) {
-				this.$confirm('确认删除该生产方吗?', '提示', {
+
+            //删除
+            toDelete(id) {
+                this.$confirm('确认删除机构用户?', '提示', {
 					type: 'warning'
 				}).then(() => {
-                    this.http.post(this.port.base.delCompany, {
-                        id: row.id
+                    this.http.post(this.port.system.delAccount, {
+                        id: id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
                                 message: '删除成功',
                                 type: 'success'
                             });
-                            this.getFactory();
+                            this.getList();
                         } else {
                             this.$message({
                                 message: res.msg,
@@ -412,158 +222,6 @@
                     })
 				});
             },
-            
-			//显示编辑界面
-			handleEdit(index, row) {
-                this.editFormVisible = true;
-                var array = [];
-                for(var i in row.relateCompanyList){
-                    array.push(row.relateCompanyList[i].id)
-                }
-                this.editForm = {
-                    id: row.id,
-                    companyName: row.companyName,
-                    companyType: 1,
-                    companyAddress: row.companyAddress,
-                    yLng: row.ylng,
-                    xLat: row.xlat,
-                    companyIds: array,
-                    flag: 1
-                };
-            },
-            
-			//编辑
-			editSubmit() {
-				this.$refs.editForm.validate((valid) => {
-					if (valid) {
-                        this.editLoading = true;
-                        var str = "";
-                        for(var i in this.editForm.companyIds){
-                            if(i == this.editForm.companyIds.length-1){
-                                str += this.editForm.companyIds[i]
-                            } else {
-                                str += this.editForm.companyIds[i] + ","
-                            }
-                        }
-                        this.http.post(this.port.base.addCompany, {
-                            id: this.editForm.id,
-                            companyName: this.editForm.companyName,
-                            companyType: 1,
-                            companyAddress: this.editForm.companyAddress,
-                            yLng: this.editForm.yLng,
-                            xLat: this.editForm.xLat,
-                            companyIds: str,
-                            flag: 1
-                        } , res => {
-                            this.editLoading = false;
-                            if (res.code == "ok") {
-                                this.editFormVisible = false;
-                                this.$message({
-                                    message: '修改成功',
-                                    type: 'success'
-                                });
-                                this.getFactory();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.editLoading = false;
-                            this.editFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-            },
-
-            //获取地图
-            setMap(mapId) {
-                if(mapId == 'addContainer') {
-                    this.map = new AMap.Map('addContainer', {
-                        resizeEnable: true, // 允许缩放
-                        center:[ this.addForm.yLng , this.addForm.xLat ],
-                        zoom:10
-                    })
-
-                    this.marker = new AMap.Marker({
-                        map: this.map,
-                        position: new AMap.LngLat(this.addForm.yLng , this.addForm.xLat),   // 经纬度
-                    });
-                } else {
-                    this.map = new AMap.Map('editContainer', {
-                        resizeEnable: true, // 允许缩放
-                        center:[this.editForm.yLng , this.editForm.xLat],
-                        zoom:10
-                    })
-
-                    this.marker = new AMap.Marker({
-                        map: this.map,
-                        position: new AMap.LngLat(this.editForm.yLng , this.editForm.xLat),   // 经纬度
-                    });
-                }
-                
-                var _this = this;
-                this.map.on('click', function(e) {
-                    if(_this.map){
-                        _this.map.remove(_this.marker);
-                    }
-                    var Lng = e.lnglat.getLng(),
-                    Lat = e.lnglat.getLat();
-                    if(mapId == 'addContainer') {
-                        _this.addForm.yLng = Lng;
-                        _this.addForm.xLat = Lat;
-                    } else {
-                        _this.editForm.yLng = Lng;
-                        _this.editForm.xLat = Lat;
-                    }
-                    _this.marker = new AMap.Marker({
-                        map: _this.map,
-                        position: new AMap.LngLat(Lng , Lat),   // 经纬度
-                    });
-                });
-            },
-
-            // 获取经纬度
-            markLocation(address,mapId) {
-                var _this = this;
-                AMap.plugin('AMap.Geocoder', function() {
-                    var geocoder = new AMap.Geocoder();            
-                    geocoder.getLocation(address, function(status, result) {
-                        if (status === 'complete' && result.info === 'OK') {
-                            // 经纬度                      
-                            var lng = result.geocodes[0].location.lng;
-                            var lat = result.geocodes[0].location.lat;
-                            
-                            _this.noSub = false;
-                            if(mapId == "addContainer") {
-                                _this.addForm.yLng = lng;
-                                _this.addForm.xLat = lat;
-                            } else {
-                                _this.editForm.yLng = lng;
-                                _this.editForm.xLat = lat;
-                            }
-                            
-                            // 添加标记
-                            if(_this.map){
-                                _this.map.remove(_this.marker);
-                                _this.map.setZoomAndCenter(10, [lng, lat]);
-                                _this.marker = new AMap.Marker({
-                                    map: _this.map,
-                                    position: new AMap.LngLat(lng, lat),   // 经纬度
-                                });
-                            }
-
-                        } else {
-                            //console.log('定位失败!');
-                        }
-                    });
-                });
-            }
         },
         created() {
             let height = window.innerHeight;
@@ -572,30 +230,12 @@
             window.onresize = function temp() {
                 that.tableHeight = window.innerHeight - 210;    
             };
-        },
-        watch: {
-            addFormVisible(val) {
-                if(val){
-                    var _this = this
-                    setTimeout(function(){ _this.setMap('addContainer'); }, 300);
-                }
-            },
-            editFormVisible(val) {
-                if(val){
-                    var _this = this
-                    setTimeout(function(){ _this.setMap('editContainer'); }, 300);
-                }
-            }
         },
 		mounted() {
-            this.getMsg();
-			this.getFactory();
+            this.getList();
         }
 	}
 </script>
 
 <style scoped>
-    .formMap {
-        height: 400px;
-    }
 </style>

+ 99 - 410
lib_vue/src/views/user/reserve.vue

@@ -3,56 +3,37 @@
 		<!--工具条-->
 		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
 			<el-form :inline="true" :model="filters">
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
-                            <el-option v-for="item in allCompanies" :key="item.id" :label="item.companyName" :value="item.id">
-                            </el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="3">
-                    <el-form-item>
-                        <el-select v-model="filters.flag" placeholder="请选择查询条件">
-                            <el-option label="姓名" value="0"></el-option>
-                            <el-option label="手机号" value="1"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或手机号进行搜索" style="width:250px;"></el-input>
+                    <el-input v-model="filters.keyName" size="small" placeholder="请输入用户名或手机号" clearable></el-input>
                 </el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click="getUsers">查询</el-button>
-				</el-form-item>
-				<el-form-item style="float:right;" v-if="user.subordinateType == 0 || user.isManager == 1">
-					<el-button type="primary" @click="handleAdd">新增</el-button>
+					<el-button type="primary" size="small" @click.native="getFactory">查询</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
 
 		<!--列表-->
 		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
-			<el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="username" label="姓名" width="120" sortable></el-table-column>
-			<el-table-column prop="account" label="手机号" width="180" sortable></el-table-column>
-			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
-            <el-table-column prop="projects" label="参与项目" sortable>
+            <el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="name" label="姓名" sortable></el-table-column>
+            <el-table-column prop="mobile" label="手机号" width='180' sortable></el-table-column>
+            <el-table-column prop="appointDate" label="预约时间" align='center' width='180' sortable>
                 <template slot-scope="scope">
-                    <span class="info" v-for="(item, index) in scope.row.projects">
-                        {{item.projectName}}
-                        <span v-if="scope.row.projects != null && index != scope.row.projects.length-1">、</span>
-                    </span>
-                </template>
-			</el-table-column>
-            <el-table-column prop="roleName" label="备注" width="180" sortable></el-table-column>
-            <el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
-			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
-			<el-table-column label="操作" align="left" width="230">
-				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || (user.parentId == 1 && user.subordinateType == 0)">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
-                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">邀请</el-button>
+					{{scope.row.appointDate}}&nbsp;&nbsp;&nbsp;{{scope.row.time==0?'上午':'下午'}}
+				</template>
+            </el-table-column>
+            <el-table-column prop="age" label="孩子年龄" align='center' width='100' sortable></el-table-column>
+            <el-table-column prop="content" label="备注说明" width='180' sortable></el-table-column>
+            <el-table-column prop="stage" label="状态" align='center' sortable>
+                <template slot-scope="scope">
+					<span :style="scope.row.stage==1?'color:green':'color:red'">{{scope.row.stage==1?'已接收':'未接收'}}</span>
+				</template>
+            </el-table-column>
+            <el-table-column prop="indate" label="时间" align='center' width='180' sortable></el-table-column>
+			<el-table-column label="操作" align='center' width="200">
+				<template slot-scope="scope">
+                    <el-button type="primary" v-if="scope.row.stage!=1" size="small" @click.native.native="reserve(scope.row.id)">接收</el-button>
+                    <el-button type="primary" size="small" @click.native.native="handleAdd(scope.row)">修改时间</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -70,210 +51,90 @@
             </el-pagination>
 		</el-col>
 
-        <!--新增界面-->
-		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
-				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
-				</el-form-item>
-                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" label="参与项目" prop="projectIds">
-					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable placeholder="请选择参与项目" style="width:202px">
-                        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
-                        </el-option>
-                    </el-select>
-				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
-                        <el-option v-for="item in company" :key="item.id" :label="item.companyName" :value="item.id">
+        <!--修改时间-->
+		<el-dialog title="修改时间" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
+				<el-form-item label="预约时间" prop="timeDate">
+                    <el-date-picker v-model="addForm.timeDate" :clearable="false" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" style="display:inline-block;width:300px;"></el-date-picker>
+                    <el-select v-model="addForm.time" placeholder="请选择教育机构" style="display:inline-block;">
+                        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
-				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
 				<el-button @click.native="addFormVisible = false">取消</el-button>
 				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
 			</div>
 		</el-dialog>
-
-		<!--编辑界面-->
-		<el-dialog title="编辑人员" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="editForm" label-width="80px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="editForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
-				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="editForm.account" disabled autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
-				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-                    <el-input v-model="editForm.companyId" disabled autocomplete="off" placeholder="请选择所属公司"></el-input>
-				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="editForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
-				</el-form-item>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-                 <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
-			</div>
-		</el-dialog>
-
-        <!--邀请界面-->
-		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
-                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
-            </el-input>
-		</el-dialog>
 	</section>
 </template>
 
 <script>
-	import util from '../../common/js/util'
-
+    import util from '../../common/js/util'
+    
 	export default {
 		data() {
-            var checkPhone = (rule, value, callback) => {
-                if (!value) {
-                    return callback(new Error('请输入联系方式'));
-                } else {
-                    const reg = /^1[0-9]\d{9}$/
-                    if (reg.test(value)) {
-                        callback();
-                    } else {
-                        return callback(new Error('请输入正确的联系方式'));
-                    }
-                }
-            };
 			return {
 				filters: {
-                    keyName: '',
-                    roleName: '',
-                    flag: '姓名',
-                    companyId: ''
+                    keyName: ''
                 },
-                
                 user: JSON.parse(sessionStorage.getItem('user')),
-                company: [],
-                projects: [],
-                //搜索用 涉及到的所有公司
-                allCompanies: [],
-
-				list: [],
+                list: [],
+                
 				total: 0,
                 page: 1,
                 size: 20,
                 listLoading: false,
                 tableHeight: 0,
-
+                
                 formRules: {
-                    username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
-                    ],
-                    account: [
-                        { required: true, validator: checkPhone, trigger: 'blur'}
+					timeDate: [
+						{ required: true, message: '请选择预约时间', trigger: 'blur' }
                     ],
-                    teamName: [
-						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
-                    ],
-                    projectIds: [
-						{ required: true, message: '请选择参与项目', trigger: ["blur",'change'] }
-					],
-                    companyId: [
-						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
-					]
                 },
 
-                //新增界面是否显示
-                addFormVisible: false,
-				addLoading: false,
-				//新增界面数据
+                options: [{
+                    value: 0,
+                    label: '上午'
+                }, {
+                    value: 1,
+                    label: '下午'
+                }],
+
+                // 新增界面
+				addFormVisible: false,
+                addLoading: false,
 				addForm: {
-					username: '',
-                    account: '',
-                    projectIds: '',
-                    companyId: '',
-                    roleName: '',
-                    flag: 0
+                    id: 0,
+                    timeDate: '',
+                    time: '',
 				},
-
-                //编辑界面是否显示
-				editFormVisible: false,
-				editLoading: false,
-				//编辑界面数据
-				editForm: {
-					id: 0,
-					username: '',
-                    account: '',
-                    companyId: '',
-                    roleName: '',
-                    flag: 1
-                },
-                
-                //邀请
-                inviteVisible: false,
-                inviteLink: ''
 			}
 		},
 		methods: {
-            //获取基础数据
-            getMsg(){
-                if(this.user.parentId == 1 && this.user.subordinateType == 0) {
-                    this.company = [];
-                    this.allCompanies = [];
-                    this.http.post(this.port.base.getCompanyList, {
-                        id: this.user.id,
-                        parentId: this.user.parentId
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.company = res.data;
-                            this.allCompanies = res.data;
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-                } else if(this.user.parentId > 1 && this.user.isManager == 1) {
-                    this.http.post(this.port.project.projectByUser, {}, 
-                    res => {
-                        if (res.code == "ok") {
-                            this.projects = res.data;
-                            //再获取一下公司列表
-                            this.getAllCompanies();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    });
-                }
-            },  
+            //  分页
+			handleCurrentChange(val) {
+				this.page = val;
+				this.getList();
+            },
 
-            //新版获取所有公司
-            getAllCompanies(){
-                this.allCompanies = [];
-                this.http.post(this.port.base.getInfo, {}, res => {
+            handleSizeChange(val) {
+                this.size = val;
+				this.getList();
+            },
+
+            //获取基础数据
+            getList() {
+                this.http.post(this.port.user.reserList, {
+                    // keyName: this.filters.keyName,
+                    pageNum: this.page,
+                    pageSize: this.size,
+                    id: this.user.id,
+                }, res => {
                     if (res.code == "ok") {
-                        this.allCompanies = res.data;
+                        this.list = res.data.list;
+                        this.total = res.data.total;
                     } else {
                         this.$message({
                             message: res.msg,
@@ -285,34 +146,21 @@
                         message: error,
                         type: 'error'
                     });
-                });
-            },
-
-            //分页
-			handleCurrentChange(val) {
-				this.page = val;
-				this.getUsers();
-            },
-
-            handleSizeChange(val) {
-                this.size = val;
-				this.getUsers();
+                })
             },
 
-			//获取用户列表
-			getUsers() {
-				this.listLoading = true;
-                this.http.post(this.port.project.userList, {
-                    keyName: this.filters.keyName,
-                    currentPage: this.page,
-                    pageSize: this.size,
-                    companyId: this.filters.companyId==''?-1:this.filters.companyId,
-                    flag: this.filters.flag=='姓名'?0:this.filters.flag
-                }, res => {
-                    this.listLoading = false;
+            //接收
+            reserve(id) {
+                this.http.post(this.port.user.reserEdit, {
+                    id: id,
+                    stage: 1,
+                } , res => {
                     if (res.code == "ok") {
-                        this.list = res.data.list;
-                        this.total = res.data.total;
+                        this.$message({
+                            message: "接收成功",
+                            type: "success"
+                        });
+                        this.getList();
                     } else {
                         this.$message({
                             message: res.msg,
@@ -320,43 +168,38 @@
                         });
                     }
                 }, error => {
-                    this.listLoading = false;
                     this.$message({
                         message: error,
                         type: 'error'
                     });
                 })
             },
-            
-            //显示新增界面
-			handleAdd() {
+
+            //显示修改界面
+			handleAdd(row) {
+                this.addForm = {
+                    id: row.id,
+                    timeDate: row.appointDate,
+                    time: row.time,
+                };
                 this.addFormVisible = true;
-				this.addForm = {
-                    parentId: this.user.id,
-					username: '',
-                    account: '',
-                    mobile: '',
-                    projectIds: '',
-					companyId: '',
-                    roleName: '',
-                    flag: 0
-				};
             },
 
-            //新增
+            //修改
 			addSubmit() {
 				this.$refs.addForm.validate((valid) => {
 					if (valid) {
-						this.addLoading = true;
-                        this.http.post(this.port.project.addUser, this.addForm , res => {
+                        this.addLoading = true;
+                        this.http.post(this.port.user.reserEdit, this.addForm , 
+                        res => {
                             this.addLoading = false;
+                            this.addFormVisible = false;
                             if (res.code == "ok") {
-                                this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
-                                    type: 'success'
+                                    message: "修改成功",
+                                    type: "success"
                                 });
-                                this.getUsers();
+                                this.getList();
                             } else {
                                 this.$message({
                                     message: res.msg,
@@ -373,155 +216,7 @@
                         })
 					}
 				});
-			},
-
-			//删除
-			handleDel(index, row) {
-                this.$confirm('确认删除该人员吗?', '提示', {
-					type: 'warning'
-				}).then(() => {
-                    this.http.post(this.port.project.delUser, {
-                        id: row.id
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            this.getUsers();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-				});
             },
-            
-			//显示编辑界面
-			handleEdit(index, row) {
-                this.editFormVisible = true;
-				this.editForm = {
-                    id: row.id,
-                    parentId: this.user.id,
-					username: row.username,
-                    account: row.account,
-					companyId: row.companyName,
-                    roleName: row.roleName,
-                    flag: 1
-                };
-            },
-            
-			//编辑
-			editSubmit() {
-				this.$refs.editForm.validate((valid) => {
-					if (valid) {
-                        this.editLoading = true;
-                        this.http.post(this.port.project.addUser, {
-                            id: this.editForm.id,
-                            parentId: this.editForm.parentId,
-                            username: this.editForm.username,
-                            roleName: this.editForm.roleName,
-                            flag: 1
-                        } , res => {
-                            this.editLoading = false;
-                            if (res.code == "ok") {
-                                this.editFormVisible = false;
-                                this.$message({
-                                    message: '修改成功',
-                                    type: 'success'
-                                });
-                                this.getUsers();
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: 'error'
-                                });
-                            }
-                        }, error => {
-                            this.editLoading = false;
-                            this.editFormVisible = false;
-                            this.$message({
-                                message: error,
-                                type: 'error'
-                            });
-                        })
-					}
-				});
-            },
-            
-            //修改
-            choseProject() {
-                if(this.addForm.projectIds == ""){
-                    this.company = [];
-                    this.addForm.companyId = null;
-                }else{
-                    this.http.post(this.port.base.getProduceCompany, {
-                        projectId: this.addForm.projectIds
-                    }, res => {
-                        if (res.code == "ok") {
-                            this.company = res.data;
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    }, error => {
-                        this.$message({
-                            message: error,
-                            type: 'error'
-                        });
-                    })
-                }
-            },
-
-            //邀请
-            invite(index, row) {
-                this.http.post(this.port.project.inviteUser, {
-                    inviteeId: row.id,
-                    projectId: row.projects[0].id,
-                    operatorId: this.user.id
-                } , res => {
-                    if (res.code == "ok") {
-                        this.inviteVisible = true;
-                        this.inviteLink = res.data.addressUrl;
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: 'error'
-                        });
-                    }
-                }, error => {
-                    this.$message({
-                        message: error,
-                        type: 'error'
-                    });
-                })
-            },
-
-            //复制链接
-            copyLink() {
-                //this.inviteVisible = false;
-                this.$message({
-                    message: "复制成功!",
-                    type: 'success'
-                });
-            },
-
-            onError(e) {
-                //this.inviteVisible = false;
-                this.$message({
-                    message: "复制失败!",
-                    type: 'error'
-                });
-            }
         },
         created() {
             let height = window.innerHeight;
@@ -532,16 +227,10 @@
             };
         },
 		mounted() {
-            this.getMsg();
-			this.getUsers();
+            this.getList();
         }
 	}
 </script>
 
 <style scoped>
-    .el-input-group__append button.el-button {
-        background-color: #409EFF;
-        border-color: #409EFF;
-        color: #fff;
-    }
 </style>