Commit c84c2946 by lixiaomin

修改页面

parent 35cf57e6
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改对话框 --> <!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1400px" append-to-body class="dialogClass"> <el-dialog :title="title" :visible.sync="open" width="1400px" append-to-body class="dialogClass" @close="close('form')">
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row> <el-row>
<el-form-item label="优惠券名称" prop="name"> <el-form-item label="优惠券名称" prop="name">
...@@ -127,8 +127,9 @@ ...@@ -127,8 +127,9 @@
<el-form-item label="User可领次数" label-width="110px" prop="userNumber" style="margin-left: 15px;"> <el-form-item label="User可领次数" label-width="110px" prop="userNumber" style="margin-left: 15px;">
<el-radio-group v-model="form.userNumber" @change="changeUserNumber"> <el-radio-group v-model="form.userNumber" @change="changeUserNumber">
<el-radio :label="1" > <el-radio :label="1" >
<span></span><el-input class="inputCalss" v-model="form.daysLimit" :disabled="form.userNumber=='2'"/><span class="spanClass"></span> <span></span><el-input class="inputCalss" v-model="daysLimitPage" :disabled="form.userNumber=='2'"/>
<el-input class="inputCalss" v-model="form.userLimit" :disabled="form.userNumber=='2'"/><span class="spanClass"></span> <span class="spanClass"></span>
<el-input class="inputCalss" v-model="userLimitPage" :disabled="form.userNumber=='2'"/><span class="spanClass"></span>
</el-radio> </el-radio>
<el-radio :label="2" style="margin-top: 10px;">无限制</el-radio> <el-radio :label="2" style="margin-top: 10px;">无限制</el-radio>
</el-radio-group> </el-radio-group>
...@@ -197,7 +198,7 @@ ...@@ -197,7 +198,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-hasPermi="['coupon:update']">确 定</el-button> <el-button type="primary" @click="submitForm" v-hasPermi="['coupon:update']">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="resetForm('form')">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<GiveCoupon ref="giveCoupon"></GiveCoupon> <GiveCoupon ref="giveCoupon"></GiveCoupon>
...@@ -256,6 +257,8 @@ export default { ...@@ -256,6 +257,8 @@ export default {
daysLimit:null, daysLimit:null,
week:[] week:[]
}, },
daysLimitPage:"",
userLimitPage:"",
// 表单校验 // 表单校验
rules: { rules: {
name: [{ required: true, message: "不能为空", trigger: "blur" }], name: [{ required: true, message: "不能为空", trigger: "blur" }],
...@@ -312,10 +315,14 @@ export default { ...@@ -312,10 +315,14 @@ export default {
this.getCityList(); this.getCityList();
}, },
methods: { methods: {
close(formName){
this.$refs[formName].resetFields();
},
changeUserNumber(val){ changeUserNumber(val){
console.log("val",val);
if(val==2){ if(val==2){
this.form.userLimit=null; this.userLimitPage="";
this.form.daysLimit=null; this.daysLimitPage="";
} }
}, },
formateTime(val){ formateTime(val){
...@@ -434,9 +441,10 @@ export default { ...@@ -434,9 +441,10 @@ export default {
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { resetForm(formName) {
this.open = false; this.open = false;
}, this.$refs[formName].resetFields();
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -458,6 +466,7 @@ export default { ...@@ -458,6 +466,7 @@ export default {
this.getShopRangeList(); this.getShopRangeList();
this.getShopAreaTree(); this.getShopAreaTree();
this.getMessageMoudle(); this.getMessageMoudle();
this.$refs['form'].resetFields();
}, },
/** 上线、下线按钮操作 */ /** 上线、下线按钮操作 */
handleStatus(row,tag) { handleStatus(row,tag) {
...@@ -530,8 +539,8 @@ export default { ...@@ -530,8 +539,8 @@ export default {
this.form.userNumber=2 this.form.userNumber=2
}else{ }else{
this.form.userNumber=1; this.form.userNumber=1;
this.form.daysLimit=response.data.daysLimit; this.daysLimitPage=response.data.daysLimit;
this.form.userLimit=response.data.userLimit; this.userLimitPage=response.data.userLimit;
} }
this.form.times=[response.data.useStartTime,response.data.useEndTime]; this.form.times=[response.data.useStartTime,response.data.useEndTime];
this.form.relativeTime=response.data.relativeTime; this.form.relativeTime=response.data.relativeTime;
...@@ -712,9 +721,12 @@ export default { ...@@ -712,9 +721,12 @@ export default {
}else if(this.firstRadioValue=="1"){ }else if(this.firstRadioValue=="1"){
this.form.priceLimit=0; this.form.priceLimit=0;
} }
if(this.form.userNumber=="2"){ if(this.form.userNumber==2){
this.form.daysLimit=0; this.form.daysLimit=0;
this.form.userLimit=0; this.form.userLimit=0;
}else{
this.form.daysLimit=this.daysLimitPage;
this.form.userLimit=this.userLimitPage;
} }
if(this.form.times.length>0){ if(this.form.times.length>0){
this.form.useStartTime=this.form.times[0]; this.form.useStartTime=this.form.times[0];
...@@ -863,9 +875,13 @@ export default { ...@@ -863,9 +875,13 @@ export default {
this.jiZhe=""; this.jiZhe="";
this.liJian=""; this.liJian="";
this.shopRange=[]; this.shopRange=[];
this.form.daysLimit=null; this.daysLimitPage="";
this.form.userLimit=null; this.userLimitPage="";
this.priceLimit=""; this.priceLimit="";
this.storesRange=[];
this.form.week=[];
this.form.daysLimit=null;
this.form.userLimit=null;
}, },
getMessageMoudle(){ getMessageMoudle(){
getMessageMoudle().then((response) => { getMessageMoudle().then((response) => {
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改对话框 --> <!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body @close="close('form')">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类别名" prop="name"> <el-form-item label="类别名" prop="name">
<el-input v-model="form.name" placeholder="请输入类别名" minlength="1" maxlength="7"/> <el-input v-model="form.name" placeholder="请输入类别名" minlength="1" maxlength="7"/>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-hasPermi="['coupon:category:update']">确 定</el-button> <el-button type="primary" @click="submitForm" v-hasPermi="['coupon:category:update']">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="resetForm('form')">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
form: { form: {
id: null, id: null,
name: null, name: null,
type: null, type: '',
desc : null, desc : null,
state:null state:null
}, },
...@@ -149,16 +149,20 @@ export default { ...@@ -149,16 +149,20 @@ export default {
}); });
}, },
// 取消按钮 // 取消按钮
cancel() { resetForm(formName) {
this.$confirm('数据未保存,确定离开?', '提示', { this.$confirm('数据未保存,确定离开?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.open = false; this.open = false;
this.$refs[formName].resetFields();
}).catch(() => { }).catch(() => {
}); });
},
close(formName){
this.$refs[formName].resetFields();
}, },
// 表单重置 // 表单重置
reset() { reset() {
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-hasPermi="['machine:model:edit']" size="mini" type="text" @click="handleEditDialog(scope.row)" v-show=!scope.row.isShow>编辑组件属性</el-button> <el-button v-hasPermi="['machine:model:edit']" size="mini" type="text" @click="handleEditDialog(scope.row)" v-show=!scope.row.isShow>编辑组件属性</el-button>
<el-button size="mini" type="text" @click="handleEnter(scope.$index, scope.row)" v-show=scope.row.isShow>确定</el-button> <el-button size="mini" type="text" @click="handleEnter(scope.$index, scope.row)" v-show=scope.row.isShow>确定</el-button>
<el-button v-hasPermi="['machine:model:del']" size="mini" type="text" @click="handlDelete(scope.row)">删除</el-button> <el-button v-hasPermi="['machine:model:del']" size="mini" type="text" @click="handlDelete(scope.$index,scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -301,7 +301,11 @@ export default { ...@@ -301,7 +301,11 @@ export default {
} }
}); });
}, },
handlDelete(row){ handlDelete(index,row){
if(!row.id){
this.modelComponentList.splice(index,1);
return;
}
delComponent(row.id,row.model_id).then((response) => { delComponent(row.id,row.model_id).then((response) => {
if(response.code==0){ if(response.code==0){
this.$modal.msgSuccess("删除组件成功!"); this.$modal.msgSuccess("删除组件成功!");
......
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