|
@@ -13,7 +13,7 @@
|
|
|
<el-col :span="24" class="main">
|
|
|
<div class="w_1200">
|
|
|
<el-col :span="24" class="info">
|
|
|
- <fabuList @submit="submit" :form="form"></fabuList>
|
|
|
+ <fabuList @submit="submit" :form="form" @caogao="caogao"></fabuList>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -53,6 +53,8 @@ export default {
|
|
|
...demand(['update', 'fetch', 'query', 'create', 'delete']),
|
|
|
async submit() {
|
|
|
let res = {};
|
|
|
+
|
|
|
+ this.form.status = '1';
|
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
|
if (data.id) {
|
|
|
res = await this.update(data);
|
|
@@ -70,6 +72,28 @@ export default {
|
|
|
this.$message.error('信息创建失败');
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ async caogao() {
|
|
|
+ let res = {};
|
|
|
+
|
|
|
+ this.form.status = '0';
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ if (data.id) {
|
|
|
+ res = await this.update(data);
|
|
|
+ } else {
|
|
|
+ data.uid = this.user.uid;
|
|
|
+ res = await this.create(data);
|
|
|
+ }
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '保存草稿成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.display = true;
|
|
|
+ } else {
|
|
|
+ this.$message.error('信息创建失败');
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|