Commit fd7f6e16 by crushh

udpate: tem

parent c6089df9
......@@ -23,26 +23,49 @@
label-width="160px"
size="small"
>
<el-form-item label="上架规则名称" prop="activityName">
<el-form-item label="上架规则名称" prop="ruleTitle">
<el-input
maxlength="12"
show-word-limit
placeholder="请输入上架规则名称"
v-model="ruleForm.activityName"
v-model="ruleForm.ruleTitle"
style="width:340px"
/>
</el-form-item>
<el-form-item label="上架规则名称备注" prop="activityRemark">
<el-form-item label="上架规则名称备注" prop="ruleExplanation">
<el-input
maxlength="30"
show-word-limit
placeholder="请输入上架规则说明"
v-model="ruleForm.activityRemark"
v-model="ruleForm.ruleExplanation"
style="width:340px"
/>
</el-form-item>
<el-form-item label="适用人群" prop="activityTime">
<el-radio v-model="ruleForm.memberType" :label="1">
全部会员
</el-radio>
<el-radio v-model="ruleForm.memberType" :label="2">
会员分组
</el-radio>
<el-radio v-model="ruleForm.memberType" :label="3">
会员筛选
</el-radio>
</el-form-item>
<el-form-item v-if="ruleForm.memberType === 2">
<vue-gic-member-group
style="padding-left:0"
:readonly="readonly"
:height="543"
:defaltSelected="defaltSelected"
:projectName="projectName"
:effectiveStatus="1"
@handleDataTransferred="handleDataTransferred"
@handleDataLeft="handleDataLeft"
/>
</el-form-item>
<el-form-item v-if="ruleForm.memberType === 3">
<vue-gic-people
:projectName="projectName"
:searchBackTxt.sync="searchBackTxt"
......@@ -67,7 +90,8 @@
</el-button>
</div>
</el-form-item>
<div class="confim-btn">
<div class="confim-btn" :style="{ width: fixedWidth + 'px' }">
<el-button type="primary" size="small" @click="nextStep()">
确认新建
</el-button>
......@@ -85,11 +109,12 @@ export default {
callback(new Error('请填写'));
};
return {
fixedWidth: document.documentElement.clientWidth - 200,
ruleForm: {
},
rules: {
activityName: [
ruleTitle: [
{ required: true, message: '请填写', trigger: 'blur' },
],
activityTime: [
......@@ -103,7 +128,8 @@ export default {
hasSearchData: '',
sceneValue: 'member', // 场景值
responseParams: [], // 回显的数据
defaltSelected: [],
headerList: ['isRealTime', 'latestUpdateTime', 'updateType', 'effectiveStatus', 'effectiveDate'], // 表头配置,默认全部,分组名称默认显示不可配置
};
},
methods: {
......@@ -125,10 +151,29 @@ export default {
// 传个参数给父组件 来查数据
hideBtn (refresh) {
},
handleDataTransferred (data) {
this.defaltSelected = data;
},
handleDataLeft (selectedData, selectionToRemove) {
this.defaltSelected = selectedData;
},
},
};
</script>
<style>
<style scoped>
.confim-btn {
height: 32px;
padding: 12px 0;
position: fixed;
bottom: 0px;
left: 200px;
background: #fff;
z-index: 2;
text-align: center;
border-top: 1px solid #dcdfe6;
}
.fix-btn {
margin-left: -100px;
}
</style>
......@@ -18,7 +18,7 @@
<div class="search-wrap">
<div class="table-page-search-wrapper">
<el-input
v-model="searchValue"
v-model="ruleTitle"
placeholder="请输入上架规则名称"
prefix-icon="el-icon-search"
clearable
......@@ -50,40 +50,39 @@
<template slot-scope="{row}">
<div>
<div class="title">
{{ row.title }}
{{ row.ruleTitle }}
</div>
<div
style="font-size: 12px;color: rgb(144, 147, 153);"
>
{{ row.tips }}
{{ row.ruleExplanation }}
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="ruleTitle"
prop="relationCount"
label="已关联商品"
>
<template slot-scope="{row}">
<span style="margin-right:20px">
{{ row.number }}
{{ row.relationCount }}
</span>
<el-button
type="text"
@click="relatingDetail(row)"
@click="relatingDetail(row.integralMallProRuleId,'查看')"
>
查看
</el-button>
</template>
</el-table-column>
<el-table-column
prop="ruleTitle"
label="操作"
>
<template slot-scope="{row}">
<el-button
type="text"
@click="relating(row)"
@click="relatingDetail(row.integralMallProRuleId,'选择')"
>
关联商品
</el-button>
......@@ -109,45 +108,49 @@
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="dialogTableVisible" width="850px">
<div :class="['infoTips',title=='查看关联商品'?'infoTips_waring':'']">
<i :class="['el-icon-info','infoTipsIcon',title=='查看关联商品'?'infoTips_waring':'']" />
<el-dialog :title="`${type}关联商品`" :visible.sync="dialogTableVisible" width="850px">
<div :class="['infoTips',type=='查看'?'infoTips_waring':'']">
<i :class="['el-icon-info','infoTipsIcon',type=='查看'?'infoTips_waring':'']" />
<div class="infoTipsContent">
{{ title=='查看关联商品'?'移除规则后,上架规则不再作用于商品,商品将不能在会员小程序-积分商城上展示,请谨慎操作!':'选中已关联上架规则的商品,则规则被更新' }}
{{ type=='查看'?'移除规则后,上架规则不再作用于商品,商品将不能在会员小程序-积分商城上展示,请谨慎操作!':'选中已关联上架规则的商品,则规则被更新' }}
<br>
</div>
</div>
<div class="search-wrap">
<div class="table-page-search-wrapper">
<el-select
v-model="relateForm.type"
v-model="relateForm.proType"
clearable
class="w-160"
placeholder="所有商品类型"
@change="changeType"
@change="searchGoods"
>
<el-option label="礼品" :value="0" />
<el-option label="优惠券" :value="1" />
<el-option label="兑换券" :value="2" />
<el-option label="实物礼品" :value="3" />
</el-select>
<el-select
v-model="relateForm.relate"
v-if="type=='选择'"
v-model="relateForm.ruleRelationFlag"
clearable
placeholder="是否已关联上架规则"
class="w-180"
@change="changeType"
@change="searchGoods"
>
<el-option label="已关联上架规则" :value="0" />
<el-option label="未关联上架规则" :value="1" />
</el-select>
<el-input
placeholder="请输入礼品名称/礼品编码"
v-model="relateForm.date"
v-model="relateForm.search"
clearable
size="small"
class="w-260"
@clear="searchGoods"
@keyup.enter.native="searchGoods"
/>
</div>
<el-button type="primary" size="small" v-if="title=='查看关联商品'">
<el-button type="primary" size="small" v-if="type=='查看'">
批量移除
</el-button>
</div>
......@@ -171,13 +174,13 @@
</div>
</template>
</el-table-column>
<el-table-column property="type" label="商品类型" width="100" />
<el-table-column property="price" label="成本" width="100" />
<el-table-column property="stock" label="当前库存" width="100" />
<el-table-column property="relate" label="是否已关联规则" min-width="120">
<el-table-column property="proType" label="商品类型" width="100" />
<el-table-column property="costValue" label="成本" width="100" />
<el-table-column property="virtualStock" label="当前库存" width="100" />
<el-table-column property="ruleTitle" label="是否已关联规则" min-width="120">
<template slot-scope="{row}">
<p class="goods-descript">
{{ row.relate }}
{{ row.ruleTitle?row.ruleTitle:'否' }}
</p>
</template>
</el-table-column>
......@@ -186,7 +189,10 @@
<div class="pagination">
<el-pagination
layout="prev, pager, next"
:total="50"
:current-page.sync="relateForm.currentPage"
:page-size.sync="relateForm.pageSize"
@current-change="getRelatingGoodsTable"
:total="totalCount"
/>
</div>
</div>
......@@ -197,7 +203,7 @@
size="small"
:loading="btnLoading"
@click="submit"
v-if="title=='选择关联商品'"
v-if="type=='选择'"
>确定</el-button>
</span>
</el-dialog>
......@@ -207,6 +213,7 @@
</template>
<script>
import request from '@/service/request.js';
export default {
data () {
return {
......@@ -217,14 +224,16 @@ export default {
],
multipleSelection: [],
dialogTableVisible: false,
title: '选择关联商品',
type: '选择',
relateForm: {
date: '',
type: '',
relate: '',
search: '',
proType: '',
pageSize: 5,
currentPage: 1,
ruleRelationFlag: '',
},
searchValue: '',
total: 100,
ruleTitle: '',
totalCount: '',
};
},
mounted () {
......@@ -232,24 +241,29 @@ export default {
},
methods: {
getList () {
request.get('/api-integral-mall/list-rule', { ruleTitle: this.ruleTitle }).then(res => {
if (res.data.errorCode === 0) {
if (res.data.result.result) {
this.tableDate = res.data.result.result;
}
}
});
for (let i = 0; i < 19; i++) {
this.tableDate.push(
{
title: '新客积分兑换上架规则规则',
tips: '上架规则说明内容内容上架规则说明内容内容上架规则说明内容内容',
number: 236,
ruleTitle: '新客积分兑换上架规则规则',
ruleExplanation: '上架规则说明内容内容上架规则说明内容内容上架规则说明内容内容',
relationCount: 236,
},
);
}
},
relatingDetail (row) {
relatingDetail (integralMallProRuleId, type) {
this.dialogTableVisible = true;
this.title = '查看关联商品';
this.getRelatingGoodsTable(row);
},
relating (row) {
this.dialogTableVisible = true;
this.title = '选择关联商品';
this.type = type;
this.relateForm.currentPage = 1;
this.relateForm.integralMallProRuleId = integralMallProRuleId;
this.getRelatingGoodsTable();
},
editRule (row) {
this.$router.push({ path: '/editRule', query: { id: row.id } });
......@@ -274,20 +288,36 @@ export default {
handleSelectionChange (val) {
this.multipleSelection = val;
},
getRelatingGoodsTable (row) {
getRelatingGoodsTable () {
this.loading = true;
const api = this.type == '选择' ? '/api-integral-mall/page-select-rule-pro' : '/api-integral-mall/page-rule-pro';
// const params = this.type =='选择'?
request.get(api, { params: this.relateForm }).then(res => {
if (res.data.errorCode === 0) {
if (res.data.result.result) {
this.relatingGoodsTable = res.data.result.result;
this.totalCount = res.data.result.totalCount;
}
}
}).finally(_ => {
this.loading = false;
});
this.relatingGoodsTable = [];
for (let i = 0; i < 5; i++) {
this.relatingGoodsTable.push({
mallProImageUrl: 'https://pic01-10001430.image.myqcloud.com/f39e4665-db45-487e-847a-673fedddab44',
proName: '上架规则说明内容内容上架规则说明内容内容上架规则说明内容内容',
proCode: 236,
type: '实物礼品',
price: 1000.00,
stock: 1000,
relate: '新客积分兑换上架规则规则',
proType: '实物礼品',
costValue: 1000.00,
virtualStock: 1000,
ruleTitle: '新客积分兑换上架规则规则',
});
}
this.loading = false;
},
searchGoods () {
this.relateForm.currentPage = 1;
this.getRelatingGoodsTable();
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment