Compare commits
3 Commits
8e3054b3d9
...
a65df7e75f
| Author | SHA1 | Date | |
|---|---|---|---|
| a65df7e75f | |||
|
|
2a65cc5cce | ||
|
|
7dd33ed9e6 |
@@ -84,5 +84,44 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: page
|
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>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上线/下线" prop="isDownline">
|
<el-form-item label="上线/下线">
|
||||||
<el-radio-group v-model="advertisement.isDownline">
|
<el-radio-group v-model="advertisement.isDownline">
|
||||||
<el-radio :label="1">上线</el-radio>
|
<el-radio label="1">上线</el-radio>
|
||||||
<el-radio :label="0">下线</el-radio>
|
<el-radio label="0">下线</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -44,14 +44,14 @@
|
|||||||
|
|
||||||
<el-col :span="15">
|
<el-col :span="15">
|
||||||
<el-form-item label="广告链接" prop="advertiseUrl">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" class="submission" @click="handleSubmit">提交</el-button>
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- </el-card> -->
|
<!-- </el-card> -->
|
||||||
@@ -65,7 +65,7 @@ export default {
|
|||||||
components: { upload },
|
components: { upload },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
advertisement: { isDownline: '1' },
|
advertisement: { isDownline: '1', positionImage: '' },
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<el-input clearable placeholder="广告名称" v-model="page.params.advertiseName" class="form_content_width" />
|
<el-input clearable placeholder="广告名称" v-model="page.params.advertiseName" class="form_content_width" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否上线:">
|
<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="0" />
|
||||||
<el-option label="否" value="1" />
|
<el-option label="否" value="1" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<el-dropdown-item :command="1">删除</el-dropdown-item>
|
<el-dropdown-item :command="1">删除</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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 type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column prop="id" label="编号" min-width="120"></el-table-column>
|
<el-table-column prop="id" label="编号" min-width="120"></el-table-column>
|
||||||
<el-table-column prop="advertiseName" label="广告名称"></el-table-column>
|
<el-table-column prop="advertiseName" label="广告名称"></el-table-column>
|
||||||
@@ -82,11 +82,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog title="添加广告" :visible.sync="addDialog" v-el-drag-dialog width="45%">
|
<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>
|
||||||
|
|
||||||
<el-dialog title="修改广告" :visible.sync="updateDialog" v-el-drag-dialog width="45%">
|
<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>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -109,6 +109,7 @@ export default {
|
|||||||
updateDialog: false, // 修改弹窗
|
updateDialog: false, // 修改弹窗
|
||||||
treeSelect: [],
|
treeSelect: [],
|
||||||
FromData: null,
|
FromData: null,
|
||||||
|
multipleSelection: [],
|
||||||
advertisement: {},
|
advertisement: {},
|
||||||
grid: {
|
grid: {
|
||||||
xl: 7,
|
xl: 7,
|
||||||
@@ -126,14 +127,41 @@ export default {
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
tableData: []
|
tableData: [],
|
||||||
|
delData: { ids: [] }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
handleSizeChange(val) {
|
||||||
this.page.pageSize = val
|
this.page.pageSize = val
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -142,7 +170,10 @@ export default {
|
|||||||
this.page.currentPage = val
|
this.page.currentPage = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
console.log('handleSelectionChange-----', val)
|
||||||
|
this.multipleSelection = val
|
||||||
|
},
|
||||||
// 列表
|
// 列表
|
||||||
getList() {
|
getList() {
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
@@ -196,14 +227,18 @@ export default {
|
|||||||
// 删除
|
// 删除
|
||||||
del(row, scope) {
|
del(row, scope) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
|
|
||||||
this.$alert('请确定删除!', '提示', {
|
this.$alert('请确定删除!', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
callback: action => {
|
callback: action => {
|
||||||
if (action == 'confirm') {
|
if (action == 'confirm') {
|
||||||
|
this.delData = {}
|
||||||
|
this.delData.ids.push(row)
|
||||||
|
console.log('----', this.delData)
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
this,
|
this,
|
||||||
'loading',
|
'loading',
|
||||||
marketingApi.delete(row).then(res => {
|
marketingApi.delete(this.delData).then(res => {
|
||||||
if ((res.code = 20000)) {
|
if ((res.code = 20000)) {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上线/下线" prop="isDownline">
|
<el-form-item label="上线/下线" >
|
||||||
<el-radio-group v-model="advertisement.isDownline">
|
<el-radio-group v-model="advertisement.isDownline">
|
||||||
<el-radio :label="1">上线</el-radio>
|
<el-radio :label="1">上线</el-radio>
|
||||||
<el-radio :label="0">下线</el-radio>
|
<el-radio :label="0">下线</el-radio>
|
||||||
@@ -70,7 +70,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
advertisement: { isDownline: '1' },
|
advertisement: {},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
advertiseName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<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="1">取消推荐</el-dropdown-item>
|
||||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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 type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||||
@@ -66,21 +67,24 @@
|
|||||||
:total="page.totalCount"
|
:total="page.totalCount"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import marketingApi from '@/api/finance/marketing.js'
|
import marketingApi from '@/api/finance/marketing.js'
|
||||||
import { loadingFn } from '@/utils/validate'
|
import { loadingFn } from '@/utils/validate'
|
||||||
|
import homeProductListAdd from './homeProductListAdd'
|
||||||
export default {
|
export default {
|
||||||
name: 'product_productClassify',
|
name: 'product_productClassify',
|
||||||
components: {},
|
components: { homeProductListAdd },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editDialogConfig: {
|
addDialog: false,
|
||||||
visible: false
|
multipleSelection: [],
|
||||||
},
|
|
||||||
treeSelect: [],
|
|
||||||
FromData: null,
|
FromData: null,
|
||||||
grid: {
|
grid: {
|
||||||
xl: 7,
|
xl: 7,
|
||||||
@@ -100,14 +104,60 @@ export default {
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
tableData: []
|
tableData: [],
|
||||||
|
delData: { ids: [] }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
handleSizeChange(val) {
|
||||||
this.page.pageSize = val
|
this.page.pageSize = val
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -116,8 +166,10 @@ export default {
|
|||||||
this.page.currentPage = val
|
this.page.currentPage = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
// 商品分类;
|
handleSelectionChange(val) {
|
||||||
goodsCategory() {},
|
console.log('handleSelectionChange-----', val)
|
||||||
|
this.multipleSelection = val
|
||||||
|
},
|
||||||
// 列表
|
// 列表
|
||||||
getList() {
|
getList() {
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
@@ -135,11 +187,13 @@ export default {
|
|||||||
|
|
||||||
// 修改状态
|
// 修改状态
|
||||||
onchangeIsShow(row) {
|
onchangeIsShow(row) {
|
||||||
console.log(row)
|
console.log('-----', row)
|
||||||
let data = {
|
let data = {
|
||||||
id: row.id,
|
ids: [],
|
||||||
isRecommended: row.isRecommended
|
isRecommended: row.isRecommended
|
||||||
}
|
}
|
||||||
|
data.ids.push(row)
|
||||||
|
console.log('-----', data)
|
||||||
marketingApi
|
marketingApi
|
||||||
.whetherToRecommend(data)
|
.whetherToRecommend(data)
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
@@ -151,7 +205,9 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
addClass() {
|
||||||
|
this.addDialog = true
|
||||||
|
},
|
||||||
// 置顶
|
// 置顶
|
||||||
topOne(row, scope) {
|
topOne(row, scope) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
@@ -180,10 +236,12 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
callback: action => {
|
callback: action => {
|
||||||
if (action == 'confirm') {
|
if (action == 'confirm') {
|
||||||
|
this.delData = { ids: [] }
|
||||||
|
this.delData.ids.push(row)
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
this,
|
this,
|
||||||
'loading',
|
'loading',
|
||||||
marketingApi.homeDelete(row).then(res => {
|
marketingApi.homeDelete(this.delData).then(res => {
|
||||||
if ((res.code = 20000)) {
|
if ((res.code = 20000)) {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
@@ -194,6 +252,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.addDialog = false
|
||||||
|
},
|
||||||
// 表格搜索
|
// 表格搜索
|
||||||
userSearchs() {
|
userSearchs() {
|
||||||
this.page.currentPage = 1
|
this.page.currentPage = 1
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<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="1">取消推荐</el-dropdown-item>
|
||||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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 type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||||
@@ -66,21 +67,23 @@
|
|||||||
:total="page.totalCount"
|
:total="page.totalCount"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import marketingApi from '@/api/finance/marketing.js'
|
import marketingApi from '@/api/finance/marketing.js'
|
||||||
import { loadingFn } from '@/utils/validate'
|
import { loadingFn } from '@/utils/validate'
|
||||||
|
import homeProductListAdd from './homeProductListAdd'
|
||||||
export default {
|
export default {
|
||||||
name: 'product_productClassify',
|
name: 'product_productClassify',
|
||||||
components: {},
|
components: { homeProductListAdd },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editDialogConfig: {
|
addDialog: false,
|
||||||
visible: false
|
multipleSelection: [],
|
||||||
},
|
|
||||||
treeSelect: [],
|
|
||||||
FromData: null,
|
FromData: null,
|
||||||
grid: {
|
grid: {
|
||||||
xl: 7,
|
xl: 7,
|
||||||
@@ -100,14 +103,60 @@ export default {
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
tableData: []
|
tableData: [],
|
||||||
|
delData: { ids: [] }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
handleSizeChange(val) {
|
||||||
this.page.pageSize = val
|
this.page.pageSize = val
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -116,8 +165,9 @@ export default {
|
|||||||
this.page.currentPage = val
|
this.page.currentPage = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
// 商品分类;
|
handleSelectionChange(val) {
|
||||||
goodsCategory() {},
|
this.multipleSelection = val
|
||||||
|
},
|
||||||
// 列表
|
// 列表
|
||||||
getList() {
|
getList() {
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
@@ -128,18 +178,25 @@ export default {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.addDialog = false
|
||||||
|
},
|
||||||
pageChange(index) {
|
pageChange(index) {
|
||||||
this.page.currentPage = index
|
this.page.currentPage = index
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
addClass() {
|
||||||
|
this.addDialog = true
|
||||||
|
},
|
||||||
// 修改状态
|
// 修改状态
|
||||||
onchangeIsShow(row) {
|
onchangeIsShow(row) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
let data = {
|
let data = {
|
||||||
id: row.id,
|
ids: [],
|
||||||
isRecommended: row.isRecommended
|
isRecommended: row.isRecommended
|
||||||
}
|
}
|
||||||
|
data.ids.push(row)
|
||||||
|
console.log('-----', data)
|
||||||
marketingApi
|
marketingApi
|
||||||
.whetherToRecommend(data)
|
.whetherToRecommend(data)
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
@@ -179,10 +236,12 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
callback: action => {
|
callback: action => {
|
||||||
if (action == 'confirm') {
|
if (action == 'confirm') {
|
||||||
|
this.delData = { ids: [] }
|
||||||
|
this.delData.ids.push(row)
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
this,
|
this,
|
||||||
'loading',
|
'loading',
|
||||||
marketingApi.homeDelete(row).then(res => {
|
marketingApi.homeDelete(this.delData).then(res => {
|
||||||
if ((res.code = 20000)) {
|
if ((res.code = 20000)) {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
<el-dropdown class="bnt mr14" @command="batchSelect">
|
<el-dropdown class="bnt mr14" @command="batchSelect">
|
||||||
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<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="1">取消推荐</el-dropdown-item>
|
||||||
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
<el-dropdown-item :command="2">删除</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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 type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column prop="productId" label="编号"></el-table-column>
|
<el-table-column prop="productId" label="编号"></el-table-column>
|
||||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
||||||
@@ -66,21 +67,24 @@
|
|||||||
:total="page.totalCount"
|
:total="page.totalCount"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import marketingApi from '@/api/finance/marketing.js'
|
import marketingApi from '@/api/finance/marketing.js'
|
||||||
import { loadingFn } from '@/utils/validate'
|
import { loadingFn } from '@/utils/validate'
|
||||||
|
import homeProductListAdd from './homeProductListAdd'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'product_productClassify',
|
name: 'product_productClassify',
|
||||||
components: {},
|
components: { homeProductListAdd },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editDialogConfig: {
|
addDialog: false,
|
||||||
visible: false
|
multipleSelection: [],
|
||||||
},
|
|
||||||
treeSelect: [],
|
|
||||||
FromData: null,
|
FromData: null,
|
||||||
grid: {
|
grid: {
|
||||||
xl: 7,
|
xl: 7,
|
||||||
@@ -100,14 +104,60 @@ export default {
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
tableData: []
|
tableData: [],
|
||||||
|
delData: { ids: [] }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
handleSizeChange(val) {
|
||||||
this.page.pageSize = val
|
this.page.pageSize = val
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -116,8 +166,9 @@ export default {
|
|||||||
this.page.currentPage = val
|
this.page.currentPage = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
// 商品分类;
|
handleSelectionChange(val) {
|
||||||
goodsCategory() {},
|
this.multipleSelection = val
|
||||||
|
},
|
||||||
// 列表
|
// 列表
|
||||||
getList() {
|
getList() {
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
@@ -132,14 +183,18 @@ export default {
|
|||||||
this.page.currentPage = index
|
this.page.currentPage = index
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.addDialog = false
|
||||||
|
},
|
||||||
// 修改状态
|
// 修改状态
|
||||||
onchangeIsShow(row) {
|
onchangeIsShow(row) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
let data = {
|
let data = {
|
||||||
id: row.id,
|
ids: [],
|
||||||
isRecommended: row.isRecommended
|
isRecommended: row.isRecommended
|
||||||
}
|
}
|
||||||
|
data.ids.push(row)
|
||||||
|
console.log('-----', data)
|
||||||
marketingApi
|
marketingApi
|
||||||
.whetherToRecommend(data)
|
.whetherToRecommend(data)
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
@@ -151,6 +206,10 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addClass() {
|
||||||
|
this.addDialog = true
|
||||||
|
},
|
||||||
// 置顶
|
// 置顶
|
||||||
topOne(row, scope) {
|
topOne(row, scope) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
@@ -179,10 +238,12 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
callback: action => {
|
callback: action => {
|
||||||
if (action == 'confirm') {
|
if (action == 'confirm') {
|
||||||
|
this.delData = { ids: [] }
|
||||||
|
this.delData.ids.push(row)
|
||||||
loadingFn.call(
|
loadingFn.call(
|
||||||
this,
|
this,
|
||||||
'loading',
|
'loading',
|
||||||
marketingApi.homeDelete(row).then(res => {
|
marketingApi.homeDelete(this.delData).then(res => {
|
||||||
if ((res.code = 20000)) {
|
if ((res.code = 20000)) {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
this.handleCurrentChange()
|
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: {
|
proxy: {
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
// target: `cls`,
|
// 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.24:38080`,
|
||||||
|
target: `http://192.168.0.22:38080`,
|
||||||
// target: `http://192.168.1.83:38080`,
|
// target: `http://192.168.1.83:38080`,
|
||||||
// target: 'http://222.132.26.119:8081',
|
// target: 'http://222.132.26.119:8081',
|
||||||
// target: `https://www.xingoil.com/adminapi`,
|
// target: `https://www.xingoil.com/adminapi`,
|
||||||
|
|||||||
Reference in New Issue
Block a user