master
parent
737c19a9bf
commit
7f97fffcc3
@ -0,0 +1,19 @@
|
|||||||
|
import httpService from "@/request"
|
||||||
|
|
||||||
|
// 城市-查询所有城市信息
|
||||||
|
export function getAllCity(params) {
|
||||||
|
return httpService({
|
||||||
|
url: `/city/allCity`,
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 城市-根据父类ID查询城市信息
|
||||||
|
export function getCityByParent(params) {
|
||||||
|
return httpService({
|
||||||
|
url: `/city/findByParentId`,
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import httpService from "@/request"
|
||||||
|
|
||||||
|
// 上传平台照片
|
||||||
|
export function uploadImg(params) {
|
||||||
|
return httpService({
|
||||||
|
url: `/user/upload/uploadImg`,
|
||||||
|
method: 'post',
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
}
|
@ -1,31 +1,187 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
<div class="main-content">
|
||||||
<div class="cardTitle">添加订单信息</div>
|
<div class="cardTitle">添加订单信息</div>
|
||||||
<a-divider />
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<a-form-model>
|
<a-form-model :labelCol="{span: 2}" :wrapperCol="{span: 8}">
|
||||||
<a-form-model-item label="订单号">
|
<a-form-model-item label="订单号">
|
||||||
<a-input style="width: 240px"></a-input>
|
<a-input v-model="form.code" ></a-input>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item 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-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>
|
||||||
<a-form-model-item label="选择功能模块">
|
<a-form-model-item label="选择功能模块">
|
||||||
|
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item label="选择有效时长">
|
<a-form-model-item label="选择有效时长">
|
||||||
<a-select style="width: 240px">
|
<a-select v-model="form.timeTypeId" @change="timeChange">
|
||||||
|
<a-select-option :value="item.id" v-for="(item, index) in timeData" :key="index">
|
||||||
|
{{item.years == 0 ? '' : item.years+'年'}}
|
||||||
|
{{item.months == 0 ? '' : item.months+'个月'}}
|
||||||
|
{{item.days == 0 ? '' : item.days+'天'}}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item label="购买金额">
|
||||||
|
<span style="color: red">¥ {{form.payPrice}}</span>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item 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-select v-model="form.communityId">
|
||||||
|
<a-select-option :value="item.id" v-for="(item, index) in comData" :key="index">
|
||||||
|
{{item.companyName}}
|
||||||
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-form-model>
|
</a-form-model>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="cardTitle">高级配置</div>
|
||||||
|
<div class="content">
|
||||||
|
<a-form-model :labelCol="{span: 2}" :wrapperCol="{span: 8}">
|
||||||
|
<a-form-model-item label="域名">
|
||||||
|
<a-input style="width: 394px"></a-input>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item label="服务器ip">
|
||||||
|
<a-input style="width: 394px"></a-input>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item label="是否定制">
|
||||||
|
<a-select style="width: 394px" @change="textareaDisable" v-model="form.isCustomized">
|
||||||
|
<a-select-option :value="0">
|
||||||
|
不定制
|
||||||
|
</a-select-option>
|
||||||
|
<a-select-option :value="1">
|
||||||
|
定制
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item label="定制需求">
|
||||||
|
<a-textarea v-model="form.customizedDemand" style="width: 394px" :disabled="form.isCustomized == 0" placeholder="请填写定制需求">
|
||||||
|
</a-textarea>
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-form-model>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a-space style="margin-left: 138px">
|
||||||
|
<a-button type="primary" @click="addConfirm">创建订单</a-button>
|
||||||
|
<a-button @click="cancel">取消</a-button>
|
||||||
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {getAllRequest,getComById, createOrder, calcAmount} from "@/api/manage";
|
||||||
|
import {findTimeType, getChargingList, getChargeById} from "@/api/manage";
|
||||||
export default {
|
export default {
|
||||||
|
name: "addOrder",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
code: '',
|
||||||
|
payType: 1,
|
||||||
|
chargingTemplateId: undefined,
|
||||||
|
modelFunctionId: [1],
|
||||||
|
timeTypeId: undefined,
|
||||||
|
payPrice: 0,
|
||||||
|
companyId: undefined,
|
||||||
|
communityId: undefined,
|
||||||
|
domainName: '',
|
||||||
|
serviceIp: '',
|
||||||
|
isCustomized: 0, //定制
|
||||||
|
customizedDemand: '' //定制需求
|
||||||
|
},
|
||||||
|
//公司列表
|
||||||
|
companyData: [],
|
||||||
|
comData: [], //小区列表
|
||||||
|
//时长列表
|
||||||
|
timeData: [],
|
||||||
|
//收费模版
|
||||||
|
modelData: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getApi();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getApi() {
|
||||||
|
let obj = {pageNum: 1,size: 1000};
|
||||||
|
getAllRequest(obj).then(res => {
|
||||||
|
let data = res.data.rows
|
||||||
|
this.companyData = data;
|
||||||
|
})
|
||||||
|
findTimeType().then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.timeData = data
|
||||||
|
})
|
||||||
|
getChargingList(Object.assign(obj, {name: ''})).then(res => {
|
||||||
|
let data = res.data.rows;
|
||||||
|
this.modelData = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPrice() {
|
||||||
|
if(this.form.chargingTemplateId && this.form.modelFunctionId && this.form.timeTypeId) {
|
||||||
|
let obj = {
|
||||||
|
chargingTemplateId: this.form.chargingTemplateId,
|
||||||
|
modelFunctionId: this.form.modelFunctionId,
|
||||||
|
timeTypeId: this.form.timeTypeId
|
||||||
|
};
|
||||||
|
calcAmount(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.form.payPrice = data * 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modelChange(val) {
|
||||||
|
getChargeById({id: val}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
});
|
||||||
|
this.getPrice();
|
||||||
|
},
|
||||||
|
timeChange(val) {
|
||||||
|
this.getPrice();
|
||||||
|
},
|
||||||
|
textareaDisable(val) {
|
||||||
|
if(val == 0) {
|
||||||
|
this.form.customizedDemand = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//绑定小区
|
||||||
|
boundCom(val) {
|
||||||
|
getComById(val).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.comData = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addConfirm() {
|
||||||
|
createOrder(this.form).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.$router.go(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="less">
|
||||||
|
.main-content {
|
||||||
|
margin-left: 125px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
test
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in new issue