|
@@ -309,15 +309,37 @@ $(document).ready(() => {
|
|
|
};
|
|
|
const stagePos = new StagePosData(stagePosSetting);
|
|
|
|
|
|
+ const setCooperationSelectHtml = function () {
|
|
|
+ const selectHtml = [];
|
|
|
+ selectHtml.push('<option>全部</option>');
|
|
|
+ const cooName = _.uniqWith(_.map(stageTree.pwd, 'company'));
|
|
|
+ for (const i of cooName) {
|
|
|
+ selectHtml.push('<option>', i, '</option>');
|
|
|
+ }
|
|
|
+ $('#cooperationSelect').html(selectHtml.join(''));
|
|
|
+ };
|
|
|
+
|
|
|
const reloadCooperationHtml = function () {
|
|
|
const html = [];
|
|
|
- for (const p of stageTree.pwd) {
|
|
|
+ const select = $('#cooperationSelect').val();
|
|
|
+ const list = select !== '全部' ? _.filter(stageTree.pwd, { company: select }) : stageTree.pwd;
|
|
|
+ for (const p of list) {
|
|
|
if (!p.node) continue;
|
|
|
- html.push('<tr>', `<td>${p.node.code}</td>`, `<td>${p.node.name}</td>`);
|
|
|
- html.push('<td>', p.check ? `已解锁:${p.pwd}` : `<a name="ledger-unlock" lid="${p.ledger_id}" href="javascript: void(0);">解锁</a>`, '</td>');
|
|
|
+ if (p.confirm) {
|
|
|
+ html.push(`<tr class="text-success">`);
|
|
|
+ } else {
|
|
|
+ html.push(`<tr>`);
|
|
|
+ }
|
|
|
+ html.push(`<td>${p.node.code}</td>`, `<td>${p.node.name}</td>`);
|
|
|
+ if(coopwd) {
|
|
|
+ html.push('<td>', p.check ? `已解锁:${p.pwd}` : `<a name="ledger-unlock" lid="${p.ledger_id}" href="javascript: void(0);">解锁</a>`, '</td>');
|
|
|
+ }
|
|
|
+ html.push('<td>', p.company, '</td>');
|
|
|
+ html.push('<td>', p.check ? (p.confirm ? (moment(p.confirm_time).format('YYYY-MM-DD HH:mm') + ' ' + (coopwd ? `<a name="ledger-unconfirm" href="javascript: void(0);" lid="${p.ledger_id}">重新审批</a>` : '')) : `<a name="ledger-confirm" href="javascript: void(0);" lid="${p.ledger_id}" class="btn btn-sm btn-success">确认</a>`) : '' ,'</td>');
|
|
|
html.push('</tr>');
|
|
|
}
|
|
|
$('#cooperationList').html(html.join(''));
|
|
|
+
|
|
|
};
|
|
|
|
|
|
class Changes {
|
|
@@ -1924,9 +1946,11 @@ $(document).ready(() => {
|
|
|
treeCalc.calculateAll(stageTree);
|
|
|
// 加载解锁相关
|
|
|
if (result.cooperation) {
|
|
|
- stageTree.loadPwd(result.cooperation, 'bills-p-' + userID + '-' + window.location.pathname.split('/')[2]);
|
|
|
+ // stageTree.loadPwd(result.cooperation, 'bills-p-' + userID + '-' + window.location.pathname.split('/')[2]);
|
|
|
+ stageTree.loadOnlinePwd(result.cooperation, result.cooperationPwd, result.cooperationConfirm);
|
|
|
$('#cooperationCount').html(stageTree.pwd.length || '');
|
|
|
if (stageTree.pwd.length > 0) $('#cooperationCount').parent().show();
|
|
|
+ setCooperationSelectHtml();
|
|
|
reloadCooperationHtml();
|
|
|
}
|
|
|
for (const t of result.tags) {
|
|
@@ -3982,6 +4006,13 @@ $(document).ready(() => {
|
|
|
});
|
|
|
$('[name=stage-start]').submit(function (e) {
|
|
|
if (checkAuditorFrom()) {
|
|
|
+ // 再检查多人协同确认情况
|
|
|
+ const list = stageTree.pwd.find(x => {return !x.confirm });
|
|
|
+ if(list) {
|
|
|
+ toastr.error('请检查多人协同确认情况再上报');
|
|
|
+ $('#hide-all').hide();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
$(this).parent().parent().parent().modal('hide');
|
|
|
dataChecker.checkAndPost(this.action, {});
|
|
|
$('#hide-all').hide();
|
|
@@ -3989,6 +4020,14 @@ $(document).ready(() => {
|
|
|
return false;
|
|
|
});
|
|
|
$('#audit-check0').submit(function (e) {
|
|
|
+ // 再检查多人协同确认情况
|
|
|
+ const list = stageTree.pwd.find(x => {return !x.confirm });
|
|
|
+ if(list) {
|
|
|
+ toastr.error('请检查多人协同确认情况再审批通过');
|
|
|
+ $('#hide-all').hide();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
const checkType = parseInt($('[name=checkType]').val());
|
|
|
const data = {
|
|
|
opinion: $(`${'#sp-done'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
|
|
@@ -4073,6 +4112,10 @@ $(document).ready(() => {
|
|
|
|
|
|
if (p.pwd === $('#unlock-pwd').val()) {
|
|
|
const refresh = stageTree.lockNode(p, false);
|
|
|
+ // 修改线上
|
|
|
+ postData(window.location.pathname + '/save/cooperation', { type: 'save-pwd', postData: { ledger_id: lid, pwd: $('#unlock-pwd').val() } }, function (result) {
|
|
|
+ stageTree.pwdList = result.cooperationPwd;
|
|
|
+ });
|
|
|
SpreadJsObj.reloadRowsReadonly(slSpread.getActiveSheet(), refresh);
|
|
|
stagePosSpreadObj.loadCurPosData();
|
|
|
$('#unlock').modal('hide');
|
|
@@ -4082,5 +4125,39 @@ $(document).ready(() => {
|
|
|
$('.invalid-feedback', '#unlock').show();
|
|
|
$('.alert-warning', '#unlock').show();
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ $('#cooperationSelect').change(function () {
|
|
|
+ reloadCooperationHtml();
|
|
|
+ });
|
|
|
+ // 确认
|
|
|
+ $('body').on('click', '[name=ledger-confirm]', function() {
|
|
|
+ const lid = this.getAttribute('lid');
|
|
|
+ if (!lid) return;
|
|
|
+
|
|
|
+ const p = stageTree.pwd.find(x => {return x.ledger_id == lid});
|
|
|
+ if (!p) return;
|
|
|
+ // 修改线上
|
|
|
+ postData(window.location.pathname + '/save/cooperation', { type: 'save-confirm', postData: { ledger_id: lid } }, function (result) {
|
|
|
+ p.confirm = true;
|
|
|
+ p.confirm_time = new Date();
|
|
|
+ stageTree.confirmList = result.cooperationConfirm;
|
|
|
+ reloadCooperationHtml();
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 确认
|
|
|
+ $('body').on('click', '[name=ledger-unconfirm]', function() {
|
|
|
+ const lid = this.getAttribute('lid');
|
|
|
+ if (!lid) return;
|
|
|
+
|
|
|
+ const p = stageTree.pwd.find(x => {return x.ledger_id == lid});
|
|
|
+ if (!p) return;
|
|
|
+ // 修改线上
|
|
|
+ postData(window.location.pathname + '/save/cooperation', { type: 'del-confirm', postData: { ledger_id: lid } }, function (result) {
|
|
|
+ p.confirm = false;
|
|
|
+ p.confirm_time = null;
|
|
|
+ stageTree.confirmList = result.cooperationConfirm;
|
|
|
+ reloadCooperationHtml();
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|