继续
This commit is contained in:
parent
57e9b714ae
commit
06f346ba66
@ -1,5 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Service.mes.pro.IService;
|
||||
using ZR.Service.MES.md;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
@ -9,11 +11,19 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
[Route("mes/pro/workplan")]
|
||||
public class ProWorkplanController : BaseController
|
||||
{
|
||||
private readonly IProWorkplanService proWorkplanService;
|
||||
|
||||
public ProWorkplanController(IProWorkplanService proWorkplanService)
|
||||
{
|
||||
this.proWorkplanService = proWorkplanService;
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpGet("list")]
|
||||
public IActionResult List(int pageNum, int pageSize, int year , int week,string partNumber="",string color="")
|
||||
public IActionResult List(int pageNum, int pageSize, int year, int week, string partNumber = "", string color = "")
|
||||
{
|
||||
(int, List<MdBom>) data = (0,null);
|
||||
(List<ProWorkplan>,int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ namespace ZR.Model.mes.pro
|
||||
/// 来源
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "source")]
|
||||
public int? Source { get; set; }
|
||||
public string Source { get; set; }
|
||||
/// <summary>
|
||||
/// 零件号
|
||||
///</summary>
|
||||
|
||||
17
ZR.Service/mes/pro/IService/IProWorkplanService.cs
Normal file
17
ZR.Service/mes/pro/IService/IProWorkplanService.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.op.DTO;
|
||||
|
||||
namespace ZR.Service.mes.pro.IService
|
||||
{
|
||||
public interface IProWorkplanService
|
||||
{
|
||||
|
||||
public (List<ProWorkplan>,int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color);
|
||||
}
|
||||
}
|
||||
34
ZR.Service/mes/pro/ProWorkplanService.cs
Normal file
34
ZR.Service/mes/pro/ProWorkplanService.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Service.mes.pro.IService;
|
||||
using ZR.Service.MES.md.IService;
|
||||
|
||||
namespace ZR.Service.mes.pro
|
||||
{
|
||||
|
||||
[AppService(ServiceType = typeof(IProWorkplanService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProWorkplanService : BaseService<ProWorkplan>, IProWorkplanService
|
||||
{
|
||||
public (List<ProWorkplan>, int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProWorkplan>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(!string.IsNullOrEmpty(partNumber), it => it.Partnumber.Contains( partNumber))
|
||||
.AndIF(!string.IsNullOrEmpty(color), it => it.Color.Contains(color))
|
||||
.ToExpression();
|
||||
int totalCount = 0;
|
||||
List<ProWorkplan> proWorkplanList = Context.Queryable<ProWorkplan>().Where(predicate).ToPageList(pageNum, pageSize, ref totalCount);
|
||||
return (proWorkplanList, totalCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,6 +23,7 @@
|
||||
"@jiaminghi/data-view": "^2.10.0",
|
||||
"@microsoft/signalr": "^6.0.23",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"af-table-column": "^1.0.3",
|
||||
"axios": "^0.21.4",
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "3.6.5",
|
||||
|
||||
@ -41,6 +41,11 @@ import "@/vxe.scss"
|
||||
|
||||
import dataV from '@jiaminghi/data-view'
|
||||
|
||||
//需要按需引入,先引入vue并引入element-ui
|
||||
import AFTableColumn from 'af-table-column'
|
||||
|
||||
|
||||
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
@ -83,7 +88,7 @@ Vue.use(Element, {
|
||||
|
||||
Vue.use(VXETable)
|
||||
Vue.use(dataV)
|
||||
|
||||
Vue.use(AFTableColumn)
|
||||
|
||||
DictData.install()
|
||||
|
||||
|
||||
@ -20,17 +20,35 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16"> <el-button type="primary">新建生产计划</el-button> </el-col>
|
||||
<el-col :span="16"> <el-button type="primary" @click="newplan">新建生产计划</el-button> </el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table border stripe :data="workplanList" v-loading="loading_1" style="width: 100%" height="500" highlight-current-row @current-change="handleCurrentChange">
|
||||
<el-table
|
||||
border
|
||||
stripe
|
||||
:data="workplanList"
|
||||
v-loading="loading_1"
|
||||
style="width: 100%"
|
||||
height="500"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
>
|
||||
<el-table-column prop="id" label="流水号" sortable></el-table-column>
|
||||
<el-table-column prop="year" label="年"> </el-table-column>
|
||||
<el-table-column prop="week" label="周"> </el-table-column>
|
||||
<el-table-column prop="source" label="来源"> </el-table-column>
|
||||
<el-table-column prop="partnumber" label="零件号"> </el-table-column>
|
||||
<af-table-column prop="partnumber" label="零件号">
|
||||
<template slot-scope="scope">
|
||||
<div class="workplan_scope">{{ scope.row.partnumber }}</div>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<el-table-column prop="version" label="版本"> </el-table-column>
|
||||
<el-table-column prop="color" label="颜色"> </el-table-column>
|
||||
<af-table-column prop="color" label="颜色">
|
||||
<template slot-scope="scope">
|
||||
<div class="workplan_scope">{{ scope.row.color }}</div>
|
||||
</template>
|
||||
</af-table-column>
|
||||
<el-table-column prop="colorcode" label="颜色代码"> </el-table-column>
|
||||
<el-table-column prop="neednumber" label="本周要货数量"> </el-table-column>
|
||||
<el-table-column prop="passpercent" label="产品合格率"> </el-table-column>
|
||||
@ -62,6 +80,87 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加或修改生产计划对话框 -->
|
||||
<el-dialog :title="dialog_1.title" :visible.sync="dialog_1.open" width="98%">
|
||||
<el-form ref="dialog_1.form" :model="form" :rules="dialog_1.rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年份"> <el-input v-model="dialog_1.form.year"></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="周"> <el-input v-model="dialog_1.form.week"></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="来源">
|
||||
<el-select v-model="dialog_1.form.source" placeholder="请选择来源">
|
||||
<el-option label="订单" value="订单"></el-option>
|
||||
<el-option label="紧急插单" value="紧急插单"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="零件号"> <el-input v-model="dialog_1.form.partnumber"></el-input> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="版本"> <el-input v-model="dialog_1.form.version"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="颜色"> <el-input v-model="dialog_1.form.color"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="颜色代码"> <el-input v-model="dialog_1.form.colorcode"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="要货数量"> <el-input v-model="dialog_1.form.neednumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="产品合格率"> <el-input v-model="dialog_1.form.passpercent"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="每挂数量"> <el-input v-model="dialog_1.form.batchNumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="生产节拍"> <el-input v-model="dialog_1.form.productionRhythm"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="总挂具数"> <el-input v-model="dialog_1.form.hangerNumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单需生产挂具数量"> <el-input v-model="dialog_1.form.needhangerNumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="实际计划数量"> <el-input v-model="dialog_1.form.actualplanNumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="车数"> <el-input v-model="dialog_1.form.carNumber"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单生产时间(分钟)"> <el-input v-model="dialog_1.form.producttime"></el-input> </el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6"
|
||||
><el-form-item label="计划需求定性"> <el-input v-model="dialog_1.form.needcertainty"></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="6"
|
||||
><el-form-item label="备注"> <el-input v-model="dialog_1.form.remark"></el-input> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm_1">确 定</el-button>
|
||||
<el-button @click="cancel_1">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<div class="workordertable">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16"> <el-button type="primary">新建生产工单</el-button> </el-col>
|
||||
@ -160,24 +259,36 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loading_1:true
|
||||
loading_1: true,
|
||||
dialog_1: {
|
||||
title: '新增生产计划',
|
||||
open: false,
|
||||
rules: [],
|
||||
form: {
|
||||
year: new Date().getFullYear(),
|
||||
week: null,
|
||||
source: null,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
const query = { ...this.search, ...this.pagination }
|
||||
getWorkplanList(query).then((res)=>{
|
||||
if(res.code==200){
|
||||
this.loading_1=false;
|
||||
this.workplanList=res.data;
|
||||
this.pagination.total=res.total
|
||||
getWorkplanList(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.loading_1 = false
|
||||
this.workplanList = res.data.item1
|
||||
this.pagination.total = res.data.item2
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
newplan() {
|
||||
this.dialog_1.open = true
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -191,4 +302,8 @@ export default {
|
||||
margin-top: 50px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.workplan_scope {
|
||||
color: #1890ff;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user