Commit c84c2946 by lixiaomin

修改页面

parent 35cf57e6
......@@ -76,7 +76,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@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-row>
<el-form-item label="优惠券名称" prop="name">
......@@ -127,8 +127,9 @@
<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 :label="1" >
<span></span><el-input class="inputCalss" v-model="form.daysLimit" :disabled="form.userNumber=='2'"/><span class="spanClass"></span>
<el-input class="inputCalss" v-model="form.userLimit" :disabled="form.userNumber=='2'"/><span class="spanClass"></span>
<span></span><el-input class="inputCalss" v-model="daysLimitPage" :disabled="form.userNumber=='2'"/>
<span class="spanClass"></span>
<el-input class="inputCalss" v-model="userLimitPage" :disabled="form.userNumber=='2'"/><span class="spanClass"></span>
</el-radio>
<el-radio :label="2" style="margin-top: 10px;">无限制</el-radio>
</el-radio-group>
......@@ -197,7 +198,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</el-dialog>
<GiveCoupon ref="giveCoupon"></GiveCoupon>
......@@ -256,6 +257,8 @@ export default {
daysLimit:null,
week:[]
},
daysLimitPage:"",
userLimitPage:"",
// 表单校验
rules: {
name: [{ required: true, message: "不能为空", trigger: "blur" }],
......@@ -312,10 +315,14 @@ export default {
this.getCityList();
},
methods: {
close(formName){
this.$refs[formName].resetFields();
},
changeUserNumber(val){
console.log("val",val);
if(val==2){
this.form.userLimit=null;
this.form.daysLimit=null;
this.userLimitPage="";
this.daysLimitPage="";
}
},
formateTime(val){
......@@ -434,8 +441,9 @@ export default {
});
},
// 取消按钮
cancel() {
resetForm(formName) {
this.open = false;
this.$refs[formName].resetFields();
},
/** 搜索按钮操作 */
handleQuery() {
......@@ -458,6 +466,7 @@ export default {
this.getShopRangeList();
this.getShopAreaTree();
this.getMessageMoudle();
this.$refs['form'].resetFields();
},
/** 上线、下线按钮操作 */
handleStatus(row,tag) {
......@@ -530,8 +539,8 @@ export default {
this.form.userNumber=2
}else{
this.form.userNumber=1;
this.form.daysLimit=response.data.daysLimit;
this.form.userLimit=response.data.userLimit;
this.daysLimitPage=response.data.daysLimit;
this.userLimitPage=response.data.userLimit;
}
this.form.times=[response.data.useStartTime,response.data.useEndTime];
this.form.relativeTime=response.data.relativeTime;
......@@ -712,9 +721,12 @@ export default {
}else if(this.firstRadioValue=="1"){
this.form.priceLimit=0;
}
if(this.form.userNumber=="2"){
if(this.form.userNumber==2){
this.form.daysLimit=0;
this.form.userLimit=0;
}else{
this.form.daysLimit=this.daysLimitPage;
this.form.userLimit=this.userLimitPage;
}
if(this.form.times.length>0){
this.form.useStartTime=this.form.times[0];
......@@ -863,9 +875,13 @@ export default {
this.jiZhe="";
this.liJian="";
this.shopRange=[];
this.daysLimitPage="";
this.userLimitPage="";
this.priceLimit="";
this.storesRange=[];
this.form.week=[];
this.form.daysLimit=null;
this.form.userLimit=null;
this.priceLimit="";
},
getMessageMoudle(){
getMessageMoudle().then((response) => {
......
......@@ -57,7 +57,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@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-item label="类别名" prop="name">
<el-input v-model="form.name" placeholder="请输入类别名" minlength="1" maxlength="7"/>
......@@ -75,7 +75,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</el-dialog>
</div>
......@@ -112,7 +112,7 @@ export default {
form: {
id: null,
name: null,
type: null,
type: '',
desc : null,
state:null
},
......@@ -149,17 +149,21 @@ export default {
});
},
// 取消按钮
cancel() {
resetForm(formName) {
this.$confirm('数据未保存,确定离开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.open = false;
this.$refs[formName].resetFields();
}).catch(() => {
});
},
close(formName){
this.$refs[formName].resetFields();
},
// 表单重置
reset() {
this.form = {
......
......@@ -49,7 +49,7 @@
<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 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>
</el-table-column>
</el-table>
......@@ -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) => {
if(response.code==0){
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