|
@@ -42,7 +42,9 @@
|
|
|
</a-form>
|
|
|
</a-spin>
|
|
|
<template slot="footer">
|
|
|
- <a-button type="primary" @click="handleSubmit" :loading="loading"> 确定 </a-button>
|
|
|
+ <!-- <a-button type="primary" @click="handleSubmit" :loading="loading"> 确定 </a-button> -->
|
|
|
+ <a-button type="default" @click="()=>{this.visible=false}" :loading="loading"> 取消 </a-button>
|
|
|
+ <a-button type="primary" @click="handleSubmit" :loading="loading"> {{this.type=='add'?'确定':'修改'}} </a-button>
|
|
|
</template>
|
|
|
</a-modal>
|
|
|
</template>
|
|
@@ -68,6 +70,7 @@ export default {
|
|
|
|
|
|
populationData: {},
|
|
|
accountId: '',
|
|
|
+ templateId:undefined,
|
|
|
type: 'add',
|
|
|
loading: false,
|
|
|
}
|
|
@@ -87,6 +90,8 @@ export default {
|
|
|
this.type = type
|
|
|
var params = {}
|
|
|
params.templateId = templateId
|
|
|
+ this.templateId=templateId;
|
|
|
+ this.accountId = accountId
|
|
|
getAction('/batch/kuaishouTemplateTarget/getDetailByTemplateId', params).then((res) => {
|
|
|
if (res.success) {
|
|
|
var dataJson = {
|
|
@@ -159,14 +164,14 @@ export default {
|
|
|
this.$refs.population.handleSubmit()
|
|
|
this.form.validateFieldsAndScroll((err, values) => {
|
|
|
if (!err) {
|
|
|
- this.loading = true
|
|
|
+ // this.loading = true
|
|
|
|
|
|
var params = {
|
|
|
...this.populationData,
|
|
|
templateName: values.templateName,
|
|
|
accountId: this.accountId,
|
|
|
}
|
|
|
-
|
|
|
+ console.log(params)
|
|
|
if (this.type == 'add') {
|
|
|
postAction('/batch/kuaishouTemplate/createTemplate', params).then((res) => {
|
|
|
if (res.success) {
|
|
@@ -186,7 +191,25 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else if (this.type == 'look') {
|
|
|
- this.visible = false
|
|
|
+ params.templateId=this.templateId
|
|
|
+ this.visible = false;
|
|
|
+ postAction('/batch/kuaishouTemplate/updateTemplate', params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.visible = false
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ getAction('/batch/kuaishouTemplate/getTemplateByAccountId', {
|
|
|
+ accountId: this.accountId,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$emit('getData', this.accountId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error(res.result.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|