Commit 06a84822 authored by 张俊's avatar 张俊

应用详情

parent 3b6abece
......@@ -37,10 +37,10 @@
</div>
</div>
<div class="size">
<p>{{ data.size }}</p>
<P>{{ data.applytype }}</P>
<p>{{data.size}}</p>
</div>
<div class="num">{{ data.num }}</div>
<div class="count">{{ data.count }}</div>
<div class="oprate">
<upload-file
v-if="data.isMg"
......@@ -156,7 +156,7 @@ export default {
}
.serviceinfo {
width: 415px;
margin-right: 90px;
margin-right: 66px;
}
.pic {
width: 116px;
......@@ -193,27 +193,29 @@ export default {
.size {
width: 240px;
height: 107px;
background-color: rgba(249, 250, 252, 1);
line-height: 107px;
border-radius: 8px;
margin-right: 70px;
padding: 20px;
color: rgba(136, 144, 167, 1);
}
.size p:nth-of-type(1) {
line-height: 22px;
margin-bottom: 10px;
color: #242c43;
}
.num {
width: 138px;
height: 107px;
line-height: 107px;
font-size: 16px;
color: rgba(88, 97, 122, 1);
margin-right: 55px;
font-size: 14px;
color: #242c43;
margin-right: 20px;
text-align: center;
}
.count{
width: 108px;
height: 107px;
line-height: 107px;
font-size: 14px;
color: #242c43;
text-align: center;
}
.oprate {
width: 130px;
width: 150px;
height: 107px;
padding-top: 34px;
padding-left: 30px;
......
......@@ -3,7 +3,8 @@
<p class="list_title">
<span>服务信息</span>
<span>规格</span>
<span>数量</span>
<span>购买时长</span>
<span>小计</span>
<span>操作</span>
</p>
<apply-service-state ref="apply_service_state" v-for="(item,index) in service_arr" :idx="index" :key="index+5000" :data="item"></apply-service-state>
......@@ -67,13 +68,16 @@ export default {
font-weight: bold;
}
.list_title span:nth-of-type(1){
margin-right: 460px;
margin-right: 414px;
}
.list_title span:nth-of-type(2){
margin-right: 315px;
margin-right: 246px;
}
.list_title span:nth-of-type(3){
margin-right: 155px;
margin-right: 96px;
}
.list_title span:nth-of-type(4){
margin-right: 124px;
}
</style>
......@@ -11,6 +11,16 @@
class="table_in_input"
></el-input>
</div>
<div v-else-if="typeHead == 'inputMoney'" class="text-xs-center">
<el-input
ref="inpNum"
v-model="inputText"
:disabled="couldNotEdit || name == ''||itemEdit"
size="small"
@input="changeValue"
class="table_in_input"
></el-input>
</div>
<div
v-else-if="typeHead == 'input' || type == '' || (typeHead == 'upload' && type == 'text')"
class="text-xs-center"
......
......@@ -154,7 +154,7 @@
></v-apaas-table-umhref>
<!-- could edit -->
<v-apaas-table-input
v-else-if="item.type === 'input' || item.type === 'upload' || item.type === 'inputNumber'"
v-else-if="item.type === 'input' || item.type === 'upload' || item.type === 'inputNumber'||item.type ==='inputMoney'"
:item="helper.GetProperty(scope.row, item.prop)"
:header="item.prop" ref=""
:id="scope.row.id"
......@@ -162,7 +162,7 @@
:rowId="scope.$index"
:type="scope.row[item.uploadKey] ? scope.row[item.uploadKey] : ''"
:typeHead="item.type"
:itemEdit="scope.row[item.prop]=='不限次数'||scope.row[item.prop]=='申请获取应用镜像部署权限'||scope.row[item.prop]=='提供2核4G,4核8G等多种规格'"
:itemEdit="scope.row[item.prop]=='不限次数'||scope.row[item.prop]=='申请获取应用镜像部署权限'"
:couldNotEdit="couldNotEdit"
@changeInputValue="changeInputValue"
@changeUpFile="changeUpFile"
......@@ -381,6 +381,10 @@ export default {
type: Boolean,
default: false
},
limitEditLength:{
type: Number,
default: 0
},
params: {
type: Object,
default: () => {}
......@@ -483,7 +487,11 @@ export default {
this.selectedTabsPage = JSON.parse(JSON.stringify(data.newArr));
this.pagination.total = data.total;
if (this.autoAdd) {
this.addRow();
if(this.limitEditLength!==0&&this.limitEditLength<=this.selectedTabsPage.length){
}else{
this.addRow();
}
}
if (this.selectedTabsPage[0] && this.selectedTabsPage[0].id) {
} else {
......@@ -676,7 +684,11 @@ export default {
val.inputValue != "" &&
val.rowId + 1 == this.selectedTabsPage.length
) {
this.addRow();
if(this.limitEditLength!==0&&this.limitEditLength<=this.selectedTabsPage.length){
}else{
this.addRow();
}
}
},
// 根据id修改该行数据
......
......@@ -6,8 +6,15 @@
</info-list>
<div class="footout">
<span>{{service_arr.length}}项服务</span>
<span class="applybtn" @click="sub_service()">提交申请</span>
<div class="count_money">
<p>
费用总计:&nbsp;&nbsp;&nbsp; <span>{{all_cost}}</span><span>金币</span>
</p>
<p>
<span>{{service_arr.length}}项服务</span><span>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;账户余额: {{now_money}}金币</span>
</p>
</div>
</div>
</div>
</template>
......@@ -30,6 +37,8 @@ export default {
preson: "",
phone: "",
},
all_cost:'',
now_money:'',
module_arr: [
{
title: "服务申请",
......@@ -120,9 +129,19 @@ export default {
});
this.get_car_list(temp_arr);
}
this.get_account_money()
},
mounted() {},
methods: {
get_account_money(){
this.$http
.get(`/apaas/backmgt/user/myAccount`).then(res=>{
console.log(res);
if(res.data.success){
this.now_money = res.data.data.account_balance
}
})
},
get_one_app(app_data) {
this.$http
.get(`/apaas/serviceapp/v3/shopcart/appinfo?app_id=${app_data.app_id}`)
......@@ -142,13 +161,14 @@ export default {
this.service_arr[0]["title"] = data.app_name;
this.service_arr[0]["type"] = data.type_name;
this.service_arr[0]["auth"] = data.org_name;
this.service_arr[0]["size"] =
"规格:" + (app_data.spec_id == 0 ? "部署" : "开发");
this.service_arr[0]["size"] ="应用镜像部署权限:"+data.price+"金币/月";
this.service_arr[0]["applytype"] =
"申请方式:" + (app_data.duration_unit == 1 ? "" : "");
this.service_arr[0]["num"] = app_data.duration;
this.service_arr[0]["count"] = app_data.duration*parseFloat(data.price)+'金币';
this.service_arr[0]["isMg"] = false;
this.service_arr[0]["isapp"] = true;
this.all_cost = app_data.duration*parseFloat(data.price)
}
});
},
......@@ -237,6 +257,10 @@ export default {
});
},
sub_service() {
if(this.all_cost>this.now_money){
this.$message.error('余额不足,请进行充值')
return
}
let formInline = this.$refs.apply_info.formInline;
let flag = null;
this.$refs.apply_info.$refs.ruleForm.validate((valid) => {
......@@ -327,6 +351,7 @@ export default {
get_car_list(car_arr) {
this.service_arr = [];
this.post_arr = [];
var temp_cost = 0
this.$http
.get(`/apaas/serviceapp/v3/shopcart/list`)
.then((response) => {
......@@ -345,13 +370,14 @@ export default {
this.service_arr[l]["title"] = e.application.app_name;
this.service_arr[l]["type"] = e.application.type_name;
this.service_arr[l]["auth"] = e.application.org_name;
this.service_arr[l]["size"] =
"规格:" + (e.spec_id == 0 ? "部署" : "开发");
this.service_arr[l]["size"] ="应用镜像部署权限:"+e.application.price+"金币/月";
this.service_arr[l]["applytype"] =
"申请方式:" + (e.duration_method == 1 ? "" : "");
this.service_arr[l]["num"] = e.duration;
this.service_arr[l]["count"] = e.duration*parseFloat(e.application.price)+'金币';
this.service_arr[l]["isMg"] = false;
this.service_arr[l]["isapp"] = true;
temp_cost = temp_cost + e.duration*parseFloat(e.application.price)
} else {
//服务
this.service_arr[l]["img"] = e.service.cover;
......@@ -387,6 +413,7 @@ export default {
this.service_arr[l]["isapp"] = false;
}
});
this.all_cost = temp_cost
// this.service_arr =
})
.catch((response) => {});
......@@ -417,10 +444,36 @@ export default {
height: 44px;
line-height: 44px;
text-align: center;
display: inline-block;
float: right;
background-color: rgba(229, 102, 0, 1);
border-radius: 8px;
margin-left: 20px;
cursor: pointer;
}
.count_money{
float: right;
margin-top: -10px;
}
.count_money p:nth-of-type(1){
font-size: 18px;
color: #242c43;
margin-bottom: 10px;
}
.count_money p:nth-of-type(1) span{
color: #e56600;
}
.count_money p:nth-of-type(1) span:nth-of-type(1){
font-size: 24px;
}
.count_money p:nth-of-type(1) span:nth-of-type(2){
font-size: 14px;
}
.count_money p:nth-of-type(2){
font-size: 14px;
color: #58617a;
}
.count_money p:nth-of-type(2) span:nth-of-type(2){
color: #a9aec0;
margin-left: 20px;
}
</style>
......@@ -876,7 +876,7 @@ export default {
edit_size_arr: [
{
prop: "type",
label: '规格类型<span title="计费计时"><img style="width:20px;" src="'+require('../../../assets/imgs/demo_logo.png')+'" alt=""></span>',
label: '规格类型<span title="计次收费规格:仅依据服务调用次数进行收费,不限时长。&#10;时长收费规格:按月为时间单位进行收费,每月使用次数不限。"><img style="margin-left:5px;vertical-align:-3px;" src="'+require('../../../assets/imgs/money_table_ico.png')+'" alt=""></span>',
width: "180px",
align: "center",
type: "select",
......@@ -896,11 +896,11 @@ export default {
label: "价格/金币",
width: "200px",
align: "center",
type: "inputNumber",
type: "inputMoney",
},
{
prop: "pv",
label: "调用次数",
label: '调用次数<span title="该规格提供的服务调用次数。"><img style="margin-left:5px;vertical-align:-3px;" src="'+require('../../../assets/imgs/money_table_ico.png')+'" alt=""></span>',
width: "200px",
align: "center",
type: "input",
......
......@@ -222,6 +222,7 @@
:couldNotEdit="false"
:radius="true"
:isIndex="true"
:limitEditLength="1"
:datas="service_size_data"
@changeTable="now_size_data"
></table-um>
......@@ -298,6 +299,7 @@ import { mapGetters, mapState } from "vuex";
import apassTable from "@/components/apass-table";
import imageDetail from "@/components/image-detail";
import ListPagination from "@/components/comments-pagination";
import helper from "@/services/helper";
export default {
components: {
infoList,
......@@ -367,59 +369,49 @@ export default {
fileList: [],
trans_log_header:[
{
prop: "dydw",
prop: "department_name",
label: "申请单位",
minWidth: "20%",
align: "left",
},
{
prop: "dyyw",
prop: "system_name",
label: "业务系统",
minWidth: "20%",
align: "left",
},
{
prop: "sqr",
prop: "user_name",
label: "申请人",
minWidth: "20%",
align: "center",
},
{
prop: "gg",
prop: "spcs_descript",
label: "规格",
minWidth: "20%",
align: "left",
},
{
prop: "sqsc",
prop: "duration",
label: "购买时长",
width: "110px",
align: "center",
},
{
prop: "price",
prop: "total_money",
label: "订单总价",
width: "150px",
align: "center",
},
{
prop: "sqsj",
prop: "add_time_name",
label: "交易时间",
width: "160px",
align: "center",
},
],
trans_log_data:[
{
dydw:'机关事务局',
dyyw:'业务系统',
sqr:'超管用户',
gg:'申请获取应用镜像部署权限(3000/月)',
sqsc:'1',
price:'3000金币',
sqsj:'2020-10-12 10:30:52'
}
],
trans_log_data:[],
trans_log_arr:[
{
title: "应用交易概览",
......@@ -437,16 +429,16 @@ export default {
},
],
trans_all_obj:{
all:1123,
times:13215,
month:1312,
all:0,
times:0,
month:0,
},
service_size_data:[],
service_size_arr: [
{
prop: "type",
label: "规格类别",
minWidth: "33.33%",
width: "300px",
align: "center",
},
{
......@@ -457,7 +449,7 @@ export default {
},
{
prop: "price",
label: "价格",
label: "价格(金币)",
width: "200px",
align: "center",
},
......@@ -472,16 +464,16 @@ export default {
{
prop: "type",
label: "规格类别",
width: "150px",
width: "250px",
align: "left",
type:'input'
},
{
prop: "price",
label: "价格",
label: "价格(金币)",
width: "200px",
align: "center",
type: "inputNumber",
type: "inputMoney",
},
{
prop: "time",
......@@ -653,21 +645,93 @@ export default {
];
},
methods: {
get_app_size(){
this.$http
.get(
`/apaas/hubApi/market/appSpecification?id=${this.$route.params.id}`
).then((res)=>{
console.log(res);
if(res.data.success){
var data = res.data.data
var temp = [{
id:data.id,
type:'申请获取应用镜像部署权限',
time:'按月',
price:data.price,
des:data.specifications
}]
this.service_size_data = temp
this.size_arr_down = temp
}
})
},
transchangePageSize(value) {
this.transpageSize = value;
this.transcurrentPage = 1;
this.get_app_trans_data()
},
transchangeCurrentPage(value) {
this.transcurrentPage = value;
this.get_app_trans_data()
},
change_service_size(){
console.log(this.size_arr_down);
this.$http
.put(
`/apaas/hubApi/market/appSpecification`,{
"id":parseInt(this.$route.params.id),
    "price":this.size_arr_down[0].price,
    "price_style":0,
    "specification_category":"申请获取应用镜像部署权限",
    "specifications":this.size_arr_down[0].des
}
).then(res=>{
if(res.data.success){
this.$message.success('修改成功')
this.sizeset_flag = false
this.get_app_size()
}else{
this.$message.error(this.data.errMsg)
}
})
},
get_app_trans_all(){
this.$http
.get(
`/apaas/hubApi/market/incomeStatistics?id=${this.$route.params.id}&limit=${this.transpageSize}&page=${this.transcurrentPage}`
).then(res=>{
if(res.data.success){
var data = res.data.data
this.trans_all_obj={
all:data.sum,
times:data.count,
month:data.month_count,
}
}
})
},
get_app_trans_data(){
this.$http
.get(
`/apaas/hubApi/market/transactionRecord?app_id=${this.$route.params.id}&limit=${this.transpageSize}&page=${this.transcurrentPage}`
).then(res=>{
console.log(res);
if(res.data.success){
res.data.data.forEach(e => {
e.add_time_name = helper.dateStringTransform(e.add_time)
});
this.trans_log_data = res.data.data
this.translistTotal = res.data.total
}
})
},
change_service_size(){},
now_size_data(val){
val.forEach(e=>{
e.type = '申请获取应用镜像部署权限'
e.time = '按月'
e.des = '提供2核4G,4核8G等多种规格'
})
this.size_arr_down = val
},
......@@ -1032,6 +1096,9 @@ export default {
if(this.$route.query.source == "apply"){
}else{
this.get_app_size()
this.get_app_trans_data()
this.get_app_trans_all()
this.service_arr[this.now_user].push(...["应用计费规则","应用交易记录"]);
}
}
......@@ -1154,6 +1221,7 @@ export default {
text-align: center;
cursor: pointer;
margin-bottom: 30px;
margin-top: 30px;
}
.savebtn {
margin-top: 50px;
......
......@@ -136,7 +136,7 @@ export default {
},
{
title: "总价:",
info: "2000",
info: "",
},
{
title: "审批信息",
......@@ -231,6 +231,7 @@ export default {
this.$set(this.servicead_arr[2], "url", data.apply_file);
this.$set(this.servicead_arr[3], "info", data.apply_type_name);
this.$set(this.servicead_arr[4], "info", data.apply_time);
this.$set(this.servicead_arr[5], "info", data.total_money);
})
.catch(function(response) {});
},
......
......@@ -247,7 +247,7 @@ export default {
},
{
title: "订单总价:",
info: "30000"
info: ""
}
]
};
......@@ -344,6 +344,7 @@ export default {
this.$set(this.list_arr[4], "info", data.apply_file.split('/')[0]);
this.$set(this.list_arr[4], "url", data.apply_file);
this.$set(this.list_arr[5], "info", data.apply_time.replace('Z',' ').replace('T',' '));
this.$set(this.list_arr[6], "info", data.total_money);
})
.catch(function(response) {});
......
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