张雄 3 years ago
parent 0e4bd62bb0
commit 3a8710dbb8

@ -62,6 +62,14 @@ export function findTenantByEstateId(params) {
params: params,
})
}
// 根据房屋查业主
export function findOwnerByEstateId(params) {
return httpService({
url: `/user/resident/findOwnerByEstateId`,
method: 'get',
params: params,
})
}
// 住户详情
export function residentDetail(params) {
return httpService({

@ -0,0 +1,84 @@
import httpService from "@/request"
///类型
// 查询所有业委会类型信息
export function getComList(params) {
return httpService({
url: `/user/industryCommitteeType/list`,
method: 'get',
params: params,
})
}
// 添加业委会类型
export function addComType(params) {
return httpService({
url: `/user/industryCommitteeType/insert`,
method: 'post',
data: params,
})
}
// 修改业委会类型
export function updateComType(params) {
return httpService({
url: `/user/industryCommitteeType/update`,
method: 'post',
data: params,
})
}
// 删除业委会类型
export function delComType(params) {
return httpService({
url: `/user/industryCommitteeType/delete`,
method: 'get',
params: params,
})
}
///信息
// 查询所有业委会信息
export function getIndustryCommitteeList(params) {
return httpService({
url: `/user/industryCommittee/list`,
method: 'get',
params: params,
})
}
// 添加业委会信息
export function addIndustryCom(params) {
return httpService({
url: `/user/industryCommittee/insert`,
method: 'post',
data: params,
})
}
// 删除业委会信息
export function delIndustryCom(params) {
return httpService({
url: `/user/industryCommittee/delete`,
method: 'post',
data: params,
})
}
// 根据业委会主键id查询业委会信息
export function findIndustryCom(params) {
return httpService({
url: `/user/industryCommittee/findById`,
method: 'get',
params: params,
})
}
// 根据业委会主键id查询业委会信息
export function updateIndustryCom(params) {
return httpService({
url: `/user/industryCommittee/update`,
method: 'post',
data: params,
})
}

@ -90,4 +90,31 @@ export function brandSelect(params) {
method: 'get',
params: params,
})
}
//开启/关闭积分兑换
export function isEnableRedeem(params) {
return httpService({
url: `/user/pointsGoods/isEnableRedeem`,
method: 'get',
params: params,
})
}
//查询所有积分商品
export function getPointList(params) {
return httpService({
url: `/user/pointsGoods/list`,
method: 'get',
params: params,
})
}
//设置积分
export function settingPoints(params) {
return httpService({
url: `/user/pointsGoods/settingPoints`,
method: 'post',
data: params,
})
}

@ -244,4 +244,13 @@ export default [
}
]
},
{
path: '/Commission',
name: "Commission",
title: "业委会",
icon: 'cluster',
hide: false,
component: resolve => require(['@/views/Operation/Commission'], resolve),
meta: {title: '业委会'},
},
]

