Commit fa426a9f authored by 刘怀志's avatar 刘怀志

banner暂存

parent 8ebf869f
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="所属商家:" prop="unitId">
<el-select v-model="queryParams.unitId" :disabled="!queryShop" filterable placeholder="请选择所属商家" style="width: 100%">
<el-option
v-for="(item,index) in deptList"
:key="index"
:label="item.unitName"
:value="item.businessId"
/>
</el-select>
</el-form-item>
<el-form-item label="名称:" prop="bannerName">
<el-input
v-model.trim="queryParams.bannerName"
......@@ -135,6 +144,13 @@
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
v-if="queryShop"
:class="commonField.resetPasClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleShareShop(scope.row)"
>分配商家</el-button>
</template>
</el-table-column>
</el-table>
......@@ -197,6 +213,31 @@
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
<el-dialog
:close-on-click-modal="false"
title="分配商家"
width="30%"
custom-class="paddingFixed"
:visible.sync="shareShopDiaLog"
@close="$refs.ruleForm.resetFields(),pwdType = 'password'"
>
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="auto" class="demo-ruleForm">
<el-form-item label="分配商家:" prop="shops">
<el-select v-model="ruleForm.shops" class="shopselect" filterable placeholder="请选择商家" multiple>
<el-option
v-for="(item,index) in deptList"
:key="index"
:label="item.unitName"
:value="item.businessId"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="shareShopDiaLog = false">取 消</el-button>
<el-button class="submitBtn" :disabled="shareShopLoading" :loading="shareShopLoading" type="primary" @click="handleShareShopSure">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -211,17 +252,23 @@ import {
updateCmsBanner
} from '@/api/contentManagement/cmsBanner'
import { uploadPublic } from '@/api/contentManagement/sysContest'
import {mapGetters} from "vuex";
import {listAllShop} from "@/api/sysUnit";
import {shareShop} from "@/api/contentManagement/sysContentNewsInformation";
export default {
name: 'CmsBanner',
data() {
return {
queryShop: true,
imageUrl: '',
shareShopDiaLog: false,
shareShopLoading: false,
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development',
// 遮罩层
loading: true,
// 总条数
total: 0,
deptList: [],
// banner管理表格数据
cmsBannerList: [],
// 弹出层标题
......@@ -248,12 +295,17 @@ export default {
type: undefined,
weight: undefined,
linkUrl: undefined,
flag: ''
flag: '',
unitId: ''
},
showImg: false,
imagUrl: '',
// 表单参数
form: {},
ruleForm: {
shops: [],
row: ''
},
// 表单校验
rules: {
bannerName: [
......@@ -277,14 +329,66 @@ export default {
},
computed: {
...mapGetters(['roles', 'deptId']),
commonField() {
return commonField
}
},
created() {
this.roleFunction()
this.getDeptList()
this.getList() // 列表查询
},
methods: {
/** 修改密码确定操作*/
handleShareShopSure() {
this.$refs.ruleForm.validate(pass => {
if (pass) {
this.shareShopLoading = true
const temp = {
newsVideoId: this.ruleForm.row,
unitId: this.ruleForm.shops.join(','),
type: '0'
}
shareShop(temp).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.shareShopDiaLog = false
this.loadData()
}
this.shareShopLoading = false
}).catch(e => { this.shareShopLoading = false })
} else {
return false
}
})
},
getDeptList() {
listAllShop().then(res => {
if (res.code === 200) {
this.deptList = res.data
}
})
},
handleShareShop(row) {
if (row.unitId) {
this.ruleForm.shops = JSON.parse(row.unitId)
} else {
this.ruleForm.shops = []
}
this.ruleForm.row = row.businessId
this.shareShopDiaLog = !this.shareShopDiaLog
},
roleFunction() {
if (this.roles[0].roleKey !== 'admin') {
console.log('this.roles', this.roles)
this.queryShop = false
this.queryParams.unitId = this.deptId
}
},
// 封面图片预览
justEnter(event) {},
justOut(event) {},
......@@ -385,8 +489,10 @@ export default {
type: undefined,
weight: undefined,
linkUrl: undefined,
flag: ''
flag: '',
unitId: ''
}
this.roleFunction()
this.handleQuery()
},
/** 新增按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment