modelChip
This commit is contained in:
parent
5f44ec715b
commit
e624eace6e
|
@ -10,3 +10,14 @@ export function appGetBonusDailyAmount(params) {
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商户收益统计
|
||||||
|
*/
|
||||||
|
export function appGetMchRevenue(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/dashboard/mchRevenue',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
44
src/api/ss/hardVersion.js
Normal file
44
src/api/ss/hardVersion.js
Normal 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'
|
||||||
|
})
|
||||||
|
}
|
|
@ -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) {
|
export function getModel(modelId) {
|
||||||
return request({
|
return request({
|
||||||
|
|
197
src/components/Business/Model/ModelInput.vue
Normal file
197
src/components/Business/Model/ModelInput.vue
Normal 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>
|
|
@ -18,7 +18,7 @@
|
||||||
@row-click="changeSelection"
|
@row-click="changeSelection"
|
||||||
@row-dblclick="select"
|
@row-dblclick="select"
|
||||||
@select-all="selectionAll"
|
@select-all="selectionAll"
|
||||||
@select="changeSelection"
|
@select="handleSelect"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
>
|
>
|
||||||
<el-table-column align="center" type="selection" v-if="multiple"></el-table-column>
|
<el-table-column align="center" type="selection" v-if="multiple"></el-table-column>
|
||||||
|
@ -107,7 +107,7 @@ export default {
|
||||||
refreshTableSelection() {
|
refreshTableSelection() {
|
||||||
if(this.multiple){
|
if(this.multiple){
|
||||||
this.tableData.forEach(item => {
|
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);
|
this.$refs.multipleTable.toggleRowSelection(item, true);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.multipleTable.toggleRowSelection(item, false);
|
this.$refs.multipleTable.toggleRowSelection(item, false);
|
||||||
|
@ -119,10 +119,10 @@ export default {
|
||||||
selectionAll(val){
|
selectionAll(val){
|
||||||
let flag = val.length > 0;
|
let flag = val.length > 0;
|
||||||
this.tableData.forEach(item => {
|
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);
|
this.selected.push(item);
|
||||||
} else if (!flag && this.selected.map(i => i.id).includes(item.id)){
|
} else if (!flag && this.selected.map(i => i.modelId).includes(item.modelId)){
|
||||||
this.selected = this.selected.filter(i => i.id !== item.id);
|
this.selected = this.selected.filter(i => i.modelId !== item.modelId);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -134,12 +134,16 @@ export default {
|
||||||
this.select(this.row);
|
this.select(this.row);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleSelect(selection, row) {
|
||||||
|
this.changeSelection(row);
|
||||||
|
},
|
||||||
// 更换某一行的选中状态
|
// 更换某一行的选中状态
|
||||||
changeSelection(row){
|
changeSelection(row){
|
||||||
|
console.log(row);
|
||||||
if(this.multiple){
|
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.$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 {
|
}else {
|
||||||
this.$refs.multipleTable.toggleRowSelection(row, true);
|
this.$refs.multipleTable.toggleRowSelection(row, true);
|
||||||
this.selected.push(row);
|
this.selected.push(row);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
v-if="!disabled"
|
v-if="!disabled"
|
||||||
:size="size"
|
:size="size"
|
||||||
readonly
|
readonly
|
||||||
:placeholder="placeholder"></el-input>
|
:placeholder="placeholder"/>
|
||||||
<span v-else>{{showValue}}</span>
|
<span v-else>{{showValue}}</span>
|
||||||
|
|
||||||
<model-dialog
|
<model-dialog
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<el-statistic title="店铺数" :value="user.storeCount" suffix="家"/>
|
<el-statistic title="店铺数" :value="user.storeCount" suffix="家"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" style="margin-bottom: 1em">
|
<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.withDrawlAmount" :precision="2" suffix="元"/>
|
||||||
<el-statistic title="账户余额" :value="user.balance" suffix="元" :precision="2"/>
|
<el-statistic title="账户余额" :value="user.balance" suffix="元" :precision="2"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -39,7 +39,7 @@ import { $serviceType, $withdrawServiceType } from '@/utils/mixins'
|
||||||
import LineField from '@/components/LineField/index.vue'
|
import LineField from '@/components/LineField/index.vue'
|
||||||
import SmUser from '@/views/system/smUser/index.vue'
|
import SmUser from '@/views/system/smUser/index.vue'
|
||||||
import { SmUserType } from '@/utils/constants'
|
import { SmUserType } from '@/utils/constants'
|
||||||
|
import { appGetMchRevenue } from '@/api/app/dashboard'
|
||||||
export default {
|
export default {
|
||||||
name: "MchUserProfile",
|
name: "MchUserProfile",
|
||||||
mixins: [$serviceType, $withdrawServiceType],
|
mixins: [$serviceType, $withdrawServiceType],
|
||||||
|
@ -48,7 +48,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
user: {}
|
user: {},
|
||||||
|
mchRevenue: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -59,6 +60,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
|
this.getMchRevenue();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 修改默认设备服务费
|
// 修改默认设备服务费
|
||||||
|
@ -86,6 +88,11 @@ export default {
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getMchRevenue() {
|
||||||
|
appGetMchRevenue().then(res => {
|
||||||
|
this.mchRevenue = res.data;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
323
src/views/ss/hardVersion/index.vue
Normal file
323
src/views/ss/hardVersion/index.vue
Normal 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>
|
|
@ -122,6 +122,9 @@
|
||||||
<template v-else-if="column.key === 'userId'">
|
<template v-else-if="column.key === 'userId'">
|
||||||
<user-link :id="d.row.userId" :name="d.row.userName"/>
|
<user-link :id="d.row.userId" :name="d.row.userName"/>
|
||||||
</template>
|
</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>
|
<template v-else>
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</template>
|
||||||
|
@ -216,6 +219,8 @@ export default {
|
||||||
{key: 'mobile', visible: true, label: '手机号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{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: '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: '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],
|
orderSorts: ['ascending', 'descending', null],
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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-form-item label="SN前缀" prop="snPrefix">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.snPrefix"
|
v-model="queryParams.snPrefix"
|
||||||
|
@ -93,6 +98,9 @@
|
||||||
<template v-else-if="column.key === 'serviceType'">
|
<template v-else-if="column.key === 'serviceType'">
|
||||||
<dict-tag :options="dict.type.service_type" :value="d.row[column.key]"/>
|
<dict-tag :options="dict.type.service_type" :value="d.row[column.key]"/>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="column.key === 'chip'">
|
||||||
|
<dict-tag :options="dict.type.model_chip" :value="d.row[column.key]"/>
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</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 v-for="option of dict.type.sm_model_tag" :label="option.value" :key="option.value">{{option.label}}</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</form-col>
|
</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">
|
<form-col :span="span * 2" label="产品介绍" prop="introduce">
|
||||||
<el-input v-model="form.introduce" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.introduce" type="textarea" placeholder="请输入内容" />
|
||||||
</form-col>
|
</form-col>
|
||||||
|
@ -188,7 +201,7 @@ const defaultSort = {
|
||||||
export default {
|
export default {
|
||||||
name: "Model",
|
name: "Model",
|
||||||
mixins: [$serviceType, $showColumns],
|
mixins: [$serviceType, $showColumns],
|
||||||
dicts: ['sm_model_tag', 'service_type'],
|
dicts: ['sm_model_tag', 'service_type', 'model_chip'],
|
||||||
components: { AppInput },
|
components: { AppInput },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -207,6 +220,7 @@ export default {
|
||||||
{key: 'serviceRate', visible: false, label: '默认服务费', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{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: '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: '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],
|
orderSorts: ['ascending', 'descending', null],
|
||||||
|
|
|
@ -120,6 +120,14 @@
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['system:bill:export']"
|
v-hasPermi="['system:bill:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="userType === UserType.APP"
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExportApp"
|
||||||
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -267,6 +275,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
UserType,
|
||||||
// 当前选中行
|
// 当前选中行
|
||||||
row: {},
|
row: {},
|
||||||
defaultSort,
|
defaultSort,
|
||||||
|
@ -477,7 +486,12 @@ export default {
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('system/bill/export', {
|
this.download('system/bill/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `bill_${new Date().getTime()}.xlsx`)
|
}, `充值订单_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
handleExportApp() {
|
||||||
|
this.download('app/bill/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `充值订单_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user