2.8注塑机看板

dev
tengxi 2 years ago
parent 37de12cd4a
commit 1acbf88004

@ -0,0 +1,310 @@
package org.jeecg.modules.demo.ttinjectequip.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.ttinjectequip.entity.TtInjectEquip;
import org.jeecg.modules.demo.ttinjectequip.service.ITtInjectEquipService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import static java.math.BigDecimal.valueOf;
/**
* @Description: tt_inject_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Api(tags="tt_inject_equip")
@RestController
@RequestMapping("/ttinjectequip/ttInjectEquip")
@Slf4j
public class TtInjectEquipController extends JeecgController<TtInjectEquip, ITtInjectEquipService> {
@Autowired
private ITtInjectEquipService ttInjectEquipService;
@Autowired
private RedisUtil redisUtil;
/**
*
*
* @param ttInjectEquip
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_inject_equip-分页列表查询")
@ApiOperation(value="tt_inject_equip-分页列表查询", notes="tt_inject_equip-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtInjectEquip>> queryPageList(TtInjectEquip ttInjectEquip,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtInjectEquip> queryWrapper = QueryGenerator.initQueryWrapper(ttInjectEquip, req.getParameterMap());
Page<TtInjectEquip> page = new Page<TtInjectEquip>(pageNo, pageSize);
IPage<TtInjectEquip> pageList = ttInjectEquipService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttInjectEquip
* @return
*/
//@AutoLog(value = "tt_inject_equip-2.8注塑机看板列表查询")
@ApiOperation(value="tt_inject_equip-2.8注塑机看板列表查询", notes="tt_inject_equip-2.8注塑机看板列表查询")
@GetMapping(value = "/queryList")
public Result<List<TtInjectEquip>> queryList(TtInjectEquip ttInjectEquip) throws ParseException {
//select * from tt_inject_data
//order by equip_no,day_name
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = new Date();
String nowDateString = sdf.format(date);//2023-02-08 11:23 2023-02-08 08:50
List<TtInjectEquip> injectDataList = new ArrayList<>();
for(int i = 1; i<21;i++){
Random generator = new Random(); //温度随机数
int randomIndex1 = generator.nextInt( 3 ) - 1;//随机数-1到1
int randomIndex2 = generator.nextInt( 3 ) - 1;//随机数-1到1
int randomIndex3 = generator.nextInt( 3 ) - 1;//随机数-1到1
int randomIndex4 = generator.nextInt( 3 ) - 1;//随机数-1到1
int randomIndex5 = 0;
int currentpressure=generator.nextInt(3)-1;
int passrate = generator.nextInt(7)-3;
int currenttemp=generator.nextInt(4)-2;
int clyle=generator.nextInt(11)-10;
TtInjectEquip injectEquip = new TtInjectEquip();
injectEquip.setEqtNo("注塑机" + i); //注塑机编号
Object object = redisUtil.get(injectEquip.getEqtNo());
if (object != null) {
randomIndex5 = Integer.parseInt(String.valueOf(object));
}else{
randomIndex5 = generator.nextInt( 60 );//随机数0到59 45
redisUtil.set(injectEquip.getEqtNo(), randomIndex5);
}
String openTimeParam = String.valueOf(randomIndex5);
if(randomIndex5 < 10){
openTimeParam = "0" + String.valueOf(randomIndex5);
}
injectEquip.setDayName(date);
injectEquip.setDynamicMoldActTemp(String.valueOf(135 + randomIndex1)); //动模温度
injectEquip.setDynamicMoldCfgTemp(String.valueOf(135 + randomIndex2));
injectEquip.setFixedMoldActTemp(String.valueOf(135 + randomIndex3)); //定模温度
injectEquip.setFixedMoldCfgTemp(String.valueOf(135 + randomIndex4));
injectEquip.setCurrentPressure(valueOf(72+currentpressure));
injectEquip.setPassRate(valueOf(98 + passrate));
injectEquip.setCurrentTemp(valueOf(125+currenttemp));
if(i == 6 || i == 8){ //注塑机定义四种状态
injectEquip.setEquipStatus(2);
injectEquip.setOpenTime(0);
injectEquip.setTodayProgress(0);
injectEquip.setTodayQty(0);
injectEquip.setCurrentPressure(valueOf(0));
injectEquip.setCurrentTemp(valueOf(0));
injectEquip.setPassRate(valueOf(0));
injectEquip.setCycleTime(0);
injectEquip.setOutputQty(0);
}else if(i == 11 || i == 12){
injectEquip.setEquipStatus(3);
injectEquip.setOpenTime(0);
injectEquip.setTodayProgress(0);
injectEquip.setTodayQty(0);
injectEquip.setCurrentPressure(valueOf(0));
injectEquip.setCurrentTemp(valueOf(0));
injectEquip.setPassRate(valueOf(0));
injectEquip.setCycleTime(0);
injectEquip.setOutputQty(0);
}else if(i == 19){
injectEquip.setEquipStatus(4);
injectEquip.setOpenTime(0);
injectEquip.setTodayProgress(0);
injectEquip.setTodayQty(0);
injectEquip.setCurrentPressure(valueOf(0));
injectEquip.setCurrentTemp(valueOf(0));
injectEquip.setPassRate(valueOf(0));
injectEquip.setCycleTime(0);
injectEquip.setOutputQty(0);
}else{
injectEquip.setEquipStatus(1);
String openDate = nowDateString.substring(0, 10) + " 08:" + openTimeParam;//开机时间8点到9点之间2023-02-08 08:45
long time = date.getTime();
long time2 = sdf.parse(openDate).getTime();
int Minutes = (int)(time - time2) / (1000 * 60 );
int cycletime = (int)(time - time2) / (1000-clyle ); //生产节拍
if(Minutes < 0){//未到开机时间
injectEquip.setOpenTime(0);//开机时长分钟
injectEquip.setEquipStatus(4);
injectEquip.setTodayProgress(0);
injectEquip.setTodayQty(0);
injectEquip.setCurrentPressure(valueOf(0));
injectEquip.setCurrentTemp(valueOf(0));
injectEquip.setPassRate(valueOf(0));
injectEquip.setCycleTime(0);
injectEquip.setOutputQty(0);
}else{
injectEquip.setOpenTime(Minutes);//开机时长分钟
injectEquip.setCycleTime(cycletime);
injectEquip.setTodayQty((int)Math.round(Minutes * 2.5));//现在产量每分钟3个
injectEquip.setOutputQty((int)Math.round(Minutes * 2.5));
injectEquip.setTodayProgress(injectEquip.getTodayQty()/12);
if(injectEquip.getTodayProgress() >= 100){//生产完成关机
injectEquip.setEquipStatus(4);
injectEquip.setOpenTime(480);
injectEquip.setTodayProgress(100);
injectEquip.setTodayQty(1200);
}
}
}
injectDataList.add(injectEquip);
}
return Result.OK(injectDataList);
}
/**
*
*
* @param ttInjectEquip
* @return
*/
@AutoLog(value = "tt_inject_equip-添加")
@ApiOperation(value="tt_inject_equip-添加", notes="tt_inject_equip-添加")
//@RequiresPermissions("ttinjectequip:tt_inject_equip:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtInjectEquip ttInjectEquip) {
ttInjectEquipService.save(ttInjectEquip);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttInjectEquip
* @return
*/
@AutoLog(value = "tt_inject_equip-编辑")
@ApiOperation(value="tt_inject_equip-编辑", notes="tt_inject_equip-编辑")
//@RequiresPermissions("ttinjectequip:tt_inject_equip:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtInjectEquip ttInjectEquip) {
ttInjectEquipService.updateById(ttInjectEquip);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_inject_equip-通过id删除")
@ApiOperation(value="tt_inject_equip-通过id删除", notes="tt_inject_equip-通过id删除")
//@RequiresPermissions("ttinjectequip:tt_inject_equip:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttInjectEquipService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_inject_equip-批量删除")
@ApiOperation(value="tt_inject_equip-批量删除", notes="tt_inject_equip-批量删除")
//@RequiresPermissions("ttinjectequip:tt_inject_equip:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttInjectEquipService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_inject_equip-通过id查询")
@ApiOperation(value="tt_inject_equip-通过id查询", notes="tt_inject_equip-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtInjectEquip> queryById(@RequestParam(name="id",required=true) String id) {
TtInjectEquip ttInjectEquip = ttInjectEquipService.getById(id);
if(ttInjectEquip==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttInjectEquip);
}
/**
* excel
*
* @param request
* @param ttInjectEquip
*/
//@RequiresPermissions("ttinjectequip:tt_inject_equip:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtInjectEquip ttInjectEquip) {
return super.exportXls(request, ttInjectEquip, TtInjectEquip.class, "tt_inject_equip");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttinjectequip:tt_inject_equip:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtInjectEquip.class);
}
}

