modelChip

This commit is contained in:
磷叶 2025-03-17 10:12:07 +08:00
parent 5f44ec715b
commit e624eace6e
11 changed files with 640 additions and 13 deletions

View File

@ -10,3 +10,14 @@ export function appGetBonusDailyAmount(params) {
params
})
}
/**
* 获取商户收益统计
*/
export function appGetMchRevenue(params) {
return request({
url: '/app/dashboard/mchRevenue',
method: 'get',
params
})
}

44
src/api/ss/hardVersion.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询硬件版本列表
export function listHardVersion(query) {
return request({
url: '/ss/hardVersion/list',
method: 'get',
params: query
})
}
// 查询硬件版本详细
export function getHardVersion(id) {
return request({
url: '/ss/hardVersion/' + id,
method: 'get'
})
}
// 新增硬件版本
export function addHardVersion(data) {
return request({
url: '/ss/hardVersion',
method: 'post',
data: data
})
}
// 修改硬件版本
export function updateHardVersion(data) {
return request({
url: '/ss/hardVersion',
method: 'put',
data: data
})
}
// 删除硬件版本
export function delHardVersion(id) {
return request({
url: '/ss/hardVersion/' + id,
method: 'delete'
})
}

View File

@ -9,6 +9,14 @@ export function listModel(query) {
})
}
// 通过ids查询型号列表
export function listModelByIds(ids) {
return request({
url: `/system/model/listByIds/${ids}`,
method: 'get',
})
}
// 查询型号列表详细
export function getModel(modelId) {
return request({

View File

@ -0,0 +1,197 @@
<!--version: 4, 型号选择器-->
<!--版本更新内容添加prop属性修复多选-->
<template>
<div>
<template v-if="multiple">
<el-tag
v-for="(item,index) of selected"
:key="item.modelId"
size="small"
style="margin-right: 4px"
disable-transitions
:closable="!disabled"
@close="onCloseSelected(index)"
>{{item.modelName}}</el-tag>
<el-tag style="cursor: not-allowed" size="small" type="info" v-if="disabled">+</el-tag>
<el-tag style="cursor: pointer" size="small" @click="openDialog" type="success" v-else>+</el-tag>
</template>
<el-input
v-else
:value="inputBindValue"
@focus="openDialog"
:size="size"
:disabled="disabled"
readonly
:placeholder="placeholder">
<template #suffix>
<div class="input-suffix"></div>
<i class="el-icon-arrow-right"/>
</template>
</el-input>
<model-dialog
:show.sync="dialogShow"
:search="query"
:multiple="multiple"
:init-select="selected"
@select="onSubmit"
:title="title"/>
</div>
</template>
<script>
import {isDeepEqual} from "@/utils";
import { listModelByIds } from '@/api/system/model'
import ModelDialog from '@/components/Business/Model/modelDialog.vue'
export default {
name: 'ModelInput',
components: { ModelDialog },
props:{
//
title: {
type: String,
default: "选择型号"
},
placeholder: {
type: String,
default: "点击选择型号",
},
//
showProp: {
type: String,
default: 'modelName'
},
//
prop: {
type: String,
default: 'modelId'
},
//
multiple: {
type: Boolean,
default: false,
},
// (id)
value: {
type: [Array, String, Number],
default: null
},
//
query: {
type: Object,
default: () => ({})
},
//
beforeOpen: {
type: Function,
default: () => {
return true;
}
},
//
beforeClose: {
type: Function,
default: () => {
return true;
}
},
//
size: {
type: String,
default: "medium"
},
//
disabled: {
type: Boolean,
default: false,
},
//
objectParser: {
type: Function,
default: (obj) => {
return JSON.stringify(obj);
}
},
},
data() {
return {
selected: [], //
dialogShow: false, //
}
},
computed: {
//
inputBindValue() {
if (this.selected == null || this.selected.length === 0) {
return null;
}
return this.selected.map(item => item[this.showProp]).join(",");
}
},
watch: {
value(nv, ov) {
this.loadSelected(nv);
}
},
created() {
this.loadSelected(this.value);
},
methods: {
onCloseSelected(index) {
this.selected.splice(index, 1);
this.onSubmit(this.selected);
},
//
loadSelected(ids) {
if (ids == null || ids.length === 0) {
this.selected = [];
return;
}
if (ids instanceof Array) {
this.doLoad(ids);
} else {
this.doLoad([ids]);
}
},
//
doLoad(ids) {
listModelByIds(ids).then(res => {
this.selected = res.data;
})
},
//
inputValue(val){
this.$emit('input', val);
},
//
onSubmit(selected){
console.log(selected);
let value = null;
if (this.multiple) {
value = selected.map(item => item[this.prop]);
} else {
value = selected[this.prop];
}
this.$emit('submit', selected);
if (!isDeepEqual(this.value, value)) {
this.$emit('change', selected);
}
this.inputValue(value);
this.closeDialog();
},
closeDialog() {
if (this.beforeClose()) {
this.dialogShow = false;
}
},
//
openDialog(){
if (this.beforeOpen()) {
this.dialogShow = true;
}
}
}
}
</script>

View File

@ -18,7 +18,7 @@
@row-click="changeSelection"
@row-dblclick="select"
@select-all="selectionAll"
@select="changeSelection"
@select="handleSelect"
highlight-current-row
>
<el-table-column align="center" type="selection" v-if="multiple"></el-table-column>
@ -107,7 +107,7 @@ export default {
refreshTableSelection() {
if(this.multiple){
this.tableData.forEach(item => {
if (this.selected.map(j => j.id).includes(item.id)) {
if (this.selected.map(j => j.modelId).includes(item.modelId)) {
this.$refs.multipleTable.toggleRowSelection(item, true);
} else {
this.$refs.multipleTable.toggleRowSelection(item, false);
@ -119,10 +119,10 @@ export default {
selectionAll(val){
let flag = val.length > 0;
this.tableData.forEach(item => {
if (flag && !this.selected.map(i => i.id).includes(item.id)){
if (flag && !this.selected.map(i => i.modelId).includes(item.modelId)){
this.selected.push(item);
} else if (!flag && this.selected.map(i => i.id).includes(item.id)){
this.selected = this.selected.filter(i => i.id !== item.id);
} else if (!flag && this.selected.map(i => i.modelId).includes(item.modelId)){
this.selected = this.selected.filter(i => i.modelId !== item.modelId);
}
})
},
@ -134,12 +134,16 @@ export default {
this.select(this.row);
}
},
handleSelect(selection, row) {
this.changeSelection(row);
},
//
changeSelection(row){
console.log(row);
if(this.multiple){
if (this.selected.map(i => i.id).includes(row.id)){
if (this.selected.map(i => i.modelId).includes(row.modelId)){
this.$refs.multipleTable.toggleRowSelection(row, false);
this.selected = this.selected.filter(i => i.id !== row.id);
this.selected = this.selected.filter(i => i.modelId !== row.modelId);
}else {
this.$refs.multipleTable.toggleRowSelection(row, true);
this.selected.push(row);

View File

@ -5,7 +5,7 @@
v-if="!disabled"
:size="size"
readonly
:placeholder="placeholder"></el-input>
:placeholder="placeholder"/>
<span v-else>{{showValue}}</span>
<model-dialog

View File

@ -6,7 +6,7 @@
<el-statistic title="店铺数" :value="user.storeCount" suffix="家"/>
</el-row>
<el-row type="flex" style="margin-bottom: 1em">
<el-statistic title="总收入" :value="user.totalIncome" :precision="2" suffix="元"/>
<el-statistic title="总收入" :value="mchRevenue.totalIncome" :precision="2" suffix="元"/>
<el-statistic title="总提现" :value="user.withDrawlAmount" :precision="2" suffix="元"/>
<el-statistic title="账户余额" :value="user.balance" suffix="元" :precision="2"/>
</el-row>
@ -39,7 +39,7 @@ import { $serviceType, $withdrawServiceType } from '@/utils/mixins'
import LineField from '@/components/LineField/index.vue'
import SmUser from '@/views/system/smUser/index.vue'
import { SmUserType } from '@/utils/constants'
import { appGetMchRevenue } from '@/api/app/dashboard'
export default {
name: "MchUserProfile",
mixins: [$serviceType, $withdrawServiceType],
@ -48,7 +48,8 @@ export default {
data() {
return {
loading: false,
user: {}
user: {},
mchRevenue: {}
}
},
computed: {
@ -59,6 +60,7 @@ export default {
},
created() {
this.getUserInfo();
this.getMchRevenue();
},
methods: {
//
@ -86,6 +88,11 @@ export default {
}).finally(() => {
this.loading = false;
})
},
getMchRevenue() {
appGetMchRevenue().then(res => {
this.mchRevenue = res.data;
})
}
}
}

View File

@ -0,0 +1,323 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="版本" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入版本"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="适用型号" prop="modelId">
<model-simple-select v-model="queryParams.modelId" placeholder="请选择适用型号" @change="handleQuery" clearable/>
</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="handleAdd"
v-hasPermi="['ss:hardVersion:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ss:hardVersion:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ss:hardVersion:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="hardVersionList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
<el-table-column type="selection" width="55" align="center" />
<template v-for="column of showColumns">
<el-table-column
:key="column.key"
:label="column.label"
:prop="column.key"
:align="column.align"
:min-width="column.minWidth"
:sort-orders="orderSorts"
:sortable="column.sortable"
:show-overflow-tooltip="column.overflow"
:width="column.width"
>
<template slot-scope="d">
<template v-if="column.key === 'id'">
{{d.row[column.key]}}
</template>
<template v-else-if="column.key === 'modelIds'">
<template v-if="d.row.modelList">
{{d.row.modelList.map(item => item.modelName).join('') | dv}}
</template>
</template>
<template v-else>
{{d.row[column.key]}}
</template>
</template>
</el-table-column>
</template>
<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-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ss:hardVersion:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ss:hardVersion:remove']"
>删除</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="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="版本" prop="code">
<el-input v-model="form.code" placeholder="请输入版本" />
</el-form-item>
<el-form-item label="适用型号" prop="modelIds">
<model-input v-model="form.modelIds" multiple placeholder="请选择适用型号" />
</el-form-item>
<el-form-item label="文件" prop="fileUrl">
<image-upload v-model="form.fileUrl" placeholder="请输入文件链接" :limit="1" :file-type="['bin']"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listHardVersion, getHardVersion, delHardVersion, addHardVersion, updateHardVersion } from "@/api/ss/hardVersion";
import { $showColumns } from '@/utils/mixins';
import ModelInput from '@/components/Business/Model/ModelInput.vue';
import ModelSimpleSelect from '@/components/Business/Model/ModelSimpleSelect.vue';
//
const defaultSort = {
prop: "createTime",
order: "descending"
}
export default {
name: "HardVersion",
components: {
ModelInput,
ModelSimpleSelect
},
mixins: [$showColumns],
data() {
return {
//
columns: [
{key: 'id', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
{key: 'code', visible: true, label: '版本', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'modelIds', visible: true, label: '适用型号列表', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'fileUrl', visible: true, label: '文件链接', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
hardVersionList: [],
//
title: "",
//
open: false,
defaultSort,
//
queryParams: {
pageNum: 1,
pageSize: 20,
orderByColumn: defaultSort.prop,
isAsc: defaultSort.order,
id: null,
code: null,
remark: null,
},
//
form: {},
//
rules: {
code: [
{ required: true, message: "版本代码不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 当排序按钮被点击时触发 **/
onSortChange(column) {
if (column.order == null) {
this.queryParams.orderByColumn = defaultSort.prop;
this.queryParams.isAsc = defaultSort.order;
} else {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
}
this.getList();
},
/** 查询硬件版本列表 */
getList() {
this.loading = true;
listHardVersion(this.queryParams).then(response => {
this.hardVersionList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
code: null,
modelIds: [],
fileUrl: null,
remark: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加硬件版本";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getHardVersion(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改硬件版本";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateHardVersion(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHardVersion(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除硬件版本编号为"' + ids + '"的数据项?').then(function() {
return delHardVersion(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ss/hardVersion/export', {
...this.queryParams
}, `hardVersion_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -122,6 +122,9 @@
<template v-else-if="column.key === 'userId'">
<user-link :id="d.row.userId" :name="d.row.userName"/>
</template>
<template v-else-if="['idCardFront', 'idCardBack'].includes(column.key)">
<image-preview :src="d.row[column.key]" :width="50" :height="50"/>
</template>
<template v-else>
{{d.row[column.key]}}
</template>
@ -216,6 +219,8 @@ export default {
{key: 'mobile', visible: true, label: '手机号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'score', visible: true, label: '比对分数', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'faceImage', visible: true, label: '人脸图像', minWidth: null, sortable: false, overflow: false, align: 'center', width: null},
{key: 'idCardFront', visible: true, label: '身份证正面', minWidth: null, sortable: false, overflow: false, align: 'center', width: null},
{key: 'idCardBack', visible: true, label: '身份证反面', minWidth: null, sortable: false, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],

View File

@ -17,6 +17,11 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="芯片" prop="chip">
<el-select v-model="queryParams.chip" placeholder="请选择芯片">
<el-option v-for="option of dict.type.model_chip" :label="option.label" :value="option.value" :key="option.value"/>
</el-select>
</el-form-item>
<el-form-item label="SN前缀" prop="snPrefix">
<el-input
v-model="queryParams.snPrefix"
@ -93,6 +98,9 @@
<template v-else-if="column.key === 'serviceType'">
<dict-tag :options="dict.type.service_type" :value="d.row[column.key]"/>
</template>
<template v-else-if="column.key === 'chip'">
<dict-tag :options="dict.type.model_chip" :value="d.row[column.key]"/>
</template>
<template v-else>
{{d.row[column.key]}}
</template>
@ -158,6 +166,11 @@
<el-checkbox v-for="option of dict.type.sm_model_tag" :label="option.value" :key="option.value">{{option.label}}</el-checkbox>
</el-checkbox-group>
</form-col>
<form-col :span="span * 2" label="芯片" prop="chip">
<el-radio-group v-model="form.chip" placeholder="请选择芯片">
<el-radio v-for="option of dict.type.model_chip" :label="option.value" :key="option.value">{{option.label}}</el-radio>
</el-radio-group>
</form-col>
<form-col :span="span * 2" label="产品介绍" prop="introduce">
<el-input v-model="form.introduce" type="textarea" placeholder="请输入内容" />
</form-col>
@ -188,7 +201,7 @@ const defaultSort = {
export default {
name: "Model",
mixins: [$serviceType, $showColumns],
dicts: ['sm_model_tag', 'service_type'],
dicts: ['sm_model_tag', 'service_type', 'model_chip'],
components: { AppInput },
data() {
return {
@ -207,6 +220,7 @@ export default {
{key: 'serviceRate', visible: false, label: '默认服务费', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'snPrefix', visible: true, label: 'SN前缀', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'sort', visible: true, label: '排序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'chip', visible: true, label: '芯片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],

View File

@ -120,6 +120,14 @@
@click="handleExport"
v-hasPermi="['system:bill:export']"
>导出</el-button>
<el-button
v-if="userType === UserType.APP"
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExportApp"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -267,6 +275,7 @@ export default {
},
data() {
return {
UserType,
//
row: {},
defaultSort,
@ -477,7 +486,12 @@ export default {
handleExport() {
this.download('system/bill/export', {
...this.queryParams
}, `bill_${new Date().getTime()}.xlsx`)
}, `充值订单_${new Date().getTime()}.xlsx`)
},
handleExportApp() {
this.download('app/bill/export', {
...this.queryParams
}, `充值订单_${new Date().getTime()}.xlsx`)
}
}
};