吊挂管理-吊挂运行记录 2.6

zhc4dev
zhc077 2 years ago
parent cacb1dc68b
commit 1c5620c3ec
  1. 187
      ant-design-vue-jeecg/src/views/hanger/HangRecordList.vue
  2. 495
      ant-design-vue-jeecg/src/views/hanger/HangerManage.vue
  3. 50
      ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue
  4. 150
      ant-design-vue-jeecg/src/views/hanger/modules/HangRecordForm.vue
  5. 60
      ant-design-vue-jeecg/src/views/hanger/modules/HangRecordModal.vue
  6. 84
      ant-design-vue-jeecg/src/views/hanger/modules/HangRecordModal__Style#Drawer.vue
  7. 6
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue
  8. 155
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/HangRecordController.java
  9. 111
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/HangRecord.java
  10. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/HangRecordMapper.java
  11. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IHangRecordService.java
  12. 19
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/HangRecordServiceImpl.java

@ -0,0 +1,187 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.code" placeholder="请输入吊挂编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.point" placeholder="请输入工站编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.orderCode" placeholder="请输入工单编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<j-dict-select-tag type="list" v-model="queryParam.status" dictCode="hang_record_status" placeholder="请选择状态" />
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</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('吊挂运行记录表')">导出</a-button>
</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">
</a-table>
</div>
<hang-record-modal ref="modalForm" @ok="modalFormOk"></hang-record-modal>
</a-card>
</template>
<script>
import '@assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import HangRecordModal from './modules/HangRecordModal'
import {filterMultiDictText} from '@comp/dict/JDictSelectUtil'
export default {
name: 'HangRecordList',
mixins: [JeecgListMixin, mixinDevice],
components: {
HangRecordModal
},
data() {
return {
description: '吊挂运行记录表管理页面',
labelCol: {
xs: { span: 12 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 12 },
sm: { span: 16 },
},
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '吊挂编号',
align: "center",
dataIndex: 'hangCode'
},
{
title: '工站编号',
align: "center",
dataIndex: 'point'
},
{
title: '生产开始时间',
align: "center",
dataIndex: 'workTime'
},
{
title: '生产结束时间',
align: "center",
dataIndex: 'offTime'
},
{
title: '时长(分钟)',
align: "center",
dataIndex: 'duration'
},
{
title: '状态',
align: "center",
dataIndex: 'status_dictText'
},
// {
// title: '',
// dataIndex: 'action',
// align: "center",
// fixed: "right",
// width: 147,
// scopedSlots: {customRender: 'action'}
// }
],
url: {
list: "/org.jeecg.modules.hanger/hangRecord/list",
delete: "/org.jeecg.modules.hanger/hangRecord/delete",
deleteBatch: "/org.jeecg.modules.hanger/hangRecord/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.hanger/hangRecord/exportXls",
importExcelUrl: "org.jeecg.modules.hanger/hangRecord/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'hangCode', text: '吊挂编号', dictCode: 'zy_hang,code,code'})
fieldList.push({type: 'string', value: 'point', text: '工站编号', dictCode: 'zy_hang_point,point,point'})
fieldList.push({type: 'string', value: 'orderCode', text: '工单编号', dictCode: 'work_order,id,id'})
fieldList.push({type: 'datetime', value: 'workTime', text: '生产开始时间'})
fieldList.push({type: 'datetime', value: 'offTime', text: '生产结束时间'})
fieldList.push({type: 'int', value: 'duration', text: '时长', dictCode: ''})
fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: 'devicestatus1,,'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,495 @@
<template>
<a-card :bordered="false">
<p style="font-size: 30px;color:#333; padding-left: 30% ">{{ planInfo.productCode }}工单生产计划管理</p>
<template>
<div>
<el-descriptions border :column='4'>
<el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item>
<el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item>
<!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item>
<!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item>
<el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item>
<el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item>
<el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item>
<el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item>
<el-descriptions-item label="生产时长">{{ planInfo.duration }}</el-descriptions-item>
<el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item>
<el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item>
<el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item>
<el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item>
<!-- <el-descriptions-item label="制定人">100</el-descriptions-item>-->
<!-- <el-descriptions-item label="制定时间">100</el-descriptions-item>-->
<el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item>
</el-descriptions>
</div>
</template>
<!-- table区域-begin -->
<div>
<j-vxe-table
ref="xTable"
toolbar
:toolbarConfig="toolbarConfig"
row-number
row-selection
keep-source
:rowSelection="clickTrue"
:clickSelectRow="clickTrue"
:loading="loading"
:columns="columns"
@selectRowChange="handleSelectRowChange"
:dataSource="dataSource"
@valueChange="handleValueChange"
@save="handleTableSave"
>
<template v-slot:toolbarSuffix>
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button>
<a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button>
<a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单
</a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill">查看物料单
</a-button>
<a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库
</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>-->
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template>
<template v-slot:action="props">
<a @click="jump2MianLiao(props)">面料</a>
<a-divider type="vertical"/>
<a @click="jump2FuLiao(props)">辅料</a>
<a-divider type="vertical"/>
<a @click="viewDetail(props)">详情</a>
</template>
</j-vxe-table>
</div>
<ZyPlanProcessDataDetail ref="zyPlanProcessDataDetail"></ZyPlanProcessDataDetail>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction, postAction} from "@api/manage";
import {filterObj, pushIfNotExist, randomNumber, randomUUID} from "@/utils/util";
import {JVXETypes} from '@/components/jeecg/JVxeTable'
import Area from "@comp/_util/Area";
import ZyPlanProcessDataDetail from '@views/productplan/ZyPlanProcessDataDetail'
export default {
name: 'ZyPlanProcessDataList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessDataDetail,
},
data() {
return {
toolbarConfig: {
// add remove clearSelection
btn: ['save',]
},
description: '生产计划工序管理页面',
loading: false,
dataSource: [],
columns: [
{
title: '工序名称',
key: 'processName',
width: '180px',
},
{
title: '工位ID',
key: 'stationId',
type: JVXETypes.hidden,
},
{
title: '工位名称',
key: 'stationName',
type: JVXETypes.select,
width: '200px',
options: [],
placeholder: '请选择${title}',
},
{
title: '工位序号',
key: 'stationNum',
width: '80px',
},
{
title: '设备名称',
key: 'machineIds',
type: JVXETypes.hidden
},
{
title: '设备名称',
key: 'machineNames',
type: JVXETypes.selectMultiple,
width: '180px',
options: [],
placeholder: '请选择${title}',
},
{
title: 'toodsIds',
key: 'toolsIds',
type: JVXETypes.hidden,
},
{
title: '工具名称',
key: 'toolsNames',
type: JVXETypes.selectMultiple,
width: '180px',
options: [],
placeholder: '请选择${title}',
},
{key: 'proProcess', type: JVXETypes.hidden, title: '前导工序ID', width: '120px'},
{
title: '前导工序',
key: 'proProcessName',
type: JVXETypes.popup,
width: '180px',
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
// orgFields: 'id,process_code,process_name,process_describe',
// destFields: 'proProcessName,process_code,process_name,process_describe',
orgFields: 'process_name,id',
destFields: 'proProcessName,proProcess',
},
{key: 'postProcess', type: JVXETypes.hidden, title: '后导工序ID', width: '120px'},
{
title: '后导工序',
key: 'postProcessName',
type: JVXETypes.popup,
width: '180px',
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
orgFields: 'process_name,id',
destFields: 'postProcessName,postProcess',
},
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input},
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input},
{
title: '工人id',
key: 'userIds',
type: JVXETypes.hidden,
},
{
title: '工人名称',
key: 'userNames',
type: JVXETypes.selectMultiple,
width: '200px',
options: [],
placeholder: '请选择${title}',
},
{key: 'totalMachine', title: '机器时长', width: '80', type: JVXETypes.normal},
{key: 'totalMaunal', title: '人工时长', width: '80', type: JVXETypes.normal},
{
title: '管理',
key: 'action',
type: JVXETypes.slot,
fixed: 'right',
minWidth: '150px',
align: 'center',
slotName: 'action',
},
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo",
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess",
autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling",
createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill",
sendToRepository: "/org.jeecg.modules.productplan/zyPlanProcess/sendToRepository",
stationToolslist: "/stationTool/list2",
stationMachinelist: "/stationMachine/list2",
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch",
},
loadRouteType: false,
planId: "",
dictOptions: {},
planInfo: {},
superFieldList: [],
stationIdList: [],
userIdList: [],
toolsList: [],
machineList: [],
clickTrue: true,
}
},
created() {
this.loadParameter();
this.getPlanInfo(this.planId);
},
methods: {
//
viewDetail(props) {
// alert("deatil row id:"+props.row.id);
this.$refs.zyPlanProcessDataDetail.showModal(props.row.id)
},
jump2MianLiao(props) {
console.log("mianLiao() ----props:", props)
this.$router.push({
path: '/productplan/ZyPlanProcessFabricDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
jump2FuLiao(props) {
console.log("fuLiao() ----props:", props)
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
getPlanInfo(planId) {
// debugger;
getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => {
if (res.success) {
this.planInfo = res.result.records || res.result;
// console.log("getPlanInfo------------:" + JSON.stringify(this.planInfo));
} else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
handleTableSave({$table, target}) {
console.log("生产计划工序保存开始-----------------")
//
$table.validate().then((errMap) => {
//
if (!errMap) {
//
let tableData = target.getTableData()
console.log('当前保存的数据是:', tableData)
//
this.loading = true
postAction(this.url.addProcessBatch, tableData).then(res => {
if (res.success) {
this.$message.success(`保存成功!`)
} else {
this.$message.warn(`保存失败:` + res.message)
}
}).finally(() => {
this.loading = false
this.loadData();
})
}
})
},
fanHui() {
this.$router.push({
path: '/productplan/ZyProductPlanList',
});
},
//
syncProductProcess() {
this.loading = true;
getAction(this.url.syncProductProcess, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
/**
* 根据工序id查询工序设备表zy_process_machine用工序设备表数据与工位设备进行匹配(工位设备包含工序设备即是匹配成功则自动填充工位设备字段数据匹配不上则不自动填充由用户自己录入)
*/
autoFilling() {
this.loading = true;
getAction(this.url.autoFilling, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
/**
* 根据该生产计划的工序面料工序辅料按类统计各种面料辅料的用量汇总到计划面料计划辅料表
*/
createMaterialBill() {
this.loading = true;
getAction(this.url.createMaterialBill, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
viewMaterialBill() {
// alert("deatil this.planId:"+this.planId);
// this.$refs.zyPlanProcessDataDetail.showModal(this.planId)
this.$router.push({
path: '/productplan/ZyPlanWuLiaoDataDetail',
query: { //
'planId': this.planId,
},
});
},
//
sendToRepository(){
this.loading = true;
getAction(this.url.sendToRepository, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
loadParameter() {
// debugger;
if (this.loadRouteType === false) {
this.planId = this.$route.query.planId;
console.log("*******传递的planId:" + this.planId)
this.loadRouteType = true;
}
},
loadData(arg) {
console.log("the loadData---------开始");
// var that = this;
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
// 1
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
console.log("----------------the params:", params);
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records || res.result;
this.stationIdList = this.dataSource[0].stationIdList;
this.userIdList = this.dataSource[0].userIdList;
} else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.planId = this.planId;
return filterObj(param);
},
//
handleSelectRowChange(event) {
// console.log("handleSelectRowChange")
console.log("handleSelectRowChange-event:", event)
const {type, row, column, value, target, $table} = event
console.log("stationIdList", JSON.stringify(this.stationIdList));
console.log("---------userIdList", JSON.stringify(this.userIdList));
target.$refs.vxe.columns[4].options = this.stationIdList;
target.$refs.vxe.columns[17].options = this.userIdList;
},
/** 当选项被改变时,联动其他组件 */
handleValueChange(event) {
const {type, row, column, value, target} = event
console.log("选择列-" + column.key + ":的事件-----", event)
console.log("选择列-" + column.key + ":所在行数据-----", row)
// console.log("row", row)
//
if (column.key === 'stationName') {
let selectedStationId = event.value;
// options
// console.log('id---------:', selectedStationId)
row.stationId = selectedStationId;
//
target.setValues([{
rowKey: row.id,
values: {machineIds: '', toolsIds: '', machineNames: '', toolsNames: ''}
}])
target.$refs.vxe.columns[7].options = []
target.$refs.vxe.columns[9].options = []
getAction(this.url.stationMachinelist, {"stationId": selectedStationId}).then((res) => {
if (res.success) {
this.machineList = res.result.records || res.result;
console.log("machineList", JSON.stringify(this.machineList))
target.$refs.vxe.columns[7].options = this.machineList;
} else {
this.$message.warning(res.message)
}
});
getAction(this.url.stationToolslist, {"stationId": selectedStationId}).then((res) => {
if (res.success) {
this.toolsList = res.result.records || res.result;
console.log("toolsList", JSON.stringify(this.toolsList))
target.$refs.vxe.columns[9].options = this.toolsList;
} else {
this.$message.warning(res.message)
}
});
}
//
if (column.key === 'machineNames') {
row.machineIds = event.value;
}
if (column.key === 'toolsNames') {
row.toolsIds = event.value;
}
if (column.key === 'userNames') {
row.userIds = event.value;
}
}
},
};
</script>

@ -45,10 +45,6 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('吊挂表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('吊挂表')">导出</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>--> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
@ -117,6 +113,8 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a @click="jumpPage1(record)">管理</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
@ -146,6 +144,14 @@ export default {
return { return {
description: '吊挂表管理页面', description: '吊挂表管理页面',
// //
labelCol: {
xs: {span: 12},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 12},
sm: {span: 16},
},
columns: [ columns: [
{ {
title: '#', title: '#',
@ -250,36 +256,18 @@ export default {
} }
}, },
created() { created() {
this.getSuperFieldList(); // this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
}, },
computed: {},
methods: { methods: {
initDictConfig() { jumpPage1(record) {
this.$router.push({
path: '/src/views/hanger/HangerManage',
query: { //
'id': record.id,
},
});
}, },
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'brand', text: '品牌', dictCode: ''})
fieldList.push({type: 'string', value: 'model', text: '型号', dictCode: ''})
fieldList.push({type: 'string', value: 'code', text: '编号', dictCode: ''})
fieldList.push({type: 'int', value: 'pointnumber', text: '工站数', dictCode: ''})
fieldList.push({type: 'string', value: 'buydate', text: '购买时间', dictCode: ''})
fieldList.push({type: 'string', value: 'agent', text: '经办人', dictCode: ''})
fieldList.push({type: 'string', value: 'status', text: '状态', dictCode: ''})
fieldList.push({type: 'string', value: 'qrcode', text: '二维码', dictCode: ''})
fieldList.push({type: 'int', value: 'maintenancecycle', text: '维护周期', dictCode: ''})
fieldList.push({type: 'string', value: 'administrator', text: '管理 人', dictCode: ''})
fieldList.push({type: 'string', value: 'maintenancedate', text: '上次维护时间', dictCode: ''})
fieldList.push({type: 'string', value: 'img', text: '图片', dictCode: ''})
fieldList.push({type: 'string', value: 'img3d', text: '3d模型', dictCode: ''})
this.superFieldList = fieldList
}
} }
} }
</script> </script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,150 @@
<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="hangCode">
<j-dict-select-tag type="list" v-model="model.hangCode" dictCode="zy_hang,code,code" placeholder="请选择吊挂编号" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="point">
<j-dict-select-tag type="list" v-model="model.point" dictCode="zy_hang_point,point,point" placeholder="请选择工站编号" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode">
<j-dict-select-tag type="list" v-model="model.orderCode" dictCode="work_order,id,id" placeholder="请选择工单编号" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag type="list" v-model="model.status" dictCode="hang_record_status" placeholder="请选择状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workTime">
<j-date placeholder="请选择生产开始时间" v-model="model.workTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="offTime">
<j-date placeholder="请选择生产结束时间" v-model="model.offTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<a-input-number v-model="model.duration" 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: 'HangRecordForm',
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: {
hangCode: [
{ required: true, message: '请输入吊挂编号!'},
{ pattern: /^.{0,6}$/, message: '吊挂编号超长!'},
],
point: [
{ required: true, message: '请输入工站编号!'},
{ pattern: /^.{0,4}$/, message: '工站编号超长!'},
],
orderCode: [
{ required: true, message: '请输入工单编号!'},
{ pattern: /^\d{6,36}$/, message: '工单编号超长!'},
],
duration: [
{required: false},
{pattern: /^[0-9]{0,1000}$/, message: '时间为正整数'}
],
},
url: {
add: "/org.jeecg.modules.hanger/hangRecord/add",
edit: "/org.jeecg.modules.hanger/hangRecord/edit",
queryById: "/org.jeecg.modules.hanger/hangRecord/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,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<hang-record-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></hang-record-form>
</j-modal>
</template>
<script>
import HangRecordForm from './HangRecordForm'
export default {
name: 'HangRecordModal',
components: {
HangRecordForm
},
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>

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<hang-record-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></hang-record-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 HangRecordForm from './HangRecordForm'
export default {
name: 'HangRecordModal',
components: {
HangRecordForm
},
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>

@ -109,7 +109,7 @@ export default {
return { return {
// enterprisesManager: "sys_user,realname,id", // enterprisesManager: "sys_user,realname,id",
model:{ model:{
status:1, status:0,
}, },
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@ -121,6 +121,10 @@ export default {
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
workshopId: [
{ required: true,message: "车间不能为空"},
{ pattern: /^.{0,36}$/, message: '长度过长!'},
],
brand: [ brand: [
{ required: false}, { required: false},
{ pattern: /^.{0,36}$/, message: '长度过长!'}, { pattern: /^.{0,36}$/, message: '长度过长!'},

@ -0,0 +1,155 @@
package org.jeecg.modules.hanger.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.hanger.entity.HangRecord;
import org.jeecg.modules.hanger.service.IHangRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: 吊挂运行记录表
* @Author: jeecg-boot
* @Date: 2023-02-06
* @Version: V1.0
*/
@Api(tags = "吊挂运行记录表")
@RestController
@RequestMapping("/org.jeecg.modules.hanger/hangRecord")
@Slf4j
public class HangRecordController extends JeecgController<HangRecord, IHangRecordService> {
@Autowired
private IHangRecordService hangRecordService;
/**
* 分页列表查询
*
* @param hangRecord
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "吊挂运行记录表-分页列表查询")
@ApiOperation(value = "吊挂运行记录表-分页列表查询", notes = "吊挂运行记录表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(HangRecord hangRecord,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<HangRecord> queryWrapper = QueryGenerator.initQueryWrapper(hangRecord, req.getParameterMap());
Page<HangRecord> page = new Page<HangRecord>(pageNo, pageSize);
IPage<HangRecord> pageList = hangRecordService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param hangRecord
* @return
*/
@AutoLog(value = "吊挂运行记录表-添加")
@ApiOperation(value = "吊挂运行记录表-添加", notes = "吊挂运行记录表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody HangRecord hangRecord) {
hangRecordService.save(hangRecord);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param hangRecord
* @return
*/
@AutoLog(value = "吊挂运行记录表-编辑")
@ApiOperation(value = "吊挂运行记录表-编辑", notes = "吊挂运行记录表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody HangRecord hangRecord) {
hangRecordService.updateById(hangRecord);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "吊挂运行记录表-通过id删除")
@ApiOperation(value = "吊挂运行记录表-通过id删除", notes = "吊挂运行记录表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
hangRecordService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "吊挂运行记录表-批量删除")
@ApiOperation(value = "吊挂运行记录表-批量删除", notes = "吊挂运行记录表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.hangRecordService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "吊挂运行记录表-通过id查询")
@ApiOperation(value = "吊挂运行记录表-通过id查询", notes = "吊挂运行记录表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
HangRecord hangRecord = hangRecordService.getById(id);
if (hangRecord == null) {
return Result.error("未找到对应数据");
}
return Result.OK(hangRecord);
}
/**
* 导出excel
*
* @param request
* @param hangRecord
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HangRecord hangRecord) {
return super.exportXls(request, hangRecord, HangRecord.class, "吊挂运行记录表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, HangRecord.class);
}
}

@ -0,0 +1,111 @@
package org.jeecg.modules.hanger.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 吊挂运行记录表
* @Author: jeecg-boot
* @Date: 2023-02-06
* @Version: V1.0
*/
@Data
@TableName("hang_record")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "hang_record对象", description = "吊挂运行记录表")
public class HangRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 吊挂编号
*/
@Excel(name = "吊挂编号", width = 15)
@ApiModelProperty(value = "吊挂编号")
private String hangCode;
/**
* 工站编号
*/
@Excel(name = "工站编号", width = 15)
@ApiModelProperty(value = "工站编号")
private String point;
/**
* 工单编号
*/
@Excel(name = "工单编号", width = 15)
@ApiModelProperty(value = "工单编号")
private String orderCode;
/**
* 生产开始时间
*/
@Excel(name = "生产开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "生产开始时间")
private Date workTime;
/**
* 生产结束时间
*/
@Excel(name = "生产结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "生产结束时间")
private Date offTime;
/**
* 时长
*/
@Excel(name = "时长", width = 15)
@ApiModelProperty(value = "时长")
private Integer duration;
/**
* 状态
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
@Dict(dicCode = "hang_record_status")
private Integer status;
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.hanger.entity.HangRecord;
/**
* @Description: 吊挂运行记录表
* @Author: jeecg-boot
* @Date: 2023-02-06
* @Version: V1.0
*/
public interface HangRecordMapper extends BaseMapper<HangRecord> {
}

@ -0,0 +1,15 @@
package org.jeecg.modules.hanger.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.hanger.entity.HangRecord;
/**
* @Description: 吊挂运行记录表
* @Author: jeecg-boot
* @Date: 2023-02-06
* @Version: V1.0
*/
public interface IHangRecordService extends IService<HangRecord> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.hanger.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.hanger.entity.HangRecord;
import org.jeecg.modules.hanger.mapper.HangRecordMapper;
import org.jeecg.modules.hanger.service.IHangRecordService;
import org.springframework.stereotype.Service;
/**
* @Description: 吊挂运行记录表
* @Author: jeecg-boot
* @Date: 2023-02-06
* @Version: V1.0
*/
@Service
public class HangRecordServiceImpl extends ServiceImpl<HangRecordMapper, HangRecord> implements IHangRecordService {
}
Loading…
Cancel
Save