|
@@ -501,6 +501,13 @@ export default {
|
|
|
param = paramsAll;
|
|
|
}
|
|
|
// this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
|
|
|
+
|
|
|
+ if (!this.isEdit) {
|
|
|
+ // 新增页面
|
|
|
+ this.saveDisable = true
|
|
|
+ this.sendSaveOrEdit(param)
|
|
|
+ return
|
|
|
+ }
|
|
|
this.showSaveDialog(
|
|
|
param,
|
|
|
'<div><p style="color: #333333">确定保存修改内容?</p><p style="color: #D70A25">保存后将覆盖原有数据,且原有数据无法恢复。</p></div>'
|
|
@@ -509,34 +516,40 @@ export default {
|
|
|
showSaveDialog(param, msg) {
|
|
|
this.showConfirmDialog(msg, () => {
|
|
|
this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
- api
|
|
|
- .saveTermPrompts(param)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === '0') {
|
|
|
- this.isSuccessUpload = 0; // 修改文件上传状态为0
|
|
|
- this.warning(res.data.msg || '保存成功', 'success');
|
|
|
- this.isSaveSuccess = true; // 保存成功,可正常退出
|
|
|
- //返回带搜索条件的首页
|
|
|
- this.$router.push({
|
|
|
- name: 'MedicinePrompt',
|
|
|
- params: Object.assign({}, this.$route.params, {
|
|
|
- currentPage: 1
|
|
|
- })
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.warning(res.data.msg);
|
|
|
- }
|
|
|
- this.saveDisable = false;
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- if (err.code === '900010001') {
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.saveDisable = false;
|
|
|
- this.warning(err);
|
|
|
- });
|
|
|
+ this.sendSaveOrEdit(param)
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ //保存编辑 接口
|
|
|
+ sendSaveOrEdit(param) {
|
|
|
+ api
|
|
|
+ .saveTermPrompts(param)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ this.isSuccessUpload = 0; // 修改文件上传状态为0
|
|
|
+ this.warning(res.data.msg || '保存成功', 'success');
|
|
|
+ this.isSaveSuccess = true; // 保存成功,可正常退出
|
|
|
+ //返回带搜索条件的首页
|
|
|
+ this.$router.push({
|
|
|
+ name: 'MedicinePrompt',
|
|
|
+ params: Object.assign({}, this.$route.params, {
|
|
|
+ currentPage: 1
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.warning(res.data.msg);
|
|
|
+ }
|
|
|
+ this.saveDisable = false;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ if (err.code === '900010001') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.saveDisable = false;
|
|
|
+ this.warning(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
// 弹出窗
|
|
|
showConfirmDialog(msg, resolve) {
|
|
|
this.$confirm(msg, '', {
|