产品管理联调

dev_202304
yujialong 2 years ago
parent 261356b04d
commit 8229dd1904
  1. 27
      src/utils/api.js
  2. 3
      src/utils/editor.js
  3. 30
      src/views/order/AddOrder.vue
  4. 1143
      src/views/shop/addProduct/index.vue
  5. 128
      src/views/shop/list/market/index.vue
  6. 62
      src/views/shop/list/product/index.vue

@ -432,4 +432,31 @@ export default {
saveScheme: `nakadai/nakadai/partner/schemeManagement/save`, saveScheme: `nakadai/nakadai/partner/schemeManagement/save`,
schemeList: `nakadai/nakadai/partner/schemeManagement/schemeList`, schemeList: `nakadai/nakadai/partner/schemeManagement/schemeList`,
updateScheme: `nakadai/nakadai/partner/schemeManagement/update`, updateScheme: `nakadai/nakadai/partner/schemeManagement/update`,
// 商城管理
addProductCategory: `nakadai/productClassification/addProductCategory`,
deleteProductCategory: `nakadai/productClassification/deleteProductCategory`,
productCategoryList: `nakadai/productClassification/productCategoryList`,
addProductType: `nakadai/productType/addProductType`,
deleteProductType: `nakadai/productType/deleteProductType`,
productTypeList: `nakadai/productType/productTypeList`,
addSupplier: `nakadai/supplier/addSupplier`,
deleteSupplier: `nakadai/supplier/deleteSupplier`,
supplierList: `nakadai/supplier/supplierList`,
addTags: `nakadai/tags/addTags`,
deleteTags: `nakadai/tags/deleteTags`,
tagsList: `nakadai/tags/tagsList`,
addGoods: `nakadai/mall/addGoods`,
listOfGoods: `nakadai/mall/listOfGoods`,
deletionOfGoods: `nakadai/mall/deletionOfGoods`,
detailsOfGoods: `nakadai/mall/detailsOfGoods`,
renewalOfGoods: `nakadai/mall/renewalOfGoods`,
goodsOffTheShelf: `nakadai/mall/goodsOffTheShelf`,
// 营销推广
delMarketing: `nakadai/nakadai/mall/marketing/promotion/batchDeletion`,
findByIdMarketing: `nakadai/nakadai/mall/marketing/promotion/findById`,
listMarketing: `nakadai/nakadai/mall/marketing/promotion/pagingQueryList`,
saveMarketing: `nakadai/nakadai/mall/marketing/promotion/save`,
updateMarketing: `nakadai/nakadai/mall/marketing/promotion/update`,
}; };

@ -376,7 +376,8 @@ export default {
ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei")
ed.target.editorCommands.execCommand("fontSize", false, "19px") ed.target.editorCommands.execCommand("fontSize", false, "19px")
ed.target.editorCommands.execCommand("lineHeight", false, "1.5") ed.target.editorCommands.execCommand("lineHeight", false, "1.5")
top.document.querySelector('#articleTitle').focus() // 第一个字段聚焦 const el = top.document.querySelector('#articleTitle')
el && el.focus() // 第一个字段聚焦
}) })
}, },
} }

