|
|
|
@ -22,14 +22,15 @@
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="选择功能模块">
|
|
|
|
|
|
|
|
|
|
<a-checkbox-group v-model="form.modelFunctionId" :options="functionType" @change="functionChange" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="选择有效时长">
|
|
|
|
|
<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+'年'}}
|
|
|
|
|
<a-select-option :value="item.id" v-for="(item, index) in timeType" :key="index">
|
|
|
|
|
<!-- {{item.years == 0 ? '' : item.years+'年'}}
|
|
|
|
|
{{item.months == 0 ? '' : item.months+'个月'}}
|
|
|
|
|
{{item.days == 0 ? '' : item.days+'天'}}
|
|
|
|
|
{{item.days == 0 ? '' : item.days+'天'}} -->
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
@ -56,13 +57,13 @@
|
|
|
|
|
<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-input v-model="form.domainName" style="width: 394px"></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="服务器ip">
|
|
|
|
|
<a-input style="width: 394px"></a-input>
|
|
|
|
|
<a-input v-model="form.serviceIp" 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 v-model="form.isCustomized" style="width: 394px" @change="textareaDisable">
|
|
|
|
|
<a-select-option :value="0">
|
|
|
|
|
不定制
|
|
|
|
|
</a-select-option>
|
|
|
|
@ -87,7 +88,8 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getAllRequest,getComById, createOrder, calcAmount} from "@/api/manage";
|
|
|
|
|
import {findTimeType, getChargingList, getChargeById} from "@/api/manage";
|
|
|
|
|
import {getChargingList, getChargeById} from "@/api/manage";
|
|
|
|
|
import {findTimeType, findSuperNavigation} from "@/api/manage";
|
|
|
|
|
export default {
|
|
|
|
|
name: "addOrder",
|
|
|
|
|
data() {
|
|
|
|
@ -96,7 +98,7 @@ export default {
|
|
|
|
|
code: '',
|
|
|
|
|
payType: 1,
|
|
|
|
|
chargingTemplateId: undefined,
|
|
|
|
|
modelFunctionId: [1],
|
|
|
|
|
modelFunctionId: [],
|
|
|
|
|
timeTypeId: undefined,
|
|
|
|
|
payPrice: 0,
|
|
|
|
|
companyId: undefined,
|
|
|
|
@ -109,8 +111,12 @@ export default {
|
|
|
|
|
//公司列表
|
|
|
|
|
companyData: [],
|
|
|
|
|
comData: [], //小区列表
|
|
|
|
|
//功能列表
|
|
|
|
|
functionType: [], //选项
|
|
|
|
|
allFunctionType: [],
|
|
|
|
|
//时长列表
|
|
|
|
|
timeData: [],
|
|
|
|
|
timeType: [],
|
|
|
|
|
allTimeType: [],
|
|
|
|
|
//收费模版
|
|
|
|
|
modelData: [],
|
|
|
|
|
}
|
|
|
|
@ -124,15 +130,19 @@ export default {
|
|
|
|
|
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
|
|
|
|
|
})
|
|
|
|
|
findTimeType().then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.allTimeType = data
|
|
|
|
|
})
|
|
|
|
|
findSuperNavigation().then(res => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.allFunctionType = data;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getPrice() {
|
|
|
|
|
if(this.form.chargingTemplateId && this.form.modelFunctionId && this.form.timeTypeId) {
|
|
|
|
@ -148,14 +158,44 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
modelChange(val) {
|
|
|
|
|
this.form.timeTypeId = undefined;
|
|
|
|
|
this.form.modelFunctionId = [];
|
|
|
|
|
this.form.communityId = undefined;
|
|
|
|
|
getChargeById({id: val}).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
let data = res.data;
|
|
|
|
|
let functionData = [];
|
|
|
|
|
data.functionList.forEach(ele => {
|
|
|
|
|
this.allFunctionType.forEach(e => {
|
|
|
|
|
if(e.id == ele) {
|
|
|
|
|
let obj = {label: e.name,value: e.id}
|
|
|
|
|
functionData.push(obj);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.functionType = functionData;
|
|
|
|
|
let timeData = [];
|
|
|
|
|
data.timeTypeList.forEach(ele => {
|
|
|
|
|
this.allTimeType.forEach(e => {
|
|
|
|
|
if(e.id == ele) {
|
|
|
|
|
let year = e.years == 0 ? '' : e.years+'年';
|
|
|
|
|
let month = e.months == 0 ? '' : e.months+'个月';
|
|
|
|
|
let day = e.days == 0 ? '' : e.days+'天';
|
|
|
|
|
let obj = {name: year+month+day,id: e.id}
|
|
|
|
|
timeData.push(obj);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.timeType = timeData;
|
|
|
|
|
});
|
|
|
|
|
this.getPrice();
|
|
|
|
|
},
|
|
|
|
|
timeChange(val) {
|
|
|
|
|
this.getPrice();
|
|
|
|
|
},
|
|
|
|
|
// 选择功能模块
|
|
|
|
|
functionChange(val) {
|
|
|
|
|
// console.log(val)
|
|
|
|
|
},
|
|
|
|
|
textareaDisable(val) {
|
|
|
|
|
if(val == 0) {
|
|
|
|
|
this.form.customizedDemand = ''
|
|
|
|
@ -170,7 +210,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
addConfirm() {
|
|
|
|
|
createOrder(this.form).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancel() {
|
|
|
|
|