|
|
|
@ -3,10 +3,12 @@
|
|
|
|
|
<div class="main-content">
|
|
|
|
|
<div class="cardTitle">添加订单信息</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<a-form-model :labelCol="{span: 2}" :wrapperCol="{span: 8}" :rules="rules">
|
|
|
|
|
<a-form-model ref="order" :model="form" :labelCol="{span: 2}" :wrapperCol="{span: 8}" :rules="rules">
|
|
|
|
|
<!-- <a-form-model-item label="订单号">
|
|
|
|
|
<a-input v-model="form.code" ></a-input>
|
|
|
|
|
</a-form-model-item> -->
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="支付类型" prop="payType">
|
|
|
|
|
<a-select v-model="form.payType">
|
|
|
|
|
<a-select-option :value="1">线下</a-select-option>
|
|
|
|
@ -14,6 +16,8 @@
|
|
|
|
|
<a-select-option :value="3">微信</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="选择收费模版" prop="chargingTemplateId">
|
|
|
|
|
<a-select v-model="form.chargingTemplateId" @change="modelChange">
|
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in modelData" :key="index">
|
|
|
|
@ -21,9 +25,13 @@
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="选择功能模块" prop="modelFunctionId">
|
|
|
|
|
<a-checkbox-group v-model="form.modelFunctionId" :options="functionType" @change="functionChange" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="选择有效时长" prop="timeTypeId">
|
|
|
|
|
<a-select v-model="form.timeTypeId" @change="timeChange">
|
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in timeType" :key="index">
|
|
|
|
@ -34,9 +42,13 @@
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="购买金额">
|
|
|
|
|
<span style="color: red">¥ {{form.payPrice}}</span>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-model-item label="绑定小区" prop="communityId">
|
|
|
|
|
<a-select v-model="form.communityId">
|
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in comData" :key="index">
|
|
|
|
@ -44,6 +56,8 @@
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cardTitle">高级配置</div>
|
|
|
|
@ -102,11 +116,11 @@ export default {
|
|
|
|
|
customizedDemand: '' //定制需求
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
payType: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
|
|
|
|
chargingTemplateId: [{ required: true, message: "请选择模版", trigger: "blur" }],
|
|
|
|
|
modelFunctionId: [{ required: true, message: "请选择模块", trigger: "blur" }],
|
|
|
|
|
timeTypeId: [{ required: true, message: "请选择时长", trigger: "blur" }],
|
|
|
|
|
communityId: [{ required: true, message: "请选择小区", trigger: "blur" }],
|
|
|
|
|
payType: [{ required: true, message: "请选择类型", trigger: "change" }],
|
|
|
|
|
chargingTemplateId: [{ required: true, message: "请选择模版", trigger: "change" }],
|
|
|
|
|
modelFunctionId: [{ required: true, message: "请选择模块", trigger: "change" }],
|
|
|
|
|
timeTypeId: [{ required: true, message: "请选择时长", trigger: "change" }],
|
|
|
|
|
communityId: [{ required: true, message: "请选择小区", trigger: "change" }],
|
|
|
|
|
},
|
|
|
|
|
comData: [], //小区列表
|
|
|
|
|
//功能列表
|
|
|
|
@ -149,11 +163,13 @@ export default {
|
|
|
|
|
modelFunctionId: this.form.modelFunctionId,
|
|
|
|
|
timeTypeId: this.form.timeTypeId
|
|
|
|
|
};
|
|
|
|
|
if(obj.modelFunctionId.length != 0) {
|
|
|
|
|
calcAmount(obj).then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.form.payPrice = data * 1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
modelChange(val) {
|
|
|
|
|
this.form.timeTypeId = undefined;
|
|
|
|
@ -204,6 +220,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addConfirm() {
|
|
|
|
|
this.$refs.order.validate((valid) => {
|
|
|
|
|
if(valid) {
|
|
|
|
|
createOrder(this.form).then((res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
@ -212,6 +230,8 @@ export default {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancel() {
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
@ -223,5 +243,6 @@ export default {
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.main-content {
|
|
|
|
|
margin-left: 125px;
|
|
|
|
|
width: 1400px
|
|
|
|
|
}
|
|
|
|
|
</style>
|