浏览代码

新闻暂存

gks 1 年之前
父节点
当前提交
37a87f5118
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 9 4
      src/views/news/edit.vue

+ 9 - 4
src/views/news/edit.vue

@@ -45,7 +45,7 @@
         v-if="checkPermi(['business:NEWS:confirm'])"
         type="warning"
         @click="submitForm('draft')"
-        >暂 存</el-button
+        >暂 存1</el-button
       >
       <el-button @click="$layer.close(layerid)">取 消</el-button>
     </div>
@@ -131,16 +131,14 @@ export default {
         if (valid) {
           this.form.status = 1;
           if (this.form.id != null && type == "add") {
-            
             updateNEWS(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.$layer.close(this.layerid);
               this.$parent.getList();
             });
           } else {
-            if (type == "draft") {
+            if (this.form.id != null && type == "draft") {
               this.form.status = 0;
-           
               updateNEWS(this.form).then((response) => {
                 this.$modal.msgSuccess("修改成功");
                 this.$layer.close(this.layerid);
@@ -152,6 +150,13 @@ export default {
                 this.$layer.close(this.layerid);
                 this.$parent.getList();
               });
+            } else if (type == "draft") {
+              this.form.status = 0;
+              addNEWS(this.form).then((response) => {
+                this.$modal.msgSuccess("操作成功");
+                this.$layer.close(this.layerid);
+                this.$parent.getList();
+              });
             }
           }
         }