产品管理联调

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. 1403
      src/views/shop/addProduct/index.vue
  5. 132
      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`,
schemeList: `nakadai/nakadai/partner/schemeManagement/schemeList`,
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("fontSize", false, "19px")
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">
<template slot-scope="scope">
<div class="flex-c-c">
<!-- <el-button
type="text"
@click="delPracticalCourses(scope.$index)"
style="margin-right:10px;"
>删除</el-button> -->
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@ -1201,6 +1206,14 @@
</div>
<!-- 选择客户 -->
<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>
</template>
@ -1392,7 +1405,10 @@ export default {
repeatMsg: '',
clients: [],
valueList: [],
rate: ''
rate: '',
shipVisible: false,
shipContent: '',
curRow: {},
};
},
watch: {
@ -2452,6 +2468,7 @@ export default {
if(row.ship === 1) {
row.isEnable = 1
}
if (type == 3 && row.ship) this.shipVisible = true //
},
// 0
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() {
this.form.cityId = "";

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save