Преглед на файлове

医健宝-首页pad使用情况展示,销售公司流量充值及记录

chenguo преди 1 ден
родител
ревизия
4a42ec2016

+ 18 - 0
src/api/company/traffic.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+export function rechargeTraffic(data) {
+  return request({
+    url: '/company/traffic/rechargeTraffic',
+    method: 'post',
+    data: data
+  })
+}
+
+export function listTrafficRecords(query) {
+  return request({
+    url: '/company/traffic/list',
+    method: 'get',
+    params: query
+  })
+}
+

+ 19 - 0
src/api/company/trafficLog.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+
+export function listTrafficLogExport(query) {
+  return request({
+    url: '/company/trafficLog/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function listTrafficLog(query) {
+  return request({
+    url: '/company/trafficLog/list',
+    method: 'get',
+    params: query
+  })
+}
+

+ 351 - 0
src/views/company/companyTraffic/index.vue

@@ -0,0 +1,351 @@
+<template>
+  <div class="app-container">
+    <!-- 查询条件 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="公司名称">
+        <!-- 修改为多选搜索框 -->
+        <el-select
+          v-model="queryParams.companyIds"
+          multiple
+          filterable
+          remote
+          reserve-keyword
+          placeholder="请输入公司名称搜索"
+          :remote-method="searchCompanies"
+          :loading="companySearchLoading"
+          style="width: 220px"
+          clearable
+          size="small"
+        >
+          <el-option
+            v-for="item in companyOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+
+      <el-form-item label="操作时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 操作按钮区域 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleRecharge"
+          v-hasPermi="['company:traffic:charge']"
+        >流量充值</el-button>
+      </el-col>
+
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 数据表格 -->
+    <el-table v-loading="loading" :data="trafficRecordList" @selection-change="handleSelectionChange">
+
+      <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="createBy" />
+
+      <el-table-column label="操作时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>-->
+
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleRechargeCompany(scope.row)"
+            v-hasPermi="['company:traffic:charge']"
+          >充值</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 流量充值对话框 -->
+    <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-item label="公司ID" prop="companyId">
+          <el-select
+            v-model="rechargeForm.companyId"
+            filterable
+            remote
+            placeholder="请输入公司名称搜索"
+            :remote-method="searchCompanies"
+            :loading="companySearchLoading"
+            @change="syncCompanyName"
+            style="width: 220px"
+            clearable
+            size="small"
+            :disabled="isCompanyRecharge"
+          >
+            <el-option
+              v-for="item in companyOptions"
+              :key="item.dictValue"
+              :label="item.dictValue"
+              :value="item.dictValue"
+            >
+            <span style="float: left">{{ item.dictValue }}</span>
+            <span style="margin-left: 30px">{{ item.dictLabel }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="公司名称" prop="companyName">
+          <el-input v-model="rechargeForm.companyName" placeholder="请输入公司名称" size="small" disabled/>
+        </el-form-item>
+
+
+        <el-form-item label="充值金额" prop="chargeAmount">
+          <el-input-number
+            v-model="rechargeForm.chargeAmount"
+            :min="1"
+            :max="999999999"
+            placeholder="请输入充值金额(KB)"
+            controls-position="right"
+            style="width: 100%"
+          />
+        </el-form-item>
+
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            v-model="rechargeForm.remark"
+            type="textarea"
+            placeholder="请输入备注"
+            :rows="3"
+          />
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRechargeForm">确 定</el-button>
+        <el-button @click="cancelRecharge">取 消</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { listTrafficRecords, rechargeTraffic } from "@/api/company/traffic";
+import { allList } from '@/api/company/company'
+import { resetForm } from '@/utils/common'
+import { delAdIqiyiAccount } from '@/api/ad/AdIqiyiAccount'
+
+export default {
+  name: "CompanyTraffic",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 流量记录表格数据
+      trafficRecordList: [],
+      // 弹出层标题
+      rechargeTitle: "",
+      // 是否显示充值弹出层
+      rechargeOpen: false,
+      // 日期范围
+      dateRange: [],
+      // 公司搜索相关
+      companySearchLoading: false,
+      companyOptions: [],
+      isCompanyRecharge: false,
+
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyName: null,
+        companyIds: [], // 修改为数组
+        createTimeStart: null,
+        createTimeEnd: null
+      },
+      // 流量充值表单参数(保持不变)
+      rechargeForm: {
+        companyId: null,
+        companyName: null,
+        chargeAmount: null,
+        remark: null
+      },
+      // 流量详情数据
+      detailData: {},
+      // 表单校验(保持不变)
+      rechargeRules: {
+        companyId: [
+          { required: true, message: "公司ID不能为空", trigger: "blur" }
+        ],
+        chargeAmount: [
+          { required: true, message: "充值金额不能为空", trigger: "blur" },
+          { type: "number", min: 1, message: "充值金额必须大于0", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    resetForm,
+    resetOption(){
+      this.companyOptions = []
+    },
+    /** 查询流量记录列表 */
+    getList() {
+      this.loading = true;
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.createTimeStart = this.dateRange[0];
+        this.queryParams.createTimeEnd = this.dateRange[1];
+      } else {
+        this.queryParams.createTimeStart = null;
+        this.queryParams.createTimeEnd = null;
+      }
+
+      listTrafficRecords(this.queryParams).then(response => {
+        this.trafficRecordList = response.rows;
+        console.log(this.trafficRecordList)
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索公司 */
+    searchCompanies( query) {
+      allList().then(response => {
+        console.log("response.rows", response.rows)
+        this.companyOptions = response.rows.filter(item => item.dictLabel.includes(query));
+        this.companySearchLoading = false;
+      }).catch(()=>{
+        this.companySearchLoading = false;
+      });
+    },
+    syncCompanyName(){
+      if(!this.rechargeForm.companyId){
+        this.rechargeForm.companyName = null;
+      }
+      this.rechargeForm.companyName = this.companyOptions.filter(item => item.dictValue === this.rechargeForm.companyId)[0].dictLabel;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    /** 多选框选中数据 */
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+
+    /** 流量充值按钮操作 */
+    handleRecharge() {
+      this.rechargeTitle = "流量充值";
+      this.resetForm("rechargeForm");
+      this.companyOptions = [];
+      this.isCompanyRecharge = false;
+      this.rechargeForm.operationType = 1; // 默认充值
+      this.rechargeOpen = true;
+    },/** 流量充值按钮操作 */
+    handleRechargeCompany(row) {
+      this.rechargeTitle = "流量充值";
+      this.resetForm("rechargeForm");
+      this.companyOptions = [];
+      this.isCompanyRecharge = true;
+      this.rechargeForm.companyId = row.companyId;
+      this.rechargeForm.companyName = row.companyName;
+      this.rechargeForm.operationType = 1; // 默认充值
+      this.rechargeOpen = true;
+    },
+
+    /** 提交流量充值 */
+    submitRechargeForm() {
+      this.$refs["rechargeForm"].validate(valid => {
+        if (valid) {
+          //添加confirm提示
+          this.$confirm('确定要为 '+this.rechargeForm.companyName+' 充值 '+this.rechargeForm.chargeAmount+' 元吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            return rechargeTraffic(this.rechargeForm);
+          }).then(response => {
+            if(response.code === 200){
+              this.msgSuccess("充值成功");
+            }else{
+              this.msgError(response.msg);
+            }
+            this.rechargeOpen = false;
+            this.getList();
+          }).catch(() => {});
+        }
+      });
+    },
+
+    /** 取消充值 */
+    cancelRecharge() {
+      this.rechargeOpen = false;
+      this.resetForm("rechargeForm");
+    }
+  }
+};
+</script>
+
+<style scoped>
+
+.mb8 {
+  margin-bottom: 8px;
+}
+</style>

+ 276 - 0
src/views/company/companyTrafficLog/index.vue

@@ -0,0 +1,276 @@
+<template>
+  <div class="app-container">
+    <!-- 查询条件 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="公司名称">
+        <el-select
+          v-model="queryParams.companyIds"
+          multiple
+          filterable
+          remote
+          reserve-keyword
+          placeholder="请输入公司名称搜索"
+          :remote-method="searchCompanies"
+          :loading="companySearchLoading"
+          style="width: 220px"
+          clearable
+          size="small"
+        >
+          <el-option
+            v-for="item in companyOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="操作类型">
+        <el-select v-model="queryParams.operationType" placeholder="请选择操作类型" clearable size="small">
+          <el-option label="充值" :value="1"></el-option>
+          <el-option label="扣费" :value="2"></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="操作人员">
+        <el-input
+          v-model="queryParams.createBy"
+          placeholder="请输入操作人员"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="操作时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 操作按钮区域 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['company:trafficLog:export']"
+        >导出</el-button>
+      </el-col>
+
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 数据表格 -->
+    <el-table v-loading="loading" :data="trafficRecordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+
+      <el-table-column label="公司名称" align="center" prop="companyName" :show-overflow-tooltip="true" :formatter="companyNameFormatter"/>
+
+      <el-table-column label="操作类型" align="center" prop="operationType">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.operationType === 1 ? 'success' : 'danger'">
+            {{ scope.row.operationType === 1 ? '充值' : '扣费' }}
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="流量数量(KB)" align="center" prop="trafficAmount">
+        <template slot-scope="scope">
+          <span :class="scope.row.operationType === 1 ? 'recharge' : 'deduction'">
+            {{ scope.row.operationType === 1 ? '+' : '-' }}{{ scope.row.trafficAmount }}
+          </span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作后余额(KB)" align="center" prop="balance" />
+
+      <el-table-column label="操作人员" align="center" prop="userId" />
+
+      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
+
+      <el-table-column label="操作时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listTrafficLog, listTrafficLogExport } from "@/api/company/trafficLog";
+import { allList } from '@/api/company/company'
+
+export default {
+  name: "CompanyTrafficLog",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 流量记录表格数据
+      trafficRecordList: [],
+      // 日期范围
+      dateRange: [],
+      // 公司搜索相关
+      companySearchLoading: false,
+      companyOptions: [],
+      formatterCompanyOptions: [],
+
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyName: null,
+        companyId: null,
+        companyIds: [], // 多选公司ID
+        operationType: null,
+        createBy: null,
+        createTime: null,
+        createTimeStart: null,
+        createTimeEnd: null
+      }
+    };
+  },
+  created() {
+    this.getList();
+    //初始化formatterCompanyOptions
+    allList().then(e => {
+      this.formatterCompanyOptions = e.rows;
+    })
+  },
+  methods: {
+    /** 查询流量记录列表 */
+    getList() {
+      this.loading = true;
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.createTimeStart = this.dateRange[0];
+        this.queryParams.createTimeEnd = this.dateRange[1];
+      } else {
+        this.queryParams.createTimeStart = null;
+        this.queryParams.createTimeEnd = null;
+      }
+
+      listTrafficLog(this.queryParams).then(response => {
+        this.trafficRecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    /** 搜索公司 */
+    searchCompanies(query) {
+      this.companySearchLoading = true;
+      allList().then(response => {
+        this.companyOptions = response.rows;
+        if (query) {
+          this.companyOptions = this.companyOptions.filter(item =>
+            item.dictLabel.includes(query)
+          );
+        }
+        this.companySearchLoading = false;
+      }).catch(()=>{
+        this.companySearchLoading = false;
+      });
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    /** 多选框选中数据 */
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+
+    companyNameFormatter(row){
+      return this.formatterCompanyOptions.filter(item => item.dictValue === row.companyId)[0].dictLabel
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = {...this.queryParams};
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        queryParams.createTimeStart = this.dateRange[0];
+        queryParams.createTimeEnd = this.dateRange[1];
+      }
+      this.$confirm('是否确认导出所有流量充值记录数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return listTrafficLogExport(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+
+    }
+  }
+};
+</script>
+
+<style scoped>
+.recharge {
+  color: #67C23A;
+  font-weight: bold;
+}
+
+.deduction {
+  color: #F56C6C;
+  font-weight: bold;
+}
+
+.mb8 {
+  margin-bottom: 8px;
+}
+</style>

+ 20 - 2
src/views/course/courseTrafficLog/index.vue

@@ -13,6 +13,7 @@
           placeholder="选择年月"
           :picker-options="pickerOptions"
           :value-format="'yyyy-MM'"
+          @change="handleTimeChange"
         ></el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -107,7 +108,11 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
-        time:new Date().toISOString().slice(0, 7)
+        time:new Date().getFullYear()+'-'+(new Date().getMonth()+1).toString().padStart(2, '0'),
+        //本月第一天
+        startDate: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString().replaceAll('/','-'),
+        //本月最后一天
+        endDate: new Date(new Date().getFullYear(), new Date().getMonth()+1, 0).toLocaleDateString().replaceAll('/','-'),
       },
       // 表单参数
       form: {},
@@ -144,7 +149,20 @@ export default {
     },
 
     handleShortcut() {
-      this.queryParams.time = new Date().toISOString().slice(0, 7);
+      const now = new Date();
+      this.queryParams.time =  now.getFullYear()+'-'+(now.getMonth() + 1).toString().padStart(2, '0');
+    },
+    handleTimeChange() {
+      if(this.queryParams.time){
+        const year = this.queryParams.time.slice(0, 4);
+        const month = this.queryParams.time.slice(5, 7);
+        this.queryParams.startDate = this.queryParams.time+'-01';
+        const lastDay = new Date(year, month, 0).getDate();
+        this.queryParams.endDate =  this.queryParams.time+'-'+lastDay;
+      }else{
+        this.queryParams.startDate = null;
+        this.queryParams.endDate = null;
+      }
     },
     /** 查询短链课程流量记录列表 */
     getList() {

+ 66 - 0
src/views/his/company/index.vue

@@ -10,6 +10,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="所属部门" prop="deptId">
+        <el-select v-model="queryParams.deptId" placeholder="请选择所属部门" clearable size="small">
+          <el-option
+            v-for="item in deptOptions"
+            :key="item.deptId"
+            :label="item.deptName"
+            :value="item.deptId"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="联系电话" prop="companyMobile">
         <el-input
           v-model="queryParams.companyMobile"
@@ -104,6 +114,13 @@
       </el-table-column>
       <el-table-column label="管理员账号" align="center" prop="userName" />
       <el-table-column label="限制用户数量" align="center" prop="limitUserCount" />
+      <el-table-column label="限制pad数量" align="center" prop="maxPadNum" :formatter="padNumFormatter"/>
+      <el-table-column label="占用pad数量" align="center" prop="usedNum" />
+      <el-table-column label="所属部门" align="center" prop="deptId" >
+        <template slot-scope="scope">
+          <el-tag prop="deptId" v-for="(item, index) in deptOptions" :key="'deptId'+index"   v-if="scope.row.deptId===item.deptId">{{item.deptName}}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="备注" align="center" prop="remark" />
       <el-table-column label="开始时间" align="center" prop="startTime" width="180" />
       <el-table-column label="到期时间" align="center" prop="limitTime" width="180" />
@@ -182,6 +199,22 @@
               />
             </el-select>
         </el-form-item>
+      <!-- 所属部门 -->
+        <el-form-item label="所属部门" prop="deptId">
+          <el-select
+            v-model="form.deptId"
+            placeholder="请选择"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in deptOptions"
+              :key="item.deptId"
+              :label="item.deptName"
+              :value="item.deptId"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="商务负责人" prop="manager">
           <el-input v-model="form.manager" placeholder="请输入商务负责人" />
         </el-form-item>
@@ -194,6 +227,12 @@
         <el-form-item label="员工数量" prop="limitUserCount">
           <el-input-number v-model="form.limitUserCount"  :min="1" :max="10000"  ></el-input-number>
         </el-form-item>
+        <el-form-item label="pad数量" prop="maxPadNum">
+          <el-input-number v-model="form.maxPadNum"  :min="-1" :max="10000"  ></el-input-number>
+          <span class="pad-tips">
+            注:-1表示不做限制
+          </span>
+        </el-form-item>
         <el-form-item label="坐席数量" prop="voiceCallerNumber">
           <el-input-number v-model="form.voiceCallerNumber"  :min="0" :max="10000"  ></el-input-number>
         </el-form-item>
@@ -411,6 +450,7 @@ import {getVoiceApiList } from "@/api/company/companyVoiceApi";
 import {getCitysArea} from "../../../api/company/company";
 import {cateList} from "@/api/his/packageCate";
 import { getConfigByKey } from '@/api/system/config'
+import { listDept } from '@/api/system/dept'
 export default {
   name: "Company",
   data() {
@@ -449,6 +489,8 @@ export default {
       statusOptions: [],
       // 企业类型字典
       companyTypeOptions: [],
+      //部门字典
+      deptOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -458,6 +500,7 @@ export default {
         status: null,
         companyType: null,
         limitUserCount: null,
+        maxPadNum:-1,
       },
       voiceApis: [],
       // 表单参数
@@ -491,6 +534,9 @@ export default {
        limitUserCount: [
          { required: true, message: "用户数量不能为空", trigger: "blur" }
        ],
+       maxPadNum: [
+         { required: true, message: "最大Pad数量不能为空", trigger: "blur" }
+       ],
        status: [
          { required: true, message: "状态不能为空", trigger: "blur" }
        ],
@@ -560,6 +606,9 @@ export default {
     cateList().then((response) => {
       this.cateList = response.rows;
     });
+    listDept().then(response => {
+      this.deptOptions = response.data;
+    });
     // getConfigByKey("courseMa.config").then(response => {
     //   if(response.data && response.data.configValue) {
     //     this.miniAppList = JSON.parse(response.data.configValue);
@@ -652,6 +701,7 @@ export default {
         remark: null,
         linkName: null,
         limitUserCount: null,
+        maxPadNum: -1,
         miniAppMaster: [],
         miniAppList: [],
         isDel: null,
@@ -710,6 +760,7 @@ export default {
       const companyId = row.companyId || this.ids
       getCompany(companyId).then(response => {
         this.form = response.data;
+        this.form.usedNum = row.usedNum
         this.open = true;
         this.title = "修改公司";
         if(this.form.status!=null){
@@ -774,6 +825,10 @@ export default {
           // }
 
           if (this.form.companyId != null) {
+            /* if(this.form.maxPadNum < this.form.usedNum && this.form.maxPadNum !== -1){
+              this.msgError("最大Pad数不能小于已使用Pad数,当前已使用"+this.form.usedNum)
+               return;
+            } */
             updateCompany(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
@@ -817,7 +872,18 @@ export default {
           this.download(response.msg);
           this.exportLoading = false;
         }).catch(() => {});
+    },
+    padNumFormatter(row){
+      console.log(row.maxPadNum.type)
+      return row.maxPadNum === -1 ? '不限' : row.maxPadNum
     }
   }
 };
 </script>
+<style scoped>
+.pad-tips {
+  color: #999;
+  font-size: 12px;
+  height: 50px;
+}
+</style>

+ 19 - 1
src/views/index.vue

@@ -42,7 +42,7 @@
               </div>
 
             </div>
-            <div class="botttombg companycard">
+            <div class="cardafter companycard">
               <div class="card-title1">
                 <img src="../assets/images/tab_enterprise.png" alt="" class="icon-img">
                 企微数量
@@ -51,6 +51,17 @@
                 <count-to :start-val="0" :end-val="qwMemberNum" :duration="3600" class="card-panel-num companynumber" />
               </div>
             </div>
+            <div class="botttombg companycard">
+              <div class="card-title1">
+                <svg-icon icon-class="phone" />
+                pad使用情况
+              </div>
+              <div class="card-value highlight1">
+                <count-to :start-val="0" :end-val="padUsedNum" :duration="3600" class="card-panel-num companynumber" />
+                /
+                <count-to :start-val="0" :end-val="padTotalNum" :duration="1800" class="card-panel-num companynumber" />
+              </div>
+            </div>
           </div>
         </el-col>
 
@@ -870,6 +881,10 @@ export default {
       memberCount: 0,
       // 企微数量
       qwMemberNum: 0,
+      // pad使用情况
+      padTotalNum: 0,
+      // pad使用情况
+      padUsedNum: 0,
       // 正常会员数量
       normalNum: 0,
       // 黑名单会员数量
@@ -1082,6 +1097,9 @@ export default {
           this.groupMgrCount = res.data.groupMgrCount??0;
           this.memberCount = res.data.memberCount??0;
           this.qwMemberNum = res.data.qwMemberNum??0;
+          this.padTotalNum = res.data.padTotalNum??0;
+          this.padUsedNum = res.data.padUsedNum??0;
+          this.padInfo = res.data.padInfo;
           this.normalNum = res.data.normalNum??0;
           this.blackNum = res.data.blackNum??0;
           this.todayIncreaseUserNum = res.data.todayIncreaseUserNum??0;