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/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 = `
`;