计划管理

master
Gitea 2 years ago
parent f7c7784166
commit eb7d50c86e
  1. 223
      ant-design-vue-jeecg/src/views/zyplanprocess/ZyPlanProcessList.vue
  2. 167
      ant-design-vue-jeecg/src/views/zyplanprocess/modules/ZyPlanProcessForm.vue
  3. 60
      ant-design-vue-jeecg/src/views/zyplanprocess/modules/ZyPlanProcessModal.vue
  4. 84
      ant-design-vue-jeecg/src/views/zyplanprocess/modules/ZyPlanProcessModal__Style#Drawer.vue
  5. 46
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java

@ -0,0 +1,223 @@
<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-item label="工序名称">
<a-input placeholder="请输入工序名称" v-model="queryParam.processName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="设备名称">
<a-input placeholder="请输入设备名称" v-model="queryParam.machineNames"></a-input>
</a-form-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">
<!-- 高级查询区域 -->
</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">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" 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>
<zy-plan-process-modal ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyPlanProcessModal from './modules/ZyPlanProcessModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'ZyPlanProcessList',
mixins:[JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessModal
},
data () {
return {
description: '生产计划工序管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'工序名称',
align:"center",
dataIndex: 'processName'
},
{
title:'工位名称',
align:"center",
dataIndex: 'stationName'
},
{
title:'工位序号',
align:"center",
dataIndex: 'stationNum'
},
{
title:'设备名称',
align:"center",
dataIndex: 'machineNames'
},
{
title:'工具名称',
align:"center",
dataIndex: 'toolsNames'
},
{
title:'前导工序',
align:"center",
dataIndex: 'proProcessName'
},
{
title:'后导工序',
align:"center",
dataIndex: 'postProcessName'
},
{
title:'输入产品',
align:"center",
dataIndex: 'inputProduct'
},
{
title:'成品/半成品',
align:"center",
dataIndex: 'semiProduct'
},
{
title:'工人名称',
align:"center",
dataIndex: 'userNames'
},
{
title:'机器时长',
align:"center",
dataIndex: 'totalMachine'
},
{
title:'人工时长',
align:"center",
dataIndex: 'totalMaunal'
},
/* {
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}*/
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/pagelist",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,167 @@
<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="工位id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId">
<j-dict-select-tag type="list" v-model="model.stationId" dictCode="" placeholder="请选择工位id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="设备id列表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machineIds">
<j-dict-select-tag type="list" v-model="model.machineIds" dictCode="" placeholder="请选择设备id列表" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工具id列表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolsIds">
<a-input v-model="model.toolsIds" placeholder="请输入工具id列表" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工序id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processId">
<j-dict-select-tag type="list" v-model="model.processId" dictCode="" placeholder="请选择工序id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="成员id列表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userIds">
<j-dict-select-tag type="list" v-model="model.userIds" dictCode="sys_user,user_name,id" placeholder="请选择成员id列表" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="前导工序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="proProcess">
<j-popup
v-model="model.proProcess"
field="proProcess"
org-fields="process_id"
dest-fields="productId"
code="zy_product_process"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="后导工序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="postProcess">
<j-search-select-tag v-model="model.postProcess" dict="" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="输入产品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inputProduct">
<a-input v-model="model.inputProduct" placeholder="请输入输入产品" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="成品/半成品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="semiProduct">
<a-input v-model="model.semiProduct" placeholder="请输入成品/半成品" ></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: 'ZyPlanProcessForm',
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: {
userIds: [
{ required: false},
{ pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},
],
proProcess: [
{ required: false},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
],
inputProduct: [
{ required: false},
{ pattern: /^-?\d+$/, message: '请输入整数!'},
],
},
url: {
add: "/zyplanprocess/zyPlanProcess/add",
edit: "/zyplanprocess/zyPlanProcess/edit",
queryById: "/zyplanprocess/zyPlanProcess/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;
})
}
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</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="关闭">
<zy-plan-process-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-plan-process-form>
</j-modal>
</template>
<script>
import ZyPlanProcessForm from './ZyPlanProcessForm'
export default {
name: 'ZyPlanProcessModal',
components: {
ZyPlanProcessForm
},
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">
<zy-plan-process-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-plan-process-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 ZyPlanProcessForm from './ZyPlanProcessForm'
export default {
name: 'ZyPlanProcessModal',
components: {
ZyPlanProcessForm
},
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>

@ -11,11 +11,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyPlanProcessService;
@ -58,6 +60,33 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
@Autowired @Autowired
private IStationToolService iStationToolService; private IStationToolService iStationToolService;
private static Map<String,String> useridstationid = new HashMap<String,String>(){{
put("GW01","1600683844590194690");
put("GW02","1613836246416949250");
put("GW03","1600683904673599490");
put("GW04","1601500192400568321");
put("GW05","1656505483663036418");
put("GW06","1656575967264034817");
put("GW07","1656577068503715841");
put("GW08","1656577699205402625");
put("GW09","1656578712880599042");
put("GW11","1656579165194342401");
put("GW12","1656579622599970817");
put("GW13","1656580199899779073");
put("GW14","1656580681556873217");
put("GW15","1656583367589154817");
put("GW16","1656582814427566082");
put("GW17","1656581033844854785");
put("GW18","1656583052286545922");
put("GW19","1656583813116514305");
put("GW21","1656585411720957954");
put("GW23","1656584237127094274");
put("GW24","1656585245655879681");
put("GW25","1656585691661389826");
put("GW26","1656585855876780033");
put("GW27","1656586337106055170");
put("GW28","1656587241611907073");
}};
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -336,4 +365,21 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return super.importExcel(request, response, ZyPlanProcess.class); return super.importExcel(request, response, ZyPlanProcess.class);
} }
@ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询")
@GetMapping(value = "/pagelist")
public Result<?> pagelist(ZyPlanProcess zyPlanProcess,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String username = loginUser.getUsername();
String stationid = useridstationid.get(username).toString();
QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
queryWrapper.eq("station_id",stationid);
Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
IPage<ZyPlanProcess> pageList = zyPlanProcessService.page(page, queryWrapper);
return Result.OK(pageList);
}
} }

Loading…
Cancel
Save