Commit 1eb01c14 by 胡悦
2 parents b5bbd0c8 03e81db9
......@@ -7,7 +7,7 @@
<div class="live-room container">
<el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="套餐名称" prop="packageName" style="width: 420px">
<el-input size="small" v-model="ruleForm.packageName" placeholder="请输入套餐名称"></el-input>
<el-input size="small" v-model="ruleForm.packageName" placeholder="请输入套餐名称"></el-input>
</el-form-item>
<el-form-item size="small" label="套餐内容" class="is-required">
<el-button @click="openDialog" size="small" icon="el-icon-plus">选择服务</el-button>
......@@ -18,9 +18,7 @@
<img src="@/assets/closeIcon.png" @click="closeChoseItemFun(item, index)" alt="" />
</div>
</div>
<div class="el-form-item__error" v-if="setmealContentRules">
请选择套餐
</div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
<div class="totalWrap" v-if="this.choseItemList.length > 0">
<span>合计:</span>
<span>{{ totalPrice }}元</span>
......@@ -48,7 +46,7 @@
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="goBack" size="small">取消</el-button>
</div>
<glsx-dialog title="套餐服务" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<glsx-dialog title="套餐服务" class="setmealServiceDialog" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body">
<div class="subTitle">
<span>请选择套餐服务:</span>
......@@ -91,16 +89,14 @@
<span class="redText">{{ selectNum }}</span>
项
</span>
<span class="bottomText" style="margin-left:20px">合计:</span>
<span class="bottomText" style="margin-left: 20px">合计:</span>
<span class="smallRedText">¥</span>
<span class="redText">{{ totalPrice }}</span>
</div>
</div>
</glsx-dialog>
<glsx-dialog title="" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body">
当前有内容信息未保存,是否继续取消
</div>
<glsx-dialog title="" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body">当前有内容信息未保存,是否继续返回</div>
</glsx-dialog>
</div>
</template>
......@@ -120,25 +116,29 @@ export default {
packagePrice: '',
notes: ''
},
copyRuleForm: {}, //用于检查页面信息是否改动
rules: {
packageName: [{ required: true, message: '请输入套餐名称', trigger: 'blur' }],
packagePrice: [{ required: true, message: '请输入售价', trigger: 'blur' }]
},
allItemList: [],
choseItemList: [], //['一年12次洗车劵×1', '车身打蜡×2', '全车镀膜×1'],
copyChoseItemList: [], //用于检查页面信息是否改动
merchantId: 44184606,
merchantName: '',
setmealContentRules: false,
//弹窗
setmealDialogVisible: false,
//弹窗2(提示弹窗)
isTipDialogVisible:false,
isTipDialogVisible: false,
selectNum: 0,
totalPrice: 0,
copyTotalPrice: 0, //用于检查页面信息是否改动
id: this.$route.query.id || 0
}
},
created() {
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
......@@ -190,6 +190,9 @@ export default {
this.ruleForm = res.data
this.choseItemList = res.data.list || []
this.totalPrice = res.data.referencePrice
this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
this.copyChoseItemList = this.choseItemList
}
})
},
......@@ -325,11 +328,16 @@ export default {
})
},
// resetForm(formName) {
// this.$router.go(-1)
// },
goBack() {
this.$router.go(-1)
// this.$router.go(-1)
if (JSON.stringify(this.ruleForm) == JSON.stringify(this.copyRuleForm) && this.choseItemList.length == this.copyChoseItemList.length && this.totalPrice == this.copyTotalPrice) {
this.$router.go(-1)
} else {
this.isTipDialogVisible = true
}
},
oninput(value) {
let str = value
......@@ -347,8 +355,8 @@ export default {
if (len1 == '-') {
str = ''
} //限制只能输入一个小数点
if(Number(value)>=99999){
return str=99999
if (Number(value) >= 99999) {
return (str = 99999)
}
if (str.indexOf('.') != -1) {
let str_ = str.substr(str.indexOf('.') + 1)
......@@ -391,11 +399,11 @@ export default {
// }, 0)
this.getSetmealServiceFun()
},
handleTipClose(){
this.isTipDialogVisible=false
handleTipClose() {
this.isTipDialogVisible = false
},
handleTipConfirm(){
this.$router.go(-1);
handleTipConfirm() {
this.$router.go(-1)
}
}
}
......@@ -495,7 +503,7 @@ export default {
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
/deep/.el-dialog__headerbtn {
background-color: #d9e0f5;
background-color: #d9e0f5;
width: 25px;
height: 25px;
border-radius: 50%;
......@@ -512,9 +520,9 @@ export default {
color: #000000;
}
/deep/ .el-dialog__body {
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
padding: 0px 25px;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
padding: 0px 25px;
.content-body {
max-height: 446px;
.subTitle {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!