Commit fd7f6e16 by crushh

udpate: tem

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