market_api_923
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!-- 用户编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
width="680px"
|
||||
width="750px"
|
||||
:visible="visible"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="true"
|
||||
@@ -18,6 +18,13 @@
|
||||
placeholder="请输入活动标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属门店:" prop="bizId">
|
||||
<org-select
|
||||
:data="organizationList"
|
||||
placeholder="请选择所属门店"
|
||||
v-model="form.bizId"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景图片:" prop="bgImg">
|
||||
<ele-image-upload
|
||||
v-model="form.bgImg"
|
||||
@@ -52,7 +59,7 @@
|
||||
<el-input
|
||||
v-model="form.introduction"
|
||||
placeholder="请输入活动简介"
|
||||
:rows="4"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -87,18 +94,22 @@
|
||||
<script>
|
||||
import EleImageUpload from 'ele-admin/es/ele-image-upload';
|
||||
import request from '@/utils/request';
|
||||
import OrgSelect from '@/views/sylive/organization/components/org-select.vue';
|
||||
import { addActivity, updateActivity } from '@/api/sylive/activity';
|
||||
export default {
|
||||
components: { EleImageUpload },
|
||||
components: { EleImageUpload, OrgSelect },
|
||||
props: {
|
||||
// 弹窗是否打开
|
||||
visible: Boolean,
|
||||
// 修改回显的数据
|
||||
data: Object
|
||||
data: Object,
|
||||
// 全部机构
|
||||
organizationList: Array
|
||||
},
|
||||
data() {
|
||||
const defaultForm = {
|
||||
activityId: null,
|
||||
bizId: null,
|
||||
title: '',
|
||||
channelId: '',
|
||||
dateRange: '',
|
||||
@@ -120,6 +131,13 @@
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
bizId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择所属门店',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
bgImg: [
|
||||
{
|
||||
required: true,
|
||||
@@ -195,8 +213,6 @@
|
||||
...this.form
|
||||
};
|
||||
const saveOrUpdate = this.isUpdate ? updateActivity : addActivity;
|
||||
console.log(3333);
|
||||
console.log(data);
|
||||
saveOrUpdate(data)
|
||||
.then((msg) => {
|
||||
this.loading = false;
|
||||
@@ -292,11 +308,11 @@
|
||||
if (visible) {
|
||||
if (this.data) {
|
||||
this.$util.assignObject(this.form, {
|
||||
...this.data,
|
||||
password: ''
|
||||
...this.data
|
||||
});
|
||||
this.isUpdate = true;
|
||||
} else {
|
||||
this.form.organizationId = this.organizationId;
|
||||
this.isUpdate = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -66,7 +66,12 @@
|
||||
</ele-pro-table>
|
||||
</el-card>
|
||||
<!-- 编辑弹窗 -->
|
||||
<activity-edit :visible.sync="showEdit" :data="current" @done="reload" />
|
||||
<activity-edit
|
||||
:data="current"
|
||||
:visible.sync="showEdit"
|
||||
:organization-list="organizationList"
|
||||
@done="reload"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -79,6 +84,7 @@
|
||||
removeActivitys,
|
||||
updateActivityStatus
|
||||
} from '@/api/sylive/activity';
|
||||
import { listOrganizations } from '@/api/sylive/organization';
|
||||
|
||||
export default {
|
||||
name: 'syliveActivity',
|
||||
@@ -88,6 +94,10 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 加载状态
|
||||
loading: true,
|
||||
// 门店数据
|
||||
organizationList: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
@@ -172,7 +182,27 @@
|
||||
showEdit: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.organizationQuery();
|
||||
},
|
||||
methods: {
|
||||
/* 查询机构 */
|
||||
organizationQuery() {
|
||||
this.loading = true;
|
||||
listOrganizations({ unOrganizationType: 4 })
|
||||
.then((list) => {
|
||||
this.loading = false;
|
||||
this.organizationList = this.$util.toTreeData({
|
||||
data: list,
|
||||
idField: 'organizationId',
|
||||
parentIdField: 'parentId'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
this.loading = false;
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 表格数据源 */
|
||||
datasource({ page, limit, where, order }) {
|
||||
return pageActivity({ ...where, ...order, page, limit });
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
<!--<el-button
|
||||
size="small"
|
||||
icon="el-icon-upload2"
|
||||
class="ele-btn-icon"
|
||||
@click="openImport"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</template>
|
||||
<!-- 用户名列 -->
|
||||
<template v-slot:nickname="{ row }">
|
||||
|
||||
Reference in New Issue
Block a user