Commit d5c290c1 authored by 黄奎's avatar 黄奎

页面修改

parent ef03eee8
<template>
<q-card class="q-px-md" style="width:850px;max-width:900px;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">改价</div>
<div class="text-h6">报价单修改价格</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<div class="text-subtitle2 text-weight-bold q-mb-md">
<span>客户信息</span>
</div>
<q-card-section style="max-height:75vh;" class="scroll">
<div class="row">
<div class="col q-mr-md">
<q-input standout bottom-slots v-model="model.Name" ref="Name" label="报价单名称" dense readonly />
报价单名称:{{model.Name}}
</div>
<div class="col">
<q-select dense standout behavior="menu" v-model="model.CustomerSource" ref="CustomerSource"
:options="CustomerSources" option-label="name" option-value="id" label="客户来源" emit-value map-options
:rules="[val => !!val || '请选择客户来源']" readonly />
客户来源:{{model.CustomerSourceName}}
</div>
</div>
<div class="row">
<div class="col q-mr-md">
<q-select dense standout behavior="menu" v-model="model.CustomerType" ref="CustomerType"
:options="CustomerTypes" option-label="name" option-value="id" label="客户类型" emit-value map-options
:rules="[val => !!val || '请选择客户类型']" readonly />
客户类型:{{model.CustomerTypeName}}
</div>
<div class="col">
<q-input standout bottom-slots v-model="model.JoinNum" ref="JoinNum" label="报名人数" dense mask="#" fill-mask="0"
reverse-fill-mask :rules="[val => !!val || '请输入报名人数']" readonly>
<template v-slot:append>
<span style="font-size:14px;"></span>
</template>
</q-input>
报名人数: {{model.JoinNum}}
</div>
</div>
<div class="row">
<div class="col q-mr-md">
<q-input standout bottom-slots v-model="model.CustomerName" ref="CustomerName" label="客户姓名" dense
:rules="[val => !!val || '请输入客户姓名']" readonly />
客户姓名:{{model.CustomerName}}
</div>
<div class="col">
<q-input standout bottom-slots v-model="model.CustomerTel" label="客户电话" dense mask="#" reverse-fill-mask
readonly />
客户电话:{{model.CustomerTel}}
</div>
</div>
<div class="row">
<div class="col q-mr-md">
<q-input standout bottom-slots v-model="model.EffectiveEnd" ref="CustomerName" label="报价有效期" dense
:rules="[val => !!val || '']" readonly />
报价有效期:{{model.EffectiveEnd}}
</div>
<div class="col">
</div>
</div>
<div class="text-subtitle2 text-weight-bold q-mb-md">
<span>申请信息</span>
</div>
<div class="row">
<div class="col q-mr-md">
申请原因:{{model.ApplyReason}}
</div>
</div>
<div class="text-subtitle2 text-weight-bold q-mb-md">
<span>课程信息</span>
</div>
......@@ -65,14 +68,14 @@
</template>
<template v-slot:body-cell-DiscountPrice="props">
<q-td :props="props">
<span>{{props.row.DiscountPrice}}</span>&nbsp;
<i class="iconfont icon-edit" @click.stop="getClassItem(props.row)" title="点击修改价格">
<span style="width:80px;">{{props.row.DiscountPrice.toFixed(2)}}</span>&nbsp;
<i class="iconfont icon-edit" @click.stop="getClassItem(props.row)" title="点击修改价格" style="cursor:pointer;color:blue;font-size: 13px;">修改价格
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="calenderDialog" style="width:300px;">
<div style="margin:10px 0 15px 0;">设置价格</div>
<q-input standout bottom-slots filled v-model="priceMsg.price" label="价格" dense
mask="#" fill-mask="0" reverse-fill-mask :rules="[val => !!val || '请输入价格']">
<q-input standout bottom-slots filled v-model="priceMsg.price" label="价格" dense mask="#"
fill-mask="0" reverse-fill-mask :rules="[val => !!val || '请输入价格']">
</q-input>
<q-input v-model="priceMsg.remark" filled type="textarea" placeholder="优惠说明" />
<q-card-actions align="right" class="bg-white">
......@@ -106,8 +109,7 @@
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="primary" v-close-popup />
<q-btn label="保存" color="accent" class="q-px-md" style="font-weight:400 !important"
@click="transOfferToOrder" />
<q-btn label="保存" color="accent" class="q-px-md" style="font-weight:400 !important" @click="saveOfferPrice" />
</q-card-actions>
</q-card>
</template>
......@@ -115,38 +117,13 @@
<script>
import {
queryCourseOfferInfo,
saveOfferToOrder,
saveCourseOffer
} from "../../api/course/index";
import {
getClassDropDownList,
} from "../../api/school/index";
export default {
props: ["obj"],
data() {
return {
CustomerTypes: [{
id: 1,
name: "新客户"
},
{
id: 2,
name: "续班客户"
}
],
CustomerSources: [{
id: 1,
name: "学校介绍"
},
{
id: 2,
name: "朋友介绍"
},
{
id: 3,
name: "网络广告"
}
],
model: {},
columns: [{
name: "CourseName",
......@@ -197,7 +174,6 @@
rowsPerPage: 12
},
chosenCourses: [], //报价详情列表
isShowClass: false, //选择班级
priceMsg: {
price: 0,
remark: ''
......@@ -224,41 +200,17 @@
//设置
setPriceUpdate(item) {
item.DiscountPrice = parseInt(this.priceMsg.price);
item.ActualPrice = parseInt(item.OriginalPrice-item.DiscountPrice);
item.Remark = item.Remark+'^'+this.priceMsg.remark;
item.ActualPrice = parseInt(item.OriginalPrice - item.DiscountPrice);
item.Remark = item.Remark + '^' + this.priceMsg.remark;
let num1 = 0;
let num2 = 0;
this.model.OfferDetails.forEach(x => {
num1+=x.DiscountPrice;
num2+=x.ActualPrice;
num1 += x.DiscountPrice;
num2 += x.ActualPrice;
});
this.model.TotalDiscountPrice = num1;
this.model.TotalPrice = num2;
this.isShowEdit=false;
},
//选择班级
setClass(item) {
this.isShowClass = true;
getClassDropDownList({
CourseId: item.CourseId,
IsAddDefault: 1, //添加默认选项
}).then(res => {
item.ClassList = [];
if (res.Code == 1) {
item.ClassList = res.Data;
}
});
},
//选择班级改变事件
changeClass(item) {
if (item.ClassId > 0) {
let val = item.ClassList.find(x => x.ClassId == item.ClassId);
if (val) {
item.ClassName = val.ClassName;
}
} else {
item.ClassName = ""
}
this.isShowEdit = false;
},
//初始化对象
initObj() {
......@@ -274,7 +226,9 @@
EffectiveStart: tempObj.EffectiveStart,
EffectiveEnd: tempObj.EffectiveEnd,
CustomerType: tempObj.CustomerType,
CustomerTypeName: tempObj.CustomerTypeName,
CustomerSource: tempObj.CustomerSource,
CustomerSourceName: tempObj.CustomerSourceName,
TotalOriginalPrice: tempObj.TotalOriginalPrice,
TotalPrice: tempObj.TotalPrice,
TotalDiscountPrice: tempObj.TotalDiscountPrice,
......@@ -282,7 +236,8 @@
CustomerName: tempObj.CustomerName,
CustomerTel: tempObj.CustomerTel,
OfferDetails: [],
JoinNum: tempObj.JoinNum
JoinNum: tempObj.JoinNum,
ApplyReason: tempObj.ApplyReason,
};
if (tempObj.OfferDetails && tempObj.OfferDetails.length > 0) {
this.model.OfferDetails = tempObj.OfferDetails;
......@@ -290,49 +245,20 @@
}
}
})
} else {
this.model = {
Id: 0,
Name: "",
EffectiveStart: "",
EffectiveEnd: "",
CustomerType: null,
CustomerSource: null,
TotalOriginalPrice: 0.0,
TotalPrice: 0.0,
TotalDiscountPrice: 0.0,
CustomerInfo: "",
CustomerName: "",
CustomerTel: "",
OfferDetails: [],
JoinNum: 0
};
}
},
//报价单转订单
transOfferToOrder() {
saveCourseOffer(this.model).then(r => {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "positive",
timeout: 2000,
message: "报价单保存成功",
position: "top",
actions: [{
label: "点击查看",
color: "primary",
handler: () => {
this.$router.push({
path: "/sale/quotation",
query: {
Id: r.Data
}
});
}
}]
});
this.$emit("save");
//修改报价单价格
saveOfferPrice() {
saveCourseOffer(this.model).then(r => {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "positive",
timeout: 2000,
message: "修改价格成功!",
position: "top",
});
this.$emit("save");
});
},
},
watch: {
......
......@@ -119,10 +119,18 @@
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.Name" label="报价单名称"
@clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.SerialNum" label="流水号"
@clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.CustomerName"
label="客户名称" @clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-select filled stack-label use-input option-value="Id" clearable @input="resetSearch"
option-label="EmployeeName" v-model="msg.CreateBy" :options="EmployeeList"
label="直属上级" :dense="false" emit-value map-options @filter="filterFn">
option-label="EmployeeName" v-model="msg.CreateBy" :options="EmployeeList" label="员工" :dense="false"
emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -150,8 +158,8 @@
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<div>
<q-btn flat size="xs" icon="edit" color="accent" v-if="isHavePriceAction" style="font-weight:400" label="改价"
@click="editOrderPrice(props.row)" />
<q-btn flat size="xs" icon="edit" color="accent" v-if="isHavePriceAction && props.row.CustomerStatus==5 "
style="font-weight:400" label="改价" @click="editOrderPrice(props.row)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="详情"
@click="gotoDetails(props.row)" />
</div>
......@@ -163,27 +171,15 @@
</template>
</q-table>
</div>
<q-dialog v-model="showForm" persistent>
<quotation-form :obj="offerObj" @save="refreshPage()"></quotation-form>
</q-dialog>
<q-dialog v-model="showOrderForm" persistent>
<offertransorder-form :obj="offerObj" @save="refreshPage()"></offertransorder-form>
</q-dialog>
<q-dialog v-model="showEditPrice" persistent>
<edittransorder-form :obj="offerObj" @save="refreshPage()"></edittransorder-form>
</q-dialog>
<!-- 查看报价单 -->
<viewquotation-form v-if="isShowviewQuo" :rId="rId" :isShowCancle="1" @close="closeQuota">
</viewquotation-form>
</div>
</template>
<script>
import quotationForm from '../../components/sale/quotation-form'
import offertransorderForm from '../../components/sale/offertransorder-form'
import edittransorderForm from '../../components/sale/edittransorder-form'
import viewquotationForm from '../../components/sale/viewquotation-form'
......@@ -203,8 +199,6 @@
title: "报价单"
},
components: {
quotationForm,
offertransorderForm,
edittransorderForm,
viewquotationForm
},
......@@ -217,13 +211,13 @@
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
Name: "",
CreateBy:0,
Name: "", //报价单名称
IsGetDetails: 1,
CreateBy: 0
CreateBy: "", //所属员工
SerialNum: "", //流水号
CustomerName: "", //客户名称
},
pageCount: 0,
showForm: false, //是否显示报价单弹窗
offerObj: {}, //报价单信息
columns: [{
name: "SerialNum",
......@@ -309,13 +303,12 @@
field: 'Id'
}
],
showOrderForm: false, //是否显示转订单表单
commonId: 0,
showEditPrice: false, //是否显示改价表单
EmployeeList:[], //员工列表
EmployeeList: [], //员工列表
AllemployeeList: [], //所有员工列表
isShowviewQuo:false,
rId:0
isShowviewQuo: false,
rId: 0
}
},
computed: mapState({
......@@ -337,8 +330,8 @@
this.getcourseofferpage();
},
methods: {
closeQuota(){
this.isShowviewQuo=false;
closeQuota() {
this.isShowviewQuo = false;
},
//筛选员工
filterFn(val, update) {
......@@ -359,10 +352,10 @@
if (res.Code == 1) {
var jsonData = res.Data;
if (jsonData && jsonData.length > 0) {
jsonData.unshift({
Id: 0,
EmployeeName: "请选择"
});
// jsonData.unshift({
// Id: 0,
// EmployeeName: "请选择"
// });
this.AllemployeeList = JSON.parse(JSON.stringify(jsonData));
this.EmployeeList = JSON.parse(JSON.stringify(jsonData));;
}
......@@ -380,11 +373,6 @@
}
});
},
//报价单转订单
offerTransOrder(item) {
this.offerObj = item;
this.showOrderForm = true;
},
//改价
editOrderPrice(item) {
this.offerObj = item;
......@@ -392,14 +380,14 @@
},
//刷新页面
refreshPage() {
this.showForm = false;
this.showOrderForm = false;
this.showEditPrice = false;
this.getcourseofferpage();
},
//报价单详情
gotoDetails(item) {
this.rId=item.Id;
this.isShowviewQuo=true;
this.rId = item.Id;
this.isShowviewQuo = true;
},
//重新查询
resetSearch() {
......@@ -409,17 +397,23 @@
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getcourseofferpage()
this.getcourseofferpage();
},
//获取报价单分页列表
getcourseofferpage() {
this.loading = true;
if (this.msg.CreateBy == "") {
this.msg.CreateBy == 0;
}
queryCourseOfferPage(this.msg).then(res => {
this.loading = false
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
if (this.msg.CreateBy == 0) {
this.msg.CreateBy == "";
}
}).catch(() => {
this.loading = false
this.loading = false;
})
},
}
......
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