Commit 41ab270f authored by 黄奎's avatar 黄奎

页面修改

parent 0f87234e
...@@ -8,16 +8,15 @@ ...@@ -8,16 +8,15 @@
<div class="text-caption q-mb-lg text-grey-6">基础价格设置</div> <div class="text-caption q-mb-lg text-grey-6">基础价格设置</div>
<div class="row wrap"> <div class="row wrap">
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.courseObj.OriginalPrice" <q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.studyAbroadObj.SuggestPrice"
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="卖价" ref="SuggestPrice" class="col-6 q-pr-lg q-pb-lg" label="合同建议卖价"
@keyup.native="checkPrice(priceObj.courseObj, 'OriginalPrice')" :rules="[val => !!val || '请填写基础收费']" /> @keyup.native="checkPrice(priceObj.studyAbroadObj, 'SuggestPrice')" :rules="[val => !!val || '合同建议卖价']" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.courseObj.SellPrice" <q-input filled stack-label maxlength="8" :dense="false" v-model="priceObj.studyAbroadObj.SellPrice"
ref="SellPrice" class="col-6 q-pr-lg q-pb-lg" label="成本" ref="SellPrice" class="col-6 q-pr-lg q-pb-lg" label="实际卖价"
@keyup.native="checkPrice(priceObj.courseObj, 'SellPrice')" :rules="[val => !!val || '请填写卖价']" /> @keyup.native="checkPrice(priceObj.studyAbroadObj, 'SellPrice')" :rules="[val => !!val || '请填写实际卖价']" />
</div> </div>
</div> </div>
<div class="q-pt-none scroll" style="max-height:60hv"> <div class="q-pt-none scroll" style="max-height:60hv">
<table> <table>
...@@ -112,8 +111,8 @@ ...@@ -112,8 +111,8 @@
</q-input> </q-input>
</td> </td>
<td> <td>
<q-btn flat size="xs" icon="iconfont icon-shanchu" title="删除" color="negative" <q-btn flat size="xs" icon="iconfont icon-shanchu" title="删除" color="negative" style="font-weight:400"
style="font-weight:400" class="q-mr-xs" label="" @click="delPrice(index)" /> class="q-mr-xs" label="" @click="delPrice(index)" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -123,8 +122,8 @@ ...@@ -123,8 +122,8 @@
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading" <q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveStudyAbroadLoading"
@click="saveCourse" /> @click="saveStudyAbroad" />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
...@@ -132,11 +131,13 @@ ...@@ -132,11 +131,13 @@
<script> <script>
import { import {
saveCoursePreferential,
queryCoursePreferentialList,
queryCourseInfo,
queryCoursePreferentialType queryCoursePreferentialType
} from "../../api/course/index"; } from "../../api/course/index";
import {
queryStudyAbroadInfo,
saveBatchStudyAbroad,
} from "../../api/studyabroad/index";
export default { export default {
components: {}, components: {},
props: { props: {
...@@ -149,13 +150,13 @@ ...@@ -149,13 +150,13 @@
return { return {
persistent: true, persistent: true,
optionTitle: "", optionTitle: "",
saveCourseLoading: false, saveStudyAbroadLoading: false,
//价格对象 //价格对象
priceObj: { priceObj: {
studyAbroadObj: { studyAbroadObj: {
CourseId: 0, //课程编号 Id: 0, //留学就业编号
OriginalPrice: 0, //原 SuggestPrice: 0, //建议卖
SellPrice: 0 // SellPrice: 0 //实际卖
}, },
priceList: [] //价格列表 priceList: [] //价格列表
}, },
...@@ -199,27 +200,24 @@ ...@@ -199,27 +200,24 @@
}, },
//初始化表单 //初始化表单
initObj() { initObj() {
if (this.saveObj && this.saveObj.CourseId > 0) { if (this.saveObj && this.saveObj.Id > 0) {
queryCourseInfo({ queryStudyAbroadInfo({
CourseId: this.saveObj.CourseId Id: this.saveObj.Id,
}).then(res => { IsGetPrice: 1
this.priceObj.courseObj.CourseId = res.Data.CourseId;
this.priceObj.courseObj.OriginalPrice = res.Data.OriginalPrice;
this.priceObj.courseObj.SellPrice = res.Data.SellPrice;
});
queryCoursePreferentialList({
CourseId: this.saveObj.CourseId
}).then(res => { }).then(res => {
if (res.Code == 1 && res.Data) { this.priceObj.studyAbroadObj.Id = res.Data.Id;
this.priceObj.priceList = res.Data; this.priceObj.studyAbroadObj.SuggestPrice = res.Data.SuggestPrice;
this.priceObj.studyAbroadObj.SellPrice = res.Data.SellPrice;
if (res.Data.PreferentialList && res.Data.PreferentialList.length > 0) {
this.priceObj.priceList = res.Data.PreferentialList;
} }
}); });
this.optionTitle = "修改课程优惠信息"; this.optionTitle = "修改留学优惠信息";
} else { } else {
this.optionTitle = "新增课程优惠信息"; this.optionTitle = "新增留学优惠信息";
this.priceObj.courseObj.CourseId = 0; this.priceObj.studyAbroadObj.CourseId = 0;
this.priceObj.courseObj.OriginalPrice = 0; this.priceObj.studyAbroadObj.SuggestPrice = 0;
this.priceObj.courseObj.SellPrice = 0; this.priceObj.studyAbroadObj.SellPrice = 0;
} }
}, },
//关闭弹窗 //关闭弹窗
...@@ -228,8 +226,8 @@ ...@@ -228,8 +226,8 @@
this.persistent = false; this.persistent = false;
}, },
//保存菜单 //保存菜单
saveCourse() { saveStudyAbroad() {
this.saveCourseLoading = true; this.saveStudyAbroadLoading = true;
if (this.priceObj.priceList && this.priceObj.priceList.length > 0) { if (this.priceObj.priceList && this.priceObj.priceList.length > 0) {
this.priceObj.priceList.forEach(item => { this.priceObj.priceList.forEach(item => {
if (item.BuyNum == "") { if (item.BuyNum == "") {
...@@ -249,9 +247,9 @@ ...@@ -249,9 +247,9 @@
} }
}); });
} }
saveCoursePreferential(this.priceObj) saveBatchStudyAbroad(this.priceObj)
.then(res => { .then(res => {
this.saveCourseLoading = false; this.saveStudyAbroadLoading = false;
this.$q.notify({ this.$q.notify({
icon: "iconfont icon-chenggong", icon: "iconfont icon-chenggong",
color: "accent", color: "accent",
...@@ -263,7 +261,7 @@ ...@@ -263,7 +261,7 @@
this.closeSaveForm(); this.closeSaveForm();
}) })
.catch(() => { .catch(() => {
this.saveCourseLoading = false; this.saveStudyAbroadLoading = false;
}); });
} }
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</q-table> </q-table>
<studyAbroad-form v-if="isShowStudy" :save-obj="studyObj" @close="closeStudyForm" @success="refreshPage"> <studyAbroad-form v-if="isShowStudy" :save-obj="studyObj" @close="closeStudyForm" @success="refreshPage">
</studyAbroad-form> </studyAbroad-form>
<studyAbroadprice-form v-if="closeStudyForm" :save-obj="studyObj" @close="closeStudyForm" @success="refreshPage"> <studyAbroadprice-form v-if="isShowStudyPrice" :save-obj="studyObj" @close="closeStudyForm" @success="refreshPage">
</studyAbroadprice-form> </studyAbroadprice-form>
</div> </div>
</div> </div>
...@@ -170,7 +170,6 @@ ...@@ -170,7 +170,6 @@
PageCount: 0, PageCount: 0,
isShowStudy: false, //是否显示留学弹窗 isShowStudy: false, //是否显示留学弹窗
studyObj: {}, //留学对象 studyObj: {}, //留学对象
isShowStudyPrice: false, //是否显示价格设置 isShowStudyPrice: false, //是否显示价格设置
} }
}, },
...@@ -206,6 +205,7 @@ ...@@ -206,6 +205,7 @@
closeStudyForm() { closeStudyForm() {
this.isShowStudy = false; this.isShowStudy = false;
this.isShowStudyPrice = false; this.isShowStudyPrice = false;
this.refreshPage();
}, },
//刷新页面 //刷新页面
refreshPage() { refreshPage() {
......
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