|
@@ -170,6 +170,45 @@ function getTenderTreeHtml (this_code, this_status, aidList = []) {
|
|
|
return EmptyTenderHtml.join('');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+function getShenpiHtml (this_code) {
|
|
|
+ const html = [];
|
|
|
+ html.push('<table class="table table-hover table-bordered">');
|
|
|
+ html.push('<thead>', '<tr>');
|
|
|
+ html.push('<th>名称</th>');
|
|
|
+ html.push('<th width="100">审批流程</th>');
|
|
|
+ html.push('<th width="40">选择</th>');
|
|
|
+ html.push('</tr>', '</thead>');
|
|
|
+ for (const sp of sp_lc) {
|
|
|
+ html.push('<tr>');
|
|
|
+ html.push('<td>', sp.name, '</td>');
|
|
|
+ html.push('<td>');
|
|
|
+ html.push(sp_status_list[sp.status].name);
|
|
|
+ const this_status = parseInt($('.' + sp.code + '_div').children('.lc-show').siblings('.form-group').find('input:checked').val());
|
|
|
+ if(this_status != sp_status.sqspr) {
|
|
|
+ const nameList = [];
|
|
|
+ const aid_num = $('.' + sp.code + '_div').children('.lc-show').children('ul').find('.remove-audit').length;
|
|
|
+ const aidList = [];
|
|
|
+ for (let i = 0; i < aid_num; i++) {
|
|
|
+ const aid = parseInt($('.' + sp.code + '_div').children('.lc-show').children('ul').find('.remove-audit').eq(i).data('id'));
|
|
|
+ aidList.push(aid);
|
|
|
+ }
|
|
|
+ if(aidList.length > 0) {
|
|
|
+ for (const uid of aidList) {
|
|
|
+ const user = _.find(accountList, { id: uid });
|
|
|
+ nameList.push(user.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ html.push('<i class="fa fa-question-circle text-primary" data-container="body" data-toggle="tooltip" data-placement="bottom" ' +
|
|
|
+ 'data-original-title="'+ (nameList.length > 0 ? nameList.join('-') : '') +'"></i>');
|
|
|
+ }
|
|
|
+ html.push('</td>');
|
|
|
+ html.push('<td>', this_code !== sp.code ? '<input type="checkbox" data-code="'+ sp.code +'">' : '', '</td>');
|
|
|
+ html.push('</tr>');
|
|
|
+ }
|
|
|
+ html.push('</table>');
|
|
|
+ return html.join('');
|
|
|
+}
|
|
|
$(document).ready(function () {
|
|
|
let timer = null;
|
|
|
let oldSearchVal = null;
|
|
@@ -438,7 +477,7 @@ $(document).ready(function () {
|
|
|
setTimeout(function () { $("#tender-list [data-toggle='tooltip']").tooltip(); },800);
|
|
|
});
|
|
|
|
|
|
- $('#save-other-shenpi').click(function () {
|
|
|
+ $('#save-other-tender').click(function () {
|
|
|
$(this).attr('disabled', true);
|
|
|
const num = $('#tender-list input:checked').length;
|
|
|
if (num < 2) {
|
|
@@ -447,10 +486,10 @@ $(document).ready(function () {
|
|
|
}
|
|
|
const data = {
|
|
|
type: 'copy2ot',
|
|
|
- status: $('#shenpi_status').val(),
|
|
|
+ status: parseInt($('#shenpi_status').val()),
|
|
|
code: $('#shenpi_code').val(),
|
|
|
};
|
|
|
- if(data.code !== shenpi_status.gdspl) {
|
|
|
+ if(data.status !== shenpi_status.gdspl) {
|
|
|
data.aidList = $('#shenpi_auditors').val();
|
|
|
}
|
|
|
// 获取已选中的标段
|
|
@@ -468,5 +507,53 @@ $(document).ready(function () {
|
|
|
window.location.reload();
|
|
|
}, 1000)
|
|
|
})
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.set-otherShenpi').on('click', function () {
|
|
|
+ const this_code = $(this).data('code');
|
|
|
+ const this_status = parseInt($(this).siblings('.lc-show').siblings('.form-group').find('input:checked').val());
|
|
|
+ const aid_num = $(this).siblings('.lc-show').children('ul').find('.remove-audit').length;
|
|
|
+ const aidList = [];
|
|
|
+ for (let i = 0; i < aid_num; i++) {
|
|
|
+ const aid = parseInt($(this).siblings('.lc-show').children('ul').find('.remove-audit').eq(i).data('id'));
|
|
|
+ aidList.push(aid);
|
|
|
+ }
|
|
|
+ const html = getShenpiHtml(this_code);
|
|
|
+ $('#shenpi-name2').text($(this).data('name'));
|
|
|
+ $('#shenpi_code2').val(this_code);
|
|
|
+ $('#shenpi_status2').val(this_status);
|
|
|
+ $('#shenpi_auditors2').val(aidList.join(','));
|
|
|
+ $('#shenpi-list').html(html);
|
|
|
+ setTimeout(function () { $("#shenpi-list [data-toggle='tooltip']").tooltip(); },800);
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#save-other-shenpi').click(function () {
|
|
|
+ $(this).attr('disabled', true);
|
|
|
+ const num = $('#shenpi-list input:checked').length;
|
|
|
+ if (num < 1) {
|
|
|
+ toastr.warning('请选择需要设置审批同步的流程');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const data = {
|
|
|
+ type: 'copy2os',
|
|
|
+ status: parseInt($('#shenpi_status2').val()),
|
|
|
+ code: $('#shenpi_code2').val(),
|
|
|
+ };
|
|
|
+ if(data.status !== shenpi_status.gdspl) {
|
|
|
+ data.aidList = $('#shenpi_auditors2').val();
|
|
|
+ }
|
|
|
+ // 获取已选中的标段
|
|
|
+ const shenpiList = [];
|
|
|
+ for (let i = 0; i < num; i++) {
|
|
|
+ const code = $('#shenpi-list input:checked').eq(i).data('code');
|
|
|
+ shenpiList.push(code);
|
|
|
+ }
|
|
|
+ data.shenpiList = shenpiList.join(',');
|
|
|
+ postData('/tender/' + cur_tenderid + '/shenpi/audit/save', data, function () {
|
|
|
+ toastr.success('设置成功');
|
|
|
+ setTimeout(function () {
|
|
|
+ window.location.reload();
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ });
|
|
|
});
|