订单新建完成
parent
faad898297
commit
36862b93ec
|
@ -334,6 +334,8 @@
|
|||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-product-add').serialize());
|
||||
}else{
|
||||
$.modal.alertWarning("请完善表单");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -371,6 +371,8 @@
|
|||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-product-add').serialize());
|
||||
}else{
|
||||
$.modal.alertWarning("请完善表单");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
.highlightRow {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.disableBtnfalse {
|
||||
color: #ccc;
|
||||
}
|
||||
</style>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
|
@ -57,7 +61,7 @@
|
|||
<li>
|
||||
<label>项目阶段:</label>
|
||||
<select name="projectStage" class="form-control"
|
||||
th:with="type=${@dict.getType('project_stage')}" required>
|
||||
th:with="type=${@dict.getType('project_stage')}">
|
||||
<option value="">请选择合项目阶段</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||
th:value="${dict.dictValue}"></option>
|
||||
|
@ -74,7 +78,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label>行业:</label>
|
||||
<div id="industryTypeBox" style="float: right">
|
||||
<div id="industryTypeBox" style="float: right">
|
||||
<select name="industryType" class="form-control" required>
|
||||
<option value="">请先选择BG</option>
|
||||
</select>
|
||||
|
@ -186,7 +190,7 @@
|
|||
formatter: (value, row, index) => {
|
||||
if (row.highlight) {
|
||||
return `<span class="highlight">${value}</span>`
|
||||
}else{
|
||||
} else {
|
||||
return `<span>${value}</span>`
|
||||
}
|
||||
}
|
||||
|
@ -210,9 +214,9 @@
|
|||
field: 'industryType',
|
||||
title: '行业',
|
||||
formatter: function (value, row, index) {
|
||||
if(row.bgProperty=='YYS'){
|
||||
if (row.bgProperty == 'YYS') {
|
||||
return $.table.selectDictLabel([[${@dict.getType('bg_yys')}]], value);
|
||||
}else{
|
||||
} else {
|
||||
return $.table.selectDictLabel([[${@dict.getType('bg_hsys')}]], value);
|
||||
|
||||
}
|
||||
|
@ -225,7 +229,7 @@
|
|||
{
|
||||
field: 'projectGraspDegree',
|
||||
title: '项目把握度',
|
||||
width:30
|
||||
width: 30
|
||||
},
|
||||
{
|
||||
field: 'projectStage',
|
||||
|
@ -266,7 +270,7 @@
|
|||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs mb5' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>项目详情</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs mb5' + editFlag + '" href="javascript:void(0)" onclick=`openOrder(${row})`><i class="fa fa-refresh"></i>生成订单</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs mb5' + editFlag + '" href="javascript:void(0)" onclick="openOrder(' + row.id + ',' + row.canGenerate + ')" name="disableBtn' + row.canGenerate + '"><i class="fa fa-refresh"></i>生成订单</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs mb5' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
|
@ -368,6 +372,7 @@
|
|||
$('#laydate-endTime').attr('name', 'updateTimeEnd')
|
||||
}
|
||||
}
|
||||
|
||||
function changeBg() {
|
||||
if ($('[name="bgProperty"]').val() != 'YYS') {
|
||||
let datas = [[${@dict.getType('bg_hysy')}]]
|
||||
|
@ -397,6 +402,31 @@
|
|||
|
||||
}
|
||||
|
||||
function openOrder(id, canAdd) {
|
||||
if (!canAdd) {
|
||||
$.modal.alertWarning("该项目已存在订单");
|
||||
return
|
||||
}
|
||||
var options = {
|
||||
title: "新建订单",
|
||||
url: ctx + `project/order/add`,
|
||||
maxmin: false,
|
||||
full: true,
|
||||
index: 1000,
|
||||
width: 1050,
|
||||
yes: function (index, layero) {
|
||||
let body = parent.layer.getChildFrame('body', index)
|
||||
if ($(body.find('#form-product-add').get(0)).validate().form()) {
|
||||
$.operate.save(prefix + "/add", body.find('#form-product-add').serialize(), function () {
|
||||
parent.layer.close(index)
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
window.localStorage.setItem('projcetDataId', id)
|
||||
$.modal.openOptions(options)
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -85,6 +85,7 @@
|
|||
<td class="shortTd">项目编号<span class="is-required">*</span></td>
|
||||
<td>
|
||||
<input name="projectId" class="form-control" type="hidden">
|
||||
<input name="orderId" class="form-control" type="hidden">
|
||||
<input type="text" name="projectCode" placeholder="请选择" class="form-control"
|
||||
onclick="searchProject()">
|
||||
</td>
|
||||
|
@ -129,6 +130,7 @@
|
|||
<td>联系方式<span class="is-required">*</span></td>
|
||||
<td><input name="businessPhone" class="form-control" type="text" required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>合同编号<span class="is-required">*</span></td>
|
||||
<td><input type="text" name="orderCode" class="form-control" readonly placeholder="自动生成">
|
||||
|
@ -218,6 +220,15 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>进货商联系人</td>
|
||||
<td><input name="partnerPeople" class="form-control" type="text"></td>
|
||||
<td>Email</td>
|
||||
<td><input type="text" name="partnerEmail"
|
||||
class="form-control"></td>
|
||||
<td>联系方式<span class="is-required">*</span></td>
|
||||
<td><input name="partnerPhone" class="form-control" type="text" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>供货商<span class="is-required">*</span></td>
|
||||
<td colspan="5">
|
||||
|
@ -383,11 +394,39 @@
|
|||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-product-add').serialize());
|
||||
}else{
|
||||
$.modal.alertWarning("请完善表单");
|
||||
}
|
||||
}
|
||||
|
||||
function initProjcet() {
|
||||
let id = window.localStorage.getItem('projcetDataId')
|
||||
if (!id) {
|
||||
return
|
||||
}
|
||||
window.localStorage.removeItem('projcetDataId')
|
||||
$.operate.get(ctx + `sip/project/query/${id}`, function (res) {
|
||||
let data = res.data
|
||||
$('#projectNameBox').text(data.projectName)
|
||||
$('[name="customerCode"]').val(data.customerCode);
|
||||
$('[name="customerName"]').val(data.customerName);
|
||||
$('[name="projectCode"]').val(data.projectCode);
|
||||
$('[name="projectId"]').val(data.id);
|
||||
$('[name="projectName"]').val(data.projectName);
|
||||
$('[name="bgProperty"]').val(data.bgProperty);
|
||||
$('[name="agentName"]').val(data.agentName);
|
||||
$('[name="agentCode"]').val(data.agentCode);
|
||||
changeBg()
|
||||
$('[name="industryType"]').val(data.industryType);
|
||||
initProjectList()
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initProductList()
|
||||
initProjcet()
|
||||
$("input[name='estimatedOrderTime']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
|
@ -459,7 +498,7 @@
|
|||
function doSubmitProject(index, layero) {
|
||||
var rows = layero.find("iframe")[0].contentWindow.getSelections();
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请选择一个用户");
|
||||
$.modal.alertWarning("请选择一个项目");
|
||||
return;
|
||||
}
|
||||
$('#projectNameBox').text(rows[0].projectName)
|
||||
|
@ -486,6 +525,9 @@
|
|||
$('[name="partnerCode"]').val(rows[0].partnerCode);
|
||||
$('[name="partnerName"]').val(rows[0].partnerName);
|
||||
$('[name="level"]').val(rows[0].level);
|
||||
$('[name="partnerPeople"]').val(rows[0].contactPerson);
|
||||
$('[name="partnerPhone"]').val(rows[0].contactPhone);
|
||||
|
||||
|
||||
$.modal.close(index);
|
||||
}
|
||||
|
@ -534,7 +576,7 @@ ${softwareProjectProductInfoList.map((ele) => {
|
|||
<td><input value="${data.catalogueAllPrice || ''}" name="softwareProjectProductInfoList[${length}].catalogueAllPrice" type="number" class="form-control catalogueAllPrice" placeholder="自动计算" required readonly></td>
|
||||
<td><input value="${data.remark || ''}" name="softwareProjectProductInfoList[${length}].remark" type="text" class="form-control" ></td>
|
||||
|
||||
<td><span style="cursor:pointer;color: ff5722" class="delRow">删除</span></td>
|
||||
<td><span style="cursor:pointer;color: #1686d8" class="delRow">删除</span></td>
|
||||
|
||||
</tr>`)
|
||||
$('#productTable tbody').append(tr)
|
||||
|
@ -571,7 +613,7 @@ ${hardwareProjectProductInfoList.map((ele) => {
|
|||
<td><input value="${data.catalogueAllPrice || ''}" name="hardwareProjectProductInfoList[${length}].catalogueAllPrice" type="number" class="form-control catalogueAllPrice" placeholder="自动计算" required readonly></td>
|
||||
<td><input value="${data.remark || ''}" name="hardwareProjectProductInfoList[${length}].remark" type="text" class="form-control" ></td>
|
||||
|
||||
<td><span style="cursor:pointer;color: ff5722" class="delRow">删除</span></td>
|
||||
<td><span style="cursor:pointer;color: #1686d8" class="delRow">删除</span></td>
|
||||
|
||||
</tr>`)
|
||||
$('#productTable2 tbody').append(tr)
|
||||
|
@ -608,7 +650,7 @@ ${maintenanceProjectProductInfoList.map((ele) => {
|
|||
<td><input value="${data.catalogueAllPrice || ''}" name="maintenanceProjectProductInfoList[${length}].catalogueAllPrice" type="number" class="form-control catalogueAllPrice" placeholder="自动计算" required readonly></td>
|
||||
<td><input value="${data.remark || ''}" name="maintenanceProjectProductInfoList[${length}].remark" type="text" class="form-control" ></td>
|
||||
|
||||
<td><span style="cursor:pointer;color: ff5722" class="delRow">删除</span></td>
|
||||
<td><span style="cursor:pointer;color: #1686d8" class="delRow">删除</span></td>
|
||||
|
||||
</tr>`)
|
||||
$('#productTable3 tbody').append(tr)
|
||||
|
@ -790,7 +832,7 @@ ${maintenanceProjectProductInfoList.map((ele) => {
|
|||
const file = event.target.files[0];
|
||||
let data = new FormData()
|
||||
data.append('file', file)
|
||||
data.append('projectId', $('[name="projectId"]').val())
|
||||
data.append('orderId', $('[name="orderId"]').val())
|
||||
|
||||
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
|
||||
xhr.open('POST', prefix + '/importContractData', true); // 设置请求类型和URL
|
||||
|
@ -799,9 +841,7 @@ ${maintenanceProjectProductInfoList.map((ele) => {
|
|||
let data = JSON.parse(res.currentTarget.response)
|
||||
if (data.code === 0) {
|
||||
$.modal.msgSuccess('导入成功');
|
||||
data.data.forEach((row) => {
|
||||
addFile(row)
|
||||
})
|
||||
addFile(data.data)
|
||||
} else {
|
||||
$.modal.msgError(data.msg || '导入失败');
|
||||
}
|
||||
|
@ -818,21 +858,30 @@ ${maintenanceProjectProductInfoList.map((ele) => {
|
|||
});
|
||||
|
||||
function importList() {
|
||||
if (!$('[name="projectId"]').val()) {
|
||||
$.modal.alertWarning("请先选择项目");
|
||||
return
|
||||
}
|
||||
$('#uploadInput').click()
|
||||
}
|
||||
|
||||
function addFile() {
|
||||
function addFile(data) {
|
||||
let length = $('#fileBox tbody').find('tr').length
|
||||
let filterArr = ['fileName', 'createBy', 'uploadTime']
|
||||
let keys = Object.keys(data).filter((ele) => filterArr.indexOf(ele) < 0)
|
||||
let tr = $(`
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
${
|
||||
keys.map((ele) => {
|
||||
return `<input type="hidden" name="contractFileList[${length}].${ele}" value="${data[ele] || ''}">`
|
||||
}).join('')
|
||||
}
|
||||
<input value="${data.fileName || ''}" name="contractFileList[${length}].fileName" readonly class="form-control"></td>
|
||||
<td><input value="${data.createByName || ''}" name="contractFileList[${length}].createBy" readonly class="form-control"></td>
|
||||
<td><input value="${data.uploadTime || ''}" name="contractFileList[${length}].uploadTime" readonly class="form-control" ></td>
|
||||
<td><span style="cursor:pointer;color: #1686d8;margin-right: 5px;" onclick="preview('${data.filePath}')">预览</span><span style="cursor:pointer;color: #1686d8;margin-right: 5px;" onclick="downFile('${data.filePath}')">下载</span><span style="cursor:pointer;color: #dd242a" class="delfile">删除</span></td>
|
||||
</tr>`)
|
||||
$('#fileBox tbody').append(tr)
|
||||
$('.delfile').on('click', function () {
|
||||
$(this).parent().parent().remove()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
@ -853,6 +902,18 @@ ${maintenanceProjectProductInfoList.map((ele) => {
|
|||
}) : ''
|
||||
})
|
||||
}
|
||||
|
||||
function downFile(filePath) {
|
||||
$.operate.get(prefix + `/file/download?filePath=${filePath}`, function (res) {
|
||||
window.location.href = res.data
|
||||
})
|
||||
}
|
||||
|
||||
function preview(filePath) {
|
||||
$.operate.get(prefix + `/file/download?filePath=${filePath}`, function (res) {
|
||||
window.open(res.data)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue