diff --git a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs index 218965ea..ff1395f8 100644 --- a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs @@ -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) data = (0,null); + (List,int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color); return ToResponse(new ApiResult(200, "success", data)); } diff --git a/ZR.Model/MES/pro/ProWorkplan.cs b/ZR.Model/MES/pro/ProWorkplan.cs index e93147e8..14400df6 100644 --- a/ZR.Model/MES/pro/ProWorkplan.cs +++ b/ZR.Model/MES/pro/ProWorkplan.cs @@ -31,7 +31,7 @@ namespace ZR.Model.mes.pro /// 来源 /// [SugarColumn(ColumnName = "source")] - public int? Source { get; set; } + public string Source { get; set; } /// /// 零件号 /// diff --git a/ZR.Service/mes/pro/IService/IProWorkplanService.cs b/ZR.Service/mes/pro/IService/IProWorkplanService.cs new file mode 100644 index 00000000..b9566ce8 --- /dev/null +++ b/ZR.Service/mes/pro/IService/IProWorkplanService.cs @@ -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,int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color); + } +} diff --git a/ZR.Service/mes/pro/ProWorkplanService.cs b/ZR.Service/mes/pro/ProWorkplanService.cs new file mode 100644 index 00000000..24613569 --- /dev/null +++ b/ZR.Service/mes/pro/ProWorkplanService.cs @@ -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, IProWorkplanService + { + public (List, int) GetAllData(int pageNum, int pageSize, int year, int week, string partNumber, string color) + { + var predicate = Expressionable.Create() + .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 proWorkplanList = Context.Queryable().Where(predicate).ToPageList(pageNum, pageSize, ref totalCount); + return (proWorkplanList, totalCount); + } + } +} diff --git a/ZR.Vue/package.json b/ZR.Vue/package.json index 63fe7db3..d49c412b 100644 --- a/ZR.Vue/package.json +++ b/ZR.Vue/package.json @@ -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", diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 749e95ac..e85e1c78 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -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() diff --git a/ZR.Vue/src/views/productManagement/workplan.vue b/ZR.Vue/src/views/productManagement/workplan.vue index 00995a8f..d6c9b254 100644 --- a/ZR.Vue/src/views/productManagement/workplan.vue +++ b/ZR.Vue/src/views/productManagement/workplan.vue @@ -20,17 +20,35 @@
- 新建生产计划 + 新建生产计划 - + - + + + - + + + @@ -62,6 +80,87 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
新建生产工单 @@ -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; +}