Merge pull request 'chenlianjie' (#12) from chenlianjie into master

Reviewed-on: #12
pull/13/head^2
陈连杰 1 year ago
commit b51beb1b91
  1. 66
      src/components/Category/edit.vue
  2. 2
      src/views/marketing/advertisement/advertisementList.vue
  3. 55
      src/views/product/brand/components/AddOrEdit.vue
  4. 134
      src/views/product/brand/index.vue
  5. 681
      src/views/product/productAdd/newIndex.vue
  6. 2
      src/views/product/productClassify/index.vue
  7. 484
      src/views/product/productList/index.vue

@ -4,20 +4,19 @@
<el-form-item label="分类名称" prop="categoryName" :rules="[{ required: true, message: '请输入分类名称', trigger: ['blur', 'change'] }]">
<el-input v-model="editPram.categoryName" placeholder="分类名称" />
</el-form-item>
<el-form-item v-if="editPram.parentCategoryName" label="父级" >
<el-form-item v-if="editPram.parentCategoryName" label="父级">
{{ editPram.parentCategoryName }}
</el-form-item>
<el-form-item label="分类图标(180*180)">
<el-form-item label="分类图标(180*180)" prop="icon" :rules="[{ required: true, message: '请上传分类图标!', trigger: ['blur', 'change'] }]">
<div class="upLoadPicBox" @click="modalPicTap('1')">
<upload :photo="editPram.icon" @success="uploadSuccess" tip="图标尺寸为18*18比例,大小不能超过200KB,图片只能为jpg、png、gif格式"></upload>
<upload :photo="editPram.icon" @success="uploadSuccess" tip="图标尺寸为18*18比例,大小不能超过50KB,图片只能为jpg、png格式"></upload>
</div>
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="editPram.sort" :min="0" />
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="editPram.showFlag" active-text="显示" inactive-text="隐藏" active-value="1"
inactive-value="2" />
<el-switch v-model="editPram.showFlag" active-text="显示" inactive-text="隐藏" active-value="1" inactive-value="2" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loadingBtn" @click="handlerSubmit">确定</el-button>
@ -29,8 +28,8 @@
<!--创建和编辑公用一个组件-->
<script>
import upload from '@/components/Upload/index'
import productApi from '@/api/product/productAttr.js';
import { loadingFn } from "@/utils/validate"
import productApi from '@/api/product/productAttr.js'
import { loadingFn } from '@/utils/validate'
export default {
// name: "edit",
@ -43,17 +42,17 @@ export default {
},
data() {
return {
model:"classifySave",
model: 'classifySave',
loadingBtn: false,
constants: [],
editPram: {
level: 1,
icon:"",
icon: '',
showFlag: 1,
categoryName: "",
sort:1,
parentId:"",
parentCategoryName:""
categoryName: '',
sort: 1,
parentId: '',
parentCategoryName: ''
},
categoryProps: {
value: 'id',
@ -66,40 +65,39 @@ export default {
// this.initEditData()
},
methods: {
updateModel(e){
updateModel(e) {
this.model = e
},
uploadSuccess(e, res) {
if (res.code == 20000) {
({ publicUrl: this.editPram.icon } = res.data);
;({ publicUrl: this.editPram.icon } = res.data)
}
},
//
addIcon() { },
addIcon() {},
//
modalPicTap(tit, num, i) {
},
modalPicTap(tit, num, i) {},
close() {
this.$parent.$parent.editDialogConfig.visible=false;
},
initEditData() {
},
addTreeListLabelForCasCard(arr, child) {
this.$parent.$parent.editDialogConfig.visible = false
},
initEditData() {},
addTreeListLabelForCasCard(arr, child) {},
handlerSubmit() {
productApi[this.model](this.editPram).then((result) => {
if(result.code==20000){
this.$parent.$parent.editDialogConfig.visible=false;
this.$message.success("添加成功!");
this.$parent.$parent.handleCurrentChange();
this.$refs.editPram.validate(valid => {
if (valid) {
productApi[this.model](this.editPram)
.then(result => {
if (result.code == 20000) {
this.$parent.$parent.editDialogConfig.visible = false
this.$message.success('添加成功!')
this.$parent.$parent.handleCurrentChange()
}
}).catch((err) => {
});
},
handlerSaveOrUpdate(isSave) {
})
.catch(err => {})
}
})
},
handlerSaveOrUpdate(isSave) {}
}
}
</script>

@ -35,7 +35,7 @@
<el-table-column prop="advertisePosition" label="广告位置"></el-table-column>
<el-table-column prop="positionImage" label="广告图片" min-width="80">
<template slot-scope="scope">
<el-image style="width: 50px; height: 50px" :src="scope.row.positionImage"> </el-image>
<el-image style="width: 50px; height: 50px" :src="scope.row.positionImage" :preview-src-list="[scope.row.positionImage]"> </el-image>
</template>
</el-table-column>
<el-table-column label="时间" min-width="150">

@ -1,28 +1,39 @@
<template>
<div>
<el-form ref="form" :model="form">
<el-form-item prop="brandName" label="品牌名称" label-width="100px"
:rules="[{ required: true, message: '请输入品牌名称', trigger: ['blur', 'change'] }]">
<el-form-item
prop="brandName"
label="品牌名称"
label-width="100px"
:rules="[{ required: true, message: '请输入品牌名称', trigger: ['blur', 'change'] }]"
>
<el-input v-model="form.brandName"></el-input>
</el-form-item>
<el-form-item label="品牌首字母" prop="firstLetter" label-width="100px"
:rules="[{ required: true, message: '请输入品牌首字母', trigger: ['blur', 'change'] }]">
<el-form-item
label="品牌首字母"
prop="firstLetter"
label-width="100px"
:rules="[{ required: true, message: '请输入品牌首字母', trigger: ['blur', 'change'] }]"
>
<el-input v-model="form.firstLetter"></el-input>
</el-form-item>
<el-form-item label=" 品牌LOGO" label-width="100px">
<upload :photo="form.logoUrl" @success="uploadSuccess" tip="只能上传jpg/png格式文件,文件不能超过50kb">
</upload>
<el-form-item
label=" 品牌LOGO"
label-width="100px"
prop="logoUrl"
:rules="[{ required: true, message: '请上传品牌LOGO', trigger: ['blur', 'change'] }]"
>
<upload :photo="form.logoUrl" @success="uploadSuccess" tip="只能上传jpg/png格式文件,文件不能超过50kb"> </upload>
</el-form-item>
<el-form-item label="排序" label-width="100px">
<el-input-number v-model="form.sort" :min="0" />
</el-form-item>
<el-form-item label="是否显示" label-width="100px">
<el-switch v-model="form.showFlag" active-text="显示" inactive-text="隐藏" active-value="1"
inactive-value="2" />
<el-switch v-model="form.showFlag" active-text="显示" inactive-text="隐藏" active-value="1" inactive-value="2" />
</el-form-item>
</el-form>
<div slot="footer" class="footer">
<el-button @click="$emit('close')" > </el-button>
<el-button @click="$emit('close')"> </el-button>
<el-button @click="save" type="primary"> </el-button>
</div>
</div>
@ -35,30 +46,30 @@ export default {
data() {
return {
apiMode:"brandSave",
apiMode: 'brandSave',
form: {
"brandName": "",
"firstLetter": "",
"logoUrl": "",
"showFlag": "1",
"sort": "1"
brandName: '',
firstLetter: '',
logoUrl: '',
showFlag: '1',
sort: '1'
}
}
},
methods: {
save() {
this.$refs.form.validate((valid) => {
this.$refs.form.validate(valid => {
if (valid) {
this.$emit("brandSave",this.form,this.apiMode)
this.$emit('brandSave', this.form, this.apiMode)
}
});
})
},
uploadSuccess(e, res) {
console.log(...arguments,"uploadSuccess")
console.log(...arguments, 'uploadSuccess')
if (res.code == 20000) {
({ publicUrl: this.form.logoUrl } = res.data);
;({ publicUrl: this.form.logoUrl } = res.data)
}
}
},
}
}
</script>

@ -2,11 +2,9 @@
<div>
<el-card :bordered="false" shadow="never" class="ivu-mt" :body-style="{ padding: 0 }">
<div class="padding-add">
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
@submit.native.prevent inline>
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform" @submit.native.prevent inline>
<el-form-item label="输入搜索">
<el-input clearable v-model="page.brandName" placeholder="品牌名称/关键词"
class="form_content_width"></el-input>
<el-input clearable v-model="page.params.brandName" placeholder="品牌名称/关键词" class="form_content_width"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userSearchs">查询</el-button>
@ -16,9 +14,17 @@
</el-card>
<el-card :bordered="false" shadow="never" class="ivu-mt-16">
<el-button type="primary" @click="addBrand">添加品牌</el-button>
<el-table @current-change="tableCurrentChange" ref="table" :data="tableData" v-loading="loading"
highlight-current-row :row-key="getRowKey" @selection-change="handleSelectRow" empty-text="暂无数据"
class="mt14">
<el-table
@current-change="tableCurrentChange"
ref="table"
:data="tableData"
v-loading="loading"
highlight-current-row
:row-key="getRowKey"
@selection-change="handleSelectRow"
empty-text="暂无数据"
class="mt14"
>
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column>
<el-table-column label="编号">
<template slot-scope="scope">
@ -34,8 +40,7 @@
<el-table-column label="排序" prop="sort"> </el-table-column>
<el-table-column label="是否显示">
<template slot-scope="scope">
<el-switch disabled active-value="1" inactive-value="0" v-model="scope.row.showFlag"
active-color="#13ce66" inactive-color="#ff4949">
<el-switch disabled active-value="1" inactive-value="0" v-model="scope.row.showFlag" active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
@ -48,9 +53,15 @@
</el-table-column>
</el-table>
<div class="acea-row row-right page">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="page.currentPage" :page-sizes="[10, 15, 20, 30]" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="page.totalCount" />
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10, 15, 20, 30]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.totalCount"
/>
</div>
</el-card>
<el-dialog title="品牌设置" :visible.sync="isAddOrEdit" v-loading="addLoading">
@ -59,9 +70,9 @@
</div>
</template>
<script>
import productApi from '@/api/product/productAttr.js';
import { loadingFn } from "@/utils/validate"
import addOrEdit from "./components/AddOrEdit.vue"
import productApi from '@/api/product/productAttr.js'
import { loadingFn } from '@/utils/validate'
import addOrEdit from './components/AddOrEdit.vue'
export default {
components: { addOrEdit },
data() {
@ -73,10 +84,10 @@ export default {
isShowAttrList: false,
loading: false,
page: {
"currentPage": 1,
"pageSize": 10,
"params": {
brandName:""
currentPage: 1,
pageSize: 10,
params: {
brandName: ''
},
totalCount: 0
},
@ -84,8 +95,8 @@ export default {
total: 0,
selectedIds: new Set(), //id
ids: [],
multipleSelection: [],
};
multipleSelection: []
}
},
computed: {},
created() {
@ -93,71 +104,81 @@ export default {
},
methods: {
addBrand() {
this.isAddOrEdit = true;
this.isAddOrEdit = true
},
brandSave(e,model="brandSave") {
loadingFn.call(this, "addLoading", productApi[model](e).then(res => {
brandSave(e, model = 'brandSave') {
loadingFn.call(
this,
'addLoading',
productApi[model](e).then(res => {
if (res.code == 20000) {
this.$message.success("操作成功")
this.$message.success('操作成功')
setTimeout(() => {
this.isAddOrEdit = false;
this.getList();
}, 1000);
this.isAddOrEdit = false
this.getList()
}, 1000)
}
}), 1000);
}),
1000
)
},
tableCurrentChange(e) { },
tableCurrentChange(e) {},
handleCurrentChange(val) {
this.page.currentPage = val;
this.page.currentPage = val
this.getList()
},
handleSizeChange(val) {
this.page.pageSize = val
this.getList()
},
clearSelection() { },
onCancel() { },
clearSelection() {},
onCancel() {},
showAttrList(e) { },
getRowKey(row) { },
showAttrList(e) {},
getRowKey(row) {},
//
handleSelectAll(selection) { },
handleSelectAll(selection) {},
//
handleSelectRow(selection) { },
setChecked() { },
handleSelectRow(selection) {},
setChecked() {},
//
del(row) {
this.$alert('请确定删除该数据!', '提示', {
confirmButtonText: '确定',
callback: action => {
if (action == "confirm") {
loadingFn.call(this, "loading", productApi.brandDelete(row).then(res => {
if (res.code = 20000) {
this.$message.success("操作成功!")
if (action == 'confirm') {
loadingFn.call(
this,
'loading',
productApi.brandDelete(row).then(res => {
if ((res.code = 20000)) {
this.$message.success('操作成功!')
this.handleCurrentChange()
}
}));
})
)
}
}
});
},
addAttr(model) {
})
},
addAttr(model) {},
//
edit(row) {
this.isAddOrEdit = true;
this.isAddOrEdit = true
this.$nextTick(() => {
this.$refs.addOrEdit.apiMode = "brandUpdate"
this.$refs.addOrEdit.form = Object.assign(this.$refs.addOrEdit.form, row);
this.$refs.addOrEdit.apiMode = 'brandUpdate'
this.$refs.addOrEdit.form = Object.assign(this.$refs.addOrEdit.form, row)
})
},
//
getList() {
loadingFn.call(this, "loading", productApi.brandGetByPage(this.page).then(res => {
if (res.code = 20000) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data);
}));
loadingFn.call(
this,
'loading',
productApi.brandGetByPage(this.page).then(res => {
if ((res.code = 20000)) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data)
})
)
},
//
userSearchs() {
@ -167,9 +188,8 @@ export default {
init() {
this.getList()
}
},
};
}
}
</script>
<style scoped></style>

File diff suppressed because it is too large Load Diff

@ -58,7 +58,7 @@
<el-dropdown-item v-if="scope.row.level == 1">
<span @click="addClass(scope.row)">新增下级</span>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.level == 1">查看下级 </el-dropdown-item>
<!-- <el-dropdown-item v-if="scope.row.level == 1">查看下级 </el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
<el-button type=text>

@ -2,8 +2,7 @@
<div class="article-manager">
<el-card :bordered="false" shadow="never" class="ivu-mt mt16" :body-style="{ padding: '0 20px 20px' }">
<el-tabs v-model="page.params.type" @tab-click="onClickTab">
<el-tab-pane :label="item.name + '(' + item.count + ')'" :name="item.type.toString()"
v-for="(item, index) in headeNum" :key="index" />
<el-tab-pane :label="item.name + '(' + item.count + ')'" :name="item.type.toString()" v-for="(item, index) in headeNum" :key="index" />
</el-tabs>
<div>
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" inline @submit.native.prevent>
@ -11,11 +10,21 @@
<el-input clearable placeholder="请输入商品名称" v-model="page.params.productName" class="form_content_width" />
</el-form-item>
<el-form-item label="商品分类:" label-for="pid">
<el-cascader v-model="page.params.categorys" size="small" :options="treeSelect" :props="{
multiple: false, emitPath: false, checkStrictly: true, children: 'children',
<el-cascader
v-model="page.params.categorys"
size="small"
:options="treeSelect"
:props="{
multiple: false,
emitPath: false,
checkStrictly: true,
children: 'children',
label: 'categoryName',
value: 'id'
}" clearable class="form_content_width"></el-cascader>
}"
clearable
class="form_content_width"
></el-cascader>
</el-form-item>
<el-form-item label="商品类型:" prop="productType">
<el-select style="width: 100%;" v-model="page.params.productType" placeholder="请选择商品类型">
@ -24,7 +33,7 @@
</el-select>
</el-form-item>
<el-form-item label="油站名称:" label-for="siteName">
<el-input clearable placeholder="请输入油站名称:" v-model="page.siteName" class="form_content_width" />
<el-input clearable placeholder="请输入油站名称:" v-model="page.params.siteName" class="form_content_width" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userSearchs">查询</el-button>
@ -49,8 +58,16 @@
<el-button @click="onShelves" v-show="artFrom.type === '2'">批量上架</el-button>
<el-button class="export" @click="exports">导出</el-button>
</div>
<el-table ref="table" :data="tableList" class="ivu-mt mt14" v-loading="loading" highlight-current-row
:row-key="getRowKey" @selection-change="handleSelectRow" empty-text="暂无数据">
<el-table
ref="table"
:data="tableList"
class="ivu-mt mt14"
v-loading="loading"
highlight-current-row
:row-key="getRowKey"
@selection-change="handleSelectRow"
empty-text="暂无数据"
>
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column>
<el-table-column label="编号">
<template slot-scope="scope">
@ -69,45 +86,67 @@
</div>
</template>
</el-table-column> -->
<el-table-column label="商品名称" min-width="250">
<el-table-column label="商品名称" min-width="200" align="center">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column label="价格/货号" min-width="100">
<el-table-column label="价格/货号" min-width="200">
<template slot-scope="scope">
<span>价格¥{{ scope.row.price }}</span> <br />
<span>货号{{ scope.row.productNum }}</span>
</template>
</el-table-column>
<el-table-column label="标签" min-width="100">
<template slot-scope="scope">
<div>
上架
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.productStatus"
active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
<el-switch
disabled
active-value="1"
inactive-value="2"
v-model="scope.row.productStatus"
active-color="#13ce66"
inactive-color="#ff4949"
>
</el-switch>
</div>
<div>
新品
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.newMark" active-color="#13ce66"
inactive-color="#ff4949"> </el-switch>
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.newMark" active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</div>
<div>
推荐
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.recommend" active-color="#13ce66"
inactive-color="#ff4949"> </el-switch>
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.recommend" active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</div>
</template>
</el-table-column>
<el-table-column label="库存" min-width="100">
<el-table-column label="油站" min-width="150" align="center">
<template slot-scope="scope">
<span>{{ scope.row.stockList.length }}</span> <br />
<span>
{{ scope.row.siteName }}
</span>
</template>
</el-table-column>
<el-table-column label="库存" min-width="80">
<template slot-scope="scope">
<!-- <span>{{ scope.row.stockList.length }}</span> <br /> -->
<!-- <el-button type="text"> {{ scope.row.stockList.length }}</el-button> <br/> -->
<el-button @click="stockList=scope.row;isEditorStock=true" type="text"> 编辑库存</el-button> <br />
<el-button
@click="
stockList = scope.row
isEditorStock = true
"
type="text"
>
编辑库存</el-button
>
<br />
</template>
</el-table-column>
<el-table-column label="更新时间" min-width="100">
<el-table-column label="更新时间" min-width="150">
<template slot-scope="scope">
<span>
{{ scope.row.updateTime }}
@ -118,7 +157,6 @@
<template slot-scope="scope">
<span>{{ scope.row.auditStatus | auditStatusFilter }}</span> <br />
<el-button @click="openAuditingDetail(scope.row.id)" type="text">审核详情</el-button>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" minWidth="100">
@ -126,16 +164,17 @@
<el-button @click="edit(scope.row)" type="text">编辑</el-button>
<el-button @click="del(scope.row)" type="text">删除</el-button>
<el-dropdown v-if="scope.row.auditStatus==1" size="small">
<el-dropdown v-if="scope.row.auditStatus == 1" size="small">
<span class="el-dropdown-link">
<el-button type="text">审核</el-button>
<i class="el-icon-arrow-down el-icon--right"></i> </span>
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button @click="auditing(scope.row,2)" type="text">审核通过</el-button>
<el-button @click="auditing(scope.row, 2)" type="text">审核通过</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button @click="auditing(scope.row,3)" type="text">审核驳回</el-button>
<el-button @click="auditing(scope.row, 3)" type="text">审核驳回</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -156,9 +195,15 @@
</el-table-column>
</el-table>
<div class="acea-row row-right page">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="page.currentPage" :page-sizes="[10, 15, 20, 30]" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="page.totalCount" />
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10, 15, 20, 30]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.totalCount"
/>
</div>
<attribute :attrTemplate="attrTemplate" v-on:changeTemplate="changeTemplate"></attribute>
</el-card>
@ -172,16 +217,27 @@
>
<tao-bao ref="taobaos" v-if="modals" @on-close="onClose"></tao-bao>
</el-dialog> -->
<el-dialog :visible.sync="batchModal" class="batch-box" title="批量设置" :show-close="true" :close-on-click-modal="false"
width="540px">
<el-form class="batchFormData" ref="batchFormData" :rules="ruleBatch" :model="batchFormData" label-width="90px"
label-position="right" @submit.native.prevent>
<el-dialog :visible.sync="batchModal" class="batch-box" title="批量设置" :show-close="true" :close-on-click-modal="false" width="540px">
<el-form
class="batchFormData"
ref="batchFormData"
:rules="ruleBatch"
:model="batchFormData"
label-width="90px"
label-position="right"
@submit.native.prevent
>
<el-row :gutter="24">
<el-col :span="24" v-if="batchType == 1">
<el-form-item label="商品分类:" prop="cate_id">
<el-cascader v-model="batchFormData.cate_id" size="small" :options="treeSelect"
:props="{ multiple: true, emitPath: false, checkStrictly: true }" clearable
style="width: 400px"></el-cascader>
<el-cascader
v-model="batchFormData.cate_id"
size="small"
:options="treeSelect"
:props="{ multiple: true, emitPath: false, checkStrictly: true }"
clearable
style="width: 400px"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="24" v-if="batchType == 2">
@ -200,29 +256,31 @@
</el-form-item>
<el-form-item label="" v-if="batchFormData.freight == 2">
<div class="acea-row">
<el-input-number :controls="false" :min="0" v-model="batchFormData.postage" placeholder="请输入金额"
class="perW20 maxW" />
<el-input-number :controls="false" :min="0" v-model="batchFormData.postage" placeholder="请输入金额" class="perW20 maxW" />
</div>
</el-form-item>
<el-form-item label="" v-if="batchFormData.freight == 3" prop="temp_id">
<div class="acea-row">
<el-select v-model="batchFormData.temp_id" clearable placeholder="请选择运费模板" style="width: 414px">
<el-option v-for="(item, index) in templateList" :value="item.id" :key="index"
:label="item.name"></el-option>
<el-option v-for="(item, index) in templateList" :value="item.id" :key="index" :label="item.name"></el-option>
</el-select>
</div>
</el-form-item>
</el-col>
<el-col :span="24" v-if="[3, 4, 5, 6].includes(batchType)">
<el-form-item label="赠送积分:" prop="give_integral" v-if="batchType == 3">
<el-input-number :controls="false" v-model="batchFormData.give_integral" :min="0" :max="9999999999"
placeholder="请输入积分" style="width: 100%" />
<el-input-number
:controls="false"
v-model="batchFormData.give_integral"
:min="0"
:max="9999999999"
placeholder="请输入积分"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="赠送优惠券:" v-if="batchType == 4">
<div v-if="couponName.length" class="mb20">
<el-tag closable v-for="(item, index) in couponName" :key="index" @close="handleClose(item)">{{
item.title
}}</el-tag>
<el-tag closable v-for="(item, index) in couponName" :key="index" @close="handleClose(item)">{{ item.title }}</el-tag>
</div>
<el-button type="primary" @click="addCoupon">添加优惠券</el-button>
</el-form-item>
@ -231,9 +289,7 @@
<div class="labelInput acea-row row-between-wrapper" @click="openLabel">
<div style="width: 90%">
<div v-if="dataLabel.length">
<el-tag closable v-for="(item, index) in dataLabel" @close="closeLabel(item)" :key="index">{{
item.label_name
}}</el-tag>
<el-tag closable v-for="(item, index) in dataLabel" @close="closeLabel(item)" :key="index">{{ item.label_name }}</el-tag>
</div>
<span class="span" v-else>选择用户关联标签</span>
</div>
@ -278,14 +334,14 @@
</template>
<script>
import expandRow from './tableExpand.vue';
import attribute from './attribute';
import taoBao from './taoBao';
import goodsDetail from './components/goodsDetail.vue';
import couponList from '@/components/couponList';
import userLabel from '@/components/labelList';
import productApi from '@/api/product/productAttr.js';
import { loadingFn } from "@/utils/validate";
import expandRow from './tableExpand.vue'
import attribute from './attribute'
import taoBao from './taoBao'
import goodsDetail from './components/goodsDetail.vue'
import couponList from '@/components/couponList'
import userLabel from '@/components/labelList'
import productApi from '@/api/product/productAttr.js'
import { loadingFn } from '@/utils/validate'
import EditorStock from './components/EditorStock.vue'
import AuditingDetail from './components/AuditingDetail.vue'
@ -294,23 +350,23 @@ export default {
auditStatusFilter(e) {
switch (e) {
case '1':
return "待审核"
return '待审核'
case '2':
return "通过"
return '通过'
case '3':
return "不通过"
return '不通过'
default:
return "暂无数据"
return '暂无数据'
}
}
},
name: 'product_productList',
components: { expandRow, attribute, taoBao, goodsDetail, userLabel, couponList,EditorStock,AuditingDetail },
components: { expandRow, attribute, taoBao, goodsDetail, userLabel, couponList, EditorStock, AuditingDetail },
data() {
return {
isAuditingDetail:false,
stockList:{},
isEditorStock:false,
isAuditingDetail: false,
stockList: {},
isEditorStock: false,
template: false,
modals: false,
batchModal: false,
@ -325,7 +381,7 @@ export default {
give_integral: 0,
label_id: [],
coupon_ids: [],
recommend: [],
recommend: []
},
ruleBatch: {},
couponName: [], //
@ -336,14 +392,14 @@ export default {
lg: 8,
md: 12,
sm: 24,
xs: 24,
xs: 24
},
page: {
"currentPage": 1,
"pageSize": 10,
"params": {
brandName: "",
type:"0"
currentPage: 1,
pageSize: 10,
params: {
brandName: '',
type: '0'
},
totalCount: 0
},
@ -352,41 +408,41 @@ export default {
limit: 15,
cate_id: '',
type: '1',
store_name: '',
store_name: ''
},
list: [],
tableList: [],
headeNum: [
{
"count": 2,
"name": "全部商品",
"type":0,
"params": {}
count: '',
name: '全部商品',
type: 0,
params: {}
},
{
"count": 40,
"name": "已上架",
"type": 1,
"params": {
"productStatus": "1"
count: '',
name: '已上架',
type: 1,
params: {
productStatus: '1'
}
},
{
"count": 5,
"name": "未上架",
"type": 2,
"params": {
"productStatus": "2"
count: '',
name: '未上架',
type: 2,
params: {
productStatus: '2'
}
},
{
"count": 10,
"name": "待审核",
"type": 3,
"params": {
"auditStatus": "1"
count: '',
name: '待审核',
type: 3,
params: {
auditStatus: '1'
}
}
},
],
loading: false,
data: [],
@ -396,57 +452,66 @@ export default {
goodsId: '',
isProductBox: false,
treeSelect: [],
multipleSelection: [],
};
multipleSelection: []
}
},
created() {
this.init()
},
activated() { },
activated() {},
methods: {
auditing(row,auditStatus){
auditing(row, auditStatus) {
this.$prompt('审核', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder:"请输入审核说明",
inputPlaceholder: '请输入审核说明',
inputPattern: /^.+$/,
inputErrorMessage: '审核说明不能为空'
}).then(({ value }) => {
productApi.productListAuditProduct(Object.assign(row,{auditRemark:value,auditStatus})).then(res=>{
if(res.code==20000){
this.$message.success("操作成功!");
this.handleCurrentChange();
})
.then(({ value }) => {
productApi.productListAuditProduct(Object.assign(row, { auditRemark: value, auditStatus })).then(res => {
if (res.code == 20000) {
this.$message.success('操作成功!')
this.handleCurrentChange()
}
})
}).catch((e) => {
})
.catch(e => {
console.log(e)
});
})
},
openAuditingDetail(id){
this.isAuditingDetail=true;
this.$nextTick(()=>{
this.$refs.AuditingDetail.getByPage(id);
openAuditingDetail(id) {
this.isAuditingDetail = true
this.$nextTick(() => {
this.$refs.AuditingDetail.getByPage(id)
})
},
editorStockSubmit(stockList){
let { id:productId} = this.stockList;
productApi.productListUpdateBatchList({
editorStockSubmit(stockList) {
let { id: productId } = this.stockList
productApi
.productListUpdateBatchList({
productId,
stockList:stockList.map(item=>{ return {
stockList: stockList.map(item => {
return {
...item,
attributeJson:JSON.stringify( item.attributeJson)
} })
}).then(res=>{
attributeJson: JSON.stringify(item.attributeJson)
}
})
})
.then(res => {
if (res.code == 20000) {
this.isEditorStock = false
this.$message.success('操作成功!')
this.handleCurrentChange()
}
})
},
init() {
this.getCategorySelect();
this.getDataList();
this.getCategorySelect()
this.getDataList()
},
handleCurrentChange(val) {
this.page.currentPage = val;
this.page.currentPage = val
this.getDataList()
},
handleSizeChange(val) {
@ -457,96 +522,96 @@ export default {
getCategorySelect() {
productApi.getClassificationTree().then(res => {
if (res.code == 20000) {
this.treeSelect = res.data;
this.treeSelect = res.data
}
})
},
getList() { },
getList() {},
batchSub() { },
clearBatchData(status) { },
batchSub() {},
clearBatchData(status) {},
//
batchSelect(type) { },
activeData(dataLabel) { },
nameId(id, names) { },
handleClose(name) { },
batchSelect(type) {},
activeData(dataLabel) {},
nameId(id, names) {},
handleClose(name) {},
//
unique(arr) {
const res = new Map();
return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
const res = new Map()
return arr.filter(arr => !res.has(arr.id) && res.set(arr.id, 1))
},
//
productGetTemplate() { },
productGetTemplate() {},
//
labelClose() { },
labelClose() {},
look(row) {
this.goodsId = row.id;
this.isProductBox = true;
this.goodsId = row.id
this.isProductBox = true
},
//
logisticsBtn(e) {
this.batchFormData.logistics = e;
this.batchFormData.logistics = e
},
//
openLabel() {
this.labelShow = true;
this.labelShow = true
},
closeLabel(label) {
let index = this.dataLabel.indexOf(this.dataLabel.filter((d) => d.id == label.id)[0]);
this.dataLabel.splice(index, 1);
let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0])
this.dataLabel.splice(index, 1)
},
//
addCoupon() { },
getPath() { },
addCoupon() {},
getPath() {},
//
async exports() {
let [th, filekey, data, fileName] = [[], [], [], ''];
let excelData = JSON.parse(JSON.stringify(this.artFrom));
excelData.page = 1;
excelData.limit = 50;
excelData.ids = this.ids;
let [th, filekey, data, fileName] = [[], [], [], '']
let excelData = JSON.parse(JSON.stringify(this.artFrom))
excelData.page = 1
excelData.limit = 50
excelData.ids = this.ids
for (let i = 0; i < excelData.page + 1; i++) {
let lebData = await this.getExcelData(excelData);
if (!fileName) fileName = lebData.filename;
let lebData = await this.getExcelData(excelData)
if (!fileName) fileName = lebData.filename
if (!filekey.length) {
filekey = lebData.fileKey;
filekey = lebData.fileKey
}
if (!th.length) th = lebData.header;
if (!th.length) th = lebData.header
if (lebData.export.length) {
data = data.concat(lebData.export);
excelData.page++;
data = data.concat(lebData.export)
excelData.page++
} else {
this.$exportExcel(th, filekey, fileName, data);
return;
this.$exportExcel(th, filekey, fileName, data)
return
}
}
},
getExcelData(excelData) { },
freight() { },
getExcelData(excelData) {},
freight() {},
//
onShelves() { },
onShelves() {},
//
onDismount() { },
onDismount() {},
getRowKey(row) {
return row.id;
return row.id
},
//
handleSelectRow(selection) {
const uniqueArr = [];
const ids = [];
const uniqueArr = []
const ids = []
for (let i = 0; i < selection.length; i++) {
const item = selection[i];
const item = selection[i]
if (!ids.includes(item.id)) {
uniqueArr.push(item);
ids.push(item.id);
uniqueArr.push(item)
ids.push(item.id)
}
}
this.ids = ids;
this.multipleSelection = uniqueArr;
this.ids = ids
this.multipleSelection = uniqueArr
},
//
onClose() {
this.modals = false;
this.modals = false
},
//
onCopy() {
@ -557,54 +622,60 @@ export default {
},
// tab
onClickTab() {
console.log(this.page.params.type,"params");
this.page.currentPage = 1;
this.multipleSelection = [];
this.$refs.table.clearSelection();
this.page.params = {type:this.page.params.type};
this.getDataList( Object.assign({},this.page,{params:this.headeNum[this.page.params.type].params}));
console.log(this.page.params.type, 'params')
this.page.currentPage = 1
this.multipleSelection = []
this.$refs.table.clearSelection()
this.page.params = { type: this.page.params.type }
this.getDataList(Object.assign({}, this.page, { params: this.headeNum[this.page.params.type].params }))
},
//
handleCheckChange(data) {
let value = '';
let title = '';
this.list = [];
this.artFrom.cate_id = 0;
let value = ''
let title = ''
this.list = []
this.artFrom.cate_id = 0
data.forEach((item, index) => {
value += `${item.id},`;
title += `${item.title},`;
});
value = value.substring(0, value.length - 1);
title = title.substring(0, title.length - 1);
value += `${item.id},`
title += `${item.title},`
})
value = value.substring(0, value.length - 1)
title = title.substring(0, title.length - 1)
this.list.push({
value,
title,
});
this.artFrom.cate_id = value;
this.getDataList();
title
})
this.artFrom.cate_id = value
this.getDataList()
},
//
goodHeade() { },
goodHeade() {},
//
goodsCategory() {
},
goodsCategory() {},
//
getDataList(page) {
loadingFn.call(this, "loading", productApi.productListGetByPage(page?page:this.page).then(res => {
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.page.totalCount = 0 } = res.data);
}));
},
showSelectData() {
loadingFn.call(
this,
'loading',
productApi.productListGetByPage(page ? page : this.page).then(res => {
if ((res.code = 20000)) ({ list: this.tableList = [], totalCount: this.page.totalCount = 0 } = res.data)
this.headeNum[0].count = res.data.allCount
this.headeNum[1].count = res.data.upCount
this.headeNum[2].count = res.data.downCount
this.headeNum[3].count = res.data.auditCount
})
)
},
showSelectData() {},
//
userSearchs() {
this.handleCurrentChange();
this.handleCurrentChange()
// this.artFrom.page = 1;
},
//
changeSwitch(row) { },
changeSwitch(row) {},
//
exportData: function () {
exportData: function() {
// let th = ['', '', '', '', '', '', ''];
// let filterVal = ['store_name', 'store_info', 'cate_name', 'price', 'stock', 'sales', 'collect'];
// this.where.page = 'nopage';
@ -617,18 +688,18 @@ export default {
},
//
attrTap() {
this.attrTemplate = true;
this.attrTemplate = true
},
changeTemplate(msg) {
this.attrTemplate = msg;
this.attrTemplate = msg
},
//
edit(row) {
console.log(row)
this.$router.push({
name:"productAdd",
params:{
id:row.id
name: 'productAdd',
params: {
id: row.id
}
})
// this.$router.push({ path: this.$routeProStr + '/product/add_product/' + row.id });
@ -638,17 +709,16 @@ export default {
this.$alert('请确定删除!', '提示', {
confirmButtonText: '确定',
callback: action => {
if (action == "confirm") {
if (action == 'confirm') {
productApi.productListDelete(row).then(res => {
if (res.code == 20000) {
this.$message.success("操作成功!")
this.$message.success('操作成功!')
this.handleCurrentChange()
}
})
}
}
});
})
// let delfromData = {
// title: tit,
// num: num,
@ -667,9 +737,9 @@ export default {
// .catch((res) => {
// this.$message.error(res.msg);
// });
},
},
};
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-tabs__item {

Loading…
Cancel
Save