|  | @@ -53,7 +53,7 @@
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <el-table-column label="公司名称" align="center" prop="companyName" :show-overflow-tooltip="true" />
 |  |        <el-table-column label="公司名称" align="center" prop="companyName" :show-overflow-tooltip="true" />
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -      <el-table-column label="流量余额(KB)" align="center" prop="balance" />
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <el-table-column label="流量余额" align="center" prop="balance" :formatter="formatBalance"/>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <!--      <el-table-column label="操作人员" align="center" prop="createBy" />
 |  |  <!--      <el-table-column label="操作人员" align="center" prop="createBy" />
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -68,7 +68,7 @@
 | 
											
												
													
														|  |            <el-button
 |  |            <el-button
 | 
											
												
													
														|  |              size="mini"
 |  |              size="mini"
 | 
											
												
													
														|  |              type="text"
 |  |              type="text"
 | 
											
												
													
														|  | -            icon="el-icon-view"
 |  | 
 | 
											
												
													
														|  | 
 |  | +            icon="el-icon-money"
 | 
											
												
													
														|  |              @click="handleRechargeCompany(scope.row)"
 |  |              @click="handleRechargeCompany(scope.row)"
 | 
											
												
													
														|  |              v-hasPermi="['company:traffic:charge']"
 |  |              v-hasPermi="['company:traffic:charge']"
 | 
											
												
													
														|  |            >充值</el-button>
 |  |            >充值</el-button>
 | 
											
										
											
												
													
														|  | @@ -89,7 +89,7 @@
 | 
											
												
													
														|  |      <el-dialog :title="rechargeTitle" :visible.sync="rechargeOpen" width="500px" append-to-body :before-close="resetOption">
 |  |      <el-dialog :title="rechargeTitle" :visible.sync="rechargeOpen" width="500px" append-to-body :before-close="resetOption">
 | 
											
												
													
														|  |        <el-form ref="rechargeForm" :model="rechargeForm" :rules="rechargeRules" label-width="100px">
 |  |        <el-form ref="rechargeForm" :model="rechargeForm" :rules="rechargeRules" label-width="100px">
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        <el-form-item label="公司ID" prop="companyId">
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <el-form-item label="公司ID" prop="companyId" v-show="!isCompanyRecharge">
 | 
											
												
													
														|  |            <el-select
 |  |            <el-select
 | 
											
												
													
														|  |              v-model="rechargeForm.companyId"
 |  |              v-model="rechargeForm.companyId"
 | 
											
												
													
														|  |              filterable
 |  |              filterable
 | 
											
										
											
												
													
														|  | @@ -101,7 +101,6 @@
 | 
											
												
													
														|  |              style="width: 220px"
 |  |              style="width: 220px"
 | 
											
												
													
														|  |              clearable
 |  |              clearable
 | 
											
												
													
														|  |              size="small"
 |  |              size="small"
 | 
											
												
													
														|  | -            :disabled="isCompanyRecharge"
 |  | 
 | 
											
												
													
														|  |            >
 |  |            >
 | 
											
												
													
														|  |              <el-option
 |  |              <el-option
 | 
											
												
													
														|  |                v-for="item in companyOptions"
 |  |                v-for="item in companyOptions"
 | 
											
										
											
												
													
														|  | @@ -124,7 +123,7 @@
 | 
											
												
													
														|  |              v-model="rechargeForm.chargeAmount"
 |  |              v-model="rechargeForm.chargeAmount"
 | 
											
												
													
														|  |              :min="1"
 |  |              :min="1"
 | 
											
												
													
														|  |              :max="999999999"
 |  |              :max="999999999"
 | 
											
												
													
														|  | -            placeholder="请输入充值金额(KB)"
 |  | 
 | 
											
												
													
														|  | 
 |  | +            placeholder="请输入充值金额(元)"
 | 
											
												
													
														|  |              controls-position="right"
 |  |              controls-position="right"
 | 
											
												
													
														|  |              style="width: 100%"
 |  |              style="width: 100%"
 | 
											
												
													
														|  |            />
 |  |            />
 | 
											
										
											
												
													
														|  | @@ -218,8 +217,9 @@ export default {
 | 
											
												
													
														|  |    methods: {
 |  |    methods: {
 | 
											
												
													
														|  |      resetForm,
 |  |      resetForm,
 | 
											
												
													
														|  |      resetOption(){
 |  |      resetOption(){
 | 
											
												
													
														|  | -      this.companyOptions = [];
 |  | 
 | 
											
												
													
														|  |        this.rechargeOpen = false;
 |  |        this.rechargeOpen = false;
 | 
											
												
													
														|  | 
 |  | +      this.companyOptions = [];
 | 
											
												
													
														|  | 
 |  | +      this.rechargeForm = {};
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      /** 查询流量记录列表 */
 |  |      /** 查询流量记录列表 */
 | 
											
												
													
														|  |      getList() {
 |  |      getList() {
 | 
											
										
											
												
													
														|  | @@ -256,9 +256,29 @@ export default {
 | 
											
												
													
														|  |      /** 重置按钮操作 */
 |  |      /** 重置按钮操作 */
 | 
											
												
													
														|  |      resetQuery() {
 |  |      resetQuery() {
 | 
											
												
													
														|  |        this.resetForm("queryForm");
 |  |        this.resetForm("queryForm");
 | 
											
												
													
														|  | 
 |  | +      this.rechargeForm = {};
 | 
											
												
													
														|  |        this.handleQuery();
 |  |        this.handleQuery();
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    formatBalance(row){
 | 
											
												
													
														|  | 
 |  | +      //对流量值进行判断,换算成GB或TB
 | 
											
												
													
														|  | 
 |  | +      if(!row.balance){
 | 
											
												
													
														|  | 
 |  | +        return "0KB";
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      if(row.balance < 1024){
 | 
											
												
													
														|  | 
 |  | +        return row.balance + "KB";
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      else if(row.balance < 1024 * 1024){
 | 
											
												
													
														|  | 
 |  | +        return (row.balance / 1024).toFixed(2) + "MB";
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      else if(row.balance < 1024 * 1024 * 1024){
 | 
											
												
													
														|  | 
 |  | +        return (row.balance / (1024 * 1024)).toFixed(2) + "GB";
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      else{
 | 
											
												
													
														|  | 
 |  | +        return (row.balance / (1024 * 1024 * 1024)).toFixed(2) + "TB";
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      /** 多选框选中数据 */
 |  |      /** 多选框选中数据 */
 | 
											
												
													
														|  |      handleSelectionChange(selection) {
 |  |      handleSelectionChange(selection) {
 | 
											
												
													
														|  |        this.ids = selection.map(item => item.id)
 |  |        this.ids = selection.map(item => item.id)
 | 
											
										
											
												
													
														|  | @@ -270,6 +290,7 @@ export default {
 | 
											
												
													
														|  |      handleRecharge() {
 |  |      handleRecharge() {
 | 
											
												
													
														|  |        this.rechargeTitle = "流量充值";
 |  |        this.rechargeTitle = "流量充值";
 | 
											
												
													
														|  |        this.resetForm("rechargeForm");
 |  |        this.resetForm("rechargeForm");
 | 
											
												
													
														|  | 
 |  | +      this.rechargeForm = {};
 | 
											
												
													
														|  |        this.companyOptions = [];
 |  |        this.companyOptions = [];
 | 
											
												
													
														|  |        this.isCompanyRecharge = false;
 |  |        this.isCompanyRecharge = false;
 | 
											
												
													
														|  |        this.rechargeForm.operationType = 1; // 默认充值
 |  |        this.rechargeForm.operationType = 1; // 默认充值
 | 
											
										
											
												
													
														|  | @@ -278,6 +299,7 @@ export default {
 | 
											
												
													
														|  |      handleRechargeCompany(row) {
 |  |      handleRechargeCompany(row) {
 | 
											
												
													
														|  |        this.rechargeTitle = "流量充值";
 |  |        this.rechargeTitle = "流量充值";
 | 
											
												
													
														|  |        this.resetForm("rechargeForm");
 |  |        this.resetForm("rechargeForm");
 | 
											
												
													
														|  | 
 |  | +      this.rechargeForm = {};
 | 
											
												
													
														|  |        this.companyOptions = [];
 |  |        this.companyOptions = [];
 | 
											
												
													
														|  |        this.isCompanyRecharge = true;
 |  |        this.isCompanyRecharge = true;
 | 
											
												
													
														|  |        this.rechargeForm.companyId = row.companyId;
 |  |        this.rechargeForm.companyId = row.companyId;
 | 
											
										
											
												
													
														|  | @@ -314,6 +336,7 @@ export default {
 | 
											
												
													
														|  |      cancelRecharge() {
 |  |      cancelRecharge() {
 | 
											
												
													
														|  |        this.rechargeOpen = false;
 |  |        this.rechargeOpen = false;
 | 
											
												
													
														|  |        this.resetForm("rechargeForm");
 |  |        this.resetForm("rechargeForm");
 | 
											
												
													
														|  | 
 |  | +      this.rechargeForm = {};
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  |  };
 |  |  };
 |