
9 changed files with 1295 additions and 1258 deletions
@ -1,53 +1,64 @@ |
|||||
import request from '@/utils/request' |
import request from '@/utils/request' |
||||
export function fetchList(params) { |
export function fetchList(params) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/list', |
url: '/pms/PmsBrand/list', |
||||
method:'get', |
method: 'get', |
||||
params:params |
params: params |
||||
}) |
}) |
||||
} |
} |
||||
export function createBrand(data) { |
export function createBrand(data) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/create', |
url: '/pms/PmsBrand/create', |
||||
method:'post', |
method: 'post', |
||||
data:data |
data: data |
||||
}) |
}) |
||||
} |
} |
||||
|
|
||||
|
export function updateDelivery(data) { |
||||
|
return request({ |
||||
|
url: '/pms/PmsBrand/update/delivery', |
||||
|
method: 'post', |
||||
|
params: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
export function updateShowStatus(data) { |
export function updateShowStatus(data) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/update/showStatus', |
url: '/pms/PmsBrand/update/showStatus', |
||||
method:'post', |
method: 'post', |
||||
data:data |
data: data |
||||
}) |
}) |
||||
} |
} |
||||
|
|
||||
export function updateFactoryStatus(data) { |
export function updateFactoryStatus(data) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/update/factoryStatus', |
url: '/pms/PmsBrand/update/factoryStatus', |
||||
method:'post', |
method: 'post', |
||||
data:data |
data: data |
||||
}) |
}) |
||||
} |
} |
||||
|
|
||||
export function deleteBrand(id) { |
export function deleteBrand(id) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/delete/'+id, |
url: '/pms/PmsBrand/delete/' + id, |
||||
method:'get', |
method: 'get', |
||||
}) |
}) |
||||
} |
} |
||||
|
|
||||
export function getBrand(id) { |
export function getBrand(id) { |
||||
return request({ |
return request({ |
||||
url:'/pms/PmsBrand/'+id, |
url: '/pms/PmsBrand/' + id, |
||||
method:'get', |
method: 'get', |
||||
}) |
}) |
||||
} |
|
||||
|
|
||||
export function updateBrand(id,data) { |
|
||||
return request({ |
|
||||
url:'/pms/PmsBrand/update/'+id, |
|
||||
method:'post', |
|
||||
data:data |
|
||||
}) |
|
||||
} |
} |
||||
|
|
||||
|
export function updateBrand(id, data) { |
||||
|
return request({ |
||||
|
url: '/pms/PmsBrand/update/' + id, |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
@ -1,30 +1,31 @@ |
|||||
import request from '@/utils/request' |
import request from '@/utils/request' |
||||
|
|
||||
export default { |
export default { |
||||
|
|
||||
// 查询分页列表
|
// 查询分页列表
|
||||
listPage: function(params) { |
listPage: function(params) { |
||||
return request({ |
return request({ |
||||
url: '/invoicerecords/listPage', |
url: '/invoicerecords/listPage', |
||||
method: 'post', |
method: 'post', |
||||
data: params, |
data: params, |
||||
}) |
}) |
||||
}, |
}, |
||||
|
|
||||
// 获取订单详情
|
// 获取订单详情
|
||||
getOrderDetails: function(params) { |
getOrderDetails: function(params) { |
||||
return request({ |
return request({ |
||||
url: '/empsreservoorder/OrderDetailsNew/'+params, |
// url: '/empsreservoorder/OrderDetailsNew/'+params,
|
||||
method: 'get' |
url: '/order/OrderDetailsNew/' + params, |
||||
}) |
method: 'get' |
||||
}, |
}) |
||||
|
}, |
||||
// 审核发票
|
|
||||
toExamine: function(params) { |
// 审核发票
|
||||
return request({ |
toExamine: function(params) { |
||||
url: '/invoicerecords/toExamine', |
return request({ |
||||
method: 'post', |
url: '/invoicerecords/toExamine', |
||||
data: params, |
method: 'post', |
||||
}) |
data: params, |
||||
}, |
}) |
||||
|
}, |
||||
} |
} |
After Width: | Height: | Size: 374 KiB |
@ -1,281 +1,299 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
|
|
||||
<div class="tab-header webtop"> |
<div class="tab-header webtop"> |
||||
<!-- 标题 --> |
<!-- 标题 --> |
||||
<div>轮播图信息</div> |
<div>轮播图信息</div> |
||||
<!-- start 添加修改按钮 --> |
<!-- start 添加修改按钮 --> |
||||
<div> |
<div> |
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
</div> |
</div> |
||||
<!-- end 添加修改按钮 --> |
<!-- end 添加修改按钮 --> |
||||
<!-- end 详情按钮 --> |
<!-- end 详情按钮 --> |
||||
</div> |
|
||||
|
|
||||
<div class="listconadd"> |
|
||||
|
|
||||
<el-card class="box-card"> |
|
||||
|
|
||||
<div class="item"> |
|
||||
<span class="item_text">标题:</span> |
|
||||
<el-input v-model="formobj.title" placeholder="" class="item_input" clearable /> |
|
||||
</div> |
</div> |
||||
|
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
<div class="listconadd"> |
||||
<span class="item_text">轮播图图片:</span> |
|
||||
<upload |
<el-card class="box-card"> |
||||
ref="uploadImg2" |
|
||||
v-model="imgList" |
<div class="item"> |
||||
style="margin-top: 20px;" |
<span class="item_text">标题:</span> |
||||
class="item_input" |
<el-input v-model="formobj.title" placeholder="" class="item_input" clearable /> |
||||
:limit="1" |
</div> |
||||
bucket="map" |
|
||||
:class="{ hide: hideUploadBtn }" |
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
:upload-data="{ type: '0001' }" |
<span class="item_text">轮播图图片:</span> |
||||
@change="backData" |
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input" :limit="1" |
||||
/> |
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" |
||||
</div> |
@change="backData" /> |
||||
<div class="item"> |
</div> |
||||
<span class="item_text">发布人:</span> |
|
||||
<el-input v-model="formobj.publisher" placeholder="" class="item_input" clearable /> |
<div class="item"> |
||||
</div> |
<span class="item_text">发布人:</span> |
||||
<div class="item"> |
<el-input v-model="formobj.publisher" placeholder="" class="item_input" clearable /> |
||||
<span class="item_text">发布日期:</span> |
</div> |
||||
<el-date-picker v-model="formobj.releaseTime" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
<div class="item"> |
||||
</div> |
<span class="item_text">发布日期:</span> |
||||
<div class="item"> |
<el-date-picker v-model="formobj.releaseTime" type="date" class="item_input" |
||||
<span class="item_text">时效开始日期:</span> |
value-format="yyyy-MM-dd" placeholder="选择日期" /> |
||||
<el-date-picker v-model="formobj.startDate" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
</div> |
||||
</div> |
<div class="item"> |
||||
<div class="item"> |
<span class="item_text">时效开始日期:</span> |
||||
<span class="item_text">时效结束日期:</span> |
<el-date-picker v-model="formobj.startDate" type="date" class="item_input" value-format="yyyy-MM-dd" |
||||
<el-date-picker v-model="formobj.endDate" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
placeholder="选择日期" /> |
||||
</div> |
</div> |
||||
|
<div class="item"> |
||||
<!-- <div class="item2"> |
<span class="item_text">时效结束日期:</span> |
||||
|
<el-date-picker v-model="formobj.endDate" type="date" class="item_input" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期" /> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="item2"> |
||||
<span class="item_text">内容:</span> |
<span class="item_text">内容:</span> |
||||
<el-input v-model="formobj.content" type="textarea" :rows="6" placeholder="商品简介" class="item_input" |
<el-input v-model="formobj.content" type="textarea" :rows="6" placeholder="商品简介" class="item_input" |
||||
clearable /> |
clearable /> |
||||
|
|
||||
</div> --> |
</div> --> |
||||
|
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
<span class="item_text">内容图片:</span> |
<span class="item_text">内容图片:</span> |
||||
<upload |
<upload ref="uploadImg3" v-model="imgListnr" style="margin-top: 20px;" class="item_input" :limit="1" |
||||
ref="uploadImg3" |
bucket="map" :class="{ hide: hideUploadBtnNr }" :upload-data="{ type: '0001' }" |
||||
v-model="imgListnr" |
@change="backDataNr" /> |
||||
style="margin-top: 20px;" |
</div> |
||||
class="item_input" |
<div class="item2"> |
||||
:limit="1" |
<span class="item_text">轮播图内容:</span> |
||||
bucket="map" |
<editor class="item_input" :height="300" :min-height="100" :value="formobj.content" |
||||
:class="{ hide: hideUploadBtnNr }" |
@input="editinput" /> |
||||
:upload-data="{ type: '0001' }" |
</div> |
||||
@change="backDataNr" |
|
||||
/> |
|
||||
</div> |
|
||||
<div class="item2"> |
|
||||
<span class="item_text">轮播图内容:</span> |
|
||||
<editor class="item_input" :height="300" :min-height="100" :value="formobj.content" @input="editinput" /> |
|
||||
</div> |
|
||||
|
|
||||
</el-card> |
</el-card> |
||||
|
|
||||
</div> |
</div> |
||||
|
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import req from '@/api/lpk/banner.js' |
import req from '@/api/lpk/banner.js' |
||||
import Editor from '@/components/Editor' |
import Editor from '@/components/Editor' |
||||
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue' |
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue' |
||||
|
|
||||
export default { |
export default { |
||||
components: { |
components: { |
||||
upload, |
upload, |
||||
Editor |
Editor |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
imgList: [], |
imgList: [], |
||||
imgListnr: [], |
imgListnr: [], |
||||
hideUploadBtn: false, |
hideUploadBtn: true, |
||||
hideUploadBtnNr: false, |
hideUploadBtnNr: false, |
||||
submitdisabled: false, |
submitdisabled: false, |
||||
formobj: { |
formobj: { |
||||
sid: '', |
sid: '', |
||||
title: '', |
title: '', |
||||
publisher: '', |
publisher: '', |
||||
releaseTime: '', |
releaseTime: '', |
||||
startDate: '', |
startDate: '', |
||||
endDate: '', |
endDate: '', |
||||
content: '', |
content: '', |
||||
bannerUrl: '', |
bannerUrl: '', |
||||
bannerPath: '', |
bannerPath: '', |
||||
contentUrl: '' |
contentUrl: '' |
||||
} |
} |
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
editinput(text) { |
|
||||
this.formobj.content = text |
|
||||
}, |
|
||||
saveOrUpdate() { |
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|
||||
req.saveNotice(this.formobj) |
|
||||
.then(resp => { |
|
||||
if (resp.success) { |
|
||||
this.$message({ |
|
||||
showClose: true, |
|
||||
type: 'success', |
|
||||
message: resp.msg |
|
||||
}) |
|
||||
this.handleReturn('true') |
|
||||
} else { |
|
||||
// 根据resp.code进行异常情况处理 |
|
||||
} |
} |
||||
}) |
}, |
||||
.catch(() => {}) |
methods: { |
||||
}, |
editinput(text) { |
||||
handleReturn(isreload) { |
this.formobj.content = text |
||||
if (isreload === 'true') this.$emit('reloadlist') |
}, |
||||
this.formobj = { |
saveOrUpdate() { |
||||
sid: '', |
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
||||
title: '', |
req.saveNotice(this.formobj) |
||||
publisher: '', |
.then(resp => { |
||||
releaseTime: '', |
if (resp.success) { |
||||
startDate: '', |
this.$message({ |
||||
endDate: '', |
showClose: true, |
||||
content: '', |
type: 'success', |
||||
bannerUrl: '', |
message: resp.msg |
||||
bannerPath: '', |
}) |
||||
contentUrl: '' |
this.handleReturn('true') |
||||
} |
} else { |
||||
this.$emit('doback') |
// 根据resp.code进行异常情况处理 |
||||
}, |
} |
||||
showAdd() {}, |
}) |
||||
showEdit(row) { |
.catch(() => {}) |
||||
req.noticeInit(row.sid) |
}, |
||||
.then(resp => { |
handleReturn(isreload) { |
||||
if (resp.success) { |
if (isreload === 'true') this.$emit('reloadlist') |
||||
this.formobj = resp.data |
this.imgList = [] |
||||
this.imgList[0].url = resp.data.bannerUrl |
this.imgListnr = [] |
||||
|
this.hideUploadBtn = true |
||||
|
this.hideUploadBtnNr = true |
||||
|
this.formobj = { |
||||
|
sid: '', |
||||
|
title: '', |
||||
|
publisher: '', |
||||
|
releaseTime: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
content: '', |
||||
|
bannerUrl: '', |
||||
|
bannerPath: '', |
||||
|
contentUrl: '' |
||||
|
} |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
showAdd() {}, |
||||
|
showEdit(row) { |
||||
|
req.noticeInit(row.sid) |
||||
|
.then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.formobj = resp.data |
||||
|
|
||||
|
this.imgList = [] |
||||
|
if (resp.data.bannerUrl != '') { |
||||
|
this.imgList.push({ |
||||
|
url: resp.data.bannerUrl |
||||
|
}) |
||||
|
} |
||||
|
this.hideUploadBtn = this.imgList.length != 0 |
||||
|
|
||||
|
this.imgListnr = [] |
||||
|
if (resp.data.contentUrl != '') { |
||||
|
this.imgListnr.push({ |
||||
|
url: resp.data.contentUrl |
||||
|
}) |
||||
|
} |
||||
|
this.hideUploadBtnNr = this.imgListnr.length != 0 |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
.catch(e => { |
||||
|
this.formobj = row |
||||
|
this.imgList = [] |
||||
|
this.imgListnr = [] |
||||
|
}) |
||||
|
}, |
||||
|
backData(value) { |
||||
|
console.log('backData》》》》', value) |
||||
|
console.log('imgList', this.imgList) |
||||
|
|
||||
|
if (this.imgList.length > 0) { |
||||
|
this.formobj.bannerUrl = this.imgList[0].url |
||||
|
} else { |
||||
|
this.formobj.bannerUrl = '' |
||||
|
} |
||||
|
|
||||
|
this.hideUploadBtn = this.imgList.length != 0 |
||||
|
|
||||
|
}, |
||||
|
backDataNr(value) { |
||||
|
if (this.imgListnr.length > 0) { |
||||
|
this.formobj.contentUrl = this.imgListnr[0].url |
||||
|
} else { |
||||
|
this.formobj.contentUrl = '' |
||||
|
} |
||||
|
|
||||
|
this.hideUploadBtnNr = this.imgListnr.length !== 0 |
||||
} |
} |
||||
}) |
|
||||
.catch(e => { |
|
||||
this.formobj = row |
|
||||
}) |
|
||||
}, |
|
||||
backData(value) { |
|
||||
console.log('backData》》》》', value) |
|
||||
console.log('imgList', this.imgList) |
|
||||
|
|
||||
if (this.imgList.length > 0) { |
|
||||
this.formobj.bannerUrl = this.imgList[0].url |
|
||||
} else { |
|
||||
this.formobj.bannerUrl = '' |
|
||||
} |
|
||||
|
|
||||
this.hideUploadBtn = this.imgList.length !== 0 |
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn) |
|
||||
}, |
|
||||
backDataNr(value) { |
|
||||
if (this.imgListnr.length > 0) { |
|
||||
this.formobj.contentUrl = this.imgListnr[0].url |
|
||||
} else { |
|
||||
this.formobj.contentUrl = '' |
|
||||
} |
} |
||||
|
|
||||
this.hideUploadBtnNr = this.imgListnr.length !== 0 |
|
||||
} |
|
||||
} |
} |
||||
} |
|
||||
</script> |
</script> |
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
// 隐藏上传组件 |
// 隐藏上传组件 |
||||
|
|
||||
.box-card { |
::v-deep .hide { |
||||
margin-left: 60px; |
.el-upload--picture-card { |
||||
margin-right: 60px; |
display: none !important; |
||||
min-width: 70%; |
|
||||
margin-top: 20px; |
|
||||
height: auto; |
|
||||
|
|
||||
.item { |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
align-items: center; |
|
||||
margin-top: 15px; |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
|
|
||||
.item_text { |
|
||||
flex: 0.8; |
|
||||
font-size: 18px; |
|
||||
text-align: right; |
|
||||
} |
|
||||
|
|
||||
.item_input { |
|
||||
flex: 4; |
|
||||
font-size: 16px; |
|
||||
margin-left: 10px; |
|
||||
margin-right: 80px; |
|
||||
} |
|
||||
|
|
||||
.item_left_input { |
|
||||
width: 20%; |
|
||||
} |
|
||||
|
|
||||
.item_left_text { |
|
||||
height: 30px; |
|
||||
margin-left: 20px; |
|
||||
line-height: 30px; |
|
||||
color: #018AD2; |
|
||||
padding: 0px 15px; |
|
||||
border: 1.5px solid #018AD2; |
|
||||
border-radius: 5px; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
.item_right { |
|
||||
flex: 1; |
|
||||
justify-items: center; |
|
||||
|
|
||||
.item_right_list_text { |
|
||||
font-size: 16px; |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
height: auto; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
.item_right_list_delect { |
|
||||
color: #5E94FF; |
|
||||
margin-left: 20px; |
|
||||
font-size: 16px; |
|
||||
text-decoration: underline; |
|
||||
} |
} |
||||
} |
|
||||
|
|
||||
} |
.item2 { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
.item2 { |
.item_input { |
||||
display: flex; |
flex: 4; |
||||
flex-direction: row; |
font-size: 16px; |
||||
align-items: center; |
margin-left: 10px; |
||||
margin-top: 15px; |
margin-right: 80px; |
||||
|
} |
||||
.item_text { |
|
||||
flex: 0.8; |
|
||||
font-size: 18px; |
|
||||
text-align: right; |
|
||||
} |
|
||||
|
|
||||
.item_input { |
|
||||
flex: 4; |
|
||||
font-size: 16px; |
|
||||
margin-left: 10px; |
|
||||
margin-right: 80px; |
|
||||
} |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
} |
} |
||||
</style> |
</style> |
@ -1,171 +1,177 @@ |
|||||
<template> |
<template> |
||||
<div class="main-content"> |
<div class="main-content"> |
||||
<el-card class="form-container" shadow="never"> |
<el-card class="form-container" shadow="never"> |
||||
<el-form ref="brandFrom" :model="brand" :rules="rules" label-width="150px"> |
<el-form ref="brandFrom" :model="brand" :rules="rules" label-width="150px"> |
||||
<el-form-item label="品牌名称:" prop="name"> |
<el-form-item label="品牌名称:" prop="name"> |
||||
<el-input v-model="brand.name" /> |
<el-input v-model="brand.name" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="品牌首字母:"> |
<el-form-item label="品牌首字母:"> |
||||
<el-input v-model="brand.firstLetter" /> |
<el-input v-model="brand.firstLetter" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="品牌LOGO:" prop="logo"> |
<el-form-item label="品牌LOGO:" prop="logo"> |
||||
<single-upload v-model="brand.logo" /> |
<single-upload v-model="brand.logo" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="品牌专区大图:"> |
<el-form-item label="品牌专区大图:"> |
||||
<single-upload v-model="brand.bigPic" /> |
<single-upload v-model="brand.bigPic" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="品牌故事:"> |
<el-form-item label="品牌故事:"> |
||||
<el-input v-model="brand.brandStory" placeholder="请输入内容" type="textarea" :autosize="true" /> |
<el-input v-model="brand.brandStory" placeholder="请输入内容" type="textarea" :autosize="true" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="排序:" prop="sort"> |
<el-form-item label="排序:" prop="sort"> |
||||
<el-input v-model.number="brand.sort" /> |
<el-input v-model.number="brand.sort" /> |
||||
</el-form-item> |
</el-form-item> |
||||
<el-form-item label="是否显示:"> |
<el-form-item label="是否配送:"> |
||||
<el-radio-group v-model="brand.showStatus"> |
<el-radio-group v-model="brand.delivery"> |
||||
<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-form-item label="品牌制造商:"> |
<el-form-item label="是否显示:"> |
||||
<el-radio-group v-model="brand.factoryStatus"> |
<el-radio-group v-model="brand.showStatus"> |
||||
<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-form-item label="起始销售数量:"> |
<!-- <el-form-item label="品牌制造商:"> |
||||
<el-input v-model="brand.qssl" /> |
<el-radio-group v-model="brand.factoryStatus"> |
||||
</el-form-item> |
<el-radio :label="1">是</el-radio> |
||||
<el-form-item label="订购协议:"> |
<el-radio :label="0">否</el-radio> |
||||
<el-input v-model="brand.dgxy" type="textarea" :rows="6" /> |
</el-radio-group> |
||||
<!-- <textarea v-model="brand.dgxy" style="width: 100%;" :rows="6"></textarea> --> |
</el-form-item> --> |
||||
</el-form-item> |
<el-form-item label="起始销售数量:"> |
||||
<el-form-item label="起订协议:"> |
<el-input v-model="brand.qssl" /> |
||||
<el-input v-model="brand.qdxy" type="textarea" :rows="6" /> |
</el-form-item> |
||||
<!-- <textarea v-model="brand.qdxy"></textarea> --> |
<el-form-item label="订购协议:"> |
||||
</el-form-item> |
<el-input v-model="brand.dgxy" type="textarea" :rows="6" /> |
||||
<el-form-item> |
<!-- <textarea v-model="brand.dgxy" style="width: 100%;" :rows="6"></textarea> --> |
||||
<el-button type="primary" @click="onSubmit('brandFrom')">提交</el-button> |
</el-form-item> |
||||
<el-button type="primary" @click="onClose('brandFrom')">关闭</el-button> |
<el-form-item label="起订协议:"> |
||||
<el-button v-if="!isEdit" @click="resetForm('brandFrom')">重置</el-button> |
<el-input v-model="brand.qdxy" type="textarea" :rows="6" /> |
||||
</el-form-item> |
<!-- <textarea v-model="brand.qdxy"></textarea> --> |
||||
</el-form> |
</el-form-item> |
||||
</el-card> |
<el-form-item> |
||||
</div> |
<el-button type="primary" @click="onSubmit('brandFrom')">提交</el-button> |
||||
|
<el-button type="primary" @click="onClose('brandFrom')">关闭</el-button> |
||||
|
<el-button v-if="!isEdit" @click="resetForm('brandFrom')">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-card> |
||||
|
</div> |
||||
</template> |
</template> |
||||
<script> |
<script> |
||||
import { |
import { |
||||
createBrand, |
createBrand, |
||||
getBrand, |
getBrand, |
||||
updateBrand |
updateBrand |
||||
} from '@/api/brand' |
} from '@/api/brand' |
||||
import SingleUpload from '@/components/Upload/singleUpload' |
import SingleUpload from '@/components/Upload/singleUpload' |
||||
const defaultBrand = { |
const defaultBrand = { |
||||
bigPic: '', |
bigPic: '', |
||||
brandStory: '', |
brandStory: '', |
||||
factoryStatus: 0, |
factoryStatus: 0, |
||||
firstLetter: '', |
firstLetter: '', |
||||
logo: '', |
logo: '', |
||||
name: '', |
name: '', |
||||
showStatus: 0, |
showStatus: 0, |
||||
sort: 0, |
sort: 0, |
||||
qssl: 0, |
qssl: 0, |
||||
dgxy: '' |
dgxy: '' |
||||
} |
} |
||||
export default { |
export default { |
||||
name: 'BrandDetail', |
name: 'BrandDetail', |
||||
components: { |
components: { |
||||
SingleUpload |
SingleUpload |
||||
}, |
}, |
||||
props: { |
props: { |
||||
isEdit: { |
isEdit: { |
||||
type: Boolean, |
type: Boolean, |
||||
default: false |
default: false |
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
brand: Object.assign({}, defaultBrand), |
|
||||
rules: { |
|
||||
name: [{ |
|
||||
required: true, |
|
||||
message: '请输入品牌名称', |
|
||||
trigger: 'blur' |
|
||||
}, |
|
||||
{ |
|
||||
min: 2, |
|
||||
max: 140, |
|
||||
message: '长度在 2 到 140 个字符', |
|
||||
trigger: 'blur' |
|
||||
} |
} |
||||
], |
}, |
||||
|
data() { |
||||
|
return { |
||||
|
brand: Object.assign({}, defaultBrand), |
||||
|
rules: { |
||||
|
name: [{ |
||||
|
required: true, |
||||
|
message: '请输入品牌名称', |
||||
|
trigger: 'blur' |
||||
|
}, |
||||
|
{ |
||||
|
min: 2, |
||||
|
max: 140, |
||||
|
message: '长度在 2 到 140 个字符', |
||||
|
trigger: 'blur' |
||||
|
} |
||||
|
], |
||||
|
|
||||
sort: [{ |
sort: [{ |
||||
type: 'number', |
type: 'number', |
||||
message: '排序必须为数字' |
message: '排序必须为数字' |
||||
}] |
}] |
||||
} |
} |
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
if (this.isEdit) { |
if (this.isEdit) { |
||||
getBrand(this.$route.query.id).then(response => { |
getBrand(this.$route.query.id).then(response => { |
||||
this.brand = response.data |
this.brand = response.data |
||||
}) |
|
||||
} else { |
|
||||
this.brand = Object.assign({}, defaultBrand) |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
onSubmit(formName) { |
|
||||
this.$refs[formName].validate((valid) => { |
|
||||
if (valid) { |
|
||||
this.$confirm('是否提交数据', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.isEdit) { |
|
||||
updateBrand(this.$route.query.id, this.brand).then(response => { |
|
||||
this.$refs[formName].resetFields() |
|
||||
this.$message({ |
|
||||
message: '修改成功', |
|
||||
type: 'success', |
|
||||
duration: 1000 |
|
||||
}) |
|
||||
this.$router.back() |
|
||||
}) |
}) |
||||
} else { |
} else { |
||||
createBrand(this.brand).then(response => { |
this.brand = Object.assign({}, defaultBrand) |
||||
this.$refs[formName].resetFields() |
} |
||||
this.brand = Object.assign({}, defaultBrand) |
}, |
||||
this.$message({ |
methods: { |
||||
message: '提交成功', |
onSubmit(formName) { |
||||
type: 'success', |
this.$refs[formName].validate((valid) => { |
||||
duration: 1000 |
if (valid) { |
||||
}) |
this.$confirm('是否提交数据', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
if (this.isEdit) { |
||||
|
updateBrand(this.$route.query.id, this.brand).then(response => { |
||||
|
this.$refs[formName].resetFields() |
||||
|
this.$message({ |
||||
|
message: '修改成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
this.$router.back() |
||||
|
}) |
||||
|
} else { |
||||
|
createBrand(this.brand).then(response => { |
||||
|
this.$refs[formName].resetFields() |
||||
|
this.brand = Object.assign({}, defaultBrand) |
||||
|
this.$message({ |
||||
|
message: '提交成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$message({ |
||||
|
message: '验证失败', |
||||
|
type: 'error', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
}) |
}) |
||||
} |
}, |
||||
}) |
resetForm(formName) { |
||||
} else { |
this.$refs[formName].resetFields() |
||||
this.$message({ |
this.brand = Object.assign({}, defaultBrand) |
||||
message: '验证失败', |
}, |
||||
type: 'error', |
onClose() { |
||||
duration: 1000 |
this.$store.dispatch('tagsView/delView', this.$route) |
||||
}) |
this.$router.go(-1) |
||||
return false |
} |
||||
} |
} |
||||
}) |
|
||||
}, |
|
||||
resetForm(formName) { |
|
||||
this.$refs[formName].resetFields() |
|
||||
this.brand = Object.assign({}, defaultBrand) |
|
||||
}, |
|
||||
onClose(){ |
|
||||
this.$store.dispatch('tagsView/delView', this.$route) |
|
||||
this.$router.go(-1) |
|
||||
} |
|
||||
} |
} |
||||
} |
|
||||
</script> |
</script> |
||||
<style> |
<style> |
||||
</style> |
</style> |
@ -1,313 +1,292 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<div class="main-content"> |
<div class="main-content"> |
||||
<el-card class="filter-container" shadow="never"> |
<el-card class="filter-container" shadow="never"> |
||||
<div> |
<div> |
||||
<i class="el-icon-search" /> |
<i class="el-icon-search" /> |
||||
<span>筛选搜索</span> |
<span>筛选搜索</span> |
||||
<el-button |
<el-button style="float: right" type="primary" size="small" @click="searchBrandList()"> |
||||
style="float: right" |
查询结果 |
||||
type="primary" |
</el-button> |
||||
size="small" |
</div> |
||||
@click="searchBrandList()" |
<div style="margin-top: 15px"> |
||||
> |
<el-form :inline="true" :model="listQuery" size="small" label-width="140px"> |
||||
查询结果 |
<el-form-item label="输入搜索:"> |
||||
</el-button> |
<el-input v-model="listQuery.name" style="width: 203px" placeholder="品牌名称/关键字" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
<el-card class="operate-container" shadow="never"> |
||||
|
<i class="el-icon-tickets" /> |
||||
|
<span>数据列表</span> |
||||
|
<el-button class="btn-add" size="mini" @click="addBrand()"> |
||||
|
添加 |
||||
|
</el-button> |
||||
|
</el-card> |
||||
|
<div class="table-container"> |
||||
|
<el-table ref="brandTable" v-loading="listLoading" :data="list" style="width: 100%" border |
||||
|
@selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="60" align="center" /> |
||||
|
<el-table-column label="编号" width="100" align="center"> |
||||
|
<template slot-scope="scope">{{ scope.row.id }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="品牌名称" align="center"> |
||||
|
<template slot-scope="scope">{{ scope.row.name }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="品牌首字母" width="150" align="center"> |
||||
|
<template slot-scope="scope">{{ scope.row.firstLetter }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="排序" width="100" align="center"> |
||||
|
<template slot-scope="scope">{{ scope.row.sort }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="是否配送" width="180" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch v-model="scope.row.delivery" active-text="配送" inactive-text="不配送" |
||||
|
:active-value="'1'" :inactive-value="'0'" |
||||
|
@change="handleDeliveryChange(scope.$index, scope.row)" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- <el-table-column label="品牌制造商" width="150" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch v-model="scope.row.factoryStatus" :active-value="1" :inactive-value="0" |
||||
|
@change="handleFactoryStatusChange(scope.$index, scope.row)" /> |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column label="是否显示" width="100" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch v-model="scope.row.showStatus" :active-value="1" :inactive-value="0" |
||||
|
@change="handleShowStatusChange(scope.$index, scope.row)" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="相关" width="220" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>商品:</span> |
||||
|
<el-button size="mini" type="text" @click="getProductList(scope.$index, scope.row)">100 |
||||
|
</el-button> |
||||
|
<span>评价:</span> |
||||
|
<el-button size="mini" type="text" |
||||
|
@click="getProductCommentList(scope.$index, scope.row)">1000 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="200" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑 |
||||
|
</el-button> |
||||
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- <div class="batch-operate-container"> |
||||
|
<el-select v-model="operateType" size="small" placeholder="批量操作"> |
||||
|
<el-option v-for="item in operates" :key="item.value" :label="item.label" :value="item.value" /> |
||||
|
</el-select> |
||||
|
<el-button style="margin-left: 20px" class="search-button" type="primary" size="small" |
||||
|
@click="handleBatchOperate()"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</div> --> |
||||
|
<div class="pagination-container"> |
||||
|
<el-pagination background layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" |
||||
|
:page-sizes="[5,10,15]" :current-page.sync="listQuery.pageNum" :total="total" |
||||
|
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
||||
|
</div> |
||||
</div> |
</div> |
||||
<div style="margin-top: 15px"> |
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px"> |
|
||||
<el-form-item label="输入搜索:"> |
|
||||
<el-input v-model="listQuery.name" style="width: 203px" placeholder="品牌名称/关键字" /> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
</el-card> |
|
||||
<el-card class="operate-container" shadow="never"> |
|
||||
<i class="el-icon-tickets" /> |
|
||||
<span>数据列表</span> |
|
||||
<el-button |
|
||||
class="btn-add" |
|
||||
size="mini" |
|
||||
@click="addBrand()" |
|
||||
> |
|
||||
添加 |
|
||||
</el-button> |
|
||||
</el-card> |
|
||||
<div class="table-container"> |
|
||||
<el-table |
|
||||
ref="brandTable" |
|
||||
v-loading="listLoading" |
|
||||
:data="list" |
|
||||
style="width: 100%" |
|
||||
border |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="60" align="center" /> |
|
||||
<el-table-column label="编号" width="100" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.row.id }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="品牌名称" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="品牌首字母" width="100" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.row.firstLetter }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="排序" width="100" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="品牌制造商" width="100" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-switch |
|
||||
v-model="scope.row.factoryStatus" |
|
||||
:active-value="1" |
|
||||
:inactive-value="0" |
|
||||
@change="handleFactoryStatusChange(scope.$index, scope.row)" |
|
||||
/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="是否显示" width="100" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-switch |
|
||||
v-model="scope.row.showStatus" |
|
||||
:active-value="1" |
|
||||
:inactive-value="0" |
|
||||
@change="handleShowStatusChange(scope.$index, scope.row)" |
|
||||
/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="相关" width="220" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span>商品:</span> |
|
||||
<el-button |
|
||||
size="mini" |
|
||||
type="text" |
|
||||
@click="getProductList(scope.$index, scope.row)" |
|
||||
>100 |
|
||||
</el-button> |
|
||||
<span>评价:</span> |
|
||||
<el-button |
|
||||
size="mini" |
|
||||
type="text" |
|
||||
@click="getProductCommentList(scope.$index, scope.row)" |
|
||||
>1000 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="操作" width="200" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button |
|
||||
size="mini" |
|
||||
@click="handleUpdate(scope.$index, scope.row)" |
|
||||
>编辑 |
|
||||
</el-button> |
|
||||
<el-button |
|
||||
size="mini" |
|
||||
type="danger" |
|
||||
@click="handleDelete(scope.$index, scope.row)" |
|
||||
>删除 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</div> |
|
||||
<div class="batch-operate-container"> |
|
||||
<el-select |
|
||||
v-model="operateType" |
|
||||
size="small" |
|
||||
placeholder="批量操作" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in operates" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
<el-button |
|
||||
style="margin-left: 20px" |
|
||||
class="search-button" |
|
||||
type="primary" |
|
||||
size="small" |
|
||||
@click="handleBatchOperate()" |
|
||||
> |
|
||||
确定 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
<div class="pagination-container"> |
|
||||
<el-pagination |
|
||||
background |
|
||||
layout="total, sizes,prev, pager, next,jumper" |
|
||||
:page-size="listQuery.pageSize" |
|
||||
:page-sizes="[5,10,15]" |
|
||||
:current-page.sync="listQuery.pageNum" |
|
||||
:total="total" |
|
||||
@size-change="handleSizeChange" |
|
||||
@current-change="handleCurrentChange" |
|
||||
/> |
|
||||
</div> |
|
||||
</div> |
</div> |
||||
</div> |
|
||||
</template> |
</template> |
||||
<script> |
<script> |
||||
import { fetchList, updateShowStatus, updateFactoryStatus, deleteBrand } from '@/api/brand' |
import { |
||||
|
fetchList, |
||||
|
updateDelivery, |
||||
|
updateShowStatus, |
||||
|
updateFactoryStatus, |
||||
|
deleteBrand |
||||
|
} from '@/api/brand' |
||||
|
|
||||
export default { |
export default { |
||||
name: 'BrandList', |
name: 'BrandList', |
||||
data() { |
data() { |
||||
return { |
return { |
||||
operates: [ |
operates: [ |
||||
|
|
||||
], |
], |
||||
operateType: null, |
operateType: null, |
||||
listQuery: { |
listQuery: { |
||||
keyword: null, |
keyword: null, |
||||
pageNum: 1, |
pageNum: 1, |
||||
pageSize: 10 |
pageSize: 10 |
||||
|
}, |
||||
|
list: null, |
||||
|
total: null, |
||||
|
listLoading: true, |
||||
|
multipleSelection: [] |
||||
|
} |
||||
}, |
}, |
||||
list: null, |
created() { |
||||
total: null, |
|
||||
listLoading: true, |
|
||||
multipleSelection: [] |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.listLoading = true |
|
||||
fetchList(this.listQuery).then(response => { |
|
||||
this.listLoading = false |
|
||||
this.list = response.data.records |
|
||||
this.total = response.data.total |
|
||||
this.totalPage = response.data.pages |
|
||||
this.pageSize = response.data.size |
|
||||
}) |
|
||||
}, |
|
||||
handleSelectionChange(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
handleUpdate(index, row) { |
|
||||
this.$router.push({ path: '/pms/updateBrand', query: { id: row.id }}) |
|
||||
}, |
|
||||
handleDelete(index, row) { |
|
||||
this.$confirm('是否要删除该品牌', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
deleteBrand(row.id).then(response => { |
|
||||
this.$message({ |
|
||||
message: '删除成功', |
|
||||
type: 'success', |
|
||||
duration: 1000 |
|
||||
}) |
|
||||
this.getList() |
this.getList() |
||||
}) |
}, |
||||
}) |
methods: { |
||||
}, |
getList() { |
||||
getProductList(index, row) { |
this.listLoading = true |
||||
console.log(index, row) |
fetchList(this.listQuery).then(response => { |
||||
}, |
this.listLoading = false |
||||
getProductCommentList(index, row) { |
this.list = response.data.records |
||||
console.log(index, row) |
this.total = response.data.total |
||||
}, |
this.totalPage = response.data.pages |
||||
handleFactoryStatusChange(index, row) { |
this.pageSize = response.data.size |
||||
var data = new URLSearchParams() |
}) |
||||
data.append('ids', row.id) |
}, |
||||
data.append('factoryStatus', row.factoryStatus) |
handleSelectionChange(val) { |
||||
updateFactoryStatus(data).then(response => { |
this.multipleSelection = val |
||||
this.$message({ |
}, |
||||
message: '修改成功', |
handleUpdate(index, row) { |
||||
type: 'success', |
this.$router.push({ |
||||
duration: 1000 |
path: '/pms/updateBrand', |
||||
}) |
query: { |
||||
}).catch(error => { |
id: row.id |
||||
if (row.factoryStatus === 0) { |
} |
||||
row.factoryStatus = 1 |
}) |
||||
} else { |
}, |
||||
row.factoryStatus = 0 |
handleDelete(index, row) { |
||||
} |
this.$confirm('是否要删除该品牌', '提示', { |
||||
}) |
confirmButtonText: '确定', |
||||
}, |
cancelButtonText: '取消', |
||||
handleShowStatusChange(index, row) { |
type: 'warning' |
||||
const data = new URLSearchParams() |
}).then(() => { |
||||
|
deleteBrand(row.id).then(response => { |
||||
|
this.$message({ |
||||
|
message: '删除成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
this.getList() |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
getProductList(index, row) { |
||||
|
console.log(index, row) |
||||
|
}, |
||||
|
getProductCommentList(index, row) { |
||||
|
console.log(index, row) |
||||
|
}, |
||||
|
handleDeliveryChange(index, row) { |
||||
|
var data = new URLSearchParams() |
||||
|
data.append('ids', row.id) |
||||
|
data.append('delivery', row.delivery) |
||||
|
updateDelivery(data).then(response => { |
||||
|
this.$message({ |
||||
|
message: '修改成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
}).catch(error => { |
||||
|
if (row.delivery === 0) { |
||||
|
row.delivery = 1 |
||||
|
} else { |
||||
|
row.delivery = 0 |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleFactoryStatusChange(index, row) { |
||||
|
var data = new URLSearchParams() |
||||
|
data.append('ids', row.id) |
||||
|
data.append('factoryStatus', row.factoryStatus) |
||||
|
updateFactoryStatus(data).then(response => { |
||||
|
this.$message({ |
||||
|
message: '修改成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
}).catch(error => { |
||||
|
if (row.factoryStatus === 0) { |
||||
|
row.factoryStatus = 1 |
||||
|
} else { |
||||
|
row.factoryStatus = 0 |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleShowStatusChange(index, row) { |
||||
|
const data = new URLSearchParams() |
||||
|
|
||||
data.append('ids', row.id) |
data.append('ids', row.id) |
||||
data.append('showStatus', row.showStatus) |
data.append('showStatus', row.showStatus) |
||||
updateShowStatus(data).then(response => { |
updateShowStatus(data).then(response => { |
||||
this.$message({ |
this.$message({ |
||||
message: '修改成功', |
message: '修改成功', |
||||
type: 'success', |
type: 'success', |
||||
duration: 1000 |
duration: 1000 |
||||
}) |
}) |
||||
}).catch(error => { |
}).catch(error => { |
||||
if (row.showStatus === 0) { |
if (row.showStatus === 0) { |
||||
row.showStatus = 1 |
row.showStatus = 1 |
||||
} else { |
} else { |
||||
row.showStatus = 0 |
row.showStatus = 0 |
||||
} |
} |
||||
}) |
}) |
||||
}, |
}, |
||||
handleSizeChange(val) { |
handleSizeChange(val) { |
||||
this.listQuery.pageNum = 1 |
this.listQuery.pageNum = 1 |
||||
this.listQuery.pageSize = val |
this.listQuery.pageSize = val |
||||
this.getList() |
this.getList() |
||||
}, |
}, |
||||
handleCurrentChange(val) { |
handleCurrentChange(val) { |
||||
this.listQuery.pageNum = val |
this.listQuery.pageNum = val |
||||
this.getList() |
this.getList() |
||||
}, |
}, |
||||
searchBrandList() { |
searchBrandList() { |
||||
this.listQuery.pageNum = 1 |
this.listQuery.pageNum = 1 |
||||
this.getList() |
this.getList() |
||||
}, |
}, |
||||
handleBatchOperate() { |
handleBatchOperate() { |
||||
console.log(this.multipleSelection) |
console.log(this.multipleSelection) |
||||
if (this.multipleSelection < 1) { |
if (this.multipleSelection < 1) { |
||||
this.$message({ |
this.$message({ |
||||
message: '请选择一条记录', |
message: '请选择一条记录', |
||||
type: 'warning', |
type: 'warning', |
||||
duration: 1000 |
duration: 1000 |
||||
}) |
}) |
||||
return |
return |
||||
} |
} |
||||
let showStatus = 0 |
let showStatus = 0 |
||||
if (this.operateType === 'showBrand') { |
if (this.operateType === 'showBrand') { |
||||
showStatus = 1 |
showStatus = 1 |
||||
} else if (this.operateType === 'hideBrand') { |
} else if (this.operateType === 'hideBrand') { |
||||
showStatus = 0 |
showStatus = 0 |
||||
} else { |
} else { |
||||
this.$message({ |
this.$message({ |
||||
message: '请选择批量操作类型', |
message: '请选择批量操作类型', |
||||
type: 'warning', |
type: 'warning', |
||||
duration: 1000 |
duration: 1000 |
||||
}) |
}) |
||||
return |
return |
||||
|
} |
||||
|
const ids = [] |
||||
|
for (let i = 0; i < this.multipleSelection.length; i++) { |
||||
|
ids.push(this.multipleSelection[i].id) |
||||
|
} |
||||
|
const data = new URLSearchParams() |
||||
|
data.append('ids', ids) |
||||
|
data.append('showStatus', showStatus) |
||||
|
updateShowStatus(data).then(response => { |
||||
|
this.getList() |
||||
|
this.$message({ |
||||
|
message: '修改成功', |
||||
|
type: 'success', |
||||
|
duration: 1000 |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
addBrand() { |
||||
|
this.$router.push({ |
||||
|
path: '/pms/addBrand' |
||||
|
}) |
||||
|
} |
||||
} |
} |
||||
const ids = [] |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids.push(this.multipleSelection[i].id) |
|
||||
} |
|
||||
const data = new URLSearchParams() |
|
||||
data.append('ids', ids) |
|
||||
data.append('showStatus', showStatus) |
|
||||
updateShowStatus(data).then(response => { |
|
||||
this.getList() |
|
||||
this.$message({ |
|
||||
message: '修改成功', |
|
||||
type: 'success', |
|
||||
duration: 1000 |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
addBrand() { |
|
||||
this.$router.push({ path: '/pms/addBrand' }) |
|
||||
} |
|
||||
} |
} |
||||
} |
|
||||
</script> |
</script> |
||||
<style rel="stylesheet/scss" lang="scss" scoped> |
<style rel="stylesheet/scss" lang="scss" scoped> |
||||
|
|
||||
</style> |
</style> |
||||
|
|
Loading…
Reference in new issue