@ -706,6 +706,11 @@
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex-c-c"> <div class="flex-c-c">
<!-- <el-button
type="text"
@click="delPracticalCourses(scope.$index)"
style="margin-right:10px;"
>删除</el-button> -->
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@ -1201,6 +1206,14 @@
</div> </div>
<!-- 选择客户 --> <!-- 选择客户 -->
<select-client ref="client" @back="backToOrder" v-show="showSelectClient" :refresh="showSelectClient"></select-client> <select-client ref="client" @back="backToOrder" v-show="showSelectClient" :refresh="showSelectClient"></select-client>
<el-dialog title="发货信息填写" :visible.sync="shipVisible" width="380px" class="dialog" :close-on-click-modal="false">
<el-input v-model="shipContent" placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)" type="textarea" :rows="10" maxlength="300"></el-input>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="shipVisible = false">取消</el-button>
<el-button type="primary" @click="submitShip">确定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -1392,7 +1405,10 @@ export default {
repeatMsg: '', repeatMsg: '',
clients: [], clients: [],
valueList: [], valueList: [],
rate: '' rate: '',
shipVisible: false,
shipContent: '',
curRow: {},
}; };
}, },
watch: { watch: {
@ -2452,6 +2468,7 @@ export default {
if(row.ship === 1) { if(row.ship === 1) {
row.isEnable = 1 row.isEnable = 1
} }
if (type == 3 && row.ship) this.shipVisible = true //
}, },
// 0 // 0
handleNaN(val) { handleNaN(val) {
@ -2601,6 +2618,17 @@ export default {
}) })
} }
}, },
//
showShip(row) {
this.curRow = row
this.shipContent = row.shipContent
this.shipVisible = true
},
//
submitShip() {
this.curRow.shipContent = this.shipContent
this.shipVisible = false
},
// //
clearprovince() { clearprovince() {
this.form.cityId = ""; this.form.cityId = "";

File diff suppressed because it is too large Load Diff

@ -1,52 +1,66 @@
<template> <template>
<!-- 营销推广管理 --> <!-- 营销推广管理 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div style="margin-bottom: 10px;text-align: right;">
<el-button v-auth="'平台自建:新增'" type="primary" round @click="add">新增</el-button>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> <el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="courseName" label="图片" min-width="150" align="center"> <el-table-column prop="courseName" label="图片" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<img width="100" :src="scope.row.banner" alt="">
</template>
</el-table-column>
<el-table-column prop="title" label="标题" min-width="150" align="center"></el-table-column>
<el-table-column prop="url" label="链接" min-width="150" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'">
</el-switch>
<el-button style="margin-left: 10px;" v-auth="'平台自建:删除'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="(form.id ? '编辑' : '新增') + 'banner'" :visible.sync="bannerVisible" width="500px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="60px">
<el-form-item label="图片">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
:on-success="res => uploadSuccess(res, scope.row)" :on-success="uploadSuccess"
:limit="1" :limit="1"
:action="api.fileupload" :action="api.fileupload"
:headers="headers" :headers="headers"
:show-file-list="false" :show-file-list="false"
name="file" name="file"
> >
<img v-if="scope.row.pic" :src="scope.row.pic" class="avatar"> <img v-if="form.banner" :src="form.banner" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传图片</p> <p>上传图片</p>
</div> </div>
</el-upload> </el-upload>
</template> </el-form-item>
</el-table-column> <el-form-item label="标题">
<el-table-column prop="courseName" label="标题" min-width="150" align="center"> <el-input v-model="form.title" placeholder="请输入标题" maxlength="100"></el-input>
<template slot-scope="scope"> </el-form-item>
<el-input v-model="scope.row.title" placeholder="请输入标题" maxlength="100"></el-input> <el-form-item label="链接">
</template> <el-input v-model="form.url" placeholder="请输入链接" maxlength="100"></el-input>
</el-table-column> </el-form-item>
<el-table-column prop="courseName" label="链接" min-width="150" align="center"> </el-form>
<template slot-scope="scope"> <span slot="footer" class="dialog-footer">
<el-input v-model="scope.row.title" placeholder="请输入链接" maxlength="100"></el-input> <el-button @click="bannerVisible = false">取消</el-button>
</template> <el-button type="primary" @click="submitBanner">确定</el-button>
</el-table-column> </span>
<el-table-column label="操作" align="center" width="250"> </el-dialog>
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShelves"
:active-value="1"
:inactive-value="0"
@change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'">
</el-switch>
<el-button class="m-l-10" v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
</template> </template>
@ -59,36 +73,35 @@ export default {
headers: { headers: {
token: sessionStorage.getItem("token") token: sessionStorage.getItem("token")
}, },
list: [{}], list: [],
bannerVisible: false,
form: {
id: '',
banner: '',
title: '',
url: '',
}
}; };
}, },
mounted() { mounted() {
this.getList()
}, },
methods: { methods: {
getList() { getList() {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listMarketing, {
pageNum: this.page, pageNum: 1,
pageSize: this.pageSize, pageSize: 1000
keyWord: this.keyword,
createPlatform: 0,
platformSource: Setting.platformSource,
...this.form
}).then(({ page }) => { }).then(({ page }) => {
this.list = page.records; this.list = page.records;
this.total = page.total; this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => { }).catch(res => {
}); });
}, },
handleExceed() { // handleExceed() { //
this.$message.warning("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); this.$message.warning("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
}, },
uploadSuccess(res, row) { // uploadSuccess(res) { //
row.pic = res.data.filesResult.fileUrl; this.form.banner = res.data.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { // uploadError(err, file, fileList) { //
this.$message({ this.$message({
@ -103,20 +116,37 @@ export default {
handleRemove(file, fileList) { // handleRemove(file, fileList) { //
// this.form.coverUrl = '' // this.form.coverUrl = ''
}, },
addCourse() { add() {
this.$router.push("/addTheoreticalCourse"); this.form = {
id: '',
banner: '',
title: '',
url: '',
}
this.bannerVisible = true
},
edit(row) {
this.form = JSON.parse(JSON.stringify(row))
this.bannerVisible = true
}, },
editCourse(row) { // banner
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); submitBanner() {
const { form } = this
if (!form.banner) return util.errorMsg('请上传图片')
if (!form.title) return util.errorMsg('请输入标题')
this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => {
this.getList()
this.bannerVisible = false
}).catch(res => {})
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => { this.$post(`${this.api.delMarketing}?ids=${row.id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.initData(); this.getList();
}).catch(res => { }).catch(res => {
}); });
}) })

@ -41,20 +41,24 @@
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="产品名称" min-width="150" align="center"></el-table-column> <el-table-column prop="productName" label="产品名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="厂商" min-width="150" align="center"></el-table-column> <el-table-column prop="supplierName" label="厂商" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="产品类型" min-width="150" align="center"></el-table-column> <el-table-column prop="typeName" label="产品类型" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="关联产品" min-width="150" align="center"></el-table-column> <el-table-column prop="associatedProductName" label="关联产品" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="状态" min-width="150" align="center"></el-table-column> <el-table-column prop="courseName" label="状态" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.isShelves ? '下架' : '上架' }}
</template>
</el-table-column>
<el-table-column prop="courseName" label="订单量" min-width="150" align="center"></el-table-column> <el-table-column prop="courseName" label="订单量" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" 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="courseName" label="精选" min-width="150" align="center"></el-table-column> <el-table-column prop="courseName" label="精选" min-width="150" align="center"></el-table-column>
<el-table-column label="上架/下架" align="center"> <el-table-column label="上架/下架" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isShelves" v-model="scope.row.isShelves"
:active-value="1" :active-value="0"
:inactive-value="0" :inactive-value="1"
@change="changeSwitch($event, scope.row)" @change="changeSwitch($event, scope.row)"
v-auth="'/curriculum:上下架'"> v-auth="'/curriculum:上下架'">
</el-switch> </el-switch>
@ -135,47 +139,23 @@ export default {
}, },
mounted() { mounted() {
this.getClassification(); this.getClassification();
this.getData(); this.initData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
}, },
methods: { methods: {
//: getData() {
// this.$post(this.api.listOfGoods, {
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
keyWord: this.keyword, // keyWord: this.keyword,
createPlatform: 0, // createPlatform: 0,
platformSource: Setting.platformSource, // platformSource: Setting.platformSource,
...this.form ...this.form
}).then(({ page }) => { }).then(({ page }) => {
this.list = page.records; this.list = page.records;
this.total = page.total; this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => { }).catch(res => {
}); });
}, },
// redis
getRedis() {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
getData() {
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
},
initData() { initData() {
this.page = 1; this.page = 1;
this.getData(); this.getData();
@ -203,14 +183,14 @@ export default {
this.$router.push("/shop/addProduct"); this.$router.push("/shop/addProduct");
}, },
editCourse(row) { editCourse(row) {
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); this.$router.push(`/shop/addProduct?id=${row.mallId}`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => { this.$post(this.api.deletionOfGoods, row.mallId).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.initData(); this.initData();
}).catch(res => { }).catch(res => {
@ -251,7 +231,7 @@ export default {
}, },
// //
changeSwitch(value, row) { changeSwitch(value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => { this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => {
this.getData(); this.getData();
this.$message.success("修改上下架状态成功!"); this.$message.success("修改上下架状态成功!");
}).catch((res) => { }).catch((res) => {

Loading…
Cancel
Save