班组管理问题处理 1.13

zhc4dev
zhc077 2 years ago
parent 678b855a24
commit c5894d0d10
  1. 33
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
  2. 18
      ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue
  3. 35
      ant-design-vue-jeecg/src/views/team/modules/StationModal.vue
  4. 40
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java

@ -27,12 +27,6 @@
<template v-slot:toolbarSuffix> <template v-slot:toolbarSuffix>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
<!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableGet">获取值</a-button>-->
<!-- </a-tooltip>-->
<!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableSet">设置值</a-button>-->
<!-- </a-tooltip>-->
</template> </template>
</j-vxe-table> </j-vxe-table>
</div> </div>
@ -95,16 +89,27 @@ export default {
options: [], options: [],
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, },
{
title: 'stationIds',
key: 'stationIds',
type: JVXETypes.hidden,
},
{ {
title: '设备列表', title: '设备列表',
key: 'machineIds', key: 'machineNames',
type: JVXETypes.selectMultiple, type: JVXETypes.selectMultiple,
width: '200px', width: '200px',
options: [], options: [],
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, { },
title: '工具列表', {
title: 'toodsIds',
key: 'toolsIds', key: 'toolsIds',
type: JVXETypes.hidden,
},
{
title: '工具列表',
key: 'toolsIdNames',
type: JVXETypes.selectMultiple, type: JVXETypes.selectMultiple,
width: '200px', width: '200px',
options: [], options: [],
@ -150,7 +155,7 @@ export default {
dictOptions: {}, dictOptions: {},
superFieldList: [], superFieldList: [],
stationId: [], stationId: [],
stationIdList: [], stationList: [],
toolsList: [], toolsList: [],
machineList: [], machineList: [],
clickTrue: true, clickTrue: true,
@ -169,11 +174,7 @@ export default {
if (!errMap) { if (!errMap) {
// //
let tableData = target.getTableData() let tableData = target.getTableData()
// tableData.forEach(item => {
// item.id = '';
// })
console.log('当前保存的数据是:', tableData) console.log('当前保存的数据是:', tableData)
// //
this.loading = true this.loading = true
postAction(this.url.addProcessBatch, tableData).then(res => { postAction(this.url.addProcessBatch, tableData).then(res => {
@ -222,7 +223,7 @@ export default {
if (res.success) { if (res.success) {
this.dataSource = res.result.records || res.result; this.dataSource = res.result.records || res.result;
// this.stationId = this.dataSource[0].stationId; // this.stationId = this.dataSource[0].stationId;
this.stationIdList = this.dataSource[0].stationIdList; this.stationList = this.dataSource[0].stationList;
} else { } else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')"; // 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) this.$message.warning(res.message)
@ -253,7 +254,7 @@ export default {
const {type, row, column, value, target, $table} = event const {type, row, column, value, target, $table} = event
console.log(JSON.stringify(this.stationIdList)); console.log(JSON.stringify(this.stationIdList));
// target.$refs.vxe.columns[6].dictCode = this.stationIdCode; // target.$refs.vxe.columns[6].dictCode = this.stationIdCode;
target.$refs.vxe.columns[6].options = this.stationIdList; target.$refs.vxe.columns[6].options = this.stationList;
}, },
/** 当选项被改变时,联动其他组件 */ /** 当选项被改变时,联动其他组件 */
handleValueChange(event) { handleValueChange(event) {

@ -11,13 +11,22 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="部门"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="部门">
<!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>--> <!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>-->
<!-- <j-select-depart placeholder="请选择部门" v-model="model.departId"/>--> <!-- <j-select-depart placeholder="请选择部门" v-model="model.departId"/>-->
<j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'" <!-- <j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'"-->
@change="getEnterprisesManagerValChange()" <!-- @change="getEnterprisesManagerValChange()"-->
placeholder="请选择部门"/> <!-- placeholder="请选择部门"/>-->
<j-tree-select v-model="model.departId"
dict="sys_depart,depart_name,id"
pidField="parent_id"
placeholder="请选择车间"
condition='{"org_category":"2"}'
hasChildField="1"
@change="getEnterprisesManagerValChange()"
>
</j-tree-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupName" label="班组名称"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupName" label="班组名称">
@ -117,6 +126,7 @@ export default {
methods: { methods: {
getEnterprisesManagerValChange() { getEnterprisesManagerValChange() {
console.log("the departId=", this.model.departId)
this.enterprisesManager = "sys_user,realname,id,id in (select user_id from sys_user_depart where dep_id='" + this.model.departId + "')"; this.enterprisesManager = "sys_user,realname,id,id in (select user_id from sys_user_depart where dep_id='" + this.model.departId + "')";
// this.enterprisesManager = "zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')"; // this.enterprisesManager = "zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')";
}, },

@ -12,14 +12,19 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId"-->
<!-- label="车间ID">-->
<!-- <a-input placeholder="请输入车间ID" v-model="model.departId"/>-->
<!-- </a-form-model-item>-->
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="车间名称"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="车间名称">
<!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>--> <!-- <j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'" placeholder="请选择车间" />-->
<!-- <j-select-depart placeholder="请选择车间" v-model="model.departId"/>-->
<j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'" placeholder="请选择车间" /> <j-tree-select v-model="model.departId"
dict="sys_depart,depart_name,id"
pidField="parent_id"
placeholder="请选择车间"
condition='{"org_category":"2"}'
hasChildField="1"
>
</j-tree-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationName" label="工位名称"> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationName" label="工位名称">
<a-input placeholder="请输入工位名称" v-model="model.stationName"/> <a-input placeholder="请输入工位名称" v-model="model.stationName"/>
@ -37,7 +42,7 @@
</template> </template>
<script> <script>
import {httpAction} from '@/api/manage' import {getAction, httpAction} from '@/api/manage'
import moment from "moment" import moment from "moment"
export default { export default {
@ -79,6 +84,20 @@ export default {
created() { created() {
}, },
methods: { methods: {
async bianhao() {
//var n=6
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
//let num = res.result;
console.log("+6++++aaa: " + res.result)
//num=num.toString()
//while(num.length<n){
//num="0"+num
//}
//console.log(num)
this.model.nums = res.result;
})
},
add() { add() {
// //
this.edit({}); this.edit({});

@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.List;
/** /**
* @Description: 车间工位管理 * @Description: 车间工位管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -45,10 +47,28 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (ObjectUtils.isEmpty(entity)) { if (ObjectUtils.isEmpty(entity)) {
throw new JeecgBootException(id + "不存在"); throw new JeecgBootException(id + "不存在");
} }
Station station = new Station(); List<Station> list = this.list(new LambdaQueryWrapper<Station>().orderByDesc(Station::getStationNum));
station.setId(id); Integer maxStationNum = list.get(0).getStationNum();
station.setStationNum(entity.getStationNum() + 1); //最后一条不能下移
this.updateById(station); if (maxStationNum.intValue() != entity.getStationNum()) {
//先把下一编号减1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() + 1));
// station1.setStationNum(null);
this.lambdaUpdate().set(Station::getStationNum, 333).eq(Station::getId, station1.getId()).update();
// Station station = new Station();
// station.setId(id);
// station.setStationNum(null);
this.lambdaUpdate().set(Station::getStationNum, 666).eq(Station::getId, id).update();
// station.setStationNum(entity.getStationNum() + 1);
// this.updateById(station);
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() + 1).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() - 1).eq(Station::getId, station1.getId()).update();
// station1.setStationNum(entity.getStationNum() - 1);
// this.updateById(station1);
}
} }
@Override @Override
@ -57,11 +77,23 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (ObjectUtils.isEmpty(entity)) { if (ObjectUtils.isEmpty(entity)) {
throw new JeecgBootException(id + "不存在"); throw new JeecgBootException(id + "不存在");
} }
//第一条不能上移
if (entity.getStationNum() > 1) { if (entity.getStationNum() > 1) {
//先把上一编号加1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() - 1));
station1.setStationNum(null);
this.updateById(station1);
Station station = new Station(); Station station = new Station();
station.setId(id); station.setId(id);
station.setStationNum(null);
this.updateById(station);
station.setStationNum(entity.getStationNum() - 1); station.setStationNum(entity.getStationNum() - 1);
this.updateById(station); this.updateById(station);
station1.setStationNum(entity.getStationNum() + 1);
this.updateById(station1);
} }
} }
} }

Loading…
Cancel
Save