|
|
@@ -858,22 +858,37 @@ function bindQualityInspectionFlow() {
|
|
|
} else if (type === 'flow-check') {
|
|
|
message = pending.checkType === 3 ? '确认本次审批通过?' : pending.checkType === 4 ? '确认关闭本次巡检?' : inspection.flow_stage === 3 ? '确认退回重新整改?所有整改人将同时开始新一轮整改。' : pending.checkType === 5 ? '确认退回上报人重新上报?' : '确认退回上一个上报审批节点?';
|
|
|
}
|
|
|
+ const isReturn = type === 'flow-return';
|
|
|
$('#quality-flow-title').text($(this).text());
|
|
|
- $('#quality-flow-message').text(message);
|
|
|
+ $('#quality-flow-message').text(message).toggle(!isReturn);
|
|
|
+ $('#quality-flow-return-group').toggleClass('d-none', !isReturn);
|
|
|
+ $('[name="quality-flow-return-type"]').prop('checked', false);
|
|
|
$('#quality-flow-opinion').val('').css('height', '');
|
|
|
- $('#quality-flow-opinion-group').toggle(type === 'flow-check');
|
|
|
+ $('#quality-flow-opinion-group').toggle(type === 'flow-check' || isReturn).find('label').text(isReturn ? '退回意见' : '处理意见');
|
|
|
+ $('#quality-flow-cancel').text(isReturn ? '关闭' : '取消');
|
|
|
+ $('#quality-flow-submit').text(isReturn ? '确认退回' : '确认').toggleClass('btn-warning', isReturn).toggleClass('btn-primary', !isReturn);
|
|
|
$('#quality-flow-confirm').modal('show');
|
|
|
});
|
|
|
$('#quality-flow-submit').on('click', function () {
|
|
|
if (!pending || busy) return;
|
|
|
- if (pending.type === 'flow-check') {
|
|
|
- pending.opinion = $('#quality-flow-opinion').val().trim();
|
|
|
- if (pending.checkType !== 3 && !pending.opinion) {
|
|
|
- toastr.error('请填写退回或关闭原因');
|
|
|
+ const data = Object.assign({}, pending);
|
|
|
+ if (data.type === 'flow-return') {
|
|
|
+ const checkType = Number($('[name="quality-flow-return-type"]:checked').val());
|
|
|
+ if (![5, 6].includes(checkType) || (checkType === 6 && !inspection.flowCanReturnPrevious)) {
|
|
|
+ toastr.error('请选择退回位置');
|
|
|
return;
|
|
|
}
|
|
|
+ data.type = 'flow-check';
|
|
|
+ data.checkType = checkType;
|
|
|
}
|
|
|
- request(pending, $(this), true);
|
|
|
+ if (data.type === 'flow-check') {
|
|
|
+ data.opinion = $('#quality-flow-opinion').val().trim();
|
|
|
+ if (data.checkType !== 3 && !data.opinion) {
|
|
|
+ toastr.error(pending.type === 'flow-return' ? '请填写退回意见' : '请填写退回或关闭原因');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request(data, $(this), true);
|
|
|
});
|
|
|
}
|
|
|
|