@ -25,6 +25,14 @@ export default [
component: resolve => require(['@/views/Shop/GoodsManage/_goodsList'], resolve),
meta: {title: '商品列表'},
},
{
path: '/GoodsManage/PointGoods',
name: "PointGoods",
title: "兑换商品设置",
hide: false,
component: resolve => require(['@/views/Shop/GoodsManage/_pointGoods'], resolve),
meta: {title: '兑换商品设置'},
},
{
path: '/GoodsManage/JcookList',
name: "JcookList",

@ -242,6 +242,11 @@ export default {
let v = val;
let index = val.length
this.form.estateId = v[index-1]
this.form.applicantId = undefined;
findTenantByEstateId({estateId: v[index-1]}).then(res => {
let data = res.data;
this.applicantIds = data;
})
}
},
watch: {

@ -0,0 +1,161 @@
<template>
<div>
<a-drawer title="职位设置" :width="540" :visible="show" :body-style="{ paddingBottom: '80px' }" @close="addClose">
<div class="drawer-content" style="padding: 16px">
职位类型
<a-divider></a-divider>
<!-- tags -->
<span v-for="item,index in typeList" :key="item.id">
<a-input
v-if="item.show==true"
ref="input"
v-focus
type="text"
size="small"
:style="{ width: '78px','padding-bottom':'3px','margin-right':'7px' }"
v-model="item.name"
@blur="editType(item)"
@keyup.enter="editType(item)"
/>
<a-tag
v-else-if="item.show==false" closable @close.prevent="delType(item.id)"
@click="editInput(item,index)" >
{{item.name}}
</a-tag>
</span>
<!-- addTag -->
<span>
<a-input
v-if="inputVisible"
ref="addInput"
type="text"
size="small"
:style="{ width: '78px','padding-bottom':'3px'}"
:value="typeForm.name"
@change="handleInputChange"
@blur="handleInputConfirm"
@keyup.enter="handleInputConfirm"
/>
<a-tag v-else style="background: #fff; borderStyle: dashed;" @click="addShow">
<a-icon type="plus" /> 新增类型
</a-tag>
</span>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
// import {getPhontTypeList, addPhontType, delPhontType,updatePhontType} from "@/api/operation/suggestion"
import {getComList, addComType, updateComType, delComType} from "@/api/operation/commission"
export default {
props: {
show: {
type: Boolean,
default: false,
},
},
data() {
return {
typeForm: {
name: ''
},
typeList: [],
inputVisible: false
}
},
created() {
this.getData()
},
methods: {
async getData() {
this.typeList = []
const res = await getComList();
const arr = res.data;
arr.forEach(ele => {
ele.show = false;
})
this.typeList = arr;
this.$emit("refresh");
},
//
editInput(obj, i) {
this.$set(this.typeList[i],'show',true)
this.$forceUpdate()
},
//
addShow(){
this.inputVisible = true;
this.$nextTick(function() {
this.$refs.addInput.focus();
});
},
//
async editType(item){
let res = await updateComType({
id: item.id,
name: item.name
})
if(res.code === 200){
item.show = false
this.$forceUpdate()
this.$message.success(res.msg)
}else{
this.$message.error(res.msg)
}
},
handleInputChange(e) {
this.typeForm.name = e.target.value;
},
//
async handleInputConfirm() {
if(this.typeForm.name === ''){
this.inputVisible = false;
return
}
let res = await addComType({
name:this.typeForm.name,
})
if(res.code === 200){
this.$message.success(res.msg);
this.inputVisible = false;
this.typeForm.name = '';
this.getData()
}else{
this.$message.error(res.msg);
}
},
//
delType(id){
this.$confirm({
title: "是否删除",
icon:'delete',
onOk:async()=>{
let res = await delComType({industryCommitteeTypeId: id})
if(res.code=== 200){
this.$message.success(res.msg);
this.getData()
}else{
this.$message.error(res.msg);
}
},
})
},
addClose() {
this.$emit("addClose");
},
},
watch: {
},
}
</script>
<style lang="less">
</style>

@ -0,0 +1,36 @@
export const columns = [
{
title: "成员姓名",
width: "15%",
dataIndex: "name",
},
{
title: "职位",
width: "15%",
dataIndex: "industryCommitteeTypeName",
},
{
title: "关联房屋",
width: "25%",
dataIndex: "buildingName",
scopedSlots: { customRender: "house" },
},
{
title: "创建时间",
width: "20%",
dataIndex: "createDate",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const rules = {
appUserId: [{ required: true, message: "请选择住户", trigger: "change" }],
industryCommitteeTypeId: [{ required: true, message: "请选择职位", trigger: "change" }],
}

@ -0,0 +1,379 @@
<template>
<div>
<div class="cardTitle">
<a-space size="large">
<span>业委会</span>
</a-space>
</div>
<div class="search-box">
<a-row>
<a-col :span="20">
<a-space size="large">
<a-input v-model="form.name" style="width: 200px" placeholder="成员名称"></a-input>
<a-select v-model="form.industryCommitteeTypeId" style="width: 200px" placeholder="职位">
<a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
<a-range-picker v-model="addTime" @change="addTimeChange" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="['创建开始时间','创建结束时间']"></a-range-picker>
<a-button type="primary" @click='getData'> </a-button>
<a-button @click='reset'> </a-button>
</a-space>
</a-col>
</a-row>
</div>
<a-button style="margin: 10px" class="add-btn" @click="detailShow = true;mode = 1">添加人员</a-button>
<a-button style="margin: 10px" @click="addType" type="primary" ghost>职位设置</a-button>
<div class="main">
<a-table :columns="columns" :data-source="tableData"
:pagination="pagination" @change="handlerChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}">
<template slot="house" slot-scope="text,record">
{{record.buildingName}}号楼/{{record.unitName}}单元/{{record.estateName}}
</template>
<template slot="action" slot-scope="text,record">
<span><a @click=edit(record)>编辑</a></span>
<span><a style="margin-left: 8px;color:red" @click=del(record)>删除</a></span>
</template>
</a-table>
<div class="action">
<a-dropdown :disabled="!hasSelected">
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="del"> 批量删除 </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>
</div>
<a-drawer :title="mode==1?'添加成员':'编辑成员'" :width="720" :visible="detailShow" :body-style="{ paddingBottom: '60px' }" @close="detailClose">
<div class="drawer-content">
<span>基本信息</span>
<a-divider></a-divider>
<a-row>
<a-form-model :model="addForm" :rules="rules">
<a-col :span="11">
<a-form-model-item label="选择房屋" prop="estateId" :rules="[{ required: true, message: '请选择房屋' }]">
<a-cascader placeholder="请选择楼栋/单元/房屋" v-model="casVal" @change="chooseHouse" style="width: 240px"
:field-names="{label: 'name', value: 'id', children: 'childList' }" :options="options.estateId">
</a-cascader>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item label="成员姓名" prop="appUserId">
<a-select placeholder="请选择住户" style="width: 240px" v-model="addForm.appUserId">
<a-select-option v-for="(item) in applicantIds" :value="item.id" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item label="选择职位" prop="industryCommitteeTypeId">
<a-select placeholder="请选择职位" style="width: 240px" v-model="addForm.industryCommitteeTypeId">
<a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="11">
<a-form-model-item label="任职时间" prop="appointmentStartTime" :rules="[{ required: true, message: '请选择时间' }]">
<a-range-picker v-model=rzTime @change="rzTimeChange" style="width: 240px" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="['任职开始时间','任职结束时间']"></a-range-picker>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="成员照片">
<commonUpload :fileList='fileList' @handleChange="handleChange" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remark">
<a-textarea placeholder="请输入备注不超过1024个字符" style="width: 560px" :autoSize="{minRows: 8}" v-model="addForm.remark"></a-textarea>
</a-form-model-item>
</a-col>
</a-form-model>
</a-row>
</div>
<div class="drawer-footer" style="float: left">
<a-button @click="addConfirm" type="primary" :style="{ marginRight: '8px' }">
确认
</a-button>
<a-button @click="detailClose"> </a-button>
</div>
</a-drawer>
<addType :show="addShow" @addClose="addShow = false" @refresh="getApi"></addType>
</div>
</template>
<script>
import {findOwnerByEstateId} from "@/api/basic/resident"
import {findEstateCascade} from "@/api/basic/estate"
import {getComList, addIndustryCom, delIndustryCom, updateIndustryCom, findIndustryCom} from "@/api/operation/commission"
import {getIndustryCommitteeList} from "@/api/operation/commission"
import { rules, columns } from "./depend/config";
import addType from "./depend/addType.vue";
export default {
components: {
addType,
},
data() {
return {
form: {
name: '',
industryCommitteeTypeId: undefined,
createDateStart: '',
createDateEnd: '',
},
addForm: {
estateId: undefined,
appUserId: undefined,
industryCommitteeTypeId: undefined,
appointmentStartTime: '',
appointmentEndTime: '',
imgUrls: [],
remark: '',
},
options: {
estateId: []
},
mode: 1, //1 2
activeId: undefined,
activeName: 0,
rules: rules,
columns: columns,
tableData: [],
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
addTime: [],
//
applicantIds: [],
casVal:[],
fileList:[],
rzTime: [],
detailShow: false,
//
selectedRowKeys: [],
//
addShow: false,
typeList: []
}
},
created() {
this.getApi()
this.getData()
},
methods: {
getApi() {
getComList().then(res => {
let data = res.data;
this.typeList = data;
});
findEstateCascade().then(res => {
let data = res.data;
this.options.estateId = data;
})
},
getData() {
let obj = Object.assign(this.form, {pageNum: this.pagination.current,size: this.pagination.pageSize})
getIndustryCommitteeList(obj).then(res => {
this.tableData = res.data.rows;
this.pagination.total = res.data.total
})
},
reset() {
this.form = {
name: '',
industryCommitteeTypeId: undefined,
createDateStart: '',
createDateEnd: '',
},
this.getData()
},
handlerChange() {
this.pagination.current = val.current;
this.pagination.pageSize = val.pageSize;
this.getData()
},
detailClose() {
this.addForm = {
estateId: undefined,
appUserId: undefined,
industryCommitteeTypeId: undefined,
appointmentStartTime: '',
appointmentEndTime: '',
imgUrls: [],
remark: '',
},
this.fileList = [],
this.casVal = [],
this.rzTime = [],
this.detailShow = false
},
//
rzTimeChange(val) {
this.addForm.appointmentStartTime = val[0];
this.addForm.appointmentEndTime = val[1];
},
addTimeChange(val) {
this.form.createDateStart = val[0];
this.form.createDateEnd = val[1];
},
//
chooseHouse(val) {
let v = val;
let index = val.length
this.addForm.estateId = v[index-1]
this.addForm.appUserId = undefined;
findOwnerByEstateId({estateId: v[index-1]}).then(res => {
let data = res.data;
this.applicantIds = data;
})
},
//
addConfirm() {
if(this.mode == 1) {
addIndustryCom(this.addForm).then(res => {
if(res.code === 200){
this.$message.success(res.msg);
this.detailClose()
this.getData()
} else {
this.$message.error(res.msg);
}
})
} else {
let obj = Object.assign(this.addForm, {id: this.activeId})
updateIndustryCom(obj).then(res => {
if(res.code === 200){
this.$message.success(res.msg);
this.detailClose()
this.getData()
} else {
this.$message.error(res.msg);
}
})
}
},
//
edit(val) {
this.mode = 2;
findIndustryCom({industryCommitteeId: val.id}).then(res => {
let data = res.data;
findOwnerByEstateId({estateId: data.estateId}).then(res => {
let data = res.data;
this.applicantIds = data;
})
this.addForm = {
estateId: data.estateId,
appUserId: data.appUserId,
industryCommitteeTypeId: data.industryCommitteeTypeId,
appointmentStartTime: data.appointmentStartTime,
appointmentEndTime: data.appointmentEndTime,
imgUrls: [],
remark: data.remark,
}; //
if(data.imgList.length>0){
const pic = []
this.addForm.imgUrls.push(data.imgList[0].url)
for(let item of data.imgList){
let obj = {
name:item.url.split('_')[0] +'.'+ item.url.split('.')[1],
url: this.$ImgUrl(item.url),
uid:item.url.split('_')[1],
status:'done',
thumbUrl: this.$ImgUrl(item.url),
}
pic.push(obj)
}
this.fileList = pic
}
this.casVal = [data.buildingId,data.unitId,data.estateId];
this.rzTime = [data.appointmentStartTime,data.appointmentEndTime];
this.activeId = data.id
})
this.detailShow = true;
},
//
del(val) {
this.$confirm({
title: "是否删除该成员?",
icon:'delete',
onOk:async()=>{
let res = await delIndustryCom({industryCommitteeIds: [val.id]})
if(res.code === 200){
this.$message.success(res.msg);
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
},
//
selectionChoosed(val) {
this.selectedRowKeys = val
},
handleMenuClick(data) {
if (data.key === "del") {
this.$confirm({
title: "是否删除选中的成员?",
icon:'delete',
onOk:async()=>{
let res = await delIndustryCom({industryCommitteeIds: this.selectedRowKeys})
if(res.code === 200){
this.$message.success(res.msg);
this.selectedRowKeys = [];
this.getData()
} else {
this.$message.error(res.msg);
}
},
})
}
},
//
addType() {
this.addShow = true
},
//
handleChange(data) {
this.fileList = data;
this.addForm.imgUrls = [];
data.forEach(ele => {
if(ele.status == 'done') {
this.addForm.imgUrls.push(ele.response.data)
}
})
}
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
}
</script>
<style lang="less">
.drawer-content {
padding: 16px;
}
</style>

@ -22,7 +22,7 @@ export const columns = [
},
{
title: "内容",
width: "15%",
width: "22%",
dataIndex: "content",
scopedSlots: { customRender: "content" },
},

@ -25,9 +25,15 @@ export const columns = [
dataIndex: "mainPhoto",
scopedSlots: { customRender: "mainPhoto"}
},
{
title: "积分兑换",
width: "5%",
dataIndex: "isPointsGoods",
scopedSlots: { customRender: "point"}
},
{
title: "sku编码",
width: "8%",
width: "10%",
dataIndex: "skuId",
},
{

@ -20,6 +20,14 @@
}
"
>
<template slot="point" slot-scope="text,row">
<a-switch
checked-children="开"
un-checked-children="关"
:checked="row.isPointsGoods"
@change="changePoingGood(row)"
></a-switch>
</template>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="onSell([row.id])"></a>
@ -56,7 +64,7 @@
<script>
import { columns, pagination, formItem } from "./depend/config.js";
import { shopPushList,offShelf,onShelf} from "@/api/shop/goods/index.js";
import { shopPushList,offShelf,onShelf, isEnableRedeem} from "@/api/shop/goods/index.js";
import addForm from "./depend/form.vue";
export default {
components: {
@ -161,6 +169,17 @@ export default {
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);
}
})
}
},
computed: {
hasSelected() {

@ -0,0 +1,130 @@
export const columns = [
{
title: "商品状态",
width: "6%",
dataIndex: "status",
customRender: function (status) {
switch (status) {
case false:
return '已下架'
case true:
return '上架中'
default:
break;
}
}
},
{
title: "商品名称",
width: "18%",
dataIndex: "skuName",
},
{
title: "主图url",
width: "4%",
dataIndex: "mainPhoto",
scopedSlots: { customRender: "mainPhoto"}
},
// {
// title: "sku编码",
// width: "10%",
// dataIndex: "skuId",
// },
// {
// title: "商品类型",
// width: "4%",
// dataIndex: "mallType",
// customRender: function (mallType) {
// switch (mallType) {
// case 1:
// return 'Jcook'
// default:
// break;
// }
// }
// },
// {
// title: "店铺名",
// width: "7%",
// dataIndex: "shopName",
// },
// {
// title: "品牌名",
// width: "7%",
// dataIndex: "brandName",
// },
// {
// title: "供应商名",
// width: "7%",
// dataIndex: "vendorName",
// },
{
title: "分类名称",
width: "14%",
dataIndex: "categoryFirstName",
scopedSlots: { customRender: "type" },
},
{
title: "售卖价(元)",
width: "7%",
dataIndex: "sellPrice",
},
{
title: "商品积分",
width: "7%",
dataIndex: "points",
},
{
title: "浏览量",
width: "5%",
dataIndex: "viewsNum",
},
{
title: "积分兑换开启时间",
width: "14%",
dataIndex: "pointsCreateDate",
},
{
title: "积分修改时间",
width: "14%",
dataIndex: "pointsUpdateDate",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "250",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const formItem = [
{
type: 'input',
label:'商品名称',
prop:'name',
placeholder:'请输入'
},
{
type: 'select',
label:'商品状态',
prop:'status',
placeholder:'请选择',
option:[{ id: 0,name:'已下架'},{ id: 1,name:'上架中'}],
},
{
type: 'time',
label:'更新时间',
prop:'updateDate',
start: 'updateDateStart',
end:'updateDateEnd',
},
]
export const pagination = {
current: 1,
total: 0,
pageSize: 5,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,28 @@
export const form = {
id:undefined,
status:undefined,
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,219 @@
<template>
<div>
<div class="cardTitle">
<span>兑换商品设置</span>
</div>
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2000 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<template slot="type" slot-scope="text, row">
{{row.categoryFirstName}} / {{row.categorySecondName}} / {{row.categoryThirdName}}
</template>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="setPoint(row)"></a>
<a class="ant-dropdown-link" style="color: red" @click="delPoint(row)"></a>
</a-space>
</span>
<span slot="mainPhoto" slot-scope="text, row">
<img :src="row.mainPhoto" class="table-img" alt="" />
</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>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div> -->
<a-drawer title="设置商品积分" :width="540" :visible="pointShow" :body-style="{ paddingBottom: '60px' }" @close="pointClose">
<div class="drawer-content">
<a-descriptions layout="vertical" :column="1">
<a-descriptions-item label="商品名称">
<div class="item-name">{{pointInfo.skuName}}</div>
</a-descriptions-item>
<a-descriptions-item label="商品图片">
<img :src="pointInfo.mainPhoto" class="info-img" alt="" />
</a-descriptions-item>
<a-descriptions-item label="商品价格">
¥ {{pointInfo.sellPrice}}
</a-descriptions-item>
<a-descriptions-item label="商品积分">
<a-icon type="dollar" theme="twoTone" two-tone-color="rgb(231,198,86)" />
<a-input-number :min="0" v-model="pointForm.points" style="margin-left:8px">
</a-input-number>
</a-descriptions-item>
</a-descriptions>
</div>
<div class="drawer-footer">
<a-button @click="pointConfirm" type="primary" :style="{ marginRight: '8px' }">
确认
</a-button>
<a-button @click="pointClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { columns, pagination, formItem } from "./depend/config.js";
import {goodsInfo} from "@/api/shop/goods/index.js";
import { getPointList ,settingPoints, isEnableRedeem} from "@/api/shop/goods/index.js";
export default {
data() {
return {
searchForm: {
name: '',
status: undefined,
updateDateStart: '',
updateDateEnd: '',
},
columns,
goodsId:null,
pagination,
formItem,
tableData: [],
selectedRowKeys: [],
//
pointShow: false,
activeId: undefined,
pointForm: {
points: 0
},
pointInfo: {},
};
},
mounted() {
this.getData();
},
methods: {
getData() {
getPointList({
...this.searchForm,
pageNum: this.pagination.current,
size: this.pagination.pageSize,
}).then((res) => {
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
});
},
search(data){
this.searchForm = data;
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.getData();
},
handleMenuClick(data) {
},
addClose() {
this.drawer.show = false;
this.goodsId = null;
},
success() {
this.getData();
},
//
setPoint(val) {
goodsInfo({appGoodsPushId: val.id}).then(res => {
let data = res.data;
this.pointInfo = data;
this.pointForm.points = data.points
this.activeId = data.id;
this.pointShow = true
})
},
pointConfirm() {
let obj = {
appGoodsPushId: this.activeId,
points: this.pointForm.points
}
settingPoints(obj).then(res => {
if(res.code === 200){
this.$message.success(res.msg);
this.pointClose()
this.getData()
} else {
this.$message.error(res.msg);
}
})
},
//
delPoint(val) {
this.$confirm({
title: "是否移除该商品?",
icon: "delete",
onOk: async () => {
let res = await isEnableRedeem({ appGoodsPushId: val.id });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
pointClose() {
this.activeId = undefined,
this.pointForm.points = 0;
this.pointInfo = {}
this.pointShow = false
}
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
.item-name {
padding: 16px 0px 16px 0px;
font-weight: 500;
font-size: 14px;
line-height: 20px;
text-transform: uppercase;
color: #205FBD;
}
.info-img {
height: 172px;
width: 258px
}
</style>

Binary file not shown.
Loading…
Cancel
Save