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