|
|
@@ -55,8 +55,9 @@
|
|
|
|
|
|
<ss-bottom
|
|
|
v-if="showBottom"
|
|
|
- :buttons="bottomButtons"
|
|
|
+ :buttons="bottomSubmitting ? [{ text: '提交中...', action: 'saveSubmit' }] : bottomButtons"
|
|
|
@button-click="handleBottomAction"
|
|
|
+ :disabled="bottomSubmitting"
|
|
|
>
|
|
|
</ss-bottom>
|
|
|
|
|
|
@@ -247,8 +248,14 @@
|
|
|
return objectName === 'xxwjjl' || service.startsWith('xxwjjl_');
|
|
|
};
|
|
|
|
|
|
+ const isDisciplineAppearanceEntry = (serviceName = '', objName = '') => {
|
|
|
+ const service = String(serviceName || state.service || getUrlParams().service || '').trim();
|
|
|
+ const objectName = String(objName || state.ssObjName || '').trim();
|
|
|
+ return objectName === 'fjyrjc' || service.startsWith('fjyrjc_');
|
|
|
+ };
|
|
|
+
|
|
|
const makeCloseBottomButton = (serviceName = '', objName = '') => ({
|
|
|
- text: isSchoolViolationEntry(serviceName, objName) ? '取消' : '关闭',
|
|
|
+ text: isSchoolViolationEntry(serviceName, objName) || isDisciplineAppearanceEntry(serviceName, objName) ? '取消' : '关闭',
|
|
|
action: 'close'
|
|
|
});
|
|
|
|
|
|
@@ -257,7 +264,7 @@
|
|
|
text: text || '保存并提交',
|
|
|
action: 'saveSubmit'
|
|
|
};
|
|
|
- if (!isSchoolViolationEntry(serviceName, objName)) {
|
|
|
+ if (!isSchoolViolationEntry(serviceName, objName) && !isDisciplineAppearanceEntry(serviceName, objName)) {
|
|
|
button.backgroundColor = '#575d6d';
|
|
|
button.color = '#fff';
|
|
|
}
|
|
|
@@ -417,7 +424,10 @@
|
|
|
};
|
|
|
|
|
|
const submitSaveAndCommit = async () => {
|
|
|
+ const alignDormitorySubmit = isDisciplineAppearanceEntry(state.service, state.ssObjName);
|
|
|
+ if (alignDormitorySubmit && state.vm && state.vm.bottomSubmitting) return;
|
|
|
try {
|
|
|
+ if (alignDormitorySubmit && state.vm) state.vm.bottomSubmitting = true;
|
|
|
const cfg = getSubmitConfig();
|
|
|
if (!state.submitEnabled || !cfg.enabled) {
|
|
|
if (typeof showToastEffect === 'function') showToastEffect('当前页面不支持保存并提交', 1800, 'warning');
|
|
|
@@ -475,6 +485,10 @@
|
|
|
serviceName: finalServ,
|
|
|
payload: finalPayload,
|
|
|
};
|
|
|
+ if (alignDormitorySubmit) {
|
|
|
+ await submitFinalConfirm();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (state.vm) {
|
|
|
state.vm.showSubmitConfirm = true;
|
|
|
}
|
|
|
@@ -490,6 +504,8 @@
|
|
|
2200,
|
|
|
'error'
|
|
|
);
|
|
|
+ } finally {
|
|
|
+ if (alignDormitorySubmit && state.vm) state.vm.bottomSubmitting = false;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -527,6 +543,7 @@
|
|
|
placeholderText: '正在加载录入页面...',
|
|
|
showBottom: true,
|
|
|
showSubmitConfirm: false,
|
|
|
+ bottomSubmitting: false,
|
|
|
bottomButtons: [
|
|
|
makeCloseBottomButton(getUrlParams().service),
|
|
|
makeSubmitBottomButton('保存并提交', getUrlParams().service)
|
|
|
@@ -539,6 +556,7 @@
|
|
|
setTimeout(updateContentHeight, 0);
|
|
|
},
|
|
|
handleBottomAction(payload) {
|
|
|
+ if (this.bottomSubmitting) return;
|
|
|
if (payload && payload.action === 'close') {
|
|
|
goBack(false);
|
|
|
return;
|