Browse Source

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

# Conflicts:
#	ys_vue/src/views/mold/moldDetail.vue
sunyadv 5 years ago
parent
commit
f3b9d1b2a6

+ 49 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/entity/vo/MouldVO.java

@@ -1,6 +1,10 @@
 package com.hssx.cloudmodel.entity.vo;
 package com.hssx.cloudmodel.entity.vo;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.hssx.cloudmodel.entity.Mould;
 import com.hssx.cloudmodel.entity.Mould;
+import lombok.Data;
+
+import java.time.LocalDateTime;
 
 
 /**
 /**
  * Author: 吴涛涛 cuiyi@itany.com
  * Author: 吴涛涛 cuiyi@itany.com
@@ -8,7 +12,52 @@ import com.hssx.cloudmodel.entity.Mould;
  * Description:<描述>
  * Description:<描述>
  * Version: 1.0
  * Version: 1.0
  */
  */
+@Data
 public class MouldVO extends Mould {
 public class MouldVO extends Mould {
     private String mouldEquipmentNo;
     private String mouldEquipmentNo;
     private String projectName;
     private String projectName;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime endTime;
+    private String mangerName;
+    private String equipmentNo;
+
+    public String getMouldEquipmentNo() {
+        return mouldEquipmentNo;
+    }
+
+    public void setMouldEquipmentNo(String mouldEquipmentNo) {
+        this.mouldEquipmentNo = mouldEquipmentNo;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public LocalDateTime getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(LocalDateTime endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getMangerName() {
+        return mangerName;
+    }
+
+    public void setMangerName(String mangerName) {
+        this.mangerName = mangerName;
+    }
+
+    public String getEquipmentNo() {
+        return equipmentNo;
+    }
+
+    public void setEquipmentNo(String equipmentNo) {
+        this.equipmentNo = equipmentNo;
+    }
 }
 }

+ 9 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/entity/vo/UserVO.java

@@ -13,6 +13,15 @@ public class UserVO extends User {
     private String roleName;
     private String roleName;
     private String keyName;//项目名称
     private String keyName;//项目名称
     private Integer serchType;//搜索类型0-项目名称,1-模具编号
     private Integer serchType;//搜索类型0-项目名称,1-模具编号
+    private Integer projectId;
+
+    public Integer getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(Integer projectId) {
+        this.projectId = projectId;
+    }
 
 
     public String getKeyName() {
     public String getKeyName() {
         return keyName;
         return keyName;

+ 4 - 2
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/MouldEquipmentMapper.java

@@ -3,12 +3,14 @@ package com.hssx.cloudmodel.mapper;
 import com.hssx.cloudmodel.entity.MouldEquipment;
 import com.hssx.cloudmodel.entity.MouldEquipment;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.hssx.cloudmodel.entity.vo.MouldEquipmentVO;
 import com.hssx.cloudmodel.entity.vo.MouldEquipmentVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.RequestParam;
 
 
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  * </p>
  *
  *
  * @author 吴涛涛
  * @author 吴涛涛
@@ -16,5 +18,5 @@ import java.util.List;
  */
  */
 public interface MouldEquipmentMapper extends BaseMapper<MouldEquipment> {
 public interface MouldEquipmentMapper extends BaseMapper<MouldEquipment> {
 
 
-    List<MouldEquipmentVO> getListByCompanyId(Integer belongCompanyId);
+    List<MouldEquipmentVO> getListByCompanyId(@Param("belongCompanyId") Integer belongCompanyId,@Param("list") List<Integer> ides);
 }
 }

+ 3 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/MouldMapper.java

@@ -21,5 +21,7 @@ public interface MouldMapper extends BaseMapper<Mould> {
 
 
     void updateMouldByProjectId(@Param("project") Project project);
     void updateMouldByProjectId(@Param("project") Project project);
 
 
-    List<MouldVO> selectListByCondition(UserVO userVO);
+    List<MouldVO> selectListByCondition(@Param("userVO")UserVO userVO);
+
+    List<MouldVO> selectListByConditionByProject(@Param("userVO")UserVO userVO, @Param("list")List<Integer> set);
 }
 }

+ 15 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldEquipmentServiceImpl.java

@@ -4,19 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import com.hssx.cloudmodel.constant.Constant;
 import com.hssx.cloudmodel.constant.Constant;
+import com.hssx.cloudmodel.entity.Mould;
 import com.hssx.cloudmodel.entity.MouldEquipment;
 import com.hssx.cloudmodel.entity.MouldEquipment;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.entity.vo.MouldEquipmentVO;
 import com.hssx.cloudmodel.entity.vo.MouldEquipmentVO;
 import com.hssx.cloudmodel.mapper.MouldEquipmentMapper;
 import com.hssx.cloudmodel.mapper.MouldEquipmentMapper;
+import com.hssx.cloudmodel.mapper.MouldMapper;
 import com.hssx.cloudmodel.service.MouldEquipmentService;
 import com.hssx.cloudmodel.service.MouldEquipmentService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import com.hssx.cloudmodel.util.PageUtil;
 import com.hssx.cloudmodel.util.PageUtil;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestParam;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.LocalTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -31,6 +35,8 @@ import java.util.List;
 public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper, MouldEquipment> implements MouldEquipmentService {
 public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper, MouldEquipment> implements MouldEquipmentService {
     @Resource
     @Resource
     MouldEquipmentMapper mouldEquipmentMapper;
     MouldEquipmentMapper mouldEquipmentMapper;
+    @Resource
+    MouldMapper mouldMapper;
 
 
     @Override
     @Override
     public HttpRespMsg addAndUpdateMouldEquipment(MouldEquipment mouldEquipment, User user) {
     public HttpRespMsg addAndUpdateMouldEquipment(MouldEquipment mouldEquipment, User user) {
@@ -86,7 +92,15 @@ public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper,
     @Override
     @Override
     public HttpRespMsg getListByCompanyId(MouldEquipmentVO mouldEquipmentVO) {
     public HttpRespMsg getListByCompanyId(MouldEquipmentVO mouldEquipmentVO) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
-        List<MouldEquipmentVO> list = mouldEquipmentMapper.getListByCompanyId(mouldEquipmentVO.getBelongCompanyId());
+        List<Integer> ides = new ArrayList<>();
+        List<Mould> moulds = mouldMapper.selectList(new QueryWrapper<Mould>().eq("company_id", mouldEquipmentVO.getBelongCompanyId()));
+        for (Mould mould : moulds) {
+            ides.add(mould.getEquipmentId());
+        }
+        if(ides.size()==0){
+            ides.add(-1);
+        }
+        List<MouldEquipmentVO> list = mouldEquipmentMapper.getListByCompanyId(mouldEquipmentVO.getBelongCompanyId(),ides);
         msg.data = list;
         msg.data = list;
         return msg;
         return msg;
     }
     }

+ 16 - 3
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldServiceImpl.java

@@ -1,5 +1,6 @@
 package com.hssx.cloudmodel.service.impl;
 package com.hssx.cloudmodel.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.hssx.cloudmodel.entity.Mould;
 import com.hssx.cloudmodel.entity.Mould;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.mapper.MouldMapper;
 import com.hssx.cloudmodel.mapper.MouldMapper;
@@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -28,10 +30,21 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         if(mould.getId() != null){
         if(mould.getId() != null){
             //修改
             //修改
-            mouldMapper.updateById(mould);
+            Mould m = mouldMapper.selectOne(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
+            if((m != null && m.getId()==mould.getId()) || m == null){
+                mouldMapper.updateById(mould);
+            }else{
+                msg.setError("当前模具编号已存在,请重新输入其他模具编号");
+            }
         }else{
         }else{
-            mould.setCreatorId(user.getId());
-            mouldMapper.insert(mould);
+            //查询当前模具编号的模具是否存在
+            Integer count = mouldMapper.selectCount(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
+            if(count>0){
+                msg.setError("当前模具编号已存在,请重新输入其他模具编号");
+            }else{
+                mould.setCreatorId(user.getId());
+                mouldMapper.insert(mould);
+            }
         }
         }
         return msg;
         return msg;
     }
     }

+ 29 - 10
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/ProjectServiceImpl.java

@@ -229,23 +229,42 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public HttpRespMsg getModelListByUser(UserVO userVO, PageUtil page) {
     public HttpRespMsg getModelListByUser(UserVO userVO, PageUtil page) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         List<Integer> set = new ArrayList<>();
         List<Integer> set = new ArrayList<>();
+        set.add(-1);
+        List<MouldVO> moulds = new ArrayList<>();
         if(userVO.getId() != null){
         if(userVO.getId() != null){
             //资产方管理员,获取他公司下的所有模具
             //资产方管理员,获取他公司下的所有模具
-            if(Constant.SYS_ID == userVO.getParentId()){
-                PageHelper.startPage(page.getPageNum(),page.getPageSize());
-                List<MouldVO> moulds = mouldMapper.selectListByCondition(userVO);
-                PageInfo<MouldVO> pageInfo = new PageInfo<>(moulds);
-                msg.data = pageInfo;
+            PageHelper.startPage(page.getPageNum(),page.getPageSize());
+            if(Constant.SYS_PARENT_ID == userVO.getParentId()){
+                moulds = mouldMapper.selectListByCondition(userVO);
+            }else if(Constant.SYS_ID == userVO.getParentId()){
+                moulds = mouldMapper.selectListByCondition(userVO);
             }else{
             }else{
                 //普通用户或者项目经理
                 //普通用户或者项目经理
                 //充当项目经理参与的项目
                 //充当项目经理参与的项目
-                List<Project> project = projectMapper.selectList(new QueryWrapper<Project>().eq("manager_id", userVO.getId()));
-//                if(){
-//
-//                }
+                if(userVO.getProjectId() != -1){
+                    set.add(userVO.getProjectId());
+                    moulds = mouldMapper.selectListByConditionByProject(userVO,set);
+                }else{
+                    QueryWrapper<Project> qw = new QueryWrapper<>();
+                    qw.eq("manager_id", userVO.getId());
+                    List<Project> projects = projectMapper.selectList(qw);
+                    if(projects.size()>0){
+                        for (Project project : projects) {
+                            set.add(project.getId());
+                        }
+                    }
 //                //充当普通人员参与的项目
 //                //充当普通人员参与的项目
-
+                    List<ProjectUser> projectUsers = projectUserMapper.selectList(new QueryWrapper<ProjectUser>().eq("user_id", userVO.getId()));
+                    if(projectUsers.size()>0){
+                        for (ProjectUser projectUser : projectUsers) {
+                            set.add(projectUser.getProjectId());
+                        }
+                    }
+                    moulds = mouldMapper.selectListByConditionByProject(userVO,set);
+                }
             }
             }
+            PageInfo<MouldVO> pageInfo = new PageInfo<>(moulds);
+            msg.data = pageInfo;
         }else{
         }else{
             msg.setError("用户不存在,或者未登录!");
             msg.setError("用户不存在,或者未登录!");
         }
         }

+ 8 - 0
cloud-model/src/main/resources/mapper/MouldEquipmentMapper.xml

@@ -43,5 +43,13 @@
           tb_company tbc
           tb_company tbc
         on
         on
           tbme.belong_company_id = tbc.id
           tbme.belong_company_id = tbc.id
+        where
+          tbme.belong_company_id = #{belongCompanyId}
+        and
+        tbme.id not in
+        <foreach item="item" index="index" collection="list"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
     </select>
     </select>
 </mapper>
 </mapper>

+ 52 - 5
cloud-model/src/main/resources/mapper/MouldMapper.xml

@@ -32,8 +32,6 @@
         <id column="id" property="id" />
         <id column="id" property="id" />
         <result column="model_no" property="modelNo" />
         <result column="model_no" property="modelNo" />
         <result column="model_name" property="modelName" />
         <result column="model_name" property="modelName" />
-        <result column="water_gap" property="waterGap" />
-        <result column="tonnage" property="tonnage" />
         <result column="oc_cycle" property="ocCycle" />
         <result column="oc_cycle" property="ocCycle" />
         <result column="daily_output" property="dailyOutput" />
         <result column="daily_output" property="dailyOutput" />
         <result column="company_id" property="companyId" />
         <result column="company_id" property="companyId" />
@@ -42,6 +40,7 @@
         <result column="is_delete" property="isDelete" />
         <result column="is_delete" property="isDelete" />
         <result column="creator_id" property="creatorId" />
         <result column="creator_id" property="creatorId" />
         <result column="project_id" property="projectId" />
         <result column="project_id" property="projectId" />
+        <result column="projectName" property="projectName" />
         <result column="rfid" property="rfid" />
         <result column="rfid" property="rfid" />
         <result column="setting_life" property="settingLife" />
         <result column="setting_life" property="settingLife" />
         <result column="area" property="area" />
         <result column="area" property="area" />
@@ -51,6 +50,10 @@
         <result column="equipment_id" property="equipmentId" />
         <result column="equipment_id" property="equipmentId" />
         <result column="belong_project_grade" property="belongProjectGrade" />
         <result column="belong_project_grade" property="belongProjectGrade" />
         <result column="produce_company_id" property="produceCompanyId" />
         <result column="produce_company_id" property="produceCompanyId" />
+        <result column="projectName" property="projectName" />
+        <result column="mangerName" property="mangerName" />
+        <result column="equipmentNo" property="equipmentNo" />
+        <result column="endTime" property="endTime" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
@@ -63,7 +66,10 @@
 
 
     <select id="selectListByCondition" resultMap="BaseResultMapVO">
     <select id="selectListByCondition" resultMap="BaseResultMapVO">
         select
         select
-          tbm.model_no model_no, tbm.model_name, tbmp.end_time,tbm.state,tbm.project_name,manger_name,factory_name,area,equipment_no
+        tbm.id id,tbm.model_no model_no, tbm.model_name,
+        tbmp.end_time endTime,tbm.state state,tbp.project_name projectName,
+        tbp.manager mangerName,tbm.factory_name factory_name,tbm.area area,
+        tbmp.equipment_no equipmentNo,tbm.setting_life setting_life
         from
         from
           tb_mould tbm
           tb_mould tbm
         left join
         left join
@@ -71,7 +77,48 @@
         on
         on
           tbm.equipment_id = tbmp.id
           tbm.equipment_id = tbmp.id
         left join
         left join
-
-
+         tb_project  tbp
+        on tbp.id = tbm.project_id
+        <where>
+            <if test="userVO.parentId != 0">
+                tbm.company_id = #{userVO.companyId}
+            </if>
+            <if test="userVO.serchType == 0">
+                AND tbp.model_no like concat('%',#{userVO.keyName},'%')
+            </if>
+            <if test="userVO.serchType == 1">
+                AND tbm.model_name like concat('%',#{userVO.keyName},'%')
+            </if>
+            <if test="userVO.projectId != -1">
+                AND tbm.project_id = #{userVO.projectId}
+            </if>
+        </where>
+    </select>
+    <select id="selectListByConditionByProject" resultMap="BaseResultMapVO">
+        select
+        tbm.id id,tbm.model_no model_no, tbm.model_name, tbmp.end_time endTime,tbm.state state,tbp.project_name projectName,
+        tbp.manager mangerName,tbm.factory_name factory_name,tbm.area area,tbmp.equipment_no equipmentNo,tbm.setting_life setting_life
+        from
+        tb_mould tbm
+        left join
+        tb_mould_equipment tbmp
+        on
+        tbm.equipment_id = tbmp.id
+        left join
+        tb_project  tbp
+        on tbp.id = tbm.project_id
+        <where>
+            <if test="userVO.serchType == 0">
+                AND tbp.model_no like concat('%',#{userVO.keyName},'%')
+            </if>
+            <if test="userVO.serchType == 1">
+                AND tbm.model_name like concat('%',#{userVO.keyName},'%')
+            </if>
+                AND tbm.project_id in
+            <foreach item="item" index="index" collection="list"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </where>
     </select>
     </select>
 </mapper>
 </mapper>

+ 31 - 9
ys_vue/src/views/base/allocation.vue

@@ -87,13 +87,14 @@
         :inline="true"
         :inline="true"
         class="demo-form-inline"
         class="demo-form-inline"
       >
       >
-        <el-form-item label="云模盒编号">
+        <el-form-item label="云模盒编号" prop="equipmentNo">
           <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
           <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="所属公司">
+        <el-form-item label="所属公司" prop="belongCompanyId">
           <el-select
           <el-select
             v-model="newAllocation.belongCompanyId"
             v-model="newAllocation.belongCompanyId"
             filterable
             filterable
+            clearable
             placeholder="请选择"
             placeholder="请选择"
             style="width: 202px"
             style="width: 202px"
           >
           >
@@ -105,7 +106,7 @@
             ></el-option>
             ></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="使用年限">
+        <el-form-item label="使用年限" prop="useLife">
           <el-input v-model="newAllocation.useLife" autocomplete="off" placeholder="请填写"></el-input>
           <el-input v-model="newAllocation.useLife" autocomplete="off" placeholder="请填写"></el-input>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
@@ -131,13 +132,14 @@
         :inline="true"
         :inline="true"
         class="demo-form-inline"
         class="demo-form-inline"
       >
       >
-        <el-form-item label="云模盒编号">
+        <el-form-item label="云模盒编号" prop="equipmentNo">
           <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
           <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="所属公司">
+        <el-form-item label="所属公司" prop="belongCompanyId">
           <el-select
           <el-select
             v-model="newAllocation.belongCompanyId"
             v-model="newAllocation.belongCompanyId"
             filterable
             filterable
+            clearable
             placeholder="请选择"
             placeholder="请选择"
             style="width: 202px"
             style="width: 202px"
           >
           >
@@ -149,10 +151,10 @@
             ></el-option>
             ></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="设备名称">
+        <el-form-item label="设备名称" prop="equipmentName">
           <el-input v-model="newAllocation.equipmentName" autocomplete="off" placeholder="请填写"></el-input>
           <el-input v-model="newAllocation.equipmentName" autocomplete="off" placeholder="请填写"></el-input>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="使用年限">
+        <el-form-item label="使用年限" prop="useLife">
           <el-input v-model="newAllocation.useLife" autocomplete="off" placeholder="请填写"></el-input>
           <el-input v-model="newAllocation.useLife" autocomplete="off" placeholder="请填写"></el-input>
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
@@ -173,7 +175,6 @@ export default {
       companies: {},
       companies: {},
       newAllocation: {
       newAllocation: {
         equipmentNo: "", //设备编号
         equipmentNo: "", //设备编号
-        // power: "",
         useLife: "", //使用年限
         useLife: "", //使用年限
         equipmentName: "", //设备名称
         equipmentName: "", //设备名称
         id: "", //设备id
         id: "", //设备id
@@ -183,7 +184,28 @@ export default {
         name: "",
         name: "",
         value: ""
         value: ""
       },
       },
-      formRules: {},
+      formRules: {
+        equipmentNo: [
+          { required: true, message: "请输入云模盒编号", trigger: "blur" }
+        ],
+        useLife: [
+          {
+            required: true,
+            message: "请输入使用年限",
+            trigger: "blur"
+          }
+        ],
+        equipmentName: [
+          { required: true, message: "请输入设备名称", trigger: "blur" }
+        ],
+        belongCompanyId: [
+          {
+            required: true,
+            message: "请选择所属公司",
+            trigger: ["blur", "change"]
+          }
+        ]
+      },
       listLoading: false,
       listLoading: false,
       addLoading: false,
       addLoading: false,
       editLoading: false,
       editLoading: false,

+ 0 - 6
ys_vue/src/views/detection/detection.vue

@@ -43,12 +43,6 @@
           <a style="color: #409EFF; cursor: pointer" @click="toMaintenance(scope.row.number)">不需要</a>
           <a style="color: #409EFF; cursor: pointer" @click="toMaintenance(scope.row.number)">不需要</a>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="模具更新" width="100" sortable>
-        <el-button size="small">请求</el-button>
-      </el-table-column>
-      <el-table-column label="模具报废" width="100" sortable>
-        <el-button size="small">请求</el-button>
-      </el-table-column>
     </el-table>
     </el-table>
 
 
     <!--工具条-->
     <!--工具条-->

+ 155 - 21
ys_vue/src/views/mold/moldDetail.vue

@@ -16,43 +16,60 @@
                 <el-form-item>
                 <el-form-item>
                     <span class="projectTitle">测试用模具001</span>
                     <span class="projectTitle">测试用模具001</span>
                 </el-form-item>
                 </el-form-item>
+                <el-form-item style="float: right;">
+                      当前状态:
+                      <a style="color: #409EFF; cursor: pointer" @click="toDetection">运行</a>
+                      <span class="tips">(点击查看运行状态)</span>
+                </el-form-item>
             </el-form>
             </el-form>
         </el-col>
         </el-col>
         <el-col :span="24" :style="allDetail">
         <el-col :span="24" :style="allDetail">
             <el-col :span="24" class="title">模具基本信息</el-col>
             <el-col :span="24" class="title">模具基本信息</el-col>
             <el-col :span="24" class="main">
             <el-col :span="24" class="main">
                 <el-col :span="6" class="detail">
                 <el-col :span="6" class="detail">
-                    模具信息编号:
+                    云模盒编号:
                     <span class="info">{{mould.typeNumber}}</span>
                     <span class="info">{{mould.typeNumber}}</span>
                 </el-col>
                 </el-col>
                 <el-col :span="6" class="detail">
                 <el-col :span="6" class="detail">
+                    模具编号:
+                    <span class="info">{{mould.typeNumber}}</span>
+                  </el-col>
+                  <el-col :span="12" class="detail">
                     模具名称:
                     模具名称:
                     <span class="info">{{mould.name}}</span>
                     <span class="info">{{mould.name}}</span>
-                </el-col>
-                <el-col :span="6" class="detail">
-                    模次寿命
+                  </el-col>
+                  <el-col :span="6" class="detail">
+                    设备电量
                     <span class="info">{{mould.lifetime}}</span>
                     <span class="info">{{mould.lifetime}}</span>
-                </el-col>
-                <el-col :span="6" class="detail">
+                  </el-col>
+                  <el-col :span="6" class="detail">
+                    倒计时:
+                    <span class="info">{{mould.lifetime}}</span>
+                  </el-col>
+                  <el-col :span="6" class="detail">
                     初始模次:
                     初始模次:
                     <span class="info">{{mould.initial}}</span>
                     <span class="info">{{mould.initial}}</span>
-                </el-col>
-                <el-col :span="6" class="detail">
+                  </el-col>
+                  <el-col :span="6" class="detail">
                     对应RFID码:
                     对应RFID码:
                     <span class="info">{{mould.RFIDcode}}</span>
                     <span class="info">{{mould.RFIDcode}}</span>
-                </el-col>
-                <el-col :span="6" class="detail">
-                    云模盒编号
+                  </el-col>
+                  <el-col :span="6" class="detail">
+                    穴数
                     <span class="info">{{mould.mouldNumber}}</span>
                     <span class="info">{{mould.mouldNumber}}</span>
-                </el-col>
-                <el-col :span="12" class="detail">
-                    所属项目
+                  </el-col>
+                  <el-col :span="6" class="detail">
+                    模次寿命
                     <span class="info">{{mould.project}}</span>
                     <span class="info">{{mould.project}}</span>
-                </el-col>
-                <el-col :span="12" class="detail">
-                    生产厂家
+                  </el-col>
+                  <el-col :span="12" class="detail">
+                    所属项目
                     <span class="info">{{mould.manufacturer}}</span>
                     <span class="info">{{mould.manufacturer}}</span>
-                </el-col>
+                  </el-col>
+                  <el-col :span="12" class="detail">
+                    制造方工厂:
+                    <span class="info">{{mould.manufacturer}}</span>
+                  </el-col>
             </el-col>
             </el-col>
 
 
             <el-col :span="24" class="title">文档资料</el-col>
             <el-col :span="24" class="title">文档资料</el-col>
@@ -85,6 +102,42 @@
                     <el-tab-pane label="模具报废" name="5">模具报废</el-tab-pane>
                     <el-tab-pane label="模具报废" name="5">模具报废</el-tab-pane>
                 </el-tabs>
                 </el-tabs>
             </el-col>
             </el-col>
+    <el-col :span="24" class="title">文档资料</el-col>
+    <el-col :span="24">
+      <el-tabs v-model="activePage" @tab-click="handleClick">
+        <el-tab-pane label="模具文档" name="0">
+          <el-table
+            :data="documents"
+            highlight-current-row
+            v-loading="listLoading"
+            style="width: 100%;"
+          >
+            <el-table-column type="index" width="40"></el-table-column>
+            <el-table-column prop="name" label="名称" sortable></el-table-column>
+            <el-table-column prop="size" label="大小" width="220" sortable></el-table-column>
+            <el-table-column prop="uploader" label="上传者" width="220" sortable></el-table-column>
+            <el-table-column prop="uploadTime" label="上传时间" width="220" sortable></el-table-column>
+            <el-table-column label="状态" width="220" sortable>
+              <template slot-scope="scope">
+                <span v-if="scope.row.state == 0">需要</span>
+                <span v-else>不需要</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="300" sortable>
+              <el-button size="small">审批</el-button>
+              <el-button size="small">浏览</el-button>
+              <el-button size="small">下载</el-button>
+              <el-button size="small" type="danger">删除</el-button>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="零件文档" name="1">零件文档</el-tab-pane>
+        <el-tab-pane label="试模及验收" name="2">试模及验收</el-tab-pane>
+        <el-tab-pane label="保养方案" name="3">保养方案</el-tab-pane>
+        <el-tab-pane label="模具更新" name="4">模具更新</el-tab-pane>
+        <el-tab-pane label="模具报废" name="5">模具报废</el-tab-pane>
+      </el-tabs>
+    </el-col>
 
 
             <el-col :span="24" class="title">操作记录</el-col>
             <el-col :span="24" class="title">操作记录</el-col>
             <el-table :data="operations" highlight-current-row v-loading="listLoading" style="width: 100%;height:300px;">
             <el-table :data="operations" highlight-current-row v-loading="listLoading" style="width: 100%;height:300px;">
@@ -154,10 +207,13 @@
         },
         },
         methods: {
         methods: {
             backToList() {
             backToList() {
-            this.$router.push("/moldList");
+                this.$router.push("/moldList");
+            },
+            toDetection(){
+              this.$router.push("/detection");
             },
             },
             handleClick(tab, event) {
             handleClick(tab, event) {
-            console.log(tab, event);
+                console.log(tab, event);
             }
             }
         },
         },
         created() {
         created() {
@@ -168,6 +224,63 @@
             var mouldId = this.$route.params.id; //传到当前页面的模具编号
             var mouldId = this.$route.params.id; //传到当前页面的模具编号
         }
         }
     };
     };
+import util from "../../common/js/util";
+export default {
+  data() {
+    return {
+      //临时数据
+      mould: {
+        typeNumber: "MUJU002",
+        name: "墨模具测试",
+        project: "墨盒项目",
+        client: "南京海市蜃楼有限公司",
+        manufacturer: "南京江宁制造局",
+        mouldNumber: "MOHE0023",
+        lifetime: "1年",
+        initial: "36",
+        RFIDcode: "RFID1234",
+        blueprint: true,
+        BOMtable: true,
+        partList: false,
+        standard: false
+      },
+      documents: [
+        {
+          name: "墨盒产品验证文档.word",
+          size: "100KB",
+          uploader: "张富贵",
+          uploadTime: "2019-07-24",
+          state: 0
+        }
+      ],
+      operations: [
+        {
+          name: "王多银",
+          document: "墨盒产品验证文档.word",
+          operation: 0,
+          time: "时间"
+        }
+      ],
+      listLoading: false,
+      activePage: 0
+    };
+  },
+  methods: {
+    backToList() {
+      this.$router.push("/moldList");
+    },
+    toDetection(){
+      this.$router.push("/detection");
+    },
+    handleClick(tab, event) {
+      console.log(tab, event);
+    }
+  },
+  created() {},
+  mounted() {
+    var mouldId = this.$route.params.id; //传到当前页面的模具编号
+  }
+};
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
@@ -177,7 +290,7 @@
     }
     }
 
 
     .back {
     .back {
-       font-size:16px; 
+       font-size:16px;
     }
     }
 
 
     .divLine {
     .divLine {
@@ -211,4 +324,25 @@
     .detail {
     .detail {
         margin-bottom: 20px;
         margin-bottom: 20px;
     }
     }
+.title {
+  padding-left: 10px;
+  padding-bottom: 0px;
+  margin: 20px 0;
+  font-size: 16px;
+  line-height: 16px;
+  border-left: 1px blue solid;
+}
+.info {
+  color: grey;
+}
+.main {
+  padding-left: 10px;
+}
+.detail {
+  margin-bottom: 20px;
+}
+.tips {
+  font-size: 10px;
+  color: grey;
+}
 </style>
 </style>