杨世强 2 years ago
parent 1acbf88004
commit c5203e407c

@ -0,0 +1,277 @@
package org.jeecg.modules.demo.ttsulfequip.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 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.jeecg.modules.demo.ttsulfequip.entity.TtSulfEquip;
import org.jeecg.modules.demo.ttsulfequip.service.ITtSulfEquipService;
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;
/**
* @Description: tt_sulf_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Api(tags="tt_sulf_equip")
@RestController
@RequestMapping("/ttsulfequip/ttSulfEquip")
@Slf4j
public class TtSulfEquipController extends JeecgController<TtSulfEquip, ITtSulfEquipService> {
@Autowired
private ITtSulfEquipService ttSulfEquipService;
@Autowired
private RedisUtil redisUtil;
/**
*
*
* @param ttSulfEquip
* @return
*/
//@AutoLog(value = "tt_inject_data-硫化机看板列表查询")
@ApiOperation(value="tt_inject_data-硫化机看板列表查询", notes="tt_inject_data-硫化机看板列表查询")
@GetMapping(value = "/queryList")
public Result<List<TtSulfEquip>> queryList(TtSulfEquip ttSulfEquip) 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<TtSulfEquip> sulfEquipList = new ArrayList<>();
for(int i = 1; i<15;i++){
Random generator = new Random();
int randomIndex1 = generator.nextInt( 7 ) - 3;//随机数-1到1
int randomIndex2 = generator.nextInt( 5 ) - 2;//随机数-1到1
int randomIndex3 = generator.nextInt( 5 ) - 2;//随机数-1到1
int randomIndex4 = generator.nextInt( 5 ) - 2;//随机数-1到1
int randomIndex5 = 0;
// int randomIndex6 = generator.nextInt(201) + 300;
int[] arr = {360,420,480};
int randomIndex6 = arr[(int) (Math.random() * 3)];
TtSulfEquip sulfEquip = new TtSulfEquip();
sulfEquip.setEqtNo("硫化机" + i);
Object object = redisUtil.get(sulfEquip.getEqtNo());
if (object != null) {
randomIndex5 = Integer.parseInt(String.valueOf(object));
}else{
randomIndex5 = generator.nextInt( 60 );//随机数0到59 45
redisUtil.set(sulfEquip.getEqtNo(), randomIndex5);
}
String openTimeParam = String.valueOf(randomIndex5);
if(randomIndex5 < 10){
openTimeParam = "0" + String.valueOf(randomIndex5);
}
sulfEquip.setSulfPressure(72 + randomIndex1);
sulfEquip.setSulfTempUpper(126 + randomIndex2);
sulfEquip.setSulfTempMiddle(126 + randomIndex3);
sulfEquip.setSulfTempLower(126 + randomIndex4);
sulfEquip.setSulfTime(randomIndex6);
// if(i == 5 || i == 8){
// sulfEquip.setEquipStatus(2);
// sulfEquip.setOpenTime(0);
// sulfEquip.setTodayProgress(0);
// sulfEquip.setTodayQty(0);
// }else if(i == 11 || i == 15){
// sulfEquip.setEquipStatus(3);
// sulfEquip.setOpenTime(0);
// sulfEquip.setTodayProgress(0);
// sulfEquip.setTodayQty(0);
// }else if(i == 22){
// sulfEquip.setEquipStatus(4);
// sulfEquip.setOpenTime(0);
// sulfEquip.setTodayProgress(0);
// sulfEquip.setTodayQty(0);
// }
// else{
// sulfEquip.setEquipStatus(1);
String openDate = nowDateString.substring(0, 10) + " 08:" + openTimeParam;//开机时间8点到9点之间2023-02-08 08:45
// sulfEquip.setOpenDate(date);
String openTime = "08:"+openTimeParam;
// sulfEquip.setOpenTime(openTime);
long time = sdf.parse(nowDateString).getTime();
long time2 = sdf.parse(openDate).getTime();
int Second = (int)(time - time2) / (1000);
// if(Second < 0){//未到开机时间
// sulfEquip.setSulfTime(0);//硫化时长秒
//// sulfEquip.setOpenTime("0");
//// sulfEquip.setEquipStatus(4);
//// sulfEquip.setTodayProgress(0);
//// sulfEquip.setTodayQty(0);
// }else{
// sulfEquip.setSulfTime(Second);//硫化时长秒
//// sulfEquip.setTodayQty((int)Math.round(Minutes * 2.5));//现在产量每分钟3个
//// sulfEquip.setTodayProgress(sulfEquip.getTodayQty()/12);
// if(sulfEquip.getSulfTime() >= 28800){//生产完成关机
// sulfEquip.setSulfTime(28800);
//// sulfEquip.setEquipStatus(4);
//// sulfEquip.setOpenTime(480);
//// sulfEquip.setTodayProgress(100);
//// sulfEquip.setTodayQty(1200);
// }
// }
// }
sulfEquipList.add(sulfEquip);
}
return Result.OK(sulfEquipList);
}
/**
*
*
* @param ttSulfEquip
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tt_sulf_equip-分页列表查询")
@ApiOperation(value="tt_sulf_equip-分页列表查询", notes="tt_sulf_equip-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TtSulfEquip>> queryPageList(TtSulfEquip ttSulfEquip,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TtSulfEquip> queryWrapper = QueryGenerator.initQueryWrapper(ttSulfEquip, req.getParameterMap());
Page<TtSulfEquip> page = new Page<TtSulfEquip>(pageNo, pageSize);
IPage<TtSulfEquip> pageList = ttSulfEquipService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
*
*
* @param ttSulfEquip
* @return
*/
@AutoLog(value = "tt_sulf_equip-添加")
@ApiOperation(value="tt_sulf_equip-添加", notes="tt_sulf_equip-添加")
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TtSulfEquip ttSulfEquip) {
ttSulfEquipService.save(ttSulfEquip);
return Result.OK("添加成功!");
}
/**
*
*
* @param ttSulfEquip
* @return
*/
@AutoLog(value = "tt_sulf_equip-编辑")
@ApiOperation(value="tt_sulf_equip-编辑", notes="tt_sulf_equip-编辑")
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TtSulfEquip ttSulfEquip) {
ttSulfEquipService.updateById(ttSulfEquip);
return Result.OK("编辑成功!");
}
/**
* id
*
* @param id
* @return
*/
@AutoLog(value = "tt_sulf_equip-通过id删除")
@ApiOperation(value="tt_sulf_equip-通过id删除", notes="tt_sulf_equip-通过id删除")
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
ttSulfEquipService.removeById(id);
return Result.OK("删除成功!");
}
/**
*
*
* @param ids
* @return
*/
@AutoLog(value = "tt_sulf_equip-批量删除")
@ApiOperation(value="tt_sulf_equip-批量删除", notes="tt_sulf_equip-批量删除")
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ttSulfEquipService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* id
*
* @param id
* @return
*/
//@AutoLog(value = "tt_sulf_equip-通过id查询")
@ApiOperation(value="tt_sulf_equip-通过id查询", notes="tt_sulf_equip-通过id查询")
@GetMapping(value = "/queryById")
public Result<TtSulfEquip> queryById(@RequestParam(name="id",required=true) String id) {
TtSulfEquip ttSulfEquip = ttSulfEquipService.getById(id);
if(ttSulfEquip==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ttSulfEquip);
}
/**
* excel
*
* @param request
* @param ttSulfEquip
*/
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TtSulfEquip ttSulfEquip) {
return super.exportXls(request, ttSulfEquip, TtSulfEquip.class, "tt_sulf_equip");
}
/**
* excel
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("ttsulfequip:tt_sulf_equip:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TtSulfEquip.class);
}
}

@ -0,0 +1,101 @@
package org.jeecg.modules.demo.ttsulfequip.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_sulf_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Data
@TableName("tt_sulf_equip")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tt_sulf_equip对象", description="tt_sulf_equip")
public class TtSulfEquip implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private 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 Date openDate;
/**开模时间,类似: 13:15*/
@Excel(name = "开模时间,类似: 13:15", width = 15)
@ApiModelProperty(value = "开模时间,类似: 13:15")
private String openTime;
/**产品批号*/
@Excel(name = "产品批号", width = 15)
@ApiModelProperty(value = "产品批号")
private String lotNo;
/**胶料牌号*/
@Excel(name = "胶料牌号", width = 15)
@ApiModelProperty(value = "胶料牌号")
private String rubberNo;
/**模具编号*/
@Excel(name = "模具编号", width = 15)
@ApiModelProperty(value = "模具编号")
private String moldNo;
/**硫化压力bar单位Mpa*/
@Excel(name = "硫化压力bar单位Mpa", width = 15)
@ApiModelProperty(value = "硫化压力bar单位Mpa")
private Integer sulfPressure;
/**硫化时间s单位*/
@Excel(name = "硫化时间s单位", width = 15)
@ApiModelProperty(value = "硫化时间s单位")
private Integer sulfTime;
/**硫化温度(上模)*/
@Excel(name = "硫化温度(上模)", width = 15)
@ApiModelProperty(value = "硫化温度(上模)")
private Integer sulfTempUpper;
/**硫化温度(中模)*/
@Excel(name = "硫化温度(中模)", width = 15)
@ApiModelProperty(value = "硫化温度(中模)")
private Integer sulfTempMiddle;
/**硫化温度(下模)*/
@Excel(name = "硫化温度(下模)", width = 15)
@ApiModelProperty(value = "硫化温度(下模)")
private Integer sulfTempLower;
/**记录的创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的创建时间")
private Date createTime;
/**记录的创建人默认admin*/
@ApiModelProperty(value = "记录的创建人默认admin")
private String createBy;
/**记录的修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "记录的修改时间")
private Date updateTime;
/**记录的修改人,修改人员的登录账号*/
@ApiModelProperty(value = "记录的修改人,修改人员的登录账号")
private String updateBy;
/**设备编号类似31,32,33...*/
@Excel(name = "设备编号类似31,32,33...", width = 15)
@ApiModelProperty(value = "设备编号类似31,32,33...")
private String eqtNo;
}

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

