|
|
|
@ -3,28 +3,28 @@
|
|
|
|
|
<div class="main-content">
|
|
|
|
|
<div class="cardTitle">添加订单信息</div>
|
|
|
|
|
<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-input v-model="form.code" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="支付类型">
|
|
|
|
|
<a-form-model-item prop="payType" label="支付类型">
|
|
|
|
|
<a-select v-model="form.payType">
|
|
|
|
|
<a-select-option :value="1">线下</a-select-option>
|
|
|
|
|
<a-select-option :value="2">支付宝</a-select-option>
|
|
|
|
|
<a-select-option :value="3">微信</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</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-option :value="item.id" v-for="(item, index) in modelData" :key="index">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</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-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-option :value="item.id" v-for="(item, index) in timeType" :key="index">
|
|
|
|
|
<!-- {{item.years == 0 ? '' : item.years+'年'}}
|
|
|
|
@ -37,17 +37,17 @@
|
|
|
|
|
<a-form-model-item label="购买金额">
|
|
|
|
|
<span style="color: red">¥ {{form.payPrice}}</span>
|
|
|
|
|
</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-option :value="item.id" v-for="(item, index) in companyData" :key="index">
|
|
|
|
|
{{item.companyName}}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="绑定小区">
|
|
|
|
|
<a-form-model-item prop="communityId" label="绑定小区">
|
|
|
|
|
<a-select v-model="form.communityId">
|
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in comData" :key="index">
|
|
|
|
|
{{item.companyName}}
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
@ -108,6 +108,14 @@ export default {
|
|
|
|
|
isCustomized: 0, //定制
|
|
|
|
|
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: [],
|
|
|
|
|
comData: [], //小区列表
|
|
|
|
@ -127,7 +135,8 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
getApi() {
|
|
|
|
|
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
|
|
|
|
|
this.companyData = data;
|
|
|
|
|
});
|
|
|
|
@ -152,10 +161,12 @@ export default {
|
|
|
|
|
modelFunctionId: this.form.modelFunctionId,
|
|
|
|
|
timeTypeId: this.form.timeTypeId
|
|
|
|
|
};
|
|
|
|
|
calcAmount(obj).then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.form.payPrice = data * 1
|
|
|
|
|
});
|
|
|
|
|
if(obj.modelFunctionId.length != 0) {
|
|
|
|
|
calcAmount(obj).then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.form.payPrice = data * 1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
modelChange(val) {
|
|
|
|
@ -196,6 +207,11 @@ export default {
|
|
|
|
|
// 选择功能模块
|
|
|
|
|
functionChange(val) {
|
|
|
|
|
// console.log(val)
|
|
|
|
|
if(val.length != 0) {
|
|
|
|
|
this.getPrice()
|
|
|
|
|
} else {
|
|
|
|
|
this.form.payPrice = 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
textareaDisable(val) {
|
|
|
|
|
if(val == 0) {
|
|
|
|
@ -204,7 +220,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//绑定小区
|
|
|
|
|
boundCom(val) {
|
|
|
|
|
getComById(val).then(res => {
|
|
|
|
|
let obj = {companyId: val}
|
|
|
|
|
getComById(obj).then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.comData = data
|
|
|
|
|
})
|
|
|
|
|