Compare commits
3 Commits
8e3054b3d9
...
a65df7e75f
| Author | SHA1 | Date | |
|---|---|---|---|
| a65df7e75f | |||
|
|
2a65cc5cce | ||
|
|
7dd33ed9e6 |
@@ -84,5 +84,44 @@ export default {
|
||||
method: 'post',
|
||||
data: page
|
||||
})
|
||||
},
|
||||
chooseProducts(page) {
|
||||
// 选择商品新增推荐
|
||||
return request({
|
||||
url: `/${service_name}/${new_group_name}/chooseProducts`,
|
||||
method: 'post',
|
||||
data: page
|
||||
})
|
||||
},
|
||||
getModuleByPage(page) {
|
||||
// 模块分页查询
|
||||
return request({
|
||||
url: `/${service_name}/mallModule/getByPage`,
|
||||
method: 'post',
|
||||
data: page
|
||||
})
|
||||
},
|
||||
getProductByPage(page) {
|
||||
// 商品分页查询
|
||||
return request({
|
||||
url: `/${service_name}/mallProductInfo/getByPage`,
|
||||
method: 'post',
|
||||
data: page
|
||||
})
|
||||
},
|
||||
updateModule(page) {
|
||||
// 模块显示隐藏
|
||||
return request({
|
||||
url: `/${service_name}/mallModule/update`,
|
||||
method: 'post',
|
||||
data: page
|
||||
})
|
||||
},
|
||||
fluctuation(id, type) {
|
||||
// 模块上下移动
|
||||
return request({
|
||||
url: `/${service_name}/mallModule/fluctuation/${id}/${type}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上线/下线" prop="isDownline">
|
||||
<el-form-item label="上线/下线">
|
||||
<el-radio-group v-model="advertisement.isDownline">
|
||||
<el-radio :label="1">上线</el-radio>
|
||||
<el-radio :label="0">下线</el-radio>
|
||||
<el-radio label="1">上线</el-radio>
|
||||
<el-radio label="0">下线</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -44,14 +44,14 @@
|
||||
|
||||
<el-col :span="15">
|
||||
<el-form-item label="广告链接" prop="advertiseUrl">
|
||||
<el-input v-model="advertisement.advertiseUrl" type='url' placeholder="请输入广告链接" />
|
||||
<el-input v-model="advertisement.advertiseUrl" type="url" placeholder="请输入广告链接" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="submission" @click="handleSubmit">提交</el-button>
|
||||
<el-button :size="$store.getters.size" @click="close">取消</el-button>
|
||||
<el-button :size="$store.getters.size" @click="close">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- </el-card> -->
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
components: { upload },
|
||||
data() {
|
||||
return {
|
||||
advertisement: { isDownline: '1' },
|
||||
advertisement: { isDownline: '1', positionImage: '' },
|
||||
|
||||
rules: {
|
||||
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<el-input clearable placeholder="广告名称" v-model="page.params.advertiseName" class="form_content_width" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否上线:">
|
||||
<el-select v-model="page.params.isDownline" placeholder="状态" clearable @keyup.enter.native="getByPage">
|
||||
<el-select v-model="page.params.isDownline" placeholder="状态" clearable @keyup.enter.native="getList">
|
||||
<el-option label="是" value="0" />
|
||||
<el-option label="否" value="1" />
|
||||
</el-select>
|
||||
@@ -28,7 +28,7 @@
|
||||
<el-dropdown-item :command="1">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据">
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="id" label="编号" min-width="120"></el-table-column>
|
||||
<el-table-column prop="advertiseName" label="广告名称"></el-table-column>
|
||||
@@ -82,11 +82,11 @@
|
||||
</div>
|
||||
|
||||
<el-dialog title="添加广告" :visible.sync="addDialog" v-el-drag-dialog width="45%">
|
||||
<advertisementAdd @getByPage="getByPage" @closeDialog="closeDialog" v-if="addDialog" />
|
||||
<advertisementAdd @getList="getList" @closeDialog="closeDialog" v-if="addDialog" />
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="修改广告" :visible.sync="updateDialog" v-el-drag-dialog width="45%">
|
||||
<advertisementUpdate @getByPage="getByPage" @closeDialog="closeDialog" v-if="updateDialog" :advertisement="advertisement" />
|
||||
<advertisementUpdate @getList="getList" @closeDialog="closeDialog" v-if="updateDialog" :advertisement="advertisement" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -109,6 +109,7 @@ export default {
|
||||
updateDialog: false, // 修改弹窗
|
||||
treeSelect: [],
|
||||
FromData: null,
|
||||
multipleSelection: [],
|
||||
advertisement: {},
|
||||
grid: {
|
||||
xl: 7,
|
||||
@@ -126,14 +127,41 @@ export default {
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
tableData: [],
|
||||
delData: { ids: [] }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {},
|
||||
// 批量设置商品
|
||||
batchSelect(type) {
|
||||
this.delData = {}
|
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) {
|
||||
this.$message.error('请选择需要操作的数据')
|
||||
return
|
||||
}
|
||||
this.$alert('确定批量删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.delete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
@@ -142,7 +170,10 @@ export default {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
|
||||
handleSelectionChange(val) {
|
||||
console.log('handleSelectionChange-----', val)
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
@@ -196,14 +227,18 @@ export default {
|
||||
// 删除
|
||||
del(row, scope) {
|
||||
console.log(row)
|
||||
|
||||
this.$alert('请确定删除!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = {}
|
||||
this.delData.ids.push(row)
|
||||
console.log('----', this.delData)
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.delete(row).then(res => {
|
||||
marketingApi.delete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上线/下线" prop="isDownline">
|
||||
<el-form-item label="上线/下线" >
|
||||
<el-radio-group v-model="advertisement.isDownline">
|
||||
<el-radio :label="1">上线</el-radio>
|
||||
<el-radio :label="0">下线</el-radio>
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
advertisement: { isDownline: '1' },
|
||||
advertisement: {},
|
||||
|
||||
rules: {
|
||||
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="0">设为推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="1">取消推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据">
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||
@@ -66,21 +67,24 @@
|
||||
:total="page.totalCount"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-dialog title="选择商品" :visible.sync="addDialog" v-el-drag-dialog width="45%">
|
||||
<homeProductListAdd @getList="getList" @closeDialog="closeDialog" v-if="addDialog" type="1" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marketingApi from '@/api/finance/marketing.js'
|
||||
import { loadingFn } from '@/utils/validate'
|
||||
import homeProductListAdd from './homeProductListAdd'
|
||||
export default {
|
||||
name: 'product_productClassify',
|
||||
components: {},
|
||||
components: { homeProductListAdd },
|
||||
data() {
|
||||
return {
|
||||
editDialogConfig: {
|
||||
visible: false
|
||||
},
|
||||
treeSelect: [],
|
||||
addDialog: false,
|
||||
multipleSelection: [],
|
||||
FromData: null,
|
||||
grid: {
|
||||
xl: 7,
|
||||
@@ -100,14 +104,60 @@ export default {
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
tableData: [],
|
||||
delData: { ids: [] }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {},
|
||||
batchSelect(type) {
|
||||
this.delData = {}
|
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) {
|
||||
this.$message.error('请选择需要操作的数据')
|
||||
return
|
||||
}
|
||||
if (type == 2) {
|
||||
this.$alert('确定批量删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = {}
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (type == 0) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '0'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
} else if (type == 1) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '1'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
@@ -116,8 +166,10 @@ export default {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
// 商品分类;
|
||||
goodsCategory() {},
|
||||
handleSelectionChange(val) {
|
||||
console.log('handleSelectionChange-----', val)
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
@@ -135,11 +187,13 @@ export default {
|
||||
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
console.log(row)
|
||||
console.log('-----', row)
|
||||
let data = {
|
||||
id: row.id,
|
||||
ids: [],
|
||||
isRecommended: row.isRecommended
|
||||
}
|
||||
data.ids.push(row)
|
||||
console.log('-----', data)
|
||||
marketingApi
|
||||
.whetherToRecommend(data)
|
||||
.then(async res => {
|
||||
@@ -151,7 +205,9 @@ export default {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
addClass() {
|
||||
this.addDialog = true
|
||||
},
|
||||
// 置顶
|
||||
topOne(row, scope) {
|
||||
console.log(row)
|
||||
@@ -180,10 +236,12 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = { ids: [] }
|
||||
this.delData.ids.push(row)
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(row).then(res => {
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
@@ -194,6 +252,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
closeDialog() {
|
||||
this.addDialog = false
|
||||
},
|
||||
// 表格搜索
|
||||
userSearchs() {
|
||||
this.page.currentPage = 1
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="0">设为推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="1">取消推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据">
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||
@@ -66,21 +67,23 @@
|
||||
:total="page.totalCount"
|
||||
/>
|
||||
</div>
|
||||
<el-dialog title="选择商品" :visible.sync="addDialog" v-el-drag-dialog width="45%">
|
||||
<homeProductListAdd @getList="getList" @closeDialog="closeDialog" v-if="addDialog" :type="3" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marketingApi from '@/api/finance/marketing.js'
|
||||
import { loadingFn } from '@/utils/validate'
|
||||
import homeProductListAdd from './homeProductListAdd'
|
||||
export default {
|
||||
name: 'product_productClassify',
|
||||
components: {},
|
||||
components: { homeProductListAdd },
|
||||
data() {
|
||||
return {
|
||||
editDialogConfig: {
|
||||
visible: false
|
||||
},
|
||||
treeSelect: [],
|
||||
addDialog: false,
|
||||
multipleSelection: [],
|
||||
FromData: null,
|
||||
grid: {
|
||||
xl: 7,
|
||||
@@ -100,14 +103,60 @@ export default {
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
tableData: [],
|
||||
delData: { ids: [] }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {},
|
||||
batchSelect(type) {
|
||||
this.delData = {}
|
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) {
|
||||
this.$message.error('请选择需要操作的数据')
|
||||
return
|
||||
}
|
||||
if (type == 2) {
|
||||
this.$alert('确定批量删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = {}
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (type == 0) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '0'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
} else if (type == 1) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '1'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
@@ -116,8 +165,9 @@ export default {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
// 商品分类;
|
||||
goodsCategory() {},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
@@ -128,18 +178,25 @@ export default {
|
||||
})
|
||||
)
|
||||
},
|
||||
closeDialog() {
|
||||
this.addDialog = false
|
||||
},
|
||||
pageChange(index) {
|
||||
this.page.currentPage = index
|
||||
this.getList()
|
||||
},
|
||||
|
||||
addClass() {
|
||||
this.addDialog = true
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
console.log(row)
|
||||
let data = {
|
||||
id: row.id,
|
||||
ids: [],
|
||||
isRecommended: row.isRecommended
|
||||
}
|
||||
data.ids.push(row)
|
||||
console.log('-----', data)
|
||||
marketingApi
|
||||
.whetherToRecommend(data)
|
||||
.then(async res => {
|
||||
@@ -179,10 +236,12 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = { ids: [] }
|
||||
this.delData.ids.push(row)
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(row).then(res => {
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="0">设为推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="1">取消推荐</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据">
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||
@@ -66,21 +67,24 @@
|
||||
:total="page.totalCount"
|
||||
/>
|
||||
</div>
|
||||
<el-dialog title="选择商品" :visible.sync="addDialog" v-el-drag-dialog width="45%">
|
||||
<homeProductListAdd @getList="getList" @closeDialog="closeDialog" v-if="addDialog" :type="2" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marketingApi from '@/api/finance/marketing.js'
|
||||
import { loadingFn } from '@/utils/validate'
|
||||
import homeProductListAdd from './homeProductListAdd'
|
||||
|
||||
export default {
|
||||
name: 'product_productClassify',
|
||||
components: {},
|
||||
components: { homeProductListAdd },
|
||||
data() {
|
||||
return {
|
||||
editDialogConfig: {
|
||||
visible: false
|
||||
},
|
||||
treeSelect: [],
|
||||
addDialog: false,
|
||||
multipleSelection: [],
|
||||
FromData: null,
|
||||
grid: {
|
||||
xl: 7,
|
||||
@@ -100,14 +104,60 @@ export default {
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
tableData: [],
|
||||
delData: { ids: [] }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {},
|
||||
batchSelect(type) {
|
||||
this.delData = {}
|
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) {
|
||||
this.$message.error('请选择需要操作的数据')
|
||||
return
|
||||
}
|
||||
if (type == 2) {
|
||||
this.$alert('确定批量删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = {}
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (type == 0) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '0'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
} else if (type == 1) {
|
||||
this.delData = Object.assign(this.delData, { ids: this.multipleSelection })
|
||||
this.delData.isRecommended = '1'
|
||||
marketingApi.whetherToRecommend(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
@@ -116,8 +166,9 @@ export default {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
// 商品分类;
|
||||
goodsCategory() {},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
@@ -132,14 +183,18 @@ export default {
|
||||
this.page.currentPage = index
|
||||
this.getList()
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
this.addDialog = false
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
console.log(row)
|
||||
let data = {
|
||||
id: row.id,
|
||||
ids: [],
|
||||
isRecommended: row.isRecommended
|
||||
}
|
||||
data.ids.push(row)
|
||||
console.log('-----', data)
|
||||
marketingApi
|
||||
.whetherToRecommend(data)
|
||||
.then(async res => {
|
||||
@@ -151,6 +206,10 @@ export default {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
addClass() {
|
||||
this.addDialog = true
|
||||
},
|
||||
// 置顶
|
||||
topOne(row, scope) {
|
||||
console.log(row)
|
||||
@@ -179,10 +238,12 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
this.delData = { ids: [] }
|
||||
this.delData.ids.push(row)
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.homeDelete(row).then(res => {
|
||||
marketingApi.homeDelete(this.delData).then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
|
||||
159
src/views/marketing/home/homeProductListAdd.vue
Normal file
159
src/views/marketing/home/homeProductListAdd.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="article-manager">
|
||||
<el-card :bordered="false" shadow="never" class="ivu-mt-16">
|
||||
<div>
|
||||
<el-form :model="page" label-width="80px" label-position="right" inline @submit.native.prevent>
|
||||
<el-form-item label="商品名称:">
|
||||
<el-input clearable placeholder="商品名称" v-model="page.params.productName" class="form_content_width" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="userSearchs">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column prop="id" label="编号" min-width="120"></el-table-column>
|
||||
<el-table-column prop="productName" label="商品名称" min-width="100"></el-table-column>
|
||||
<el-table-column prop="productNum" label="货号" min-width="120" align="center"></el-table-column>
|
||||
<el-table-column prop="price" label="价格" align="right"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<div class="acea-row row-right page">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page.currentPage"
|
||||
:page-sizes="[10, 15, 20, 30]"
|
||||
:page-size="page.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="page.totalCount"
|
||||
/>
|
||||
<el-col :span="24" style="text-align: right;padding-top:20px">
|
||||
<el-button @click="close">取消</el-button>
|
||||
<el-button type="primary" @click="submit">提交</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marketingApi from '@/api/finance/marketing.js'
|
||||
import { loadingFn } from '@/utils/validate'
|
||||
export default {
|
||||
name: 'product_productClassify',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: () => undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addDialog: false, // 添加弹窗
|
||||
updateDialog: false, // 修改弹窗
|
||||
multipleSelection: [],
|
||||
FromData: null,
|
||||
advertisement: { productList: [{ id: '', productName: '' }] },
|
||||
grid: {
|
||||
xl: 7,
|
||||
lg: 7,
|
||||
md: 12,
|
||||
sm: 24,
|
||||
xs: 24
|
||||
},
|
||||
loading: false,
|
||||
|
||||
page: {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
params: {},
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
created() {
|
||||
this.advertisement.type = this.type
|
||||
},
|
||||
methods: {
|
||||
// 批量设置商品
|
||||
batchSelect(type) {},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.getProductByPage(this.page).then(res => {
|
||||
if ((res.code = 20000)) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data)
|
||||
})
|
||||
)
|
||||
},
|
||||
pageChange(index) {
|
||||
this.page.currentPage = index
|
||||
this.getList()
|
||||
},
|
||||
submit() {
|
||||
// 保存
|
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) {
|
||||
this.$message.error('请选择需要操作的数据')
|
||||
return
|
||||
}
|
||||
|
||||
this.advertisement = Object.assign(this.advertisement, { productList: this.multipleSelection })
|
||||
console.log('---------------', this.advertisement)
|
||||
marketingApi.chooseProducts(this.advertisement).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.$emit('closeDialog')
|
||||
this.$emit('getList')
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('closeDialog')
|
||||
},
|
||||
// 表格搜索
|
||||
userSearchs() {
|
||||
this.page.currentPage = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="stylus">
|
||||
.treeSel ::v-deep .ivu-select-dropdown-list {
|
||||
padding: 0 10px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tabBox_img {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<div class="article-manager">
|
||||
<div :bordered="false" shadow="never" class="ivu-mt-16">
|
||||
<div class="module">
|
||||
<div class="text mt50">模块设置</div>
|
||||
<div class="text-left mt50"></div>
|
||||
<el-table row-key="id" class="tab mt14" v-loading="loading" :data="tableData" empty-text="暂无数据">
|
||||
<el-table-column prop="moduleName" label="名称" align="center"></el-table-column>
|
||||
|
||||
<el-table-column prop="isReveal" label="显示隐藏" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
@change="onchangeIsShow(scope.row)"
|
||||
v-model="scope.row.isReveal"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button plain type="info" @click="toUp(scope.row)" icon="el-icon-upload2">上移</el-button>
|
||||
|
||||
<el-button plain @click="toDown(scope.row, scope)" type="info" icon="el-icon-download">下移</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row slot="button-group" style="margin-top:5px" v-if="false">
|
||||
<el-col :offset="22">
|
||||
<el-button type="primary" :size="$store.getters.size" @click="submit">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marketingApi from '@/api/finance/marketing.js'
|
||||
import { loadingFn } from '@/utils/validate'
|
||||
export default {
|
||||
name: 'product_productClassify',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
editDialogConfig: {
|
||||
visible: false
|
||||
},
|
||||
treeSelect: [],
|
||||
FromData: null,
|
||||
grid: {
|
||||
xl: 7,
|
||||
lg: 7,
|
||||
md: 12,
|
||||
sm: 24,
|
||||
xs: 24
|
||||
},
|
||||
loading: false,
|
||||
|
||||
page: {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
params: {
|
||||
type: '1'
|
||||
},
|
||||
totalCount: 0
|
||||
},
|
||||
total: 0,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleCommand(e) {},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.currentPage = val
|
||||
this.getList()
|
||||
},
|
||||
// 商品分类;
|
||||
goodsCategory() {},
|
||||
// 列表
|
||||
getList() {
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.getModuleByPage(this.page).then(res => {
|
||||
if ((res.code = 20000)) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data)
|
||||
})
|
||||
)
|
||||
},
|
||||
pageChange(index) {
|
||||
this.page.currentPage = index
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
console.log(row)
|
||||
let data = {
|
||||
id: row.id,
|
||||
isReveal: row.isReveal
|
||||
}
|
||||
marketingApi
|
||||
.updateModule(data)
|
||||
.then(async res => {
|
||||
this.$message.success(res.msg)
|
||||
this.getList()
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.msg)
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
// 上移
|
||||
toUp(row, scope) {
|
||||
console.log(row)
|
||||
this.$alert('请确定将改模块上移!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.fluctuation(row.id, '1').then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 下移
|
||||
toDown(row, scope) {
|
||||
this.$alert('请确定将改模块下移!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
if (action == 'confirm') {
|
||||
loadingFn.call(
|
||||
this,
|
||||
'loading',
|
||||
marketingApi.fluctuation(row.id, '0').then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.$message.success('操作成功!')
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表格搜索
|
||||
userSearchs() {
|
||||
this.page.currentPage = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.module {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.text {
|
||||
font-size: 18px;
|
||||
background: #9ea7b4;
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
line-height: 50px;
|
||||
padding-left: 50px;
|
||||
color: white;
|
||||
width: 200px;
|
||||
}
|
||||
.text-left {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 25px solid;
|
||||
border-color: transparent transparent transparent #9ea7b4;
|
||||
}
|
||||
.tab {
|
||||
width: 200px;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -25,9 +25,8 @@ module.exports = {
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
// target: `cls`,
|
||||
target: `http://192.168.0.24:38080`,
|
||||
// target: `http://192.168.0.23:38080`,
|
||||
// target: `http://192.168.0.24:38080`,
|
||||
target: `http://192.168.0.22:38080`,
|
||||
// target: `http://192.168.1.83:38080`,
|
||||
// target: 'http://222.132.26.119:8081',
|
||||
// target: `https://www.xingoil.com/adminapi`,
|
||||
|
||||
Reference in New Issue
Block a user