@ -0,0 +1,106 @@
package org.jeecg.modules.demo.ttinjectequip.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tt_inject_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Data
@TableName("tt_inject_equip")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_inject_equip对象", description="tt_inject_equip")
public class TtInjectEquip implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Integer id;
/**日期*/
@Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "日期")
private java.util.Date dayName;
/**机台*/
@Excel(name = "机台", width = 15)
@ApiModelProperty(value = "机台")
private java.lang.String eqtNo;
/**定模设定值*/
@Excel(name = "定模设定值", width = 15)
@ApiModelProperty(value = "定模设定值")
private java.lang.String fixedMoldCfgTemp;
/**定模温度*/
@Excel(name = "定模温度", width = 15)
@ApiModelProperty(value = "定模温度")
private java.lang.String fixedMoldActTemp;
/**动模设定值*/
@Excel(name = "动模设定值", width = 15)
@ApiModelProperty(value = "动模设定值")
private java.lang.String dynamicMoldCfgTemp;
/**动模温度*/
@Excel(name = "动模温度", width = 15)
@ApiModelProperty(value = "动模温度")
private java.lang.String dynamicMoldActTemp;
/**注塑机当前状态1运行 2待机 3故障 4关机*/
@Excel(name = "注塑机当前状态1运行 2待机 3故障 4关机", width = 15)
@ApiModelProperty(value = "注塑机当前状态1运行 2待机 3故障 4关机")
private java.lang.Integer equipStatus;
/**今日产量*/
@Excel(name = "今日产量", width = 15)
@ApiModelProperty(value = "今日产量")
private java.lang.Integer todayQty;
/**生产进度,看板显示的时候,前端页面需要加 %*/
@Excel(name = "生产进度,看板显示的时候,前端页面需要加 %", width = 15)
@ApiModelProperty(value = "生产进度,看板显示的时候,前端页面需要加 %")
private java.lang.Integer todayProgress;
/**开机时间*/
@Excel(name = "开机时间", width = 15)
@ApiModelProperty(value = "开机时间")
private java.lang.Integer openTime;
/**生产节拍(单位:秒)*/
@Excel(name = "生产节拍(单位:秒)", width = 15)
@ApiModelProperty(value = "生产节拍(单位:秒)")
private java.lang.Integer cycleTime;
/**温度*/
@Excel(name = "温度", width = 15)
@ApiModelProperty(value = "温度")
private java.math.BigDecimal currentTemp;
/**压力单位Mpa*/
@Excel(name = "压力单位Mpa", width = 15)
@ApiModelProperty(value = "压力单位Mpa")
private java.math.BigDecimal currentPressure;
/**合格率(单位:百分比)*/
@Excel(name = "合格率(单位:百分比)", width = 15)
@ApiModelProperty(value = "合格率(单位:百分比)")
private java.math.BigDecimal passRate;
/**产出数量*/
@Excel(name = "产出数量", width = 15)
@ApiModelProperty(value = "产出数量")
private java.lang.Integer outputQty;
/**记录创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录创建时间")
private java.util.Date createTime;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.ttinjectequip.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.ttinjectequip.entity.TtInjectEquip;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tt_inject_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
public interface TtInjectEquipMapper extends BaseMapper<TtInjectEquip> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.ttinjectequip.mapper.TtInjectEquipMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.ttinjectequip.service;
import org.jeecg.modules.demo.ttinjectequip.entity.TtInjectEquip;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tt_inject_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
public interface ITtInjectEquipService extends IService<TtInjectEquip> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttinjectequip.service.impl;
import org.jeecg.modules.demo.ttinjectequip.entity.TtInjectEquip;
import org.jeecg.modules.demo.ttinjectequip.mapper.TtInjectEquipMapper;
import org.jeecg.modules.demo.ttinjectequip.service.ITtInjectEquipService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_inject_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Service
public class TtInjectEquipServiceImpl extends ServiceImpl<TtInjectEquipMapper, TtInjectEquip> implements ITtInjectEquipService {
}

@ -0,0 +1,258 @@
<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- -END -->
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tt_inject_equip')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<!-- -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/></a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected"></a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;"></span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"></a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)"></a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tt-inject-equip-modal ref="modalForm" @ok="modalFormOk"></tt-inject-equip-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtInjectEquipModal from './modules/TtInjectEquipModal'
export default {
name: 'TtInjectEquipList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtInjectEquipModal
},
data () {
return {
description: 'tt_inject_equip',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'',
align:"center",
dataIndex: 'dayName',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'',
align:"center",
dataIndex: 'eqtNo'
},
{
title:'',
align:"center",
dataIndex: 'fixedMoldCfgTemp'
},
{
title:'',
align:"center",
dataIndex: 'fixedMoldActTemp'
},
{
title:'',
align:"center",
dataIndex: 'dynamicMoldCfgTemp'
},
{
title:'',
align:"center",
dataIndex: 'dynamicMoldActTemp'
},
{
title:'1 2 3 4',
align:"center",
dataIndex: 'equipStatus'
},
{
title:'',
align:"center",
dataIndex: 'todayQty'
},
{
title:' %',
align:"center",
dataIndex: 'todayProgress'
},
{
title:'',
align:"center",
dataIndex: 'openTime'
},
{
title:'',
align:"center",
dataIndex: 'cycleTime'
},
{
title:'',
align:"center",
dataIndex: 'currentTemp'
},
{
title:'Mpa',
align:"center",
dataIndex: 'currentPressure'
},
{
title:'',
align:"center",
dataIndex: 'passRate'
},
{
title:'',
align:"center",
dataIndex: 'outputQty'
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttinjectequip/ttInjectEquip/list",
delete: "/ttinjectequip/ttInjectEquip/delete",
deleteBatch: "/ttinjectequip/ttInjectEquip/deleteBatch",
exportXlsUrl: "/ttinjectequip/ttInjectEquip/exportXls",
importExcelUrl: "ttinjectequip/ttInjectEquip/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'date',value:'dayName',text:''})
fieldList.push({type:'string',value:'eqtNo',text:''})
fieldList.push({type:'string',value:'fixedMoldCfgTemp',text:''})
fieldList.push({type:'string',value:'fixedMoldActTemp',text:''})
fieldList.push({type:'string',value:'dynamicMoldCfgTemp',text:''})
fieldList.push({type:'string',value:'dynamicMoldActTemp',text:''})
fieldList.push({type:'int',value:'equipStatus',text:'1 2 3 4'})
fieldList.push({type:'int',value:'todayQty',text:''})
fieldList.push({type:'int',value:'todayProgress',text:' %'})
fieldList.push({type:'int',value:'openTime',text:''})
fieldList.push({type:'int',value:'cycleTime',text:''})
fieldList.push({type:'number',value:'currentTemp',text:''})
fieldList.push({type:'number',value:'currentPressure',text:'Mpa'})
fieldList.push({type:'number',value:'passRate',text:''})
fieldList.push({type:'int',value:'outputQty',text:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttinjectequip
-- sqlcomponent
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2023021408159520070', NULL, 'tt_inject_equip', '/ttinjectequip/ttInjectEquipList', 'ttinjectequip/TtInjectEquipList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0);
-- sql
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520071', '2023021408159520070', 'tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520072', '2023021408159520070', 'tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520073', '2023021408159520070', 'tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);
--
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520074', '2023021408159520070', 'tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520075', '2023021408159520070', 'excel_tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);
-- excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2023021408159520076', '2023021408159520070', 'excel_tt_inject_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttinjectequip:tt_inject_equip:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:15:07', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,174 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayName">
<j-date placeholder="请选择日期" v-model="model.dayName" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="机台" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eqtNo">
<a-input v-model="model.eqtNo" placeholder="请输入机台" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="定模设定值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fixedMoldCfgTemp">
<a-input v-model="model.fixedMoldCfgTemp" placeholder="请输入定模设定值" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="定模温度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fixedMoldActTemp">
<a-input v-model="model.fixedMoldActTemp" placeholder="请输入定模温度" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="动模设定值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dynamicMoldCfgTemp">
<a-input v-model="model.dynamicMoldCfgTemp" placeholder="请输入动模设定值" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="动模温度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dynamicMoldActTemp">
<a-input v-model="model.dynamicMoldActTemp" placeholder="请输入动模温度" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="注塑机当前状态1运行 2待机 3故障 4关机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipStatus">
<a-input-number v-model="model.equipStatus" placeholder="请输入注塑机当前状态1运行 2待机 3故障 4关机" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="今日产量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="todayQty">
<a-input-number v-model="model.todayQty" placeholder="请输入今日产量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产进度,看板显示的时候,前端页面需要加 %" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="todayProgress">
<a-input-number v-model="model.todayProgress" placeholder="请输入生产进度,看板显示的时候,前端页面需要加 %" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="开机时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openTime">
<a-input-number v-model="model.openTime" placeholder="请输入开机时间" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产节拍(单位:秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cycleTime">
<a-input-number v-model="model.cycleTime" placeholder="请输入生产节拍(单位:秒)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="温度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentTemp">
<a-input-number v-model="model.currentTemp" placeholder="请输入温度" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="压力单位Mpa" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentPressure">
<a-input-number v-model="model.currentPressure" placeholder="请输入压力单位Mpa" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="合格率(单位:百分比)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="passRate">
<a-input-number v-model="model.passRate" placeholder="请输入合格率(单位:百分比)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产出数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outputQty">
<a-input-number v-model="model.outputQty" placeholder="请输入产出数量" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TtInjectEquipForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/ttinjectequip/ttInjectEquip/add",
edit: "/ttinjectequip/ttInjectEquip/edit",
queryById: "/ttinjectequip/ttInjectEquip/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tt-inject-equip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-inject-equip-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;"></a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;"></a-button>
</div>
</a-drawer>
</template>
<script>
import TtInjectEquipForm from './TtInjectEquipForm'
export default {
name: 'TtInjectEquipModal',
components: {
TtInjectEquipForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tt-inject-equip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-inject-equip-form>
</j-modal>
</template>
<script>
import TtInjectEquipForm from './TtInjectEquipForm'
export default {
name: 'TtInjectEquipModal',
components: {
TtInjectEquipForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save