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 4e679d1c..eb9cd2ce 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/add.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/add.html @@ -63,8 +63,8 @@ width: 100px; } - .middleTd { - width: 150px; + input, textarea, #productTable td { + position: relative; } @@ -77,7 +77,8 @@ 项目名称* - + 最终客户* @@ -85,20 +86,18 @@ BG* - 行业* - - + 代表处 * @@ -113,7 +112,7 @@ - - - - + + + + + @@ -139,7 +139,7 @@ 联系方式 - + 预计金额(RMB)* @@ -162,7 +162,7 @@ 预计发货时间 + > @@ -183,13 +183,14 @@ 关键技术问题 - + 项目简述* - + @@ -210,7 +211,7 @@ 单价(RMB) 总价(RMB) 目录总价(RMB) - 备注 + 备注 操作 @@ -223,7 +224,8 @@ - + - + @@ -422,8 +426,8 @@ let tr = $(` - - + +`) $('#workLog tbody').append(tr) @@ -440,12 +444,12 @@ searchProduct(val, 'model', this) }) $('#productTable .delRow').on('click', function () { - let ele=$(this) - $.modal.confirm('是否确认删除',function (){ + let ele = $(this) + $.modal.confirm('是否确认删除', function () { $(ele).parent().parent().remove() - $('#productTable tbody tr').each((index,item)=>{ - $(item).find('.indexBox').text(index+1) - }) + $('#productTable tbody tr').each((index, item) => { + $(item).find('.indexBox').text(index + 1) + }) }); }) @@ -513,8 +517,8 @@ let cataloguePrice = $(this).parent().parent().find('.cataloguePrice').val() $(this).parent().parent().find('.discount').val(val) $(this).parent().parent().find('.price').val((cataloguePrice * val).toFixed(2)) - let price=$(this).parent().parent().find('.price').val() - let quantity=$(this).parent().parent().find('.quantity').val() + let price = $(this).parent().parent().find('.price').val() + let quantity = $(this).parent().parent().find('.quantity').val() if (price && quantity) { $(this).parent().parent().find('.allPrice').val((price * quantity).toFixed(2)) } @@ -530,6 +534,43 @@ $(this).parent().parent().find('.allPrice').val((val * num).toFixed(2)) }) } + + function changeInstitution() { + if ($('[name="operateInstitution"]').val() == 'h3c') { + $('[name="partnerName"]').val('新华三') + $('[name="partnerCode"]').val('') + } + } + + function changeBg() { + if ($('[name="bgProperty"]').val() != 'YYS') { + let datas = [[${@dict.getType('bg_hysy')}]] + let str = `` + datas.forEach((ele) => { + str += ` ` + }) + $('#industryTypeBox').html(` + + `) + } else { + let datas = [[${@dict.getType('bg_yys')}]] + let str = `` + datas.forEach((ele) => { + str += ` ` + }) + $('#industryTypeBox').html(` + + `) + } + + + } \ No newline at end of file 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 09bdba61..8f1683b2 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html @@ -1,198 +1,599 @@ - + - - + + - -
-
- -
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
-
- - -
-
-
-
-
-
- -
-
- - -
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
- -
- - - + initData() + + + }) + + function selectCustomer() { + var url = prefix + "/selectCustomer"; + var options = { + title: '选择客户', + width: "680", + url: url, + height: '600', + callBack: doSubmitCustomer + }; + $.modal.openOptions(options); + } + + function selectPartner() { + var url = prefix + "/selectPartner"; + var options = { + title: '选择代理商', + width: "680", + height: '600', + url: url, + callBack: doSubmitPartner + }; + $.modal.openOptions(options); + } + + function selectAgent() { + var url = prefix + "/selectAgent"; + var options = { + title: '选择代理商', + width: "680", + height: '600', + url: url, + callBack: doSubmitAgent + }; + $.modal.openOptions(options); + } + + function selectPeople() { + var url = prefix + "/selectPeople"; + var options = { + title: '选择代理商', + width: "680", + height: '600', + url: url, + callBack: doSubmitPeople + }; + $.modal.openOptions(options); + } + + function doSubmitCustomer(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个用户"); + return; + } + $('[name="customerCode"]').val(rows[0].customerCode); + $(' [name="customerName"]').val(rows[0].customerName); + $.modal.close(index); + } + + function doSubmitPartner(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个代理商"); + return; + } + $('[name="partnerCode"]').val(rows[0].partnerCode); + $('[name="partnerName"]').val(rows[0].partnerName); + + $.modal.close(index); + } + + function doSubmitPeople(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个代理商"); + return; + } + $('[name="hzSupportUser"]').val(rows[0].userId); + $('[name="hzSupportUserName"]').val(rows[0].userName); + + $.modal.close(index); + } + + function doSubmitAgent(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个代理商"); + return; + } + $('[name="agentCode"]').val(rows[0].agentCode); + $('[name="agentName"]').val(rows[0].agentName); + + $.modal.close(index); + } + + // 添加软件 + function initData() { + let arr=[[${projectInfo.projectProductInfoList}]] + arr.forEach((ele)=>{ + addProduct(ele) + }) + let arr2=[[${projectInfo.projectWorkProgressList }]] + arr2.forEach((ele)=>{ + addLog(ele) + }) + console.log(123,arr) + + let arr3=[[${projectInfo.projectOperateLogList}]] + arr3.forEach((ele,index)=>{ + let tr=$(` +
+ `) + $('#sysLog tbody').append(tr) + }) + changeBg() + $('[name="industryType"]').val([[${projectInfo.industryType}]]) + } + + function addProduct(data) { + let length = $('#productTable tbody').find('tr').length + let tr = $(` + + + + + + + + + + + + + + + +`) + $('#productTable tbody').append(tr) + initSearchProduct() + initPrice() + } + + function addLog(data) { + let length = $('#workLog tbody').find('tr').length + let tr = $(` + + + + + +`) + $('#workLog tbody').append(tr) + + } + + function initSearchProduct() { + $('#productTable .productBomCode').on('input', function () { + let val = $(this).val() + searchProduct(val, 'code', this) + }) + $('#productTable .model').on('input', function () { + let val = $(this).val() + searchProduct(val, 'model', this) + }) + $('#productTable .delRow').on('click', function () { + let ele = $(this) + $.modal.confirm('是否确认删除', function () { + $(ele).parent().parent().remove() + $('#productTable tbody tr').each((index, item) => { + $(item).find('.indexBox').text(index + 1) + }) + + }); + }) + + } + + function searchProduct(val, type, ele) { + if (!val) { + $(ele).parent().parent().find('.productBomCode').val('') + $(ele).parent().parent().find('.model').val('') + $(ele).parent().parent().find('.productDesc').val('') + return + } + let data = { + pageSize: 10, + pageNum: 1, + isTable: 0 + } + if (type == 'code') { + data.productCode = val + } else if (type == 'model') { + data.model = val + } + $.operate.post(ctx + 'system/product/list', data, function (res) { + if (res.rows.length) { + if (type == 'code') { + $(ele).parent().parent().find('.model').val(res.rows[0].model) + } else if (type == 'model') { + $(ele).parent().parent().find('.productBomCode').val(res.rows[0].productCode) + } + $(ele).parent().parent().find('.productDesc').val(res.rows[0].description) + } else { + if (type == 'code') { + $(ele).parent().parent().find('.model').val('') + } else if (type == 'model') { + $(ele).parent().parent().find('.productBomCode').val('') + } + $(ele).parent().parent().find('.productDesc').val('') + } + } + ) + } + + function initPrice() { + $('#productTable .quantity').on('input', function () { + let num = $(this).val() + let priceVal = $(this).parent().parent().find('.price').val() + let cateVal = $(this).parent().parent().find('.cataloguePrice').val() + if (priceVal && num) { + $(this).parent().parent().find('.allPrice').val((num * priceVal).toFixed(2)) + } + if (cateVal && num) { + $(this).parent().parent().find('.catalogueAllPrice').val((num * cateVal).toFixed(2)) + } + }) + $('#productTable .cataloguePrice').on('input', function () { + let val = $(this).val() + $(this).parent().parent().find('.price').val(val) + let quantity = $(this).parent().parent().find('.quantity').val() + if (quantity && val) + $(this).parent().parent().find('.catalogueAllPrice').val((val * quantity).toFixed(2)) + }) + $('#productTable .guidanceDiscount').on('input', function () { + let val = $(this).val() + let cataloguePrice = $(this).parent().parent().find('.cataloguePrice').val() + $(this).parent().parent().find('.discount').val(val) + $(this).parent().parent().find('.price').val((cataloguePrice * val).toFixed(2)) + let price = $(this).parent().parent().find('.price').val() + let quantity = $(this).parent().parent().find('.quantity').val() + if (price && quantity) { + $(this).parent().parent().find('.allPrice').val((price * quantity).toFixed(2)) + } + }) + $('#productTable .discount').on('input', function () { + let discount = $(this).val() + let val = $(this).parent().parent().find('.cataloguePrice').val() + $(this).parent().parent().find('.price').val((val * discount).toFixed(2)) + }) + $('#productTable .price').change('input', function () { + let val = $(this).val() + let num = $(this).parent().parent().find('.quantity').val() + $(this).parent().parent().find('.allPrice').val((val * num).toFixed(2)) + }) + } + + function changeInstitution() { + if ($('[name="operateInstitution"]').val() == 'h3c') { + $('[name="partnerName"]').val('新华三') + $('[name="partnerCode"]').val('') + } + } + + function changeBg() { + if ($('[name="bgProperty"]').val() != 'YYS') { + let datas = [[${@dict.getType('bg_hysy')}]] + let str = `` + datas.forEach((ele) => { + str += ` ` + }) + $('#industryTypeBox').html(` + + `) + } else { + let datas = [[${@dict.getType('bg_yys')}]] + let str = `` + datas.forEach((ele) => { + str += ` ` + }) + $('#industryTypeBox').html(` + + `) + } + + } + \ No newline at end of file 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 cdc4ec60..995c8a7b 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/project.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/project.html @@ -11,6 +11,7 @@ gap: 0; height: 20px; justify-content: center; + margin-right: 30px; } .sortBox div { @@ -50,38 +51,40 @@
  • - +
  • - -
  • -
  • - - -
  • - - +
  • +
  • + +
    + +
    + +
  • - + @@ -90,7 +93,11 @@
  • - + +
  • +
  • + +
  • @@ -118,6 +125,7 @@  重置
  • + @@ -148,7 +156,6 @@ -
    服务器配置 是否国产
    ${length + 1}
    ${length + 1}
    ${index+1}${ele.operateUserName}${ele.operateLog}${ele.operateTime}
    ${length + 1}删除
    ${length + 1}