From 06a84822daaf073aebb13a6766ac660bf170636f Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Thu, 29 Oct 2020 18:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/imgs/money_table_ico.png | Bin 0 -> 1225 bytes .../shop-car-apply/apply_service_state.vue | 32 +++-- .../shop-car-apply/service_list.vue | 12 +- src/components/table/table-input.vue | 10 ++ src/components/table/table-um.vue | 20 ++- src/pages/service_shop/shop_car_apply.vue | 65 ++++++++- src/pages/workbench/fwgl/serviceDetail.vue | 6 +- src/pages/workbench/yygl/app_detail.vue | 128 ++++++++++++++---- src/pages/workbench/yygl/apply_app_detail.vue | 3 +- .../workbench/yygl/approval_app_detail.vue | 3 +- 10 files changed, 215 insertions(+), 64 deletions(-) create mode 100644 src/assets/imgs/money_table_ico.png diff --git a/src/assets/imgs/money_table_ico.png b/src/assets/imgs/money_table_ico.png new file mode 100644 index 0000000000000000000000000000000000000000..ef54b892a7c09e2878789a537c61b7b2a9c7bfa0 GIT binary patch literal 1225 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+nAI{vB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxOgGuk*h0bFQqR!T z(!$6@N5ROz&`jUJQs2--*TB%qz|zXVPyq^*fVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr7I$DAddqG{Q6U zQu51-HNkp(eXTt6ic1pnl2bihY?Xkf=w)W6SQ(nTxmj8mSX#QdnHn0pI$By-nmC%8 zm|GaRn3x-w8o>0r+L zp~b+XIpmMKcq&WOv7;vs95{Z|LBPOKm~-a?O<|LNCs}tpvYk1o`kPy-?|%IQlLS5; zRXtZf?)MFyTdID=w}sDFIC%KrsRIvk4;~SC+9
-

{{ data.size }}

-

{{ data.applytype }}

+

{{data.size}}

{{ data.num }}
+
{{ data.count }}
服务信息 规格 - 数量 + 购买时长 + 小计 操作

@@ -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; } diff --git a/src/components/table/table-input.vue b/src/components/table/table-input.vue index 9503aa2..399040e 100644 --- a/src/components/table/table-input.vue +++ b/src/components/table/table-input.vue @@ -11,6 +11,16 @@ class="table_in_input" >
+
+ +
{} @@ -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修改该行数据 diff --git a/src/pages/service_shop/shop_car_apply.vue b/src/pages/service_shop/shop_car_apply.vue index 514884d..2223a96 100644 --- a/src/pages/service_shop/shop_car_apply.vue +++ b/src/pages/service_shop/shop_car_apply.vue @@ -6,8 +6,15 @@
- 共{{service_arr.length}}项服务 提交申请 +
+

+ 费用总计:    {{all_cost}}金币 +

+

+ 共{{service_arr.length}}项服务|     账户余额: {{now_money}}金币 +

+
@@ -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; +} diff --git a/src/pages/workbench/fwgl/serviceDetail.vue b/src/pages/workbench/fwgl/serviceDetail.vue index 96318ff..26a903e 100644 --- a/src/pages/workbench/fwgl/serviceDetail.vue +++ b/src/pages/workbench/fwgl/serviceDetail.vue @@ -876,7 +876,7 @@ export default { edit_size_arr: [ { prop: "type", - label: '规格类型', + label: '规格类型', 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: '调用次数', width: "200px", align: "center", type: "input", diff --git a/src/pages/workbench/yygl/app_detail.vue b/src/pages/workbench/yygl/app_detail.vue index 6652912..1907fe8 100644 --- a/src/pages/workbench/yygl/app_detail.vue +++ b/src/pages/workbench/yygl/app_detail.vue @@ -222,6 +222,7 @@ :couldNotEdit="false" :radius="true" :isIndex="true" + :limitEditLength="1" :datas="service_size_data" @changeTable="now_size_data" > @@ -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; diff --git a/src/pages/workbench/yygl/apply_app_detail.vue b/src/pages/workbench/yygl/apply_app_detail.vue index 7a2c9bc..4a9d42b 100644 --- a/src/pages/workbench/yygl/apply_app_detail.vue +++ b/src/pages/workbench/yygl/apply_app_detail.vue @@ -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) {}); }, diff --git a/src/pages/workbench/yygl/approval_app_detail.vue b/src/pages/workbench/yygl/approval_app_detail.vue index 776e2ff..60740c5 100644 --- a/src/pages/workbench/yygl/approval_app_detail.vue +++ b/src/pages/workbench/yygl/approval_app_detail.vue @@ -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) {}); -- 2.26.0