生产计划管理优化 1.16

zhc4dev
zhc077 2 years ago
parent da123bbd70
commit 08c69bdb0e
  1. 63
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  2. 64
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  3. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java
  4. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java

@ -109,13 +109,26 @@
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a v-if="record.status===0" @click="handleEdit(record)">编辑
<a-divider type="vertical"/> <a-divider type="vertical"/>
</a>
<!-- <a v-else disabled="true">编辑</a>-->
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a v-if="record.status===0">删除</a>
<!-- <a v-else disabled="true">删除</a>-->
<a-divider type="vertical"/>
</a-popconfirm> </a-popconfirm>
<a v-if="record.status ===8" disabled="true">撤销</a>
<a v-else @click="chexiao(record)">撤销</a>
<a-divider type="vertical"/>
<a @click="jumpPage1(record)">管理</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a @click="getPaiWeiTu(record)">生产计划排位图</a>
<a @click="getPaiWeiTu(record)">查看排位图</a>
</span> </span>
</a-table> </a-table>
@ -131,7 +144,7 @@ import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyProductPlanModal from './modules/ZyProductPlanModal' import ZyProductPlanModal from './modules/ZyProductPlanModal'
import {getAction} from "@api/manage"; import {getAction, putAction, httpAction, postAction} from "@api/manage";
import {filterObj} from "@/utils/util"; import {filterObj} from "@/utils/util";
export default { export default {
@ -182,7 +195,7 @@ export default {
{ {
title: '车间负责人', title: '车间负责人',
align: "center", align: "center",
dataIndex: 'responsiblePerson' dataIndex: 'responsiblePerson_dictText'
}, },
// { // {
// title: '', // title: '',
@ -204,16 +217,7 @@ export default {
width: 150, width: 150,
align: "center", align: "center",
dataIndex: 'workTime', dataIndex: 'workTime',
// customRender: function (text) {
// return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
// }
}, },
/*{
title: '创建时间', width:150,
dataIndex: 'createTime',
align:"center",
// sorter:true
},*/
{ {
title: '生产时长', title: '生产时长',
align: "center", align: "center",
@ -234,7 +238,7 @@ export default {
{ {
title: '审核人', title: '审核人',
align: "center", align: "center",
dataIndex: 'auditBy' dataIndex: 'auditBy_dictText'
}, },
{ {
title: '审核时间', title: '审核时间',
@ -257,6 +261,7 @@ export default {
url: { url: {
list: "/org.jeecg.modules.productplan/zyProductPlan/list", list: "/org.jeecg.modules.productplan/zyProductPlan/list",
paiweitu: "/org.jeecg.modules.productplan/zyProductPlan/paiweitu", paiweitu: "/org.jeecg.modules.productplan/zyProductPlan/paiweitu",
updateStatus: "/org.jeecg.modules.productplan/zyProductPlan/edit",
delete: "/org.jeecg.modules.productplan/zyProductPlan/delete", delete: "/org.jeecg.modules.productplan/zyProductPlan/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyProductPlan/deleteBatch", deleteBatch: "/org.jeecg.modules.productplan/zyProductPlan/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyProductPlan/exportXls", exportXlsUrl: "/org.jeecg.modules.productplan/zyProductPlan/exportXls",
@ -276,6 +281,34 @@ export default {
// }, // },
}, },
methods: { methods: {
jumpPage1(record) {
this.$router.push({
path: '/team/StationMachineList',
query: { //
'plan': record.id,
// 'stationName': record.stationName,
// 'stationNum': record.stationNum,
// 'departName': record.departName,
},
});
},
chexiao(record) {
let parma = {
"id": record.id,
"status": '8',
}
putAction(this.url.updateStatus, parma).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getPaiWeiTu(record) { getPaiWeiTu(record) {
// alert(JSON.stringify(record)); // alert(JSON.stringify(record));
getAction(this.url.paiweitu, record).then((res) => { getAction(this.url.paiweitu, record).then((res) => {

@ -29,11 +29,13 @@
prop="responsiblePerson"> prop="responsiblePerson">
<!-- <j-select-multi-user placeholder="请选择车间负责人"--> <!-- <j-select-multi-user placeholder="请选择车间负责人"-->
<!-- v-model="model.responsiblePerson"></j-select-multi-user>--> <!-- v-model="model.responsiblePerson"></j-select-multi-user>-->
<!-- <j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson"--> <!-- <j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson"-->
<!-- :multiple="false"></j-select-multi-user>--> <!-- :multiple="false"></j-select-multi-user>-->
<j-dict-select-tag type="list" v-model="model.responsiblePerson" <j-dict-select-tag type="list" v-model="model.responsiblePerson"
placeholder="请选择车间负责人" :disabled="model.workshopId==null"/> placeholder="请选择车间负责人"
:dict-code="departManger"
:disabled="model.workshopId==null"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -49,7 +51,7 @@
<a-form-model-item label="组长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamLeader"> <a-form-model-item label="组长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamLeader">
<!-- <a-input v-model="model.teamLeader" placeholder="请输入组长"></a-input>--> <!-- <a-input v-model="model.teamLeader" placeholder="请输入组长"></a-input>-->
<j-dict-select-tag type="list" v-model="model.teamLeader" <j-dict-select-tag type="list" v-model="model.teamLeader"
placeholder="请选择组长" :dict-code="groupxVal2" placeholder="请选择组长" :dict-code="teamLeaderVal"
:disabled="model.teamId==null"/> :disabled="model.teamId==null"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@ -73,8 +75,11 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditBy"> <a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditBy">
<j-select-multi-user placeholder="请选择审核人" v-model="model.auditBy" <!-- <j-select-multi-user placeholder="请选择审核人" v-model="model.auditBy" -->
:multiple="false"></j-select-multi-user> <!-- :multiple="false"></j-select-multi-user>-->
<j-dict-select-tag type="list" v-model="model.auditBy"
placeholder="请选择审核人"
:dict-code="auditByVal"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -113,14 +118,16 @@ export default {
}, },
data() { data() {
return { return {
departManger: "sys_user,realname,username",
auditByVal: "sys_user,realname,username",
groupxVal: "groupx,group_name,id", groupxVal: "groupx,group_name,id",
groupxVal2: "sys_user,realname,id", teamLeaderVal: "sys_user,realname,username",
model: { model: {
workTime: new Date(), workTime: '',
status:0, status: 0,
auditBy:66, auditTimr: '',
auditTimr: new Date(), speedUp: 0,
speedUp:0, auditBy: 'admin',
}, },
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
@ -169,30 +176,39 @@ export default {
// this.getNowDate(); // // this.getNowDate(); //
}, },
methods: { methods: {
departSelected() { //
// 1,()
// 2,()
getGroupxValChange() {
this.departManger = "sys_user,realname,username,id in (select user_id from sys_user_depart where dep_id='" + this.model.workshopId + "')";
this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'";
this.auditByVal = "sys_user,realname,username,id in (select user_id from sys_user_depart where dep_id='" + this.model.workshopId + "')";
},
//
getEnterprisesManagerValChange() {
// this.teamLeaderVal = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')";
let that = this; let that = this;
let param = { let param = {
"id": that.model.workshopId, "id": that.model.teamId,
} }
// alert(param.toString()); // alert(param.toString());
getAction(that.url.groupxList, param).then((res) => { getAction(that.url.groupxList, param).then((res) => {
if (res.success) { if (res.success) {
// console.log("----------" + JSON.stringify(res.result.records)) // console.log("----------" + JSON.stringify(res.result.records))
let phone = JSON.stringify(res.result.records[0].enterprisesNanager); let enterprisesManager = JSON.stringify(res.result.records[0].enterprisesManager_dictText);
that.model = Object.assign(that.model, {'mobile': phone}); // enterprisesManager.replace('"',"")
enterprisesManager = enterprisesManager.substring(1, enterprisesManager.length - 1);
that.model = Object.assign(that.model, {'teamLeader': enterprisesManager});
this.$forceUpdate(); this.$forceUpdate();
} }
}); });
},
getGroupxValChange() {
this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'";
this.departSelected();
},
getEnterprisesManagerValChange() {
this.groupxVal2 = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')";
}, },
add() { add() {
this.edit(this.modelDefault); this.edit(this.modelDefault);
this.getNowDate();
// console.log(this.model.workTime);
}, },
edit(record) { edit(record) {
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
@ -256,6 +272,8 @@ export default {
seconds = "0" + seconds; seconds = "0" + seconds;
} }
this.model.workTime = year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds; this.model.workTime = year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
this.model.auditTimr = year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
}, },
}, },

@ -17,7 +17,9 @@ import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.workproduct.entity.ZyProduct; import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService; import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -48,6 +50,9 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@Autowired @Autowired
private ISysDepartService iSysDepartService; private ISysDepartService iSysDepartService;
@Autowired
private ISysUserService iSysUserService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -57,7 +62,7 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
* @param req * @param req
* @return * @return
*/ */
@AutoLog(value = "生产计划-分页列表查询") // @AutoLog(value = "生产计划-分页列表查询")
@ApiOperation(value = "生产计划-分页列表查询", notes = "生产计划-分页列表查询") @ApiOperation(value = "生产计划-分页列表查询", notes = "生产计划-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> queryPageList(ZyProductPlan zyProductPlan, public Result<?> queryPageList(ZyProductPlan zyProductPlan,
@ -83,7 +88,7 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
* @param zyProductPlan * @param zyProductPlan
* @return * @return
*/ */
@AutoLog(value = "生产计划-添加") // @AutoLog(value = "生产计划-添加")
@ApiOperation(value = "生产计划-添加", notes = "生产计划-添加") @ApiOperation(value = "生产计划-添加", notes = "生产计划-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) { public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) {
@ -95,6 +100,8 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId()); SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : ""); zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
} }
SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getRealname, zyProductPlan.getTeamLeader()));
zyProductPlan.setTeamLeader(sysUser.getUsername());
zyProductPlanService.save(zyProductPlan); zyProductPlanService.save(zyProductPlan);
//TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划) //TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划)
return Result.OK("添加成功!"); return Result.OK("添加成功!");

@ -85,6 +85,7 @@ public class ZyProductPlan implements Serializable {
*/ */
@Excel(name = "车间负责人", width = 15) @Excel(name = "车间负责人", width = 15)
@ApiModelProperty(value = "车间负责人") @ApiModelProperty(value = "车间负责人")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String responsiblePerson; private String responsiblePerson;
/** /**
* 班组 * 班组
@ -98,7 +99,7 @@ public class ZyProductPlan implements Serializable {
*/ */
@Excel(name = "组长", width = 15) @Excel(name = "组长", width = 15)
@ApiModelProperty(value = "组长") @ApiModelProperty(value = "组长")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String teamLeader; private String teamLeader;
/** /**
* 生产开始时间 * 生产开始时间
@ -133,6 +134,7 @@ public class ZyProductPlan implements Serializable {
*/ */
@Excel(name = "审核人", width = 15) @Excel(name = "审核人", width = 15)
@ApiModelProperty(value = "审核人") @ApiModelProperty(value = "审核人")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
private String auditBy; private String auditBy;
/** /**
* 审核时间 * 审核时间

Loading…
Cancel
Save