|
@@ -1,12 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="edit-view">
|
|
<div class="edit-view">
|
|
|
- <page-title :name="pageName">
|
|
|
|
|
- <el-button @click="$router.go(-1)">取消</el-button>
|
|
|
|
|
- <el-button @click="del" :loading="$store.state.fetchingData" type="danger" v-if="formData.id">
|
|
|
|
|
- 删除
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
|
|
|
|
|
- </page-title>
|
|
|
|
|
|
|
+ <page-title :name="pageName"></page-title>
|
|
|
<div class="edit-view__content-wrapper">
|
|
<div class="edit-view__content-wrapper">
|
|
|
<div class="edit-view__content-section">
|
|
<div class="edit-view__content-section">
|
|
|
<divider />
|
|
<divider />
|
|
@@ -237,6 +231,23 @@ export default {
|
|
|
this.$http
|
|
this.$http
|
|
|
.post('/partner/save', data, { body: 'json' })
|
|
.post('/partner/save', data, { body: 'json' })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
|
|
+ let dockings = [...this.dockings];
|
|
|
|
|
+ dockings = dockings.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ partnerId: res.id
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (dockings.length > 0) {
|
|
|
|
|
+ return this.$http.post('/docking/batchSave', {
|
|
|
|
|
+ dockings: JSON.stringify(dockings)
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Promise.resolve();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
this.saving = false;
|
|
this.saving = false;
|
|
|
this.$message.success('成功');
|
|
this.$message.success('成功');
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
@@ -280,6 +291,7 @@ export default {
|
|
|
if (this.formData.id) {
|
|
if (this.formData.id) {
|
|
|
docking.partnerId = this.formData.id;
|
|
docking.partnerId = this.formData.id;
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(docking);
|
|
|
this.dockings.push(docking);
|
|
this.dockings.push(docking);
|
|
|
},
|
|
},
|
|
|
delDocking(index) {
|
|
delDocking(index) {
|
|
@@ -287,7 +299,7 @@ export default {
|
|
|
this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
|
|
this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
if (dockings[index].id) {
|
|
if (dockings[index].id) {
|
|
|
- dockings[index] = { ...info, del: true };
|
|
|
|
|
|
|
+ dockings[index] = { ...dockings[index], del: true };
|
|
|
} else {
|
|
} else {
|
|
|
dockings.splice(index, 1);
|
|
dockings.splice(index, 1);
|
|
|
}
|
|
}
|