parent
a8e2b253c6
commit
3c362751b8
5 changed files with 6191 additions and 5152 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,356 +1,440 @@ |
|||||||
<template> |
<template> |
||||||
<!-- 产品管理 --> |
<!-- 产品管理 --> |
||||||
<div style="padding-top: 24px"> |
<div style="padding-top: 24px"> |
||||||
<div class="tool"> |
<div class="tool"> |
||||||
<ul class="filter" style="align-items: flex-start"> |
<ul class="filter" |
||||||
<li> |
style="align-items: flex-start"> |
||||||
<label>学科类:</label> |
<li> |
||||||
<el-select v-model="form.categoryId" clearable |
<label>学科类:</label> |
||||||
@change="getProfessionalClass()" @clear="clearClass()"> |
<el-select v-model="form.categoryId" |
||||||
<el-option v-for="(item,index) in subjectList" :key="index" |
clearable |
||||||
:label="item.disciplineName" |
@change="getProfessionalClass()" |
||||||
:value="item.disciplineId"></el-option> |
@clear="clearClass()"> |
||||||
</el-select> |
<el-option v-for="(item,index) in subjectList" |
||||||
</li> |
:key="index" |
||||||
<li> |
:label="item.disciplineName" |
||||||
<label>专业类:</label> |
:value="item.disciplineId"></el-option> |
||||||
<el-select v-model="form.professionalCategoryId" clearable |
</el-select> |
||||||
:disabled="form.categoryId ? false : true" |
</li> |
||||||
@change="getProfessional" @clear="clearProfess()"> |
<li> |
||||||
<el-option v-for="(item,index) in professionalClassList" :key="index" |
<label>专业类:</label> |
||||||
:label="item.professionalClassName" |
<el-select v-model="form.professionalCategoryId" |
||||||
:value="item.professionalClassId"></el-option> |
clearable |
||||||
</el-select> |
:disabled="form.categoryId ? false : true" |
||||||
</li> |
@change="getProfessional" |
||||||
<li> |
@clear="clearProfess()"> |
||||||
<label>专业:</label> |
<el-option v-for="(item,index) in professionalClassList" |
||||||
<el-select v-model="form.professionalId" clearable |
:key="index" |
||||||
:disabled="form.professionalCategoryId ? false : true" |
:label="item.professionalClassName" |
||||||
@change="initData"> |
:value="item.professionalClassId"></el-option> |
||||||
<el-option v-for="(item,index) in professionalList" :key="index" |
</el-select> |
||||||
:label="item.professionalName" |
</li> |
||||||
:value="item.professionalId"></el-option> |
<li> |
||||||
</el-select> |
<label>专业:</label> |
||||||
</li> |
<el-select v-model="form.professionalId" |
||||||
<li> |
clearable |
||||||
<label>产品分类:</label> |
:disabled="form.professionalCategoryId ? false : true" |
||||||
<el-select v-model="form.productClassification" clearable placeholder="请选择产品分类" @change="initData"> |
@change="initData"> |
||||||
<el-option v-for="(item, i) in productCategoryList" :key="i" :label="item.classificationName" :value="item.classificationId"></el-option> |
<el-option v-for="(item,index) in professionalList" |
||||||
</el-select> |
:key="index" |
||||||
</li> |
:label="item.professionalName" |
||||||
<li> |
:value="item.professionalId"></el-option> |
||||||
<label>搜索:</label> |
</el-select> |
||||||
<el-input placeholder="请输入" suffix-icon="el-icon-search" v-model="form.productName" clearable size="small"></el-input> |
</li> |
||||||
</li> |
<li> |
||||||
</ul> |
<label>产品分类:</label> |
||||||
<div> |
<el-select v-model="form.productClassification" |
||||||
<el-button v-auth="'/shop:产品管理:新增'" type="primary" round @click="addCourse">新增</el-button> |
clearable |
||||||
</div> |
placeholder="请选择产品分类" |
||||||
</div> |
@change="initData"> |
||||||
|
<el-option v-for="(item, i) in productCategoryList" |
||||||
|
:key="i" |
||||||
|
:label="item.classificationName" |
||||||
|
:value="item.classificationId"></el-option> |
||||||
|
</el-select> |
||||||
|
</li> |
||||||
|
<li> |
||||||
|
<label>搜索:</label> |
||||||
|
<el-input placeholder="请输入" |
||||||
|
suffix-icon="el-icon-search" |
||||||
|
v-model="form.productName" |
||||||
|
clearable |
||||||
|
size="small"></el-input> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
<div> |
||||||
|
<el-button v-auth="'/shop:产品管理:新增'" |
||||||
|
type="primary" |
||||||
|
round |
||||||
|
@click="addCourse">新增</el-button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
<el-table :data="list" |
||||||
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> |
class="table" |
||||||
<el-table-column type="index" width="100" label="序号" align="center"> |
ref="table" |
||||||
<template slot-scope="scope"> |
stripe |
||||||
{{ scope.$index + (page - 1) * pageSize + 1 }} |
header-align="center" |
||||||
</template> |
@selection-change="handleSelectionChange" |
||||||
</el-table-column> |
row-key="id" |
||||||
<el-table-column prop="productName" label="产品名称" min-width="150" align="center"></el-table-column> |
@sort-change="sortChange"> |
||||||
<el-table-column prop="supplierName" label="厂商" min-width="150" align="center"></el-table-column> |
<el-table-column type="selection" |
||||||
<el-table-column prop="classificationName" label="产品分类" min-width="150" align="center"></el-table-column> |
width="80" |
||||||
<el-table-column prop="typeName" label="产品类型" min-width="150" align="center"></el-table-column> |
align="center" |
||||||
<el-table-column prop="associatedProductName" label="关联产品" min-width="140" align="center"></el-table-column> |
:reserve-selection="true"></el-table-column> |
||||||
<el-table-column prop="courseName" label="状态" min-width="140" align="center"> |
<el-table-column type="index" |
||||||
<template slot-scope="scope"> |
width="100" |
||||||
{{ scope.row.isShelves ? '下架' : '上架' }} |
label="序号" |
||||||
</template> |
align="center"> |
||||||
</el-table-column> |
<template slot-scope="scope"> |
||||||
<el-table-column prop="orderQuantity" label="订单量" min-width="150" align="center"></el-table-column> |
{{ scope.$index + (page - 1) * pageSize + 1 }} |
||||||
<el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column> |
</template> |
||||||
<el-table-column prop="selected" label="精选" min-width="150" align="center" sortable="custom"> |
</el-table-column> |
||||||
<template slot-scope="scope"> |
<el-table-column prop="productName" |
||||||
<i v-auth="'/shop:产品管理:精选'" :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" @click="selected(scope.row)"></i> |
label="产品名称" |
||||||
</template> |
min-width="150" |
||||||
</el-table-column> |
align="center"></el-table-column> |
||||||
<el-table-column label="上架/下架" align="center" width="90"> |
<el-table-column prop="supplierName" |
||||||
<template slot-scope="scope"> |
label="厂商" |
||||||
<el-switch |
min-width="150" |
||||||
v-model="scope.row.isShelves" |
align="center"></el-table-column> |
||||||
:active-value="0" |
<el-table-column prop="classificationName" |
||||||
:inactive-value="1" |
label="产品分类" |
||||||
@change="changeSwitch($event, scope.row)" |
min-width="150" |
||||||
v-auth="'/shop:产品管理:上下架'"> |
align="center"></el-table-column> |
||||||
</el-switch> |
<el-table-column prop="typeName" |
||||||
</template> |
label="产品类型" |
||||||
</el-table-column> |
min-width="150" |
||||||
<el-table-column label="操作" align="center" width="120"> |
align="center"></el-table-column> |
||||||
<template slot-scope="scope"> |
<el-table-column prop="associatedProductName" |
||||||
<template v-if="scope.row.isShelves"> |
label="关联产品" |
||||||
<el-button v-auth="'/shop:产品管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
min-width="140" |
||||||
<el-button v-auth="'/shop:产品管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
align="center"></el-table-column> |
||||||
</template> |
<el-table-column prop="courseName" |
||||||
<el-button v-else v-auth="'/shop:产品管理:查看'" type="text" @click="edit(scope.row, 1)">查看</el-button> |
label="状态" |
||||||
</template> |
min-width="140" |
||||||
</el-table-column> |
align="center"> |
||||||
</el-table> |
<template slot-scope="scope"> |
||||||
<div class="pagination"> |
{{ scope.row.isShelves ? '下架' : '上架' }} |
||||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
</template> |
||||||
</el-pagination> |
</el-table-column> |
||||||
</div> |
<el-table-column prop="orderQuantity" |
||||||
|
label="订单量" |
||||||
|
min-width="150" |
||||||
|
align="center"></el-table-column> |
||||||
|
<el-table-column prop="userName" |
||||||
|
label="最近编辑人" |
||||||
|
min-width="150" |
||||||
|
align="center"></el-table-column> |
||||||
|
<el-table-column prop="selected" |
||||||
|
label="精选" |
||||||
|
min-width="150" |
||||||
|
align="center" |
||||||
|
sortable="custom"> |
||||||
|
<template slot-scope="scope"> |
||||||
|
<i v-auth="'/shop:产品管理:精选'" |
||||||
|
:class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" |
||||||
|
@click="selected(scope.row)"></i> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
<el-table-column label="上架/下架" |
||||||
|
align="center" |
||||||
|
width="90"> |
||||||
|
<template slot-scope="scope"> |
||||||
|
<el-switch v-model="scope.row.isShelves" |
||||||
|
:active-value="0" |
||||||
|
:inactive-value="1" |
||||||
|
@change="changeSwitch($event, scope.row)" |
||||||
|
v-auth="'/shop:产品管理:上下架'"> |
||||||
|
</el-switch> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
<el-table-column label="操作" |
||||||
|
align="center" |
||||||
|
width="120"> |
||||||
|
<template slot-scope="scope"> |
||||||
|
<template v-if="scope.row.isShelves"> |
||||||
|
<el-button v-auth="'/shop:产品管理:编辑'" |
||||||
|
type="text" |
||||||
|
@click="edit(scope.row)">编辑</el-button> |
||||||
|
<el-button v-auth="'/shop:产品管理:删除'" |
||||||
|
type="text" |
||||||
|
@click="handleDelete(scope.row)">删除</el-button> |
||||||
|
</template> |
||||||
|
<el-button v-else |
||||||
|
v-auth="'/shop:产品管理:查看'" |
||||||
|
type="text" |
||||||
|
@click="edit(scope.row, 1)">查看</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<div class="pagination"> |
||||||
|
<el-pagination background |
||||||
|
layout="total, prev, pager, next" |
||||||
|
:total="total" |
||||||
|
@current-change="handleCurrentChange" |
||||||
|
:current-page="page"> |
||||||
|
</el-pagination> |
||||||
</div> |
</div> |
||||||
|
</div> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import Util from "@/libs/util"; |
import Util from "@/libs/util"; |
||||||
import Setting from '@/setting' |
import Setting from '@/setting' |
||||||
export default { |
export default { |
||||||
data() { |
data () { |
||||||
return { |
return { |
||||||
timer: null, |
timer: null, |
||||||
form: { |
form: { |
||||||
hotTag: 1, |
hotTag: 1, |
||||||
sort: 0, |
sort: 0, |
||||||
categoryId: '', |
categoryId: '', |
||||||
productClassification: '', |
productClassification: '', |
||||||
productName: '', |
productName: '', |
||||||
professionalCategoryId: '', |
professionalCategoryId: '', |
||||||
professionalId: '', |
professionalId: '', |
||||||
}, |
}, |
||||||
subjectList: [], //专业学科 |
subjectList: [], //专业学科 |
||||||
professionalClassList: [], //专业类 |
professionalClassList: [], //专业类 |
||||||
professionalList: [], //专业 |
professionalList: [], //专业 |
||||||
productCategoryList: [], |
productCategoryList: [], |
||||||
list: [], |
list: [], |
||||||
multipleSelection: [], |
multipleSelection: [], |
||||||
page: +this.$route.query.page || 1, // 当前页码 |
page: +this.$route.query.page || 1, // 当前页码 |
||||||
pageSize: 10, |
pageSize: 10, |
||||||
total: 0 |
total: 0 |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
watch: { |
watch: { |
||||||
'form.productName': function(val) { |
'form.productName': function (val) { |
||||||
clearTimeout(this.searchTimer); |
clearTimeout(this.searchTimer); |
||||||
this.searchTimer = setTimeout(() => { |
this.searchTimer = setTimeout(() => { |
||||||
this.initData(); |
this.initData(); |
||||||
}, 500); |
}, 500); |
||||||
} |
} |
||||||
|
}, |
||||||
|
mounted () { |
||||||
|
this.getSubject() |
||||||
|
this.getCategory() |
||||||
|
this.initData() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
getData () { |
||||||
|
this.$post(this.api.listOfGoods, { |
||||||
|
pageNum: this.page, |
||||||
|
pageSize: this.pageSize, |
||||||
|
...this.form |
||||||
|
}).then(({ page }) => { |
||||||
|
this.list = page.records; |
||||||
|
this.total = page.total; |
||||||
|
}).catch(res => { |
||||||
|
}); |
||||||
}, |
}, |
||||||
mounted() { |
initData () { |
||||||
this.getSubject() |
this.page = 1; |
||||||
this.getCategory() |
this.getData(); |
||||||
this.initData() |
|
||||||
}, |
}, |
||||||
methods: { |
|
||||||
getData() { |
|
||||||
this.$post(this.api.listOfGoods, { |
|
||||||
pageNum: this.page, |
|
||||||
pageSize: this.pageSize, |
|
||||||
...this.form |
|
||||||
}).then(({ page }) => { |
|
||||||
this.list = page.records; |
|
||||||
this.total = page.total; |
|
||||||
}).catch(res => { |
|
||||||
}); |
|
||||||
}, |
|
||||||
initData() { |
|
||||||
this.page = 1; |
|
||||||
this.getData(); |
|
||||||
}, |
|
||||||
|
|
||||||
// 获取产品分类 |
// 获取产品分类 |
||||||
getCategory() { |
getCategory () { |
||||||
this.$get(this.api.productCategoryList).then(res => { |
this.$get(this.api.productCategoryList).then(res => { |
||||||
this.productCategoryList = res.classificationList |
this.productCategoryList = res.classificationList |
||||||
}).catch(err => {}) |
}).catch(err => { }) |
||||||
}, |
}, |
||||||
// 获取学科类别 |
// 获取学科类别 |
||||||
getSubject() { |
getSubject () { |
||||||
this.$get(this.api.courseDiscipline).then(res => { |
this.$get(this.api.courseDiscipline).then(res => { |
||||||
this.subjectList = res.list; |
this.subjectList = res.list; |
||||||
}).catch(err => { |
}).catch(err => { |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
// 清除学科类别 |
// 清除学科类别 |
||||||
clearClass() { |
clearClass () { |
||||||
this.form.professionalCategoryId = ""; |
this.form.professionalCategoryId = ""; |
||||||
this.form.professionalId = ""; |
this.form.professionalId = ""; |
||||||
}, |
}, |
||||||
// 获取专业类 |
// 获取专业类 |
||||||
getProfessionalClass() { |
getProfessionalClass () { |
||||||
this.clearClass(); |
this.clearClass(); |
||||||
this.getProfessionalClassData(); |
this.getProfessionalClassData(); |
||||||
this.page = 1; |
this.page = 1; |
||||||
this.initData(); |
this.initData(); |
||||||
}, |
}, |
||||||
getProfessionalClassData() { |
getProfessionalClassData () { |
||||||
let data = { |
let data = { |
||||||
disciplineId: this.form.categoryId |
disciplineId: this.form.categoryId |
||||||
}; |
}; |
||||||
this.$get(this.api.courseProfessionalClass, data).then(res => { |
this.$get(this.api.courseProfessionalClass, data).then(res => { |
||||||
this.professionalClassList = res.list; |
this.professionalClassList = res.list; |
||||||
}).catch(err => { |
}).catch(err => { |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
// 清除专业类 |
// 清除专业类 |
||||||
clearProfess() { |
clearProfess () { |
||||||
this.form.professionalId = ""; |
this.form.professionalId = ""; |
||||||
}, |
}, |
||||||
// 获取专业 |
// 获取专业 |
||||||
getProfessional() { |
getProfessional () { |
||||||
this.clearProfess(); |
this.clearProfess(); |
||||||
this.getProfessionalData(); |
this.getProfessionalData(); |
||||||
this.page = 1; |
this.page = 1; |
||||||
|
this.initData(); |
||||||
|
}, |
||||||
|
getProfessionalData () { |
||||||
|
let data = { |
||||||
|
professionalClassId: this.form.professionalCategoryId |
||||||
|
}; |
||||||
|
this.$get(this.api.courseProfessional, data).then(res => { |
||||||
|
this.professionalList = res.list; |
||||||
|
}).catch(err => { |
||||||
|
}); |
||||||
|
}, |
||||||
|
addCourse () { |
||||||
|
this.$router.push("/shop/addProduct"); |
||||||
|
}, |
||||||
|
edit (row, show = 0) { |
||||||
|
this.$router.push(`/shop/addProduct?id=${row.mallId}&show=${show}`) |
||||||
|
}, |
||||||
|
handleDelete (row) { |
||||||
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
||||||
|
type: "warning" |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
this.$post(this.api.deletionOfGoods, row.mallId).then(res => { |
||||||
|
Util.successMsg("删除成功"); |
||||||
this.initData(); |
this.initData(); |
||||||
}, |
}).catch(res => { |
||||||
getProfessionalData() { |
}); |
||||||
let data = { |
}) |
||||||
professionalClassId: this.form.professionalCategoryId |
.catch(() => { |
||||||
}; |
}); |
||||||
this.$get(this.api.courseProfessional, data).then(res => { |
}, |
||||||
this.professionalList = res.list; |
handleSelectionChange (val) { |
||||||
}).catch(err => { |
this.multipleSelection = val; |
||||||
}); |
}, |
||||||
}, |
delAllData () { |
||||||
addCourse() { |
const list = this.multipleSelection |
||||||
this.$router.push("/shop/addProduct"); |
if (list.length != "") { |
||||||
}, |
this.$confirm(`确定要删除吗?`, "提示", { |
||||||
edit(row, show = 0) { |
type: "warning" |
||||||
this.$router.push(`/shop/addProduct?id=${row.mallId}&show=${show}`) |
}) |
||||||
}, |
.then(() => { |
||||||
handleDelete(row) { |
const data = [] |
||||||
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
list.map(e => { |
||||||
type: "warning" |
data.push('ids=' + e.id) |
||||||
}) |
}) |
||||||
.then(() => { |
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => { |
||||||
this.$post(this.api.deletionOfGoods, row.mallId).then(res => { |
this.$refs.table.clearSelection(); |
||||||
Util.successMsg("删除成功"); |
Util.successMsg("删除成功"); |
||||||
this.initData(); |
this.initData(); |
||||||
}).catch(res => { |
}).catch(res => { |
||||||
}); |
}); |
||||||
}) |
}).catch(() => { |
||||||
.catch(() => { |
}); |
||||||
}); |
} else { |
||||||
}, |
Util.errorMsg("请先选择数据 !"); |
||||||
handleSelectionChange(val) { |
} |
||||||
this.multipleSelection = val; |
}, |
||||||
}, |
handleCurrentChange (val) { |
||||||
delAllData() { |
this.page = val; |
||||||
const list = this.multipleSelection |
this.getData(); |
||||||
if (list.length != "") { |
}, |
||||||
this.$confirm(`确定要删除吗?`, "提示", { |
// 上下架 |
||||||
type: "warning" |
async changeSwitch (value, row) { |
||||||
}) |
const res = await this.$get(`${this.api.detailsOfGoods}?mallId=${row.mallId}`) |
||||||
.then(() => { |
const form = res.orderDetails |
||||||
const data = [] |
const { mall } = form |
||||||
list.map(e => { |
let err |
||||||
data.push('ids=' + e.id) |
let disErr |
||||||
}) |
// for (const e of form.mallDisciplines) { |
||||||
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => { |
// if (!e.categoryId) { |
||||||
this.$refs.table.clearSelection(); |
// disErr = '请选择学科类别!' |
||||||
Util.successMsg("删除成功"); |
// break |
||||||
this.initData(); |
// } |
||||||
}).catch(res => { |
// if (!e.professionalCategoryId) { |
||||||
}); |
// disErr = '请选择专业类!' |
||||||
}).catch(() => { |
// break |
||||||
}); |
// } |
||||||
} else { |
// if (!e.professionalId) { |
||||||
Util.errorMsg("请先选择数据 !"); |
// disErr = '请选择专业!' |
||||||
} |
// break |
||||||
}, |
// } |
||||||
handleCurrentChange(val) { |
// } |
||||||
this.page = val; |
|
||||||
this.getData(); |
|
||||||
}, |
|
||||||
// 上下架 |
|
||||||
async changeSwitch(value, row) { |
|
||||||
const res = await this.$get(`${this.api.detailsOfGoods}?mallId=${row.mallId}`) |
|
||||||
const form = res.orderDetails |
|
||||||
const { mall } = form |
|
||||||
let err |
|
||||||
let disErr |
|
||||||
// for (const e of form.mallDisciplines) { |
|
||||||
// if (!e.categoryId) { |
|
||||||
// disErr = '请选择学科类别!' |
|
||||||
// break |
|
||||||
// } |
|
||||||
// if (!e.professionalCategoryId) { |
|
||||||
// disErr = '请选择专业类!' |
|
||||||
// break |
|
||||||
// } |
|
||||||
// if (!e.professionalId) { |
|
||||||
// disErr = '请选择专业!' |
|
||||||
// break |
|
||||||
// } |
|
||||||
// } |
|
||||||
|
|
||||||
let priceErr |
let priceErr |
||||||
for (const e of form.mallPrices) { |
for (const e of form.mallPrices) { |
||||||
if (e.settlementPrice === '' || e.settlementPrice === undefined || e.area === '') { |
if (e.settlementPrice === '' || e.settlementPrice === undefined || e.area === '') { |
||||||
priceErr = 1 |
priceErr = 1 |
||||||
break |
break |
||||||
} |
|
||||||
} |
|
||||||
if (!mall.isAssociatedProduct && !mall.associatedProduct) { |
|
||||||
err = 1 |
|
||||||
} else if (!form.classificationIds.length) { |
|
||||||
err = 1 |
|
||||||
} else if (!form.typeIds.length) { |
|
||||||
err = 1 |
|
||||||
} else if (!form.supplierIds.length) { |
|
||||||
err = 1 |
|
||||||
} else if (disErr) { |
|
||||||
err = disErr |
|
||||||
} else if (!mall.coverDrawing) { |
|
||||||
err = 1 |
|
||||||
} else if (!mall.marketUnitPrice) { |
|
||||||
err = 1 |
|
||||||
} else if (priceErr) { |
|
||||||
err = 1 |
|
||||||
} else if (!mall.productIntroduction) { |
|
||||||
err = 1 |
|
||||||
} else if (!mall.detailedIntroduction) { |
|
||||||
err = 1 |
|
||||||
} |
|
||||||
if (err) { |
|
||||||
Util.errorMsg('无法上架!请编辑产品后上架!') |
|
||||||
row.isShelves = 1 |
|
||||||
return |
|
||||||
} |
|
||||||
this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => { |
|
||||||
this.getData() |
|
||||||
}).catch(({ status }) => { |
|
||||||
if (status !== 200) row.isShelves = 1 |
|
||||||
}) |
|
||||||
}, |
|
||||||
// 精选 |
|
||||||
selected(row) { |
|
||||||
this.$post(`${this.api.goodsSelection}?mallId=${row.mallId}&selected=${row.selected ? 0 : 1}`).then((res) => { |
|
||||||
this.getData(); |
|
||||||
}).catch((res) => {}) |
|
||||||
}, |
|
||||||
// 排序回调 |
|
||||||
sortChange(column) { |
|
||||||
const { order } = column |
|
||||||
if (column.prop === 'selected') { |
|
||||||
this.form.sort = order ? order === 'ascending' ? 4 : 3 : 0 |
|
||||||
} |
} |
||||||
|
} |
||||||
|
if (!mall.isAssociatedProduct && !mall.associatedProduct) { |
||||||
|
err = 1 |
||||||
|
} else if (!form.classificationIds.length) { |
||||||
|
err = 1 |
||||||
|
} else if (!form.typeIds.length) { |
||||||
|
err = 1 |
||||||
|
} else if (!form.supplierIds.length) { |
||||||
|
err = 1 |
||||||
|
} else if (disErr) { |
||||||
|
err = disErr |
||||||
|
} else if (!mall.coverDrawing) { |
||||||
|
err = 1 |
||||||
|
} else if (!mall.marketUnitPrice) { |
||||||
|
err = 1 |
||||||
|
} else if (priceErr) { |
||||||
|
err = 1 |
||||||
|
} else if (!mall.productIntroduction) { |
||||||
|
err = 1 |
||||||
|
} else if (!mall.detailedIntroduction) { |
||||||
|
err = 1 |
||||||
|
} |
||||||
|
if (err) { |
||||||
|
Util.errorMsg('无法上架!请编辑产品后上架!') |
||||||
|
row.isShelves = 1 |
||||||
|
return |
||||||
|
} |
||||||
|
this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => { |
||||||
this.getData() |
this.getData() |
||||||
}, |
}).catch(({ status }) => { |
||||||
} |
if (status !== 200) row.isShelves = 1 |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 精选 |
||||||
|
selected (row) { |
||||||
|
this.$post(`${this.api.goodsSelection}?mallId=${row.mallId}&selected=${row.selected ? 0 : 1}`).then((res) => { |
||||||
|
this.getData(); |
||||||
|
}).catch((res) => { }) |
||||||
|
}, |
||||||
|
// 排序回调 |
||||||
|
sortChange (column) { |
||||||
|
const { order } = column |
||||||
|
if (column.prop === 'selected') { |
||||||
|
this.form.sort = order ? order === 'ascending' ? 4 : 3 : 0 |
||||||
|
} |
||||||
|
this.getData() |
||||||
|
}, |
||||||
|
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
/deep/ .tool { |
/deep/ .tool { |
||||||
|
margin-bottom: 14px; |
||||||
.filter { |
.filter { |
||||||
|
flex-wrap: wrap; |
||||||
|
li { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
.el-input { |
.el-input { |
||||||
min-width: 215px; |
min-width: 215px; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
.icon { |
.icon { |
||||||
font-size: 16px; |
font-size: 16px; |
||||||
color: #9076FF; |
color: #9076ff; |
||||||
cursor: pointer; |
cursor: pointer; |
||||||
} |
} |
||||||
</style> |
</style> |
Loading…
Reference in new issue