张雄 3 years ago
parent edc5250ff0
commit 4b851eadaf

@ -37,7 +37,7 @@ export function getAllCommunityInfo(params) {
// 创建订单 // 创建订单
export function createOrder(params) { export function createOrder(params) {
return httpService({ return httpService({
url: `/user/order/createOrder`, url: `/user/alipay/createOrder`,
method: 'post', method: 'post',
data: params, data: params,
}) })

@ -3,28 +3,28 @@
<div class="main-content"> <div class="main-content">
<div class="cardTitle">添加订单信息</div> <div class="cardTitle">添加订单信息</div>
<div class="content"> <div class="content">
<a-form-model :labelCol="{span: 2}" :wrapperCol="{span: 8}"> <a-form-model ref="order" :model="form" :rules="rules" :labelCol="{span: 2}" :wrapperCol="{span: 8}">
<a-form-model-item label="订单号"> <a-form-model-item label="订单号">
<a-input v-model="form.code" ></a-input> <a-input v-model="form.code" ></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="支付类型"> <a-form-model-item prop="payType" label="支付类型">
<a-select v-model="form.payType"> <a-select v-model="form.payType">
<a-select-option :value="1">线下</a-select-option> <a-select-option :value="1">线下</a-select-option>
<a-select-option :value="2">支付宝</a-select-option> <a-select-option :value="2">支付宝</a-select-option>
<a-select-option :value="3">微信</a-select-option> <a-select-option :value="3">微信</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="选择收费模版"> <a-form-model-item prop="chargingTemplateId" label="选择收费模版">
<a-select v-model="form.chargingTemplateId" @change="modelChange"> <a-select v-model="form.chargingTemplateId" @change="modelChange">
<a-select-option :value="item.id" v-for="(item, index) in modelData" :key="index"> <a-select-option :value="item.id" v-for="(item, index) in modelData" :key="index">
{{item.name}} {{item.name}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="选择功能模块"> <a-form-model-item prop="modelFunctionId" label="选择功能模块">
<a-checkbox-group v-model="form.modelFunctionId" :options="functionType" @change="functionChange" /> <a-checkbox-group v-model="form.modelFunctionId" :options="functionType" @change="functionChange" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="选择有效时长"> <a-form-model-item prop="timeTypeId" label="选择有效时长">
<a-select v-model="form.timeTypeId" @change="timeChange"> <a-select v-model="form.timeTypeId" @change="timeChange">
<a-select-option :value="item.id" v-for="(item, index) in timeType" :key="index"> <a-select-option :value="item.id" v-for="(item, index) in timeType" :key="index">
<!-- {{item.years == 0 ? '' : item.years+'年'}} <!-- {{item.years == 0 ? '' : item.years+'年'}}
@ -37,17 +37,17 @@
<a-form-model-item label="购买金额"> <a-form-model-item label="购买金额">
<span style="color: red">¥ {{form.payPrice}}</span> <span style="color: red">¥ {{form.payPrice}}</span>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="选择公司"> <a-form-model-item prop="companyId" label="选择公司">
<a-select v-model="form.companyId" @change="boundCom"> <a-select v-model="form.companyId" @change="boundCom">
<a-select-option :value="item.id" v-for="(item, index) in companyData" :key="index"> <a-select-option :value="item.id" v-for="(item, index) in companyData" :key="index">
{{item.companyName}} {{item.companyName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="绑定小区"> <a-form-model-item prop="communityId" label="绑定小区">
<a-select v-model="form.communityId"> <a-select v-model="form.communityId">
<a-select-option :value="item.id" v-for="(item, index) in comData" :key="index"> <a-select-option :value="item.id" v-for="(item, index) in comData" :key="index">
{{item.companyName}} {{item.name}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
@ -108,6 +108,14 @@ export default {
isCustomized: 0, // isCustomized: 0, //
customizedDemand: '' // customizedDemand: '' //
}, },
rules: {
payType: [{ required: true, message: "请选择类型", trigger: "change" }],
chargingTemplateId: [{ required: true, message: "请选择模版", trigger: "change" }],
modelFunctionId: [{ required: true, message: "请选择模块", trigger: "change" }],
timeTypeId: [{ required: true, message: "请选择时长", trigger: "change" }],
companyId: [{ required: true, message: "请选择公司", trigger: "change" }],
communityId: [{ required: true, message: "请选择小区", trigger: "change" }],
},
// //
companyData: [], companyData: [],
comData: [], // comData: [], //
@ -127,7 +135,8 @@ export default {
methods: { methods: {
getApi() { getApi() {
let obj = {pageNum: 1,size: 1000}; let obj = {pageNum: 1,size: 1000};
getAllRequest(obj).then(res => { let accept = {pageNum: 1,size: 1000,status: 2}
getAllRequest(accept).then(res => {
let data = res.data.rows let data = res.data.rows
this.companyData = data; this.companyData = data;
}); });
@ -152,10 +161,12 @@ export default {
modelFunctionId: this.form.modelFunctionId, modelFunctionId: this.form.modelFunctionId,
timeTypeId: this.form.timeTypeId timeTypeId: this.form.timeTypeId
}; };
calcAmount(obj).then(res => { if(obj.modelFunctionId.length != 0) {
let data = res.data; calcAmount(obj).then(res => {
this.form.payPrice = data * 1 let data = res.data;
}); this.form.payPrice = data * 1
});
}
} }
}, },
modelChange(val) { modelChange(val) {
@ -196,6 +207,11 @@ export default {
// //
functionChange(val) { functionChange(val) {
// console.log(val) // console.log(val)
if(val.length != 0) {
this.getPrice()
} else {
this.form.payPrice = 0
}
}, },
textareaDisable(val) { textareaDisable(val) {
if(val == 0) { if(val == 0) {
@ -204,7 +220,8 @@ export default {
}, },
// //
boundCom(val) { boundCom(val) {
getComById(val).then(res => { let obj = {companyId: val}
getComById(obj).then(res => {
let data = res.data; let data = res.data;
this.comData = data this.comData = data
}) })

Loading…
Cancel
Save