班组管理问题修改 12.14

zhc4dev
zhc077 2 years ago
parent d5f7eec08c
commit 83f304ef21
  1. 285
      ant-design-vue-jeecg/src/views/devicetype/ZyDevicetypeListRef.vue
  2. 79
      ant-design-vue-jeecg/src/views/team/modules/StationMachineModal.vue
  3. 42
      ant-design-vue-jeecg/src/views/team/modules/StationToolModal.vue
  4. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/controller/StationMachineController.java
  5. 25
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/controller/StationToolController.java

@ -0,0 +1,285 @@
<template>
<a-card :bordered="false">
<!-- &lt;!&ndash; 查询区域 &ndash;&gt;-->
<!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
<!-- <a-row :gutter="24">-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
<!-- &lt;!&ndash; 查询区域-END &ndash;&gt;-->
<!-- &lt;!&ndash; 操作按钮区域 &ndash;&gt;-->
<!-- <div class="table-operator">-->
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</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>-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- </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"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:customRow="clickThenSelect"
@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="imgeSlot" slot-scope="text">-->
<!-- <img :src="text" height="" 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="openDetail(record.id)">详情</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>
<!-- <a-tabs defaultActiveKey="1">-->
<!-- <a-tab-pane tab="类型参数" key="1" >-->
<!-- <ZyTypeparametersList :mainId="selectedMainId" />-->
<!-- </a-tab-pane>-->
<!-- <a-tab-pane tab="运行参数" key="2" forceRender>-->
<!-- <ZyOperationparametersList :mainId="selectedMainId" />-->
<!-- </a-tab-pane>-->
<!-- </a-tabs>-->
<!-- <ZyDevicetypeDetail ref="ZyDevicetypeDetail"></ZyDevicetypeDetail>-->
<!-- <zyDevicetype-modal ref="modalForm" @ok="modalFormOk"></zyDevicetype-modal>-->
</a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ZyDevicetypeModal from './modules/ZyDevicetypeModal'
import { getAction } from '@/api/manage'
import ZyTypeparametersList from './ZyTypeparametersList'
import ZyOperationparametersList from './ZyOperationparametersList'
import '@/assets/less/TableExpand.less'
import ZyDevicetypeDetail from './modules/ZyDevicetypeDetail'
export default {
name: "ZyDevicetypeList",
mixins:[JeecgListMixin],
components: {
ZyTypeparametersList,
ZyOperationparametersList,
ZyDevicetypeModal,
ZyDevicetypeDetail
},
data () {
return {
description: '设备类型管理页面',
//
columns: [
// {
// title:'',
// align:"center",
// dataIndex: 'code'
// },
{
title:'名称',
align:"center",
dataIndex: 'name'
},
// {
// title:'',
// align:"center",
// dataIndex: 'img',
// scopedSlots: {customRender: 'imgSlot'}
// },
// {
// title:"",
// align:"center",
// dataIndex: 'erweima',
// scopedSlots: {customRender: 'imgeSlot'}
// },
{
title:'类型品牌',
align:"center",
dataIndex: 'brand'
},
// {
// title:'',
// align:"center",
// dataIndex: 'model'
// },
{
title:'生产厂商',
align:"center",
dataIndex: 'manufacturer'
},
{
title:'供货商',
align:"center",
dataIndex: 'supplier'
},
// {
// title:'',
// align:"center",
// dataIndex: 'contact'
// },
// {
// title:'',
// align:"center",
// dataIndex: 'place'
// },
],
url: {
list: "/devicetype/zyDevicetype/list",
delete: "/devicetype/zyDevicetype/delete",
deleteBatch: "/devicetype/zyDevicetype/deleteBatch",
exportXlsUrl: "/devicetype/zyDevicetype/exportXls",
importExcelUrl: "devicetype/zyDevicetype/importExcel",
},
dictOptions:{
},
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '50'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedMainId:'',
superFieldList:[],
selectedRowKeys: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}
},
methods: {
onSelectChange(selectedRowKeys){
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
initDictConfig(){
},
clickThenSelect(record) {
return {
on: {
click: () => {
this.onSelectChange(record.id.split(","), [record]);
}
}
}
},
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
this.selectedMainId=''
},
// onSelectChange(selectedRowKeys, selectionRows) {
// this.selectedMainId=selectedRowKeys[0]
// this.selectedRowKeys = selectedRowKeys;
// this.selectionRows = selectionRows;
// },
loadData(arg) {
if(!this.url.list){
this.$message.error("请设置url.list属性!")
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.onClearSelected()
var params = this.getQueryParams();//
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
}
if(res.code===510){
this.$message.warning(res.message)
}
this.loading = false;
})
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
fieldList.push({type:'string',value:'code',text:'类型编号',dictCode:''})
fieldList.push({type:'string',value:'name',text:'类型名称',dictCode:''})
fieldList.push({type:'string',value:'img',text:'类型图片',dictCode:''})
fieldList.push({type:'string',value:'brand',text:'类型品牌',dictCode:''})
fieldList.push({type:'string',value:'model',text:'型号',dictCode:''})
fieldList.push({type:'string',value:'manufacturer',text:'生产厂商',dictCode:''})
fieldList.push({type:'string',value:'supplier',text:'供货商',dictCode:''})
fieldList.push({type:'string',value:'contact',text:'联系人',dictCode:''})
fieldList.push({type:'string',value:'place',text:'产地',dictCode:''})
this.superFieldList = fieldList
},
openDetail(id){
this.$refs.ZyDevicetypeDetail.showModal(id)
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

@ -1,47 +1,53 @@
<template>
<j-modal
:title="title"
:width="800"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@ok="handleOk2"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="车间工位编号">-->
<!-- <j-select-depart placeholder="请选择工位" v-model="model.stationId"/>-->
<!-- </a-form-model-item>-->
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="工位ID">-->
<!-- <a-input placeholder="请输入工位ID" v-model="model.stationId" />-->
<!-- </a-form-model-item>-->
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machineId" label="设备">-->
<!-- &lt;!&ndash; <a-input placeholder="请选择设备" v-model="model.machineId" />&ndash;&gt;-->
<!-- <j-select-depart placeholder="请选择设备" v-model="model.machineId"/>-->
<!-- </a-form-model-item>-->
<a-form-model-item prop="machineId" label="设备">
<j-dict-select-tag v-model="model.machineId" dictCode="zy_devicetype,name,id" placeholder="请选择设备" />
</a-form-model-item>
<!-- <a-spin :spinning="confirmLoading">-->
<!-- <a-form-model ref="form" :model="model" :rules="validatorRules">-->
<!-- &lt;!&ndash; <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="车间工位编号">&ndash;&gt;-->
<!-- &lt;!&ndash; <j-select-depart placeholder="请选择工位" v-model="model.stationId"/>&ndash;&gt;-->
<!-- &lt;!&ndash; </a-form-model-item>&ndash;&gt;-->
<!-- &lt;!&ndash; <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="工位ID">&ndash;&gt;-->
<!-- &lt;!&ndash; <a-input placeholder="请输入工位ID" v-model="model.stationId" />&ndash;&gt;-->
<!-- &lt;!&ndash; </a-form-model-item>&ndash;&gt;-->
<!--&lt;!&ndash; <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machineId" label="设备">&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash; <a-input placeholder="请选择设备" v-model="model.machineId" />&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; <j-select-depart placeholder="请选择设备" v-model="model.machineId"/>&ndash;&gt;-->
<!--&lt;!&ndash; </a-form-model-item>&ndash;&gt;-->
<!--&lt;!&ndash; <a-form-model-item prop="machineId" label="设备">-->
<!-- <j-dict-select-tag v-model="model.machineId" dictCode="zy_devicetype,name,id" placeholder="请选择设备" />-->
<!-- </a-form-model-item>&ndash;&gt;-->
<!-- </a-form-model>-->
<!-- </a-spin>-->
</a-form-model>
</a-spin>
<ZyDevicetypeListRef ref="modalForm2"></ZyDevicetypeListRef>
</j-modal>
</template>
<script>
import {httpAction} from '@/api/manage'
import moment from "moment"
import ZyDevicetypeListRef from '@views/devicetype/ZyDevicetypeListRef'
export default {
name: "StationMachineModal",
components:{
ZyDevicetypeListRef
},
data() {
return {
title: "操作",
visible: false,
model: {
stationId: '',
machineId:[],
},
labelCol: {
xs: {span: 24},
@ -60,6 +66,7 @@ export default {
},
url: {
add: "/stationMachine/add",
addBatch: "/stationMachine/addBatch",
edit: "/stationMachine/edit",
},
}
@ -81,6 +88,40 @@ export default {
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk2() {
this.model.machineId = this.$refs["modalForm2"].selectedRowKeys.toString();
const that = this;
//
// this.$refs.form.validate(valid => {
// if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.addBatch;
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;
that.close();
})
// } else {
// return false;
// }
// })
},
handleOk() {
const that = this;
//

@ -16,19 +16,19 @@
<!-- </a-form-model-item>-->
<!-- </a-form-model>-->
<!-- </a-spin>-->
<ZyToolList ref="modalForm2"></ZyToolList>
<ZyToolListRef ref="modalForm2"></ZyToolListRef>
</j-modal>
</template>
<script>
import {httpAction} from '@/api/manage'
import moment from "moment"
import ZyToolList from "@views/erp/tool/ZyToolListRef"
import ZyToolListRef from "@views/erp/tool/ZyToolListRef"
export default {
name: "StationToolModal",
components: {
ZyToolList
ZyToolListRef
},
data() {
return {
@ -36,6 +36,7 @@ export default {
visible: false,
model: {
stationId: '',
toolsId:[],
},
labelCol: {
xs: {span: 24},
@ -54,6 +55,7 @@ export default {
},
url: {
add: "/stationTool/add",
addBatch: "/stationTool/addBatch",
edit: "/stationTool/edit",
},
}
@ -82,10 +84,9 @@ export default {
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk2(record) {
// alert(record);
// console.log('-----------------------------------------------------------------------')
console.log(this.$refs["modalForm2"].selectedRowKeys)
handleOk2() {
this.model.toolsId = this.$refs["modalForm2"].selectedRowKeys.toString();
// console.log("model.toolids:"+this.model.toolsId);
const that = this;
//
// this.$refs.form.validate(valid => {
@ -94,25 +95,24 @@ export default {
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.add;
httpurl += this.url.addBatch;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
console.log("----------the add() model:", this.model);
this.model.stationId =
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;
that.close();
})
console.log("----------the add() model:", JSON.stringify(this.model));
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;
that.close();
})
// } else {
// return false;
// }

@ -6,12 +6,15 @@ 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.apache.commons.lang3.StringUtils;
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.team.entity.StationMachine;
import org.jeecg.modules.team.entity.StationMachine;
import org.jeecg.modules.team.service.IStationMachineService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -19,6 +22,8 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* @Description: 工序设备管理
@ -70,6 +75,25 @@ public class StationMachineController extends JeecgController<StationMachine, IS
return Result.OK("添加成功!");
}
@AutoLog(value = "工序设备管理-批量添加")
@ApiOperation(value = "工序设备管理-批量添加", notes = "工序设备管理-批量添加")
@PostMapping(value = "/addBatch")
public Result<?> addBatch(@RequestBody StationMachine en) {
String machineIds = en.getMachineId();
List<StationMachine> addList = new LinkedList<>();
if (StringUtils.isNotBlank(machineIds)) {
List<String> list = Arrays.asList(machineIds.split(","));
list.forEach(e -> {
StationMachine s = new StationMachine();
BeanUtils.copyProperties(en, s);
s.setMachineId(e);
addList.add(s);
});
}
stationMachineService.saveBatch(addList);
return Result.OK("添加成功!");
}
/**
* 编辑
*

@ -6,12 +6,15 @@ 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.apache.commons.collections.list.SynchronizedList;
import org.apache.commons.lang3.StringUtils;
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.team.entity.StationTool;
import org.jeecg.modules.team.service.IStationToolService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -19,6 +22,9 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description: 工序工具管理
@ -70,6 +76,25 @@ public class StationToolController extends JeecgController<StationTool, IStation
return Result.OK("添加成功!");
}
@AutoLog(value = "工序工具管理-批量添加")
@ApiOperation(value = "工序工具管理-批量添加", notes = "工序工具管理-批量添加")
@PostMapping(value = "/addBatch")
public Result<?> addBatch(@RequestBody StationTool stationTool) {
String toolsIds = stationTool.getToolsId();
List<StationTool> addList = new LinkedList<>();
if (StringUtils.isNotBlank(toolsIds)) {
List<String> list = Arrays.asList(toolsIds.split(","));
list.forEach(e -> {
StationTool s = new StationTool();
BeanUtils.copyProperties(stationTool, s);
s.setToolsId(e);
addList.add(s);
});
}
stationToolService.saveBatch(addList);
return Result.OK("添加成功!");
}
/**
* 编辑
*

Loading…
Cancel
Save