diff --git a/erp-produce/src/main/resources/template/js/departmentMachining/departmentMachiningList.js b/erp-produce/src/main/resources/template/js/departmentMachining/departmentMachiningList.js index 5c153986848ce047ed5e6202d03c37d1ef60aff1..ba0e3334b105829e4bb2f79e1f0a02b0027ac4c6 100644 --- a/erp-produce/src/main/resources/template/js/departmentMachining/departmentMachiningList.js +++ b/erp-produce/src/main/resources/template/js/departmentMachining/departmentMachiningList.js @@ -106,7 +106,7 @@ layui.config({ // 甘特图 function gantt(data) { _openNewWindows({ - url: "../../tpl/departmentMachining/machiningGantt.html?objectId=" + data.id + '&objectKey=' + data.serviceClassName, + url: "../../tpl/departmentMachining/machiningGantt.html?id=" + data.id, title: "车间任务安排甘特图", pageId: "machiningGantt", area: ['90vw', '90vh'], diff --git a/erp-produce/src/main/resources/template/js/departmentMachining/machiningGantt.js b/erp-produce/src/main/resources/template/js/departmentMachining/machiningGantt.js index d6542e1f05e816897a526f33942bb9e2b972e364..8f3ac86c25629d4aecb0f99090013c7ed88d8f01 100644 --- a/erp-produce/src/main/resources/template/js/departmentMachining/machiningGantt.js +++ b/erp-produce/src/main/resources/template/js/departmentMachining/machiningGantt.js @@ -1,5 +1,3 @@ -var objectKey = ""; -var objectId = ""; layui.config({ base: basePath, @@ -9,48 +7,37 @@ layui.config({ }).define(['window', 'jquery', 'winui', 'form', 'laydate'], function (exports) { winui.renderColor(); var $ = layui.$, - form = layui.form, - layer = layui.layer, - laydate = layui.laydate; - objectKey = GetUrlParam("objectKey"); - objectId = GetUrlParam("objectId"); - if (isNull(objectKey) || isNull(objectId)) { - winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); - return false; - } + form = layui.form; + var id = GetUrlParam("id"); - // 根据供应商id获取所有审批通过之后的里程碑列表 - let milestoneList = []; - AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinById", params: {id: objectId}, type: 'json', method: 'GET', callback: function (json) { - $("#milestoneId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), json)); - milestoneList = json.bean.machinChildList; - console.log(1,json) - console.log(2,milestoneList) - - // var authPermission = teamObjectPermissionUtil.checkTeamBusinessAuthPermission(objectId, 'taskAuthEnum'); - // var btnStr = `
`; - // var firstBtn = true; - // if (authPermission['list']) { - // var defaultClassName = firstBtn ? 'plan-select' : ''; - // firstBtn = false; - // btnStr += `` - // } - // if (authPermission['myExecute']) { - // var defaultClassName = firstBtn ? 'plan-select' : ''; - // firstBtn = false; - // btnStr += `` - // } - // if (authPermission['myCreate']) { - // var defaultClassName = firstBtn ? 'plan-select' : ''; - // btnStr += `` - // } - // btnStr += `
`; - // $(".txtcenter").before(btnStr); + // 根据id查询加工单信息 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinForGanttById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) { + console.log(json) matchingLanguage(); form.render(); renderPanel(); - render(); + // render(); + + gantt.clearAll(); //清空缓存 + let nodeList = json.bean.node; + if (isNull(nodeList) || nodeList.length == 0) { + return; + } + $.each(nodeList, function (i, item) { + item.start_date = new Date(item.start_date); + item.end_date = new Date(item.end_date); + }); + let linkList = json.bean.link; + if (isNull(linkList) || linkList.length == 0) { + linkList = []; + } + // 解析 + gantt.parse({ + data: nodeList, + links: linkList + }); + }}); function renderPanel() { @@ -140,44 +127,43 @@ layui.config({ gantt.init("device_load"); gantt.i18n.setLocale("cn"); //使用中文 - function render() { - let milestoneId = $("#milestoneId").val(); - if (isNull(milestoneId)) { - winui.window.msg("请选择产品", {icon: 2, time: 2000}); - return false; - } - let params = { - id: objectId, - // objectKey: objectKey, - // holderId: milestoneId, - // type: $("#type .plan-select").attr("data-type") - }; - var tem = getInPoingArr(milestoneList, "id", milestoneId, null); - gantt.config.start_date = new Date(tem.startTime); - gantt.config.end_date = new Date(tem.endTime); - console.log(999) - AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinForGanttById", params: params, type: 'json', method: 'GET', callback: function (json) { - console.log(88,json) - gantt.clearAll(); //清空缓存 - let nodeList = json.bean.node; - if (isNull(nodeList) || nodeList.length == 0) { - return; - } - $.each(nodeList, function (i, item) { - item.start_date = new Date(item.start_date); - item.end_date = new Date(item.end_date); - }); - let linkList = json.bean.link; - if (isNull(linkList) || linkList.length == 0) { - linkList = []; - } - // 解析 - gantt.parse({ - data: nodeList, - links: linkList - }); - }}); - } + // function render() { + // let milestoneId = $("#milestoneId").val(); + // if (isNull(milestoneId)) { + // winui.window.msg("请选择产品", {icon: 2, time: 2000}); + // return false; + // } + // let params = { + // id: objectId, + // // objectKey: objectKey, + // // holderId: milestoneId, + // // type: $("#type .plan-select").attr("data-type") + // }; + // var tem = getInPoingArr(milestoneList, "id", milestoneId, null); + // gantt.config.start_date = new Date(tem.startTime); + // gantt.config.end_date = new Date(tem.endTime); + // console.log(999) + // AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinForGanttById", params: params, type: 'json', method: 'GET', callback: function (json) { + // gantt.clearAll(); //清空缓存 + // let nodeList = json.bean.node; + // if (isNull(nodeList) || nodeList.length == 0) { + // return; + // } + // $.each(nodeList, function (i, item) { + // item.start_date = new Date(item.start_date); + // item.end_date = new Date(item.end_date); + // }); + // let linkList = json.bean.link; + // if (isNull(linkList) || linkList.length == 0) { + // linkList = []; + // } + // // 解析 + // gantt.parse({ + // data: nodeList, + // links: linkList + // }); + // }}); + // } $("body").on("click", ".type-btn", function (e) { $(this).parent().find('.type-btn').removeClass("plan-select"); diff --git a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinList.js b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinList.js index 16c1417f7cc119d23275bb2b196e53df546624be..981caed2d143bc94c5be719490bffca189d8e573 100644 --- a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinList.js +++ b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinList.js @@ -24,31 +24,39 @@ layui.config({ limits: getLimits(), limit: getLimit(), cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers' }, - { field: 'oddNumber', rowspan: '2', title: '单据编号', align: 'center', width: 180, templet: function (d) { - return '' + d.oddNumber + ''; - }}, - { field: 'productionMation', rowspan: '2', title: '生产计划单', align: 'center', width: 200, templet: function (d) {return isNull(d.productionMation) ? '' : d.productionMation.oddNumber}}, - { colspan: '3', title: '加工成品信息', align: 'center' }, + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers', rowspan: '2' }, + { field: 'oddNumber', title: '单号', rowspan: '2', width: 200, align: 'center', templet: function (d) { + var str = '' + d.oddNumber + ''; + if (!isNull(d.fromId)) { + str += '[转]'; + } + return str; + }}, + { colspan: '2', title: '来源单据信息', align: 'center' }, { field: 'processInstanceId', rowspan: '2', title: '流程ID', width: 100, templet: function (d) { return '' + getNotUndefinedVal(d.processInstanceId) + ''; }}, { field: 'state', rowspan: '2', title: '状态', width: 90, templet: function (d) { return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("machinStateEnum", 'id', d.state, 'name'); }}, - { colspan: '3', title: '加工信息', align: 'center' }, + { field: 'pickState', rowspan: '2', title: '领料状态', width: 90, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("machinPickStateEnum", 'id', d.pickState, 'name'); + }}, + { field: 'departmentMation', title: '加工部门', rowspan: '2', align: 'left', width: 200, templet: function (d) { + return getNotUndefinedVal(d.departmentMation?.name); + }}, { field: 'createName', rowspan: '2', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, { field: 'createTime', rowspan: '2', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { field: 'lastUpdateName', rowspan: '2', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, { field: 'lastUpdateTime', rowspan: '2', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, - { title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'} + { title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar'} ], [ - { field: 'materialMation', title: '名称', align: 'left', width: 120, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}}, - { field: 'normsMation', title: '规格', align: 'left', width: 200, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}}, - { field: 'needNum', title: '加工数量', align: 'center', width: 80 }, - { field: 'departmentMation', title: '加工部门', align: 'left', width: 100, templet: function (d) {return isNull(d.departmentMation) ? '' : d.departmentMation.name}}, - { field: 'startTime', title: '开始时间', align: 'center', width: 150 }, - { field: 'endTime', title: '结束时间', align: 'center', width: 150 } + { field: 'fromTypeId', title: '来源类型', width: 150, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("machinFromType", 'id', d.fromTypeId, 'name'); + }}, + { field: 'fromId', title: '单据编号', width: 200, templet: function (d) { + return getNotUndefinedVal(d.fromMation?.oddNumber); + }}, ]], done: function(json) { matchingLanguage(); @@ -69,6 +77,12 @@ layui.config({ edit(data); } else if (layEvent === 'subApproval') { // 提交审核 subApproval(data); + }else if (layEvent === 'processingToMaterialRequisition') { //转领料单 + processingToMaterialRequisition(data); + } else if (layEvent === 'processingToSupplementMaterials') { //转补料单 + processingToSupplementMaterials(data); + } else if (layEvent === 'processingToReturnMaterials') { //转退料单 + processingToReturnMaterials(data); } else if (layEvent === 'processDetails') { // 工作流流程详情查看 activitiUtil.activitiDetails(data); } else if (layEvent === 'revoke') { //撤销 @@ -76,6 +90,44 @@ layui.config({ } }); + // 转领料单 + function processingToMaterialRequisition(data) { + _openNewWindows({ + url: "../../tpl/erpMachin/processingToMaterialRequisition.html?id=" + data.id, + title: "转领料单", + pageId: "processingToMaterialRequisition", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + } + //转补料单 + function processingToSupplementMaterials(data){ + _openNewWindows({ + url: "../../tpl/erpMachin/processingToSupplementMaterials.html?id=" + data.id, + title: '转补料单', + pageId: "processingToSupplementMaterials", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + } + + //转退料单 + function processingToReturnMaterials(data){ + _openNewWindows({ + url: "../../tpl/erpMachin/processingToReturnMaterials.html?id=" + data.id, + title: '转退料单', + pageId: "processingToReturnMaterials", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + } + // 添加 $("body").on("click", "#addBean", function() { _openNewWindows({ diff --git a/erp-produce/src/main/resources/template/js/erpMachin/processingToMaterialRequisition.js b/erp-produce/src/main/resources/template/js/erpMachin/processingToMaterialRequisition.js new file mode 100644 index 0000000000000000000000000000000000000000..55deabd0f9b8082a6f50b11430c70d7149523e02 --- /dev/null +++ b/erp-produce/src/main/resources/template/js/erpMachin/processingToMaterialRequisition.js @@ -0,0 +1,47 @@ + +// 以下两个参数开启团队权限时有值 +var objectId = '', objectKey = ''; +// 根据以下两个参数判断:工作流的判断是否要根据serviceClassName的判断 +var serviceClassName; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var id = GetUrlParam("id"); + + // 加工单转领料单 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinTransRequestById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) { + let data = json.bean; + // data.pickChildList =data.machinChildList + // 领料单的【编辑布局】 + dsFormUtil.initEditPageForStatic('content', 'FP2023100500002', data, { + savePreParams: function (params) { + }, + saveData: function (params) { + // 保存数据 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "insertMachinToPickRequest", params: params, type: 'json', method: "POST", callback: function(json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + + }, + loadComponentCallback: function () { + // $("select[attrkey='departmentId']").prop('disabled', true); + $("div[controlType='pickFromType']").remove(); + }, + tableAddRowCallback: function (tableId) { + // $("#addRow" + tableId).remove(); + // $("div[controlType='simpleTable']").find(".chooseProductBtn").prop('disabled', true); + // $("div[controlType='simpleTable']").find(".normsId").prop('disabled', true); + + } + }); + }}); + +}); \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/js/erpMachin/processingToReturnMaterials.js b/erp-produce/src/main/resources/template/js/erpMachin/processingToReturnMaterials.js new file mode 100644 index 0000000000000000000000000000000000000000..b29ef51225395d60e933f3914242b9577858b8e0 --- /dev/null +++ b/erp-produce/src/main/resources/template/js/erpMachin/processingToReturnMaterials.js @@ -0,0 +1,47 @@ + +// 以下两个参数开启团队权限时有值 +var objectId = '', objectKey = ''; +// 根据以下两个参数判断:工作流的判断是否要根据serviceClassName的判断 +var serviceClassName; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var id = GetUrlParam("id"); + + // 加工单转退料单 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinTransReturnById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) { + let data = json.bean; + // data.pickChildList =data.machinChildList + // 退料单的【编辑布局】 + dsFormUtil.initEditPageForStatic('content', 'FP2023100600006', data, { + savePreParams: function (params) { + }, + saveData: function (params) { + // 保存数据 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "insertMachinToPickReturn", params: params, type: 'json', method: "POST", callback: function(json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + + }, + loadComponentCallback: function () { + // $("select[attrkey='departmentId']").prop('disabled', true); + $("div[controlType='pickFromType']").remove(); + }, + tableAddRowCallback: function (tableId) { + // $("#addRow" + tableId).remove(); + // $("div[controlType='simpleTable']").find(".chooseProductBtn").prop('disabled', true); + // $("div[controlType='simpleTable']").find(".normsId").prop('disabled', true); + + } + }); + }}); + +}); \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/js/erpMachin/processingToSupplementMaterials.js b/erp-produce/src/main/resources/template/js/erpMachin/processingToSupplementMaterials.js new file mode 100644 index 0000000000000000000000000000000000000000..1d3f3436ef0e56e55e95244133c17437950f0019 --- /dev/null +++ b/erp-produce/src/main/resources/template/js/erpMachin/processingToSupplementMaterials.js @@ -0,0 +1,47 @@ + +// 以下两个参数开启团队权限时有值 +var objectId = '', objectKey = ''; +// 根据以下两个参数判断:工作流的判断是否要根据serviceClassName的判断 +var serviceClassName; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var id = GetUrlParam("id"); + + // 加工单转补料单 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinTransRequestById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) { + let data = json.bean; + // data.pickChildList =data.machinChildList + // 领料的【编辑布局】 + dsFormUtil.initEditPageForStatic('content', 'FP2023100600002', data, { + savePreParams: function (params) { + }, + saveData: function (params) { + // 保存数据 + AjaxPostUtil.request({url: sysMainMation.erpBasePath + "insertMachinToPickPatch", params: params, type: 'json', method: "POST", callback: function(json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + + }, + loadComponentCallback: function () { + // $("select[attrkey='departmentId']").prop('disabled', true); + $("div[controlType='pickFromType']").remove(); + }, + tableAddRowCallback: function (tableId) { + // $("#addRow" + tableId).remove(); + // $("div[controlType='simpleTable']").find(".chooseProductBtn").prop('disabled', true); + // $("div[controlType='simpleTable']").find(".normsId").prop('disabled', true); + + } + }); + }}); + +}); \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpMachin/erpMachinList.html b/erp-produce/src/main/resources/template/tpl/erpMachin/erpMachinList.html index db6c74cc5d7c914f219a61a3c90297d07282edc0..3a0598f8cb1a8b2cd2ee35359800d44646d3f282 100644 --- a/erp-produce/src/main/resources/template/tpl/erpMachin/erpMachinList.html +++ b/erp-produce/src/main/resources/template/tpl/erpMachin/erpMachinList.html @@ -33,6 +33,17 @@ 撤销 {{# } }} {{# } }} + {{# if (d.state == 'pass') { }} + {{# if (auth('1721379823318')) { }} + 转领料单 + {{# } }} + {{# if (auth('1721379731773')) { }} + 转补料单 + {{# } }} + {{# if (auth('1721379845821')) { }} + 转退料单 + {{# } }} + {{# } }} diff --git a/erp-produce/src/main/resources/template/tpl/erpMachin/processingToMaterialRequisition.html b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToMaterialRequisition.html new file mode 100644 index 0000000000000000000000000000000000000000..df8ce0b1aee60a81ab1dfd2034f8b9041d5d10ff --- /dev/null +++ b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToMaterialRequisition.html @@ -0,0 +1,29 @@ + + + + + + + + + +
+
+
+
+
+ + ` + +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpMachin/processingToReturnMaterials.html b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToReturnMaterials.html new file mode 100644 index 0000000000000000000000000000000000000000..afc656f8d3df4895e11711c7036299533738728f --- /dev/null +++ b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToReturnMaterials.html @@ -0,0 +1,29 @@ + + + + + + + + + +
+
+
+
+
+ + ` + +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/erp-produce/src/main/resources/template/tpl/erpMachin/processingToSupplementMaterials.html b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToSupplementMaterials.html new file mode 100644 index 0000000000000000000000000000000000000000..b51ba5413f81b9271f3dfdd92ad039bcf81b5b98 --- /dev/null +++ b/erp-produce/src/main/resources/template/tpl/erpMachin/processingToSupplementMaterials.html @@ -0,0 +1,29 @@ + + + + + + + + + +
+
+
+
+
+ + ` + +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/pro/src/main/resources/template/js/proTask/taskGantt.js b/pro/src/main/resources/template/js/proTask/taskGantt.js index 088b73cfc90d9d6f65d9aa3da1737908f4f7e897..67b81ce7ee3215661b9f9e29d8c92479e76fcf99 100644 --- a/pro/src/main/resources/template/js/proTask/taskGantt.js +++ b/pro/src/main/resources/template/js/proTask/taskGantt.js @@ -24,8 +24,6 @@ layui.config({ AjaxPostUtil.request({url: sysMainMation.projectBasePath + "queryAllApprovalMilestoneList", params: {objectId: objectId}, type: 'json', method: 'GET', callback: function (json) { $("#milestoneId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), json)); milestoneList = json.rows; - console.log(123,json.rows) - console.log(456,milestoneList) var authPermission = teamObjectPermissionUtil.checkTeamBusinessAuthPermission(objectId, 'taskAuthEnum'); var btnStr = `
`;