张雄 2 years ago
parent 5bebf8966b
commit 49b2291f0f

@ -74,7 +74,7 @@ export function findIndustryCom(params) {
}) })
} }
// 根据业委会主键id查询业委会信息 // 修改业委会信息
export function updateIndustryCom(params) { export function updateIndustryCom(params) {
return httpService({ return httpService({
url: `/user/industryCommittee/update`, url: `/user/industryCommittee/update`,

@ -117,4 +117,50 @@ export function settingPoints(params) {
method: 'post', method: 'post',
data: params, data: params,
}) })
}
//自营
//自营商品列表
export function selfGoodsList(params) {
return httpService({
url: `/user/shop/selfGoodsList`,
method: 'get',
params: params,
})
}
//自营商品推送
export function selfGoodsPush(params) {
return httpService({
url: `/user/shop/selfGoodsPush`,
method: 'post',
data: params,
})
}
//自营商品批量推送
export function selfGoodsMultiPush(params) {
return httpService({
url: `/user/shop/selfGoodsBatchPush`,
method: 'post',
data: params,
})
}
//自营商品-查询所有商品类型(级联)
export function findAllGoodsCategory(params) {
return httpService({
url: `/user/shopCategory/findAllGoodsCategory`,
method: 'get',
params: params,
})
}
//自营商品-自营商品推送
export function selfItemPush(params) {
return httpService({
url: `/user/shop/selfGoodsPush`,
method: 'post',
data: params,
})
} }

@ -25,7 +25,7 @@
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button> <div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button>
<a-button style="margin-left: 10px" @click="resetForm"> </a-button></div> <a-button style="margin-left: 10px" @click="resetForm"> </a-button></div>
</div> </div>
</template> </template>

@ -25,6 +25,14 @@ export default [
component: resolve => require(['@/views/Shop/GoodsManage/_goodsList'], resolve), component: resolve => require(['@/views/Shop/GoodsManage/_goodsList'], resolve),
meta: {title: '商品列表'}, meta: {title: '商品列表'},
}, },
{
path: '/GoodsManage/SelfGoodsList',
name: "SelfGoodsList",
title: "自营商品列表",
hide: false,
component: resolve => require(['@/views/Shop/GoodsManage/_selfGoodsList'], resolve),
meta: {title: '自营商品列表'},
},
{ {
path: '/GoodsManage/PointGoods', path: '/GoodsManage/PointGoods',
name: "PointGoods", name: "PointGoods",

@ -16,7 +16,7 @@ export default {
Vue.prototype.$buildingUpload = process.env.VUE_APP_URL + store.getters.getCommunityCode + '/manage/user/importExcel/importBuildingExcel' Vue.prototype.$buildingUpload = process.env.VUE_APP_URL + store.getters.getCommunityCode + '/manage/user/importExcel/importBuildingExcel'
// 静态地址 // 静态地址
Vue.prototype.$ImgUrl = (src) => { Vue.prototype.$ImgUrl = (src) => {
return process.env.VUE_APP_STATIC + store.getters.getCommunityCode + '/' + src return process.env.VUE_APP_URL + store.getters.getCommunityCode + '/' + src
} }
// 时间格式化 // 时间格式化
Vue.prototype.formatDate = (time, fmt) => { Vue.prototype.formatDate = (time, fmt) => {

@ -341,7 +341,6 @@ export default {
this.fileList =[] this.fileList =[]
}, },
async handlePreview(file) { async handlePreview(file) {
console.log(file);
if(file.name.indexOf('pdf')!==-1){ if(file.name.indexOf('pdf')!==-1){
if(file.response){ if(file.response){
window.open(this.$ImgUrl(file.response.data)) window.open(this.$ImgUrl(file.response.data))

@ -62,10 +62,13 @@
新增员工 新增员工
</a-button> </a-button>
<a-upload name="file" :action="`${$excelUpload}`" <a-upload name="file" :action="`${$excelUpload}`"
accept=".xls,.XLS,.xlsx,.XLSX" accept=".xls,.XLS,.xlsx,.XLSX" :showUploadList="false"
:headers="uploadHeaders" @change="changeFile"> :headers="uploadHeaders" @change="changeFile">
<a-button><a-icon type="upload" /> 批量导入</a-button> <a-button><a-icon type="upload" /> 批量导入</a-button>
</a-upload> </a-upload>
<a-button @click="modelDownload">
<a-icon type="copy" />模版下载
</a-button>
<a-button :disabled="!hasSelected" :loading="loading"> <a-button :disabled="!hasSelected" :loading="loading">
批量操作 批量操作
</a-button> </a-button>
@ -204,6 +207,12 @@
<a-button type="primary" @click="rePswSubmit"> </a-button> <a-button type="primary" @click="rePswSubmit"> </a-button>
</div> </div>
</a-drawer> </a-drawer>
<a-modal title="批量导入操作成功" :visible="uploadVisible" @cancel="uploadVisible = false" :footer="null">
<div>以下为导入失败的用户</div>
<p v-for="(item,index) in uploadResult" :key="index">
{{item}}
</p>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
@ -282,7 +291,10 @@ export default {
// //
uploadHeaders: { uploadHeaders: {
"manage-login-token": store.getters.getToken, "manage-login-token": store.getters.getToken,
} },
//
uploadVisible: false,
uploadResult: [],
}; };
}, },
mounted() { mounted() {
@ -566,11 +578,26 @@ export default {
} }
}, },
// //
changeFile() { changeFile(data) {
if(data.file.status == "done") {
if(data.file.response.success == false) {
this.$message.error(data.file.response.msg);
} else {
this.$message.success('操作成功');
if(data.file.response.data) {
this.uploadResult = data.file.response.data;
this.uploadVisible = true;
}
this.getData();
}
}
}, },
beforeUpload() { beforeUpload() {
},
//
modelDownload() {
window.open('https://saas.kaidalai.cn/excelModel/员工导入模版.xlsx');
} }
}, },
computed: { computed: {

@ -79,6 +79,9 @@
:headers="uploadHeaders" @change="changeFile"> :headers="uploadHeaders" @change="changeFile">
<a-button>批量导入</a-button> <a-button>批量导入</a-button>
</a-upload> </a-upload>
<a-button @click="modelDownload">
模版下载
</a-button>
<a-table :columns="unitColumns" :data-source="unitData" :row-key="record => record.id"> <a-table :columns="unitColumns" :data-source="unitData" :row-key="record => record.id">
<span slot="action" slot-scope="text, row"> <span slot="action" slot-scope="text, row">
<a-space><a @click="addUnit(text, row)">编辑</a> <a-space><a @click="addUnit(text, row)">编辑</a>
@ -344,10 +347,18 @@ export default {
}, },
changeFile(data) { changeFile(data) {
if(data.file.status == "done") { if(data.file.status == "done") {
this.$message.success('操作成功'); if(data.file.response.success == false) {
this.getInfo(); this.$message.error(data.file.response.msg);
} else {
this.$message.success('操作成功');
this.getData();
}
} }
}, },
//
modelDownload() {
window.open('https://saas.kaidalai.cn/excelModel/单元导入模版.xlsx');
}
}, },
watch: { watch: {
type: { type: {

@ -19,6 +19,9 @@
:headers="uploadHeaders" @change="changeFile"> :headers="uploadHeaders" @change="changeFile">
<a-button><a-icon type="upload" /> 批量导入</a-button> <a-button><a-icon type="upload" /> 批量导入</a-button>
</a-upload> </a-upload>
<a-button @click="modelDownload">
<a-icon type="copy" />模版下载
</a-button>
</div> </div>
<a-table <a-table
:columns="columns" :columns="columns"
@ -53,6 +56,12 @@
</span> </span>
</div> </div>
<curd-form :show='drawerConfig.show' :type="drawerConfig.type" @close='close' :editId='editId'></curd-form> <curd-form :show='drawerConfig.show' :type="drawerConfig.type" @close='close' :editId='editId'></curd-form>
<a-modal title="批量导入操作成功" :visible="uploadVisible" @cancel="uploadVisible = false" :footer="null">
<div>以下为导入失败的用户</div>
<p v-for="(item,index) in uploadResult" :key="index">
{{item}}
</p>
</a-modal>
</div> </div>
</template> </template>
@ -89,7 +98,10 @@ export default {
// //
uploadHeaders: { uploadHeaders: {
"manage-login-token": store.getters.getToken, "manage-login-token": store.getters.getToken,
} },
//
uploadVisible: false,
uploadResult: [],
}; };
}, },
created() { created() {
@ -165,10 +177,22 @@ export default {
// //
changeFile(data) { changeFile(data) {
if(data.file.status == "done") { if(data.file.status == "done") {
this.$message.success('操作成功'); if(data.file.response.success == false) {
this.getData(); this.$message.error(data.file.response.msg);
} else {
this.$message.success('操作成功');
if(data.file.response.data) {
this.uploadResult = data.file.response.data;
this.uploadVisible = true;
}
this.getData();
}
} }
}, },
//
modelDownload() {
window.open('https://saas.kaidalai.cn/excelModel/楼栋导入模版.xlsx');
}
}, },
}; };
</script> </script>

@ -32,6 +32,9 @@
:headers="uploadHeaders" @change="changeFile"> :headers="uploadHeaders" @change="changeFile">
<a-button><a-icon type="upload" /> 批量导入</a-button> <a-button><a-icon type="upload" /> 批量导入</a-button>
</a-upload> </a-upload>
<a-button @click="modelDownload">
<a-icon type="copy" />模版下载
</a-button>
</div> </div>
<div class="main"> <div class="main">
<!-- 表格 --> <!-- 表格 -->
@ -239,6 +242,12 @@
</a-button> </a-button>
</div> </div>
</a-drawer> </a-drawer>
<a-modal title="批量导入操作成功" :visible="uploadVisible" @cancel="uploadVisible = false" :footer="null">
<div>以下为导入失败的用户</div>
<p v-for="(item,index) in uploadResult" :key="index">
{{item}}
</p>
</a-modal>
</div> </div>
</template> </template>
@ -310,7 +319,10 @@ export default {
// //
uploadHeaders: { uploadHeaders: {
"manage-login-token": store.getters.getToken, "manage-login-token": store.getters.getToken,
} },
//
uploadVisible: false,
uploadResult: [],
}; };
}, },
mounted() { mounted() {
@ -460,10 +472,22 @@ export default {
// //
changeFile(data) { changeFile(data) {
if(data.file.status == "done") { if(data.file.status == "done") {
this.$message.success('操作成功'); if(data.file.response.success == false) {
this.getData(); this.$message.error(data.file.response.msg);
} else {
this.$message.success('操作成功');
if(data.file.response.data) {
this.uploadResult = data.file.response.data;
this.uploadVisible = true;
}
this.getData();
}
} }
}, },
//
modelDownload() {
window.open('https://saas.kaidalai.cn/excelModel/住户导入模版.xlsx');
}
}, },
computed: { computed: {
// selection // selection

@ -26,6 +26,9 @@
:headers="uploadHeaders" @change="changeFile"> :headers="uploadHeaders" @change="changeFile">
<a-button><a-icon type="upload" /> 批量导入</a-button> <a-button><a-icon type="upload" /> 批量导入</a-button>
</a-upload> </a-upload>
<a-button @click="modelDownload">
<a-icon type="copy" />模版下载
</a-button>
<a-button @click="drawerConfig.houseType = true">房屋配置</a-button> <a-button @click="drawerConfig.houseType = true">房屋配置</a-button>
</div> </div>
</div> </div>
@ -176,6 +179,12 @@
</a-button> </a-button>
</div> </div>
</a-drawer> </a-drawer>
<a-modal title="批量导入操作成功" :visible="uploadVisible" @cancel="uploadVisible = false" :footer="null">
<div>以下为导入失败的用户</div>
<p v-for="(item,index) in uploadResult" :key="index">
{{item}}
</p>
</a-modal>
</div> </div>
</template> </template>
@ -236,6 +245,9 @@ export default {
uploadHeaders: { uploadHeaders: {
"manage-login-token": store.getters.getToken, "manage-login-token": store.getters.getToken,
}, },
//
uploadVisible: false,
uploadResult: [],
fileList: [] fileList: []
}; };
}, },
@ -401,10 +413,22 @@ export default {
// //
changeFile(data) { changeFile(data) {
if(data.file.status == "done") { if(data.file.status == "done") {
this.$message.success('操作成功'); if(data.file.response.success == false) {
this.getData(); this.$message.error(data.file.response.msg);
} else {
this.$message.success('操作成功');
if(data.file.response.data) {
this.uploadResult = data.file.response.data;
this.uploadVisible = true;
}
this.getData();
}
} }
}, },
//
modelDownload() {
window.open('https://saas.kaidalai.cn/excelModel/房屋导入模版.xlsx');
}
}, },
computed: { computed: {
// selection // selection

@ -223,13 +223,13 @@ export default {
this.previewVisible = false; this.previewVisible = false;
}, },
// //
getAppName(val) { // getAppName(val) {
this.form.applicantId = undefined; // this.form.applicantId = undefined;
findTenantByEstateId({estateId: val}).then(res => { // findTenantByEstateId({estateId: val}).then(res => {
let data = res.data; // let data = res.data;
this.applicantIds = data; // this.applicantIds = data;
}) // })
}, // },
// //
getDepartmentName(val) { getDepartmentName(val) {
findToUser({pageNum: 1,size: 10000,positionId: val[2]}).then(res => { findToUser({pageNum: 1,size: 10000,positionId: val[2]}).then(res => {

@ -44,7 +44,7 @@
</div> </div>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="onClose"> <a-button :style="{ marginRight: '8px' }" @click="onClose">
关闭 关闭
</a-button> </a-button>
<a-button type="primary" @click="onSubmit"> </a-button> <a-button type="primary" @click="onSubmit"> </a-button>
</div> </div>
@ -142,7 +142,6 @@ export default {
}, },
onSubmit() { onSubmit() {
this.form.manageWorkOrderId = this.assignId; this.form.manageWorkOrderId = this.assignId;
console.log(this.form);
designate(this.form).then(res => { designate(this.form).then(res => {
if(res.code === 200){ if(res.code === 200){
this.$message.success(res.msg) this.$message.success(res.msg)

@ -0,0 +1,13 @@
<template>
<div>test</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -363,6 +363,7 @@ export default {
} }
} }
this.addForm.docUrls = arr; this.addForm.docUrls = arr;
if(this.mode == 1) { if(this.mode == 1) {
let obj = Object.assign(this.addForm,{type: this.form.type}) let obj = Object.assign(this.addForm,{type: this.form.type})
addFacilityInfo(obj).then(res => { addFacilityInfo(obj).then(res => {

@ -0,0 +1,100 @@
export const columns = [
{
title: "商品状态",
width: "7%",
dataIndex: "status",
customRender: function (status) {
switch (status) {
case 2: return '已下架'
case 1: return '上架中'
default: break;
}
}
},
{
title: "推送状态",
width: "7%",
dataIndex: "appShopPush",
customRender: function (appShopPush) {
switch (appShopPush) {
case false: return '未推送'
case true: return '已推送'
default: break;
}
}
},
{
title: "编号",
width: "16%",
dataIndex: "code",
},
{
title: "商品图片",
width: "7%",
dataIndex: "imgList",
scopedSlots: { customRender: "mainPhoto"}
},
{
title: "商品名称",
width: "10%",
dataIndex: "name",
},
{
title: "商品类型",
width: "12%",
dataIndex: "categoryNamePath",
},
{
title: "库存",
width: "6%",
dataIndex: "stock",
},
{
title: "销量",
width: "6%",
dataIndex: "salesVolume",
},
{
title: "更新时间",
width: "10%",
dataIndex: "updatedAt",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "250",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const formItem = [
{
type: 'input',
label:'sku编码',
prop:'skuId',
placeholder:'请输入'
},
{
type: 'input',
label:'商品名称',
prop:'skuName',
placeholder:'请输入'
},
// {
// type: 'select',
// label:'上架状态',
// prop:'status',
// placeholder:'请选择',
// option:[{ id: false,name:'下架'},{ id: true,name:'上架'}],
// },
]
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
pageSizeOptions: ['10','50','100','200'],
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,34 @@
export const form = {
id:undefined,
//是否默认配置
defaultSkuName: true,
defaultShopName: true,
defaultVendorName: true,
defaultBrandName: true,
defaultCategoryName: true,
//
skuName:undefined,
shopId:undefined,
vendorId:undefined,
brandId:undefined,
categoryFirstId:undefined,
categorySecondId:undefined,
categoryThirdId:undefined,
sellPrice:undefined,
discountPrice:undefined,
}
export const rules = {
// skuName:[{required:true,message:'请输入',trigger:'blur'}],
// shopId:[{required:true,message:'请选择',trigger:'change'}],
// status:[{required:true,message:'请选择',trigger:'change'}],
// vendorId:[{required:true,message:'请选择',trigger:'change'}],
// brandId: [{ required: true, message: '请选择', trigger: 'change' }],
sellPrice:[{required:true,message:'请输入',trigger:'blur'}],
discountPrice:[{required:true,message:'请输入',trigger:'blur'}],
}
export const options = {
cate:[],
shop: [],
vendor: [],
brand: [],
}

@ -0,0 +1,181 @@
<template>
<div>
<a-drawer
title="商品上架推送"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '60px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<!-- <a-col :span="12">
<a-form-model-item prop="status" label="上架状态">
<a-switch v-model="form.status"></a-switch
></a-form-model-item>
</a-col> -->
<a-col :span="11">
<a-form-model-item prop="skuName" label="商品名称">
<a-switch v-model="form.defaultSkuName" checked-children="默认" un-checked-children="自定义"></a-switch>
<a-input v-if="form.defaultSkuName==false" v-model="form.skuName" placeholder="请输入商品名称" style='width:60%'></a-input>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item prop="shopId" label="店铺">
<a-switch v-model="form.defaultShopName" checked-children="默认" un-checked-children="自定义"></a-switch>
<a-select v-if="form.defaultShopName==false" v-model="form.shopId" placeholder="请选择店铺" style='width:60%'>
<a-select-option v-for="item in options.shop" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item prop="vendorId" label="供应商">
<a-switch v-model="form.defaultVendorName" checked-children="默认" un-checked-children="自定义"></a-switch>
<a-select v-if="form.defaultVendorName==false" v-model="form.vendorId" placeholder="请选择供应商" style='width:60%'>
<a-select-option v-for="item in options.vendor" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item prop="brandId" label="品牌">
<a-switch v-model="form.defaultBrandName" checked-children="默认" un-checked-children="自定义"></a-switch>
<a-select v-if="form.defaultBrandName==false" v-model="form.brandId" placeholder="请选择品牌" style='width:60%'>
<a-select-option v-for="item in options.brand" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item prop="cateValue" label="商品分类">
<a-switch v-model="form.defaultCategoryName" checked-children="默认" un-checked-children="自定义"></a-switch>
<a-cascader
v-model="cateValue" v-if="form.defaultCategoryName == false"
:options="options.cate"
placeholder="请选择分类"
:field-names="{ label: 'name', value: 'id', children: 'shopCategoryVoList'}"
@change="change"
style="width: 60%"
></a-cascader> </a-form-model-item
></a-col>
<a-col :span="12">
<a-form-model-item prop="sellPrice" label="售卖价">
<a-input v-model="form.sellPrice" style="width: 60%"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="discountPrice" label="划线价">
<a-input
v-model="form.discountPrice"
style="width: 60%"
></a-input> </a-form-model-item
></a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="submit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { form, rules, options } from "./form.js";
import {
cateSelect,
shopSelect,
vendorSelect,
brandSelect,
selfItemPush,
} from "@/api/shop/goods/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
goodsId: Number,
},
data() {
return {
form,
rules,
options,
fileList: [],
cateValue: [],
};
},
mounted() {
this.getItem();
},
methods: {
getItem() {
//
Promise.all([
cateSelect(),
shopSelect(),
vendorSelect(),
brandSelect(),
]).then((res) => {
this.options.cate = res[0].data;
this.options.shop = res[1].data;
this.options.vendor = res[2].data;
this.options.brand = res[3].data;
});
},
addClose() {
this.$refs.ruleForm.resetFields();
this.form.categoryFirstId = undefined;
this.form.categorySecondId = undefined;
this.form.categoryThirdId = undefined;
this.cateValue = [];
this.$emit("addClose");
},
success() {
this.$emit("success");
this.addClose();
},
change(data) {
// console.log(data);
this.form.categoryFirstId = data[0];
this.form.categorySecondId = data[1];
this.form.categoryThirdId = data[2];
},
submit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
let res = await selfItemPush(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
}
});
},
},
watch: {
goodsId: {
handler(val) {
if (val !== null) {
this.form.id = val;
}
},
immediate: true,
},
},
};
</script>
<style></style>

@ -0,0 +1,273 @@
<template>
<div>
<div class="cardTitle">
<span>商品管理</span>
</div>
<!-- <searchForm :formItem="formItem" @getSearch="search($event)"></searchForm> -->
<div class="search-box">
<a-row>
<a-col :span="20">
<a-space size="large">
<a-form-model layout="inline">
<a-form-model-item label="店铺">
<a-select v-model="searchForm.shopId" style="width: 200px">
</a-select>
</a-form-model-item>
<a-form-model-item label="商品状态">
<a-select v-model="searchForm.status" style="width: 200px">
<a-select-option :value="1">上架</a-select-option>
<a-select-option :value="2">下架</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="商品编号">
<a-input v-model="searchForm.code" style="width: 200px" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="商品名称">
<a-input v-model="searchForm.name" style="width: 200px" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="分类">
<a-cascader v-model="casVal" style="width: 200px" :options="typeData" @change="typeChange" placeholder="请选择"
:field-names="{ label: 'name', value: 'id', children: 'shopCategoryVoList' }">
</a-cascader>
</a-form-model-item>
<a-form-model-item label="商品名称">
<a-range-picker v-model="selTime" @change="timeChange" value-format="YYYY-MM-DD HH:mm:ss"></a-range-picker>
</a-form-model-item>
<a-form-model-item>
<a-button type="primary" @click='getData'> </a-button>
<a-button @click='reset' style="margin-left: 24px"> </a-button>
</a-form-model-item>
</a-form-model>
</a-space>
</a-col>
</a-row>
</div>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2000 }"
@change="handleTableChange"
:loading="loading"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="(record, index) => { return record.id }">
<span slot="action" slot-scope="text, row">
<a-space>
<!-- <a class="ant-dropdown-link" @click="onSell([row.id])"></a>
<a class="ant-dropdown-link" @click="offSell([row.id])"></a> -->
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
</a-space>
</span>
<span slot="mainPhoto" slot-scope="text, row">
<img v-for="(item,index) in row.imgList"
:key="index" :src="'https://saas.kaidalai.cn/resource/merchant/'+item.url" class="table-img" />
</span>
</a-table>
<div class="action">
<a-dropdown :disabled="!hasSelected">
<a-menu slot="overlay" @click="handleMenuClick">
<!-- <a-menu-item key="on"> 批量上架 </a-menu-item>
<a-menu-item key="off"> 批量下架 </a-menu-item> -->
<a-menu-item key="push"> 批量推送 </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<addForm
:show="drawer.show"
@success="success"
@addClose="addClose"
:goodsId="goodsId"
></addForm>
</div>
</template>
<script>
import { findAllGoodsCategory } from "@/api/shop/goods/index.js";
import { columns, pagination, formItem } from "./depend/config.js";
import { selfGoodsList, selfGoodsMultiPush} from "@/api/shop/goods/index.js";
import addForm from "./depend/form.vue";
export default {
components: {
addForm,
},
data() {
return {
drawer: {
show: false,
},
searchForm: {
shopId: undefined,
status: undefined,
code: undefined,
categoryId: undefined,
name: undefined,
createDateStart: undefined,
createDateEnd: undefined,
},
loading: false,
typeData: [],
casVal: [],
selTime: [],
columns,
goodsId:null,
pagination,
formItem,
tableData: [],
selectedRowKeys: [],
};
},
mounted() {
// this.getApi();
this.getData();
},
methods: {
getApi() {
findAllGoodsCategory().then(res => {
let data = res.data;
this.typeData = data;
})
},
getData() {
this.loading = true;
selfGoodsList({
...this.searchForm,
pageNum: this.pagination.current,
size: this.pagination.pageSize,
}).then((res) => {
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.loading = false;
});
},
reset() {
this.searchForm = {
skuId: undefined,
skuName: undefined,
categoryFirstId: undefined,
categorySecondId: undefined,
categoryThirdId: undefined,
};
this.casVal = [];
this.getData()
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.selectedRowKeys = [];
this.getData();
},
edit(id) {
this.goodsId = id;
this.drawer.show = true;
},
onSell(ids) {
this.$confirm({
title: "是否上架",
icon: "caret-up",
onOk: async () => {
let res = await onShelf({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
offSell(ids) {
this.$confirm({
title: "是否下架",
icon: "caret-down",
onOk: async () => {
let res = await offShelf({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
multiPush(ids) {
this.$confirm({
title: "是否推送",
icon: "caret-up",
onOk: async () => {
let res = await selfGoodsMultiPush({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
handleMenuClick(data) {
if (data.key === "on") {
this.onSell(this.selectedRowKeys);
} else if (data.key === "off") {
this.offSell(this.selectedRowKeys);
} else if (data.key === "push") {
this.multiPush(this.selectedRowKeys);
}
},
addClose() {
this.drawer.show = false;
this.goodsId = null;
},
success() {
this.getData();
},
//
changePoingGood(val) {
isEnableRedeem({appGoodsPushId: val.id}).then(res => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
})
},
typeChange(value) {
this.searchForm.categoryFirstId = value[0];
this.searchForm.categorySecondId = value[1];
this.searchForm.categoryThirdId = value[2];
},
//
timeChange() {
}
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
</style>
Loading…
Cancel
Save