diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 3d379b07..832deddf 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -1056,6 +1056,7 @@ var table = { $.modal.loading("正在处理中,请稍候..."); }, success: function (result) { + let isDetail = window.localStorage.getItem('getDetail') if (typeof callback == "function") { callback(result); } @@ -1063,6 +1064,10 @@ var table = { $.modal.closeLoading(); return } + if (isDetail) { + $.modal.closeLoading(); + return + } $.operate.ajaxSuccess(result); } }; diff --git a/ruoyi-admin/src/main/resources/templates/project/info/add.html b/ruoyi-admin/src/main/resources/templates/project/info/add.html index 0103ebdf..130d61d2 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/add.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/add.html @@ -461,7 +461,10 @@ return; } $('[name="customerCode"]').val(rows[0].customerCode); - $(' [name="customerName"]').val(rows[0].customerName); + $('[name="customerName"]').val(rows[0].customerName); + $('[name="customerUserName"]').val(rows[0].contactPerson); + $('[name="contactPhone"]').val(rows[0].contactPhone); + $.modal.close(index); } diff --git a/ruoyi-admin/src/main/resources/templates/project/info/edit.html b/ruoyi-admin/src/main/resources/templates/project/info/edit.html index f4801146..119cea5e 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html @@ -500,7 +500,9 @@ return; } $('[name="customerCode"]').val(rows[0].customerCode); - $(' [name="customerName"]').val(rows[0].customerName); + $('[name="customerName"]').val(rows[0].customerName); + $('[name="customerUserName"]').val(rows[0].contactPerson); + $('[name="contactPhone"]').val(rows[0].contactPhone); $.modal.close(index); } diff --git a/ruoyi-admin/src/main/resources/templates/project/info/project.html b/ruoyi-admin/src/main/resources/templates/project/info/project.html index 326e522f..92975eaf 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/project.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/project.html @@ -239,7 +239,7 @@ } }, { - field: 'hzSupportUser', + field: 'hzSupportUserName', title: '汇智负责人' }, { @@ -414,15 +414,11 @@ full: true, index: 1000, width: 1050, + btn: ['确定', '关闭'], yes: function (index, layero) { let body = parent.layer.getChildFrame('body', index) if ($(body.find('#form-order-add').get(0)).validate().form()) { layero.find('iframe')[0].contentWindow.saveSelect() - // $.operate.save( ctx + "project/order/add", body.find('#form-order-add').serialize(), function (res) { - // if (res.code == web_status.SUCCESS) { - // parent.layer.close(index) - // } - // }); }else{ $.modal.alertWarning("请完善表单"); diff --git a/ruoyi-admin/src/main/resources/templates/project/order/add.html b/ruoyi-admin/src/main/resources/templates/project/order/add.html index dfa6eb10..c064406b 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/add.html @@ -436,7 +436,6 @@
进货商已经签订框架协议
纸质合同流程
进货商未签订框架协议
-
保存草稿  
`, yes: function (index, layero) { @@ -449,11 +448,20 @@ function changeSaveType(val) { $('[name="processType"]').val(val) } + function changeStatus(val) { $('[name="orderStatus"]').val(val) } - function submitHandler() { + function submitHandler(type) { + if (type == 'draft') { + if (!$('[name="projectCode"]').val()) { + $.modal.alertWarning("项目编号为必填"); + return; + } + $.operate.save(prefix + "/add", $('#form-order-add').serialize()); + return + } if ($.validate.form()) { saveSelect() } else { @@ -467,6 +475,7 @@ return } window.localStorage.removeItem('projcetDataId') + window.localStorage.setItem('getDetail', 1) $.operate.get(ctx + `sip/project/query/${id}`, function (res) { let data = res.data $('#projectNameBox').text(data.projectName) @@ -480,15 +489,16 @@ $('[name="agentCode"]').val(data.agentCode); changeBg() $('[name="industryType"]').val(data.industryType); - initProjectList() + initProjectList(data) + window.localStorage.removeItem('getDetail') + }) - - } $(function () { initProductList() initProjcet() + initSaveDraft() $("input[name='estimatedOrderTime']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", @@ -947,7 +957,22 @@ ${ } - function initProjectList() { + function initProjectList(data = {}) { + if (data.id) { + $('#productTable tbody').html('') + $('#productTable2 tbody').html('') + $('#productTable3 tbody').html('') + data.softwareProjectProductInfoList ? data.softwareProjectProductInfoList.forEach((ele) => { + addProduct(ele) + }) : '' + data.hardwareProjectProductInfoList ? data.hardwareProjectProductInfoList.forEach((ele) => { + addProduct2(ele) + }) : '' + data.maintenanceProjectProductInfoList ? data.maintenanceProjectProductInfoList.forEach((ele) => { + addProduct3(ele) + }) : '' + return + } let id = $('[name="projectId"]').val() $.operate.get(ctx + `sip/project/query/${id}`, function (res) { $('#productTable tbody').html('') @@ -971,10 +996,31 @@ ${ function preview(filePath, fileName) { let iframe = window.open('', 'iframe') - let url = ctx+prefix + `/file/download?filePath=` + encodeURI(filePath) + '&fileName=' + encodeURI(fileName) + let url = ctx + prefix + `/file/download?filePath=` + encodeURI(filePath) + '&fileName=' + encodeURI(fileName) iframe.document.write(`