Commit 5f384ff7 by zhouzy

改bug

1 parent b082e2f7
...@@ -651,6 +651,8 @@ export default { ...@@ -651,6 +651,8 @@ export default {
this.isAdd = cd this.isAdd = cd
console.log(this.isAdd) console.log(this.isAdd)
this.ruleForm = {} this.ruleForm = {}
this.tryNum = ''
this.value = false
setTimeout(() => { setTimeout(() => {
this.clearStyle() this.clearStyle()
}, 20) }, 20)
...@@ -715,6 +717,8 @@ export default { ...@@ -715,6 +717,8 @@ export default {
this.dialogVisible = false this.dialogVisible = false
this.effectiveNum = '' this.effectiveNum = ''
this.isAdd = false this.isAdd = false
this.value = false
this.tryNum = ''
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<div class="box"> <div class="box">
<div class="equity-title">汽车权益</div> <div class="equity-title">汽车权益</div>
<div class="add-box"> <div class="add-box">
<el-button <el-button type="primary" @click="addEquity(1)">添加</el-button>
type="primary"
@click="addEquity(1)"
>添加</el-button>
</div> </div>
<div class="table-box"> <div class="table-box">
<d2-table <d2-table
...@@ -16,32 +13,21 @@ ...@@ -16,32 +13,21 @@
:hasPage="false" :hasPage="false"
:hasNum="false" :hasNum="false"
> >
<div <div slot="mainPageFlag" slot-scope="scope">
slot="mainPageFlag" <el-button type="text" @click="carsDisplay(scope.scope)">{{
slot-scope="scope" scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示'
> }}</el-button>
<el-button
type="text"
@click="carsDisplay(scope.scope)"
>{{scope.scope.mainPageFlag==1?'取消首页展示':'首页展示'}}</el-button>
</div> </div>
<span <span slot="auth-button" slot-scope="scope" :data="scope.scope">
slot="auth-button" <el-button type="text" @click="editEquity(scope.scope, 1)"
slot-scope="scope" >编辑</el-button
:data="scope.scope" >
<el-button type="text" @click="updateShelves(scope.scope, 'car')">{{
scope.scope.status == 0 ? '上架' : '下架'
}}</el-button>
<el-button type="text" @click="setTop(scope.scope.id, 'car')"
>置顶</el-button
> >
<el-button
type="text"
@click="editEquity(scope.scope,1)"
>编辑</el-button>
<el-button
type="text"
@click="updateShelves(scope.scope, 'car')"
>{{scope.scope.status == 0?'上架':'下架'}}</el-button>
<el-button
type="text"
@click="setTop(scope.scope.id,'car')"
>置顶</el-button>
</span> </span>
</d2-table> </d2-table>
</div> </div>
...@@ -49,12 +35,12 @@ ...@@ -49,12 +35,12 @@
<div class="box"> <div class="box">
<div class="equity-title">商品权益</div> <div class="equity-title">商品权益</div>
<div class="tags-box"> <div class="tags-box">
<template v-for="(item,index) in tags"> <template v-for="(item, index) in tags">
<el-tag <el-tag
:key="index" :key="index"
effect="dark" effect="dark"
:type="item.active ? '':'info'" :type="item.active ? '' : 'info'"
@click.native="changeGoodsCategory({id:item.id,index})" @click.native="changeGoodsCategory({ id: item.id, index })"
:ref="`tag-${index}`" :ref="`tag-${index}`"
@dblclick.native="showInput(index, item.goodsCategory)" @dblclick.native="showInput(index, item.goodsCategory)"
> >
...@@ -62,18 +48,17 @@ ...@@ -62,18 +48,17 @@
class="del el-icon-error" class="del el-icon-error"
@click.stop="categoryDelete(item.id)" @click.stop="categoryDelete(item.id)"
></i> ></i>
{{item.goodsCategory}} {{ item.goodsCategory }}
<el-input <el-input
class="input-tag" class="input-tag"
v-model="inputValue" v-model="inputValue"
:ref="`tag-input-${index}`" :ref="`tag-input-${index}`"
size="small" size="small"
@keyup.enter.native="changeTagName({id:item.id,index})" @keyup.enter.native="changeTagName({ id: item.id, index })"
@blur="changeTagName({id:item.id,index})" @blur="changeTagName({ id: item.id, index })"
> >
</el-input> </el-input>
</el-tag> </el-tag>
</template> </template>
<el-input <el-input
class="input-new-tag" class="input-new-tag"
...@@ -86,18 +71,12 @@ ...@@ -86,18 +71,12 @@
maxlength="8" maxlength="8"
> >
</el-input> </el-input>
<el-button <el-button class="addTag" size="small" @click="showAddInput" v-else
class="addTag" >添加分类</el-button
size="small" >
@click="showAddInput"
v-else
>添加分类</el-button>
</div> </div>
<div class="add-box"> <div class="add-box">
<el-button <el-button type="primary" @click="addEquity(2)">添加</el-button>
type="primary"
@click="addEquity(2)"
>添加</el-button>
</div> </div>
<div class="table-box"> <div class="table-box">
<d2-table <d2-table
...@@ -107,32 +86,23 @@ ...@@ -107,32 +86,23 @@
:hasPage="false" :hasPage="false"
:hasNum="false" :hasNum="false"
> >
<div <div slot="mainPageFlag" slot-scope="scope">
slot="mainPageFlag" <el-button type="text" @click="goodsDisplay(scope.scope)">{{
slot-scope="scope" scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示'
> }}</el-button>
<el-button
type="text"
@click="goodsDisplay(scope.scope)"
>{{scope.scope.mainPageFlag==1?'取消首页展示':'首页展示'}}</el-button>
</div> </div>
<span <span slot="auth-button" slot-scope="scope" :data="scope.scope">
slot="auth-button" <el-button type="text" @click="editEquity(scope.scope, 2)"
slot-scope="scope" >编辑</el-button
:data="scope.scope"
> >
<el-button <el-button
type="text" type="text"
@click="editEquity(scope.scope,2)" @click="updateShelves(scope.scope, 'goods')"
>编辑</el-button> >{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button
<el-button >
type="text" <el-button type="text" @click="setTop(scope.scope.id, 'goods')"
@click="updateShelves(scope.scope,'goods')" >置顶</el-button
>{{scope.scope.status == 0?'上架':'下架'}}</el-button> >
<el-button
type="text"
@click="setTop(scope.scope.id,'goods')"
>置顶</el-button>
</span> </span>
</d2-table> </d2-table>
</div> </div>
...@@ -151,53 +121,59 @@ import { goodsEquityManageApi, carEquityManageApi } from '@api/api' ...@@ -151,53 +121,59 @@ import { goodsEquityManageApi, carEquityManageApi } from '@api/api'
export default { export default {
name: '', name: '',
mixins: [carMixin, goodsMixin], mixins: [carMixin, goodsMixin],
data () { data() {
return { return {
showDialog: false, showDialog: false,
isEdit: false, isEdit: false,
dialogType: 1, dialogType: 1,
editData: {} editData: {},
} }
}, },
mounted () { mounted() {
this.init() this.init()
}, },
methods: { methods: {
/*更改汽车展示状态 */ /*更改汽车展示状态 */
carsDisplay (row) { carsDisplay(row) {
if (row.mainPageFlag == 0) { if (row.mainPageFlag == 0) {
carEquityManageApi carEquityManageApi
.cardsDisplay({ id: row.id, mainPageFlag: 1 }) .cardsDisplay({ id: row.id, mainPageFlag: 1 })
.then(res => { }) .then((res) => {
this.getCarList()
})
} else { } else {
carEquityManageApi carEquityManageApi
.cardsDisplay({ id: row.id, mainPageFlag: 0 }) .cardsDisplay({ id: row.id, mainPageFlag: 0 })
.then(res => { }) .then((res) => {
}
this.getCarList() this.getCarList()
})
}
}, },
/*改变商品展示状态 */ /*改变商品展示状态 */
goodsDisplay (row) { goodsDisplay(row) {
if (row.mainPageFlag == 0) { if (row.mainPageFlag == 0) {
goodsEquityManageApi goodsEquityManageApi
.goodsDisplay({ id: row.id, mainPageFlag: 1 }) .goodsDisplay({ id: row.id, mainPageFlag: 1 })
.then(res => { }) .then((res) => {
this.getCategoryList()
})
} else { } else {
goodsEquityManageApi goodsEquityManageApi
.goodsDisplay({ id: row.id, mainPageFlag: 0 }) .goodsDisplay({ id: row.id, mainPageFlag: 0 })
.then(res => { }) .then((res) => {
}
this.getCategoryList() this.getCategoryList()
})
}
}, },
init () { init() {
this.getCarList() this.getCarList()
this.getCategoryList() this.getCategoryList()
}, },
addEquity (type) { addEquity(type) {
this.dialogType = type this.dialogType = type
this.showDialog = true this.showDialog = true
}, },
setTop (id, type) { setTop(id, type) {
let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi
target.setTop({ id }).then(({ code, message }) => { target.setTop({ id }).then(({ code, message }) => {
if (code == 0) { if (code == 0) {
...@@ -208,12 +184,12 @@ export default { ...@@ -208,12 +184,12 @@ export default {
} }
}) })
}, },
editEquity (data, type) { editEquity(data, type) {
this.editData = data this.editData = data
this.isEdit = true this.isEdit = true
this.addEquity(type) this.addEquity(type)
}, },
updateShelves ({ id, status }, type) { updateShelves({ id, status }, type) {
let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi
status = status == 1 ? 0 : 1 status = status == 1 ? 0 : 1
const callBack = () => { const callBack = () => {
...@@ -231,15 +207,15 @@ export default { ...@@ -231,15 +207,15 @@ export default {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
center: true center: true,
}).then(() => { }).then(() => {
callBack() callBack()
}) })
} else { } else {
callBack() callBack()
} }
} },
} },
} }
</script> </script>
<style src="@a/css/tao.css"> <style src="@a/css/tao.css">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!