@ -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.ttsulfequip.mapper.TtSulfEquipMapper">
</mapper>

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

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.ttsulfequip.service.impl;
import org.jeecg.modules.demo.ttsulfequip.entity.TtSulfEquip;
import org.jeecg.modules.demo.ttsulfequip.mapper.TtSulfEquipMapper;
import org.jeecg.modules.demo.ttsulfequip.service.ITtSulfEquipService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tt_sulf_equip
* @Author: jeecg-boot
* @Date: 2023-02-14
* @Version: V1.0
*/
@Service
public class TtSulfEquipServiceImpl extends ServiceImpl<TtSulfEquipMapper, TtSulfEquip> implements ITtSulfEquipService {
}

@ -0,0 +1,234 @@
<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_sulf_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-sulf-equip-modal ref="modalForm" @ok="modalFormOk"></tt-sulf-equip-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TtSulfEquipModal from './modules/TtSulfEquipModal'
export default {
name: 'TtSulfEquipList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TtSulfEquipModal
},
data () {
return {
description: 'tt_sulf_equip',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'',
align:"center",
dataIndex: 'openDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:': 13:15',
align:"center",
dataIndex: 'openTime'
},
{
title:'',
align:"center",
dataIndex: 'lotNo'
},
{
title:'',
align:"center",
dataIndex: 'rubberNo'
},
{
title:'',
align:"center",
dataIndex: 'moldNo'
},
{
title:'barMpa',
align:"center",
dataIndex: 'sulfPressure'
},
{
title:'s',
align:"center",
dataIndex: 'sulfTime'
},
{
title:'',
align:"center",
dataIndex: 'sulfTempUpper'
},
{
title:'',
align:"center",
dataIndex: 'sulfTempMiddle'
},
{
title:'',
align:"center",
dataIndex: 'sulfTempLower'
},
{
title:'31,32,33...',
align:"center",
dataIndex: 'eqtNo'
},
{
title: '',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/ttsulfequip/ttSulfEquip/list",
delete: "/ttsulfequip/ttSulfEquip/delete",
deleteBatch: "/ttsulfequip/ttSulfEquip/deleteBatch",
exportXlsUrl: "/ttsulfequip/ttSulfEquip/exportXls",
importExcelUrl: "ttsulfequip/ttSulfEquip/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:'openDate',text:''})
fieldList.push({type:'string',value:'openTime',text:': 13:15'})
fieldList.push({type:'string',value:'lotNo',text:''})
fieldList.push({type:'string',value:'rubberNo',text:''})
fieldList.push({type:'string',value:'moldNo',text:''})
fieldList.push({type:'int',value:'sulfPressure',text:'barMpa'})
fieldList.push({type:'int',value:'sulfTime',text:'s'})
fieldList.push({type:'int',value:'sulfTempUpper',text:''})
fieldList.push({type:'int',value:'sulfTempMiddle',text:''})
fieldList.push({type:'int',value:'sulfTempLower',text:''})
fieldList.push({type:'string',value:'eqtNo',text:'31,32,33...'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,26 @@
-- views/ttsulfequip
-- 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 ('2023021408258300530', NULL, 'tt_sulf_equip', '/ttsulfequip/ttSulfEquipList', 'ttsulfequip/TtSulfEquipList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258300531', '2023021408258300530', 'tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258300532', '2023021408258300530', 'tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258300533', '2023021408258300530', 'tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258310534', '2023021408258300530', 'tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258310535', '2023021408258300530', 'excel_tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', 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 ('2023021408258310536', '2023021408258300530', 'excel_tt_sulf_equip', NULL, NULL, 0, NULL, NULL, 2, 'ttsulfequip:tt_sulf_equip:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-02-14 08:25:53', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,187 @@
<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="openDate">
<j-date placeholder="请选择开模日期" v-model="model.openDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="开模时间,类似: 13:15" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openTime">
<a-input v-model="model.openTime" placeholder="请输入开模时间,类似: 13:15" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="产品批号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lotNo">
<a-input v-model="model.lotNo" placeholder="请输入产品批号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="胶料牌号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rubberNo">
<a-input v-model="model.rubberNo" placeholder="请输入胶料牌号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模具编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moldNo">
<a-input v-model="model.moldNo" placeholder="请输入模具编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="硫化压力bar单位Mpa" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sulfPressure">
<a-input-number v-model="model.sulfPressure" placeholder="请输入硫化压力bar单位Mpa" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="硫化时间s单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sulfTime">
<a-input-number v-model="model.sulfTime" placeholder="请输入硫化时间s单位" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="硫化温度(上模)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sulfTempUpper">
<a-input-number v-model="model.sulfTempUpper" placeholder="请输入硫化温度(上模)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="硫化温度(中模)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sulfTempMiddle">
<a-input-number v-model="model.sulfTempMiddle" placeholder="请输入硫化温度(中模)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="硫化温度(下模)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sulfTempLower">
<a-input-number v-model="model.sulfTempLower" placeholder="请输入硫化温度(下模)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="设备编号类似31,32,33..." :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eqtNo">
<a-input v-model="model.eqtNo" placeholder="请输入设备编号类似31,32,33..." ></a-input>
</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: 'TtSulfEquipForm',
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: {
openDate: [
{ required: true, message: '!'},
],
openTime: [
{ required: true, message: ': 13:15!'},
],
lotNo: [
{ required: true, message: '!'},
],
rubberNo: [
{ required: true, message: '!'},
],
moldNo: [
{ required: true, message: '!'},
],
sulfPressure: [
{ required: true, message: 'barMpa!'},
],
sulfTime: [
{ required: true, message: 's!'},
],
sulfTempUpper: [
{ required: true, message: '!'},
],
sulfTempMiddle: [
{ required: true, message: '!'},
],
sulfTempLower: [
{ required: true, message: '!'},
],
eqtNo: [
{ required: true, message: '31,32,33...!'},
],
},
url: {
add: "/ttsulfequip/ttSulfEquip/add",
edit: "/ttsulfequip/ttSulfEquip/edit",
queryById: "/ttsulfequip/ttSulfEquip/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-sulf-equip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tt-sulf-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 TtSulfEquipForm from './TtSulfEquipForm'
export default {
name: 'TtSulfEquipModal',
components: {
TtSulfEquipForm
},
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-sulf-equip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tt-sulf-equip-form>
</j-modal>
</template>
<script>
import TtSulfEquipForm from './TtSulfEquipForm'
export default {
name: 'TtSulfEquipModal',
components: {
TtSulfEquipForm
},
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>
Loading…
Cancel
Save