diff --git a/src/api/system/dept.js b/src/api/system/dept.js index e8963f4..29a11fd 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -9,6 +9,15 @@ export function listDept(query) { }) } +// 查询部门列表 +export function listDept2(query) { + return request({ + url: '/system/dept/list2', + method: 'get', + params: query + }) +} + // 查询部门列表(排除节点) export function listDeptExcludeChild(deptId) { return request({ diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue index 2ad2bd0..1d0e8fb 100644 --- a/src/views/system/area/index.vue +++ b/src/views/system/area/index.vue @@ -523,7 +523,8 @@ export default { this.$modal.confirm('确认要"' + text + row.areaName + '"运营区吗?').then(function () { let data = { areaId: row.areaId, - status: row.status + status: row.status, + deptId: row.deptId } updateArea(data).then(response => { diff --git a/src/views/system/audit/index.vue b/src/views/system/audit/index.vue index f42e33e..56b4506 100644 --- a/src/views/system/audit/index.vue +++ b/src/views/system/audit/index.vue @@ -469,7 +469,7 @@ export default { console.log("当前用户信息:",this.$store.state.user.name) this.userName = this.$store.state.user.name; if(this.userName === 'admin'){ - this.queryParams.statusList = '7'; + this.queryParams.statusList = '5,6,7'; }else{ this.queryParams.statusList = '5,6'; } diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index ccf07ce..6027f04 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -87,9 +87,14 @@ <span>{{ scope.row.platformServiceFee && scope.row.platformServiceFee != '0'?scope.row.platformServiceFee+'%':'' }}</span> </template> </el-table-column> - <el-table-column prop="handlingCharge" label="手续费" align="center" > + <el-table-column prop="handlingCharge" label="充值手续费" align="center" > <template slot-scope="scope"> - <span>{{ formatHandlingCharge(scope.row.handlingCharge,scope.row.handlingChargeType) }}</span> + <span>{{ scope.row.handlingCharge && scope.row.handlingCharge != '0'?scope.row.handlingCharge+'‰':'' }}</span> + </template> + </el-table-column> + <el-table-column prop="withdrawHandlingCharge" label="提现手续费" align="center" > + <template slot-scope="scope"> + <span>{{ formatWithdrawHandlingCharge(scope.row.withdrawHandlingCharge,scope.row.handlingChargeType) }}</span> </template> </el-table-column> <el-table-column prop="status" label="状态" width="100"> @@ -116,6 +121,13 @@ @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']" >修改</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="withdraw(scope.row)" + v-hasPermi="['system:dept:edit']" + >提现</el-button> <el-button v-if="scope.row.parentId != 0" size="mini" @@ -127,25 +139,12 @@ </template> </el-table-column> </el-table> + <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" + @pagination="getList" /> <!-- 添加或修改运营商对话框 --> <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> -<!-- <el-row>--> -<!-- <el-col :span="24">--> -<!-- <el-form-item label="上级组织" prop="parentId" >--> -<!-- <el-select style="width: 85%" v-model="form.parentId" placeholder="选择上级运营商">--> -<!-- <el-option--> -<!-- v-for="item in deptOptions"--> -<!-- :key="item.deptId"--> -<!-- :label="item.deptName"--> -<!-- :value="item.deptId"--> -<!-- ></el-option>--> -<!-- </el-select>--> -<!--<!– <treeselect v-model="form.parentId" :options="deptOptions" :disabled="true" placeholder="选择上级运营商" />–>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- </el-row>--> <el-row> <el-col :span="12"> <el-form-item label="运营商名称" label-width="90" prop="deptName"> @@ -175,12 +174,9 @@ </el-col> </el-row> <el-row> - <el-col :span="12" > + <el-col :span="12"> <el-form-item label="联系电话" prop="phone"> - <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" :disabled="form.deptId !== undefined"/> - <span class="el-form-item__tip" style="width: 100%;"> - <div>联系电话用于登录后台管理系统,如需修改请联系管理员</div> - </span> + <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" /> </el-form-item> </el-col> <el-col :span="12"> @@ -247,7 +243,7 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="手续费类型" label-width="120" prop="handlingChargeType"> + <el-form-item label="提现手续费类型" label-width="120" prop="handlingChargeType"> <el-radio-group v-model="form.handlingChargeType"> <el-radio v-for="dict in dict.type.et_handling_charge_type" @@ -260,22 +256,27 @@ </el-row> <el-row> <el-col :span="12"> - <el-form-item label="是否使用创享电动车小程序" label-width="160" prop="isUsePlatformApp"> - <el-switch v-model="form.isUsePlatformApp" class="drawer-switch" /> + <el-form-item label="充值手续费" label-width="90" prop="handlingCharge"> + <el-input style="width: 65%" v-model="form.handlingCharge" placeholder="请输入充值手续费" /> </el-form-item> </el-col> <el-col :span="12" v-if="form.handlingChargeType == '1'"> <el-form-item label="比例(‰)" label-width="90" > - <el-input style="width: 65%" v-model="form.handlingCharge" placeholder="请输入手续费" /> + <el-input style="width: 65%" v-model="form.withdrawHandlingCharge" placeholder="请输入手续费" /> </el-form-item> </el-col> <el-col :span="12" v-else> <el-form-item label="每笔(元)" label-width="90" > - <el-input style="width: 65%" v-model="form.handlingCharge" placeholder="请输入手续费" /> + <el-input style="width: 65%" v-model="form.withdrawHandlingCharge" placeholder="请输入手续费" /> </el-form-item> </el-col> </el-row> <el-row> + <el-col :span="12"> + <el-form-item label="是否使用创享电动车小程序" label-width="160" prop="isUsePlatformApp"> + <el-switch v-model="form.isUsePlatformApp" class="drawer-switch" /> + </el-form-item> + </el-col> <el-col :span="12" v-show="form.isUsePlatformApp != true"> <el-form-item label="appid" prop="appid"> <el-input style="width: 93%" v-model="form.appid" placeholder="请输入appid" /> @@ -346,49 +347,99 @@ </div> </el-dialog> - <!-- 添加或修改提现记录对话框 --> -<!-- <el-dialog :title="title2" :visible.sync="open2" width="500px" append-to-body>--> -<!-- <el-form ref="form2" :model="form2" :rules="rules2" label-width="120px">--> -<!-- <el-form-item label="手机号码" prop="phonenumber">--> -<!-- <el-select--> -<!-- ref="headerSearchSelect"--> -<!-- v-model="form2.phonenumber"--> -<!-- :remote-method="queryPhonenumber"--> -<!-- filterable--> -<!-- default-first-option--> -<!-- remote--> -<!-- :loading="loading2"--> -<!-- placeholder="输入手机号搜索"--> -<!-- class="header-search-select" >--> -<!-- <el-option--> -<!-- v-for="item in options"--> -<!-- :key="item.value"--> -<!-- :label="item.label+'---'+item.appName"--> -<!-- :value="item.value">--> -<!-- </el-option>--> -<!-- </el-select>--> -<!-- </el-form-item>--> -<!-- </el-form>--> -<!-- <div slot="footer" class="dialog-footer">--> -<!-- <el-button type="primary" @click="submitForm2">确 定</el-button>--> -<!-- <el-button @click="cancel">取 消</el-button>--> -<!-- </div>--> -<!-- </el-dialog>--> + <!-- 添加或修改资金流水对话框 --> + <el-dialog :title="title2" :visible.sync="open2" width="500px" append-to-body> + <el-form ref="form2" :model="form2" :rules="rules2" label-width="120px"> + <el-form-item label="提现方式" prop="method"> + <el-radio-group v-model="form2.method"> + <el-radio + v-for="dict in dict.type.et_withdraw_method" + :key="dict.value" + :label="dict.value" + >{{dict.label}}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="提现金额:" prop="amount"> + <el-input style="width: 40%" v-model="form2.amount" placeholder="请输入提现金额" /> 元 + </el-form-item> + <el-form-item label="可用余额"> + <span style="color: red;font-weight: 700">{{balance}}</span> 元 + </el-form-item> + <el-form-item v-if="form2.amount" label="提示:" style="font-weight: 300;color: red"> + <span class="amoun-tips" >提现金额:{{form2.amount}}元,手续费:{{formattedFee}} 元,实际到账:{{actualAmount}} 元</span> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="withdrawSubmit">确 定</el-button> + <el-button @click="cancel">取 消</el-button> + </div> + </el-dialog> </div> </template> <script> -import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"; + import { + listDept, + getDept, + delDept, + addDept, + updateDept, + listDeptExcludeChild, + listDept2 + } from '@/api/system/dept' import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import { listArea } from '../../../api/system/area' import { fastSearch } from '@/api/user/user' -import { bandAppUser, getUser } from '@/api/system/user' +import { getUser } from '@/api/system/user' + import { withdraw } from '@/api/system/flow' export default { name: "Dept", - dicts: ['sys_normal_disable','sys_yes_no','et_handling_charge_type'], + dicts: ['sys_normal_disable','sys_yes_no','et_handling_charge_type','et_withdraw_method'], components: { Treeselect }, + computed: { + formattedFee() { + let fee; + // console.log("this.handlingChargeType", this.handlingChargeType) + if(this.handlingChargeType === '1'){ + // console.log("1111111111111") + let withdrawHandlingCharge = parseFloat(this.withdrawHandlingCharge)/1000; + // 计算手续费 + let fee1 = this.form2.amount * withdrawHandlingCharge; + // 保留两位小数,并确保四舍五入 + fee = fee1.toFixed(2); + }else{ + // console.log("22222222222") + fee = parseFloat(this.withdrawHandlingCharge); + } + // console.log("fee============",fee) + // 判断手续费是否为0 + if (fee === 0) { + return '0.00 (免手续费)'; + } else { + return `${fee} `; + } + }, + actualAmount() { + let amount = this.form2.amount; + let fee; + console.log("this.handlingChargeType", this.handlingChargeType) + console.log("this.withdrawHandlingCharge", this.withdrawHandlingCharge) + if(this.handlingChargeType === '1'){ + let withdrawHandlingCharge = parseFloat(this.withdrawHandlingCharge)/1000; + let fee1 = this.form2.amount * withdrawHandlingCharge; + // 四舍五入到两位小数 + fee = Math.round(fee1 * 100) / 100; + // 计算实际到账金额并四舍五入到两位小数 + }else{ + fee = parseFloat(this.withdrawHandlingCharge); + } + let actual = amount - fee; + actual = actual.toFixed(2); + return `${actual} `; + } + }, data() { return { // 遮罩层 @@ -397,8 +448,12 @@ export default { showSearch: true, // 表格树数据 deptList: [], + appUserId: null, + // 总条数 + total: 0, // 运营商树选项 deptOptions: [], + balance: null, options: [], // 运营区选项 areaOptions: [], @@ -421,13 +476,17 @@ export default { deptName: undefined, status: undefined, phonenumber: null, - areaName: undefined + areaName: undefined, + pageNum: 1, + pageSize: 10, }, // 表单参数 form: { isProfitSharing: 'N' }, - form2: {}, + form2: { + method: '1' + }, // 表单校验 rules: { parentId: [ @@ -462,8 +521,23 @@ export default { ] }, rules2: { - phonenumber: [ - { required: true, message: "手机号码不能为空", trigger: "blur" }, + amount: [ + { required: true, message: "提现金额不能为空", trigger: "blur" }, + { pattern: /^\d+$/, message: '提现金额必须为正整数', trigger: 'blur' }, + // 不能超过 balance 值 + { + validator: (rule, value, callback) => { + if (value > this.balance) { + callback(new Error('提现金额不能超过可用余额')); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], + method: [ + { required: true, message: "提现方式不能为空", trigger: "blur" }, ] } }; @@ -478,7 +552,19 @@ export default { this.getList(); }, methods: { - formatHandlingCharge(charge, chargeType) { + withdrawSubmit(){ + console.log("this.form2",this.form2) + this.$refs["form2"].validate(valid => { + if (valid) { + withdraw(this.form2).then(response => { + this.$modal.msgSuccess("操作成功"); + this.open2 = false; + this.getList(); + }); + } + }); + }, + formatWithdrawHandlingCharge(charge, chargeType) { if (!charge || charge === '0') { return ''; } @@ -513,8 +599,9 @@ export default { /** 查询运营商列表 */ getList() { this.loading = true; - listDept(this.queryParams).then(response => { - this.deptList = this.handleTree(response.data, "deptId"); + listDept2(this.queryParams).then(response => { + this.deptList = this.handleTree(response.rows, "deptId"); + this.total = response.total; this.loading = false; }); }, @@ -550,6 +637,7 @@ export default { separateAccount: 'N', platformServiceFee: '4', handlingCharge: '5.4', + withdrawHandlingCharge: '5.4', handlingChargeType: '1', isUsePlatformApp: true, merchantId: null, @@ -559,7 +647,14 @@ export default { merchantSerialNumber: null, refundNotifyUrl: null }; + this.balance = 0, + this.form2 = { + handlingCharge: null, + withdrawHandlingCharge: null, + handlingChargeType: null, + }; this.resetForm("form"); + this.resetForm("form2"); }, /** 搜索按钮操作 */ handleQuery() { @@ -577,9 +672,9 @@ export default { this.open = true; this.title = "添加运营商"; listDept().then(response => { - console.log("response=============",response) + // console.log("response=============",response) this.deptOptions = response.data; - listArea().then(response => { + listArea({ pageNum: 1, pageSize: 999,}).then(response => { this.areaOptions = response.rows; this.form.parentId = 100; }); @@ -604,8 +699,11 @@ export default { this.form.isProfitSharing = this.form.isProfitSharing === 'true'; this.form.isUsePlatformApp = this.form.isUsePlatformApp === 'true'; console.log("userName==========="+response.data.userName) - this.form.appUserId = response.data.userName; - listArea().then(response => { + this.appUserId = this.form.appUserId; + if(response.data.userName){ + this.form.appUserId = response.data.userName; + } + listArea({ pageNum: 1, pageSize: 999}).then(response => { this.areaOptions = response.rows; }); listDeptExcludeChild(row.deptId).then(response => { @@ -617,10 +715,26 @@ export default { }); }); }, + withdraw(row){ + this.form2.method = '1'; + console.log("row",row) + this.reset(); + getDept(row.deptId).then(response => { + this.form2.deptId = response.data.deptId; + this.balance = response.data.balance; + this.withdrawHandlingCharge = response.data.withdrawHandlingCharge; + this.handlingChargeType = response.data.handlingChargeType; + this.open2 = true; + this.title2 = "申请提现"; + }); + }, /** 提交按钮 */ submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { + // console.log("this.appUserId=====",this.appUserId) + // console.log("this.form.appUserId=====",this.form.appUserId) + // this.form.appUserId = this.appUserId if (this.form.deptId != undefined) { updateDept(this.form).then(response => { this.$modal.msgSuccess("修改成功"); @@ -659,4 +773,9 @@ export default { font-size: 12px; line-height: 18px; } + .amoun-tips{ + color: red; + font-size: 12px; + font-weight: 700; + } </style> diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue index 9d6fa73..3a5bf8c 100644 --- a/src/views/system/device/index.vue +++ b/src/views/system/device/index.vue @@ -45,6 +45,22 @@ @keyup.enter.native="handleQuery" /> </el-form-item> + <el-form-item label="硬件版本" prop="hardwareVersion"> + <el-input style="width: 120px" + v-model="queryParams.hardwareVersion" + placeholder="请输入硬件版本" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="软件版本" prop="version"> + <el-input style="width: 120px" + v-model="queryParams.version" + placeholder="请输入软件版本" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> <el-form-item label="在线状态" prop="onlineStatus"> <el-select v-model="queryParams.onlineStatus" placeholder="请选择在线状态" style="width: 100px;" clearable> <el-option @@ -560,7 +576,7 @@ import LocationMap from '@/components/Map/location/LocationMap.vue'; import { getModel, listModel } from '@/api/system/model' import QrCode from "@/components/QrCode/index.vue"; import { listArea, selectAreaListByDeptId, selectDeptByAreaId } from '@/api/system/area' -import { listDept } from '@/api/system/dept' + import { listDept2 } from '@/api/system/dept' import { getHardwareVersion, listHardwareVersion } from '@/api/system/hardwareVersion' import Treeselect from '@riophae/vue-treeselect' import "@riophae/vue-treeselect/dist/vue-treeselect.css"; @@ -627,6 +643,8 @@ export default { areaId: null, onlineStatus: null, status: null, + version: null, + hardwareVersion: null, }, // 列信息 columns: [ @@ -646,8 +664,8 @@ export default { { key: 13, label: `车辆状态`, visible: true }, { key: 14, label: `锁`, visible: true }, { key: 15, label: `网络`, visible: true }, - { key: 16, label: `二维码`, visible: true }, - { key: 17, label: `创建时间`, visible: true }, + { key: 16, label: `二维码`, visible: false }, + { key: 17, label: `创建时间`, visible: false }, ], showPlaceSearchMap: false, selected: null, @@ -704,8 +722,8 @@ export default { this.userName = this.$store.state.user.name; this.getList(); if(this.userName === 'admin'){ - listDept({status: '0' }).then(response => { - this.deptOptions = response.data; + listDept2({status: '0',pageNum:1,pageSize:999 }).then(response => { + this.deptOptions = response.rows; }); listArea(this.queryParams).then(response => { this.areaOptions = response.rows; @@ -745,8 +763,11 @@ export default { let scrollTop = window.scrollY; let heightTop = this.$refs['tableSort'].$parent.$parent.$el.offsetTop; // 距离顶部高度 const headerWrapper = document.querySelector('.el-table__header-wrapper'); - if (scrollTop >= heightTop) { // 表头到达页面顶部固定表头 + // console.log("scrollTop------",scrollTop) + // console.log("heightTop------",heightTop) + if (scrollTop >= (heightTop+ 160)) { // 表头到达页面顶部固定表头 let top = scrollTop - (heightTop + 160); + // console.log("top------",top) headerWrapper.style.position = 'relative'; headerWrapper.style.zIndex = '500'; headerWrapper.style.top = `${top}px`; @@ -977,8 +998,8 @@ export default { }; this.resetForm("form"); if(this.userName === 'admin'){ - listDept({status: '0' }).then(response => { - this.deptOptions = response.data; + listDept2({status: '0',pageNum:1,pageSize:999 }).then(response => { + this.deptOptions = response.rows; }); } listModel(this.queryParams).then(response => { @@ -994,8 +1015,8 @@ export default { this.form.deptId = null; this.form.modelId = null; if(this.userName === 'admin'){ - listDept({status: '0' }).then(response => { - this.deptOptions = response.data; + listDept2({status: '0',pageNum:1,pageSize:999 }).then(response => { + this.deptOptions = response.rows; }); } listModel(this.queryParams).then(response => { @@ -1188,17 +1209,17 @@ export default { }; </script> <style lang="scss"> -.el-select { - .el-input__inner{ - color: red; - } + .el-select { + .el-input__inner{ + color: red; + } -} -.el-input{ - .el-input__inner{ - color: red; } -} + .el-input{ + .el-input__inner{ + color: red; + } + } .nav-container { display: flex; justify-content: center; diff --git a/src/views/system/withdrawAudit/index.vue b/src/views/system/withdrawAudit/index.vue index 842ebdd..3ebecb9 100644 --- a/src/views/system/withdrawAudit/index.vue +++ b/src/views/system/withdrawAudit/index.vue @@ -207,7 +207,7 @@ <script> import { listFlow, getFlow, delFlow, updateFlow, withdraw, rejectWithdraw } from '@/api/system/flow' import { optionselect as getAreaOptionselect } from '@/api/system/area' -import { getDeptByToken, listDept } from '@/api/system/dept' + import { getDeptByToken, listDept, listDept2 } from '@/api/system/dept' export default { name: "Flow", @@ -328,8 +328,8 @@ export default { this.getList(); this.getAreaList(); if(this.userName === 'admin'){ - listDept({status: '0' }).then(response => { - this.deptOptions = response.data; + listDept2({status: '0',pageNum:1,pageSize:999 }).then(response => { + this.deptOptions = response.rows; }); } },