Commit ec1385e9 authored by 刘殿昕's avatar 刘殿昕

数据类型问题

parent 8a8ea5fa
...@@ -651,11 +651,15 @@ ...@@ -651,11 +651,15 @@
<span @click="dialogFymx = true" class="ckfymx_a"> <span @click="dialogFymx = true" class="ckfymx_a">
查看费用明细 查看费用明细
</span> </span>
<span class="ckfymx_qian">账户余额:{{ userInfo.account_balance }} 金币</span> <span class="ckfymx_qian"
>账户余额:{{ userInfo.account_balance }} 金币</span
>
</p> </p>
</div> </div>
<el-button <el-button
:class="getSumCoin <= userInfo.account_balance ? 'submit' : 'nosubmit'" :class="
getSumCoin <= userInfo.account_balance ? 'submit' : 'nosubmit'
"
:disabled="getSumCoin > userInfo.account_balance" :disabled="getSumCoin > userInfo.account_balance"
@click="submitApp" @click="submitApp"
> >
...@@ -964,7 +968,9 @@ ...@@ -964,7 +968,9 @@
</p> </p>
</div> </div>
<p class="fyzj_2"> <p class="fyzj_2">
账户余额:<span class="fyzj_2_num">{{ userInfo.account_balance }} 金币</span> 账户余额:<span class="fyzj_2_num"
>{{ userInfo.account_balance }} 金币</span
>
</p> </p>
</div> </div>
<div class="clear_xxx"></div> <div class="clear_xxx"></div>
...@@ -1053,27 +1059,27 @@ export default { ...@@ -1053,27 +1059,27 @@ export default {
a_deductions = this.deductions; a_deductions = this.deductions;
if (this.formNew.cpu == "8") { if (this.formNew.cpu == "8") {
if (this.formNew.memory == "16") { if (this.formNew.memory == "16") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 8 && item.memory == 16; return item.cpu == 8 && item.memory == 16;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} else if (this.formNew.memory == "32") { } else if (this.formNew.memory == "32") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 8 && item.memory == 32; return item.cpu == 8 && item.memory == 32;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} }
} else if (this.formNew.cpu == "16") { } else if (this.formNew.cpu == "16") {
if (this.formNew.memory == "32") { if (this.formNew.memory == "32") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 16 && item.memory == 32; return item.cpu == 16 && item.memory == 32;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} else if (this.formNew.memory == "64") { } else if (this.formNew.memory == "64") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 16 && item.memory == 64; return item.cpu == 16 && item.memory == 64;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} }
} }
if ( if (
...@@ -1082,10 +1088,10 @@ export default { ...@@ -1082,10 +1088,10 @@ export default {
this.formNew.appDuration >= 1 this.formNew.appDuration >= 1
) { ) {
sumDisk += sumDisk +=
this.formNew.dataDisk * Number(this.formNew.dataDisk) *
this.formNew.perDataDisk * Number(this.formNew.perDataDisk) *
this.formNew.appDuration * Number(this.formNew.appDuration) *
this.hard_disk[0].price; Number(this.hard_disk[0].price);
this.jifeiList1[2] = { this.jifeiList1[2] = {
name: "数据盘", name: "数据盘",
num: `${this.formNew.dataDisk}个数据盘,每个数据盘${this.formNew.perDataDisk}GB`, num: `${this.formNew.dataDisk}个数据盘,每个数据盘${this.formNew.perDataDisk}GB`,
...@@ -1112,27 +1118,27 @@ export default { ...@@ -1112,27 +1118,27 @@ export default {
a_deductions = this.deductions; a_deductions = this.deductions;
if (this.formOld.cpu == "8") { if (this.formOld.cpu == "8") {
if (this.formOld.memory == "16") { if (this.formOld.memory == "16") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 8 && item.memory == 16; return item.cpu == 8 && item.memory == 16;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} else if (this.formOld.memory == "32") { } else if (this.formOld.memory == "32") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 8 && item.memory == 32; return item.cpu == 8 && item.memory == 32;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} }
} else if (this.formOld.cpu == "16") { } else if (this.formOld.cpu == "16") {
if (this.formOld.memory == "32") { if (this.formOld.memory == "32") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 16 && item.memory == 32; return item.cpu == 16 && item.memory == 32;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} else if (this.formOld.memory == "64") { } else if (this.formOld.memory == "64") {
let priceObj = this.cpu_memory.find(item => { let priceObj = this.cpu_memory.find((item) => {
return item.cpu == 16 && item.memory == 64; return item.cpu == 16 && item.memory == 64;
}) });
sumCM += priceObj.price; sumCM += Number(priceObj.price);
} }
} }
if ( if (
...@@ -1141,10 +1147,10 @@ export default { ...@@ -1141,10 +1147,10 @@ export default {
this.formOld.appDuration >= 1 this.formOld.appDuration >= 1
) { ) {
sumDisk += sumDisk +=
this.formOld.dataDisk * Number(this.formOld.dataDisk) *
this.formOld.perDataDisk * Number(this.formOld.perDataDisk) *
this.formOld.appDuration * Number(this.formOld.appDuration) *
this.hard_disk[0].price; Number(this.hard_disk[0].price);
this.jifeiList1[2] = { this.jifeiList1[2] = {
name: "数据盘", name: "数据盘",
num: `${this.formOld.dataDisk}个数据盘,每个数据盘${this.formOld.perDataDisk}GB`, num: `${this.formOld.dataDisk}个数据盘,每个数据盘${this.formOld.perDataDisk}GB`,
...@@ -1168,7 +1174,7 @@ export default { ...@@ -1168,7 +1174,7 @@ export default {
this.formOld.appDuration >= 1 ? this.formOld.appDuration : 0 this.formOld.appDuration >= 1 ? this.formOld.appDuration : 0
}个月`; }个月`;
} }
this.amounts_payable = (sumCM + sumDisk).toFixed(2); this.amounts_payable = Number((Number(sumCM) + Number(sumDisk)).toFixed(2));
// this.total_money = sumCM + sumDisk - a_deductions; // this.total_money = sumCM + sumDisk - a_deductions;
return this.amounts_payable; return this.amounts_payable;
}, },
......
...@@ -132,9 +132,9 @@ export default { ...@@ -132,9 +132,9 @@ export default {
this.checkList.forEach((item, index) => { this.checkList.forEach((item, index) => {
if (item) { if (item) {
if (this.list[index].service_id != 0) { if (this.list[index].service_id != 0) {
sum += (this.list[index].service.spcs_info.money * this.list[index].duration).toFixed(2); sum += Number((this.list[index].service.spcs_info.money * this.list[index].duration).toFixed(2));
} else { } else {
sum += (this.list[index].application.price * this.list[index].duration).toFixed(2); sum += Number((this.list[index].application.price * this.list[index].duration).toFixed(2));
} }
} }
}); });
......
...@@ -202,16 +202,15 @@ export default { ...@@ -202,16 +202,15 @@ export default {
}, },
submitDel() { submitDel() {
this.$refs.form1.validate((valid) => { this.$refs.form1.validate((valid) => {
console.log(valid) if (valid) {
// if (valid) { this.diaDel = false;
// this.diaDel = false; if (this.now_state == "/qa/questions") {
// if (this.now_state == "/qa/questions") { this.delQ();
// this.delQ(); } else if (this.now_state == "/qa/answers") {
// } else if (this.now_state == "/qa/answers") { this.delA();
// this.delA(); }
// } } else {
// } else { }
// }
}); });
}, },
del_q(val) { del_q(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment