Commit f3377ffa by cwq0219

组件修改

1 parent 3a8f8ef9
......@@ -2,7 +2,7 @@
<template>
<div>
<el-table
:data="tableData"
:data="getListApi ? data : tableData"
v-loading="$store.state.d2admin.loading.value"
border
:highlight-current-row="true"
......@@ -16,7 +16,7 @@
:index="index=>index+(page.pageSize - 1) * page.pageCount + 1"
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
......@@ -26,23 +26,31 @@
>
<template slot-scope="scope">
<template v-if="item.tagLabel">
<el-tag
:type="tag.type[scope.row[item.prop]]"
>{{tag.label[scope.row[item.prop]]}}</el-tag>
<el-tag v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
>{{tableParams.tag.label[scope.row[item.prop]]}}
</el-tag>
<el-tag v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
>{{tableParams[item.tagName].label[scope.row[item.prop]]}}
</el-tag>
</template>
<template v-else-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else-if="getListApi">
{{data[scope.$index][item.prop]}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template>
</el-table-column>
<el-table-column
v-if="tableOption"
v-if="tableParams.tableOption"
label="操作"
:align="tableOption.align||'center'"
:width="tableOption.width||'200'"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right"
>
<template slot-scope="scope">
......@@ -58,7 +66,7 @@
:current-page="page.pageSize"
:page-sizes="[10,20,30,40]"
:page-size="page.pageCount"
:total="total"
:total="getListApi ? total : tableTotal"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
......@@ -71,43 +79,35 @@ export default {
name: 'd2-table',
data() {
return {
searchParams: {},
tableData: [],
oldValue: {},
data: [],
// 页码
page: {
pageCount: 10,
pageSize: 1
},
// currentPage: 1,
// pageSize: 10,
total: 10
}
},
props: {
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签
tag: {
type: Array,
default: () => []
},
// 搜索条件
searchForm: {
type: Object,
default: () => []
},
// 表格栏
tableColumns: {
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
// 表格操作,默认没有
tableOption: {
type: Object,
tableTotal: {
type: Number,
default: 10
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 分页,默认有
......@@ -115,32 +115,68 @@ export default {
type: Boolean,
default: true
},
// 获取列表接口
getListApi: {
type: Function,
default: null
tableParams: {
type: Object,
default: () => {
return {
// 搜索按钮id;new Date().getTime() + parseInt(Math.random() * 1000)
// btnId: {
// type: String,
// default: ''
// },
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签-默认标签名为tag;若有多个,那么需要在表格栏的列中加“tagName”
// tag: {
// type: Array,
// default: () => []
// },
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
}
}
}
}
},
watch: {
searchForm(val) {
this.searchParams = val
searchForm: {
handler(val) {
const attr = Object.keys(val).find(item => val[item] !== this.oldValue[item])
!val[attr] && this.oldValue[attr] && this.refreshTable()
this.oldValue = _.cloneDeep(val)
},
deep: true
}
},
mounted() {
this.searchParams = this.searchForm
this.refreshTable()
const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshTable)
this.getListApi && this.refreshTable()
},
methods: {
refreshTable() {
const params = {
...this.page,
...this.searchParams
...this.searchForm
}
console.log('刷新--')
// console.log(params)
this.getListApi(params).then(res => {
this.tableData = res[this.listName]
this.data = res[this.tableParams.listName]
res.pagination && (this.total = res.pagination.totalCount)
}).catch(() => {
notice.errorTips()
......@@ -150,12 +186,12 @@ export default {
// 页码
handleSizeChange(value) {
this.page.pageCount = value
this.refreshTable()
this.getListApi ? this.refreshTable() : this.$emit('refreshTable', this.page)
},
handleCurrentChange(value) {
this.page.pageSize = value
this.refreshTable()
this.getListApi ? this.refreshTable() : this.$emit('refreshTable', this.page)
}
}
}
......
......@@ -11,7 +11,6 @@
<el-input
v-model="searchForm.keyWord"
placeholder="请输入物料代码/编码/名称"
@clear="getList"
clearable
></el-input>
</el-form-item>
......@@ -19,7 +18,6 @@
<el-select
v-model="searchForm.stationCode"
placeholder="请选择所在地"
@clear="getList"
clearable
filterable
>
......@@ -35,7 +33,7 @@
<el-button
type="primary"
icon="el-icon-search"
@click="handleSearch"
:id="tableParams.btnId"
>查询</el-button>
</el-form-item>
</el-form>
......@@ -57,9 +55,7 @@
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
tableOption=true
listName='deviceList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -119,54 +115,60 @@ export default {
stationCode: ''
},
// 表格
tableData: [],
tableColumns: [
{
label: '物料代码',
prop: 'deviceNum',
width: '170'
},
{
label: '物料编码',
prop: 'deviceCode',
width: '170'
},
{
label: 'CRC物料号',
prop: 'crcCode',
width: '170'
},
{
label: '图号',
prop: 'drawNum',
width: '170'
},
{
label: '物料名称',
prop: 'deviceName',
minWidth: '200'
},
{
label: '规格',
prop: 'specifications',
width: '140'
},
{
label: '所在地',
prop: 'stationName',
width: '120'
},
{
label: '库存',
prop: 'stockCount',
width: '100'
},
{
label: '责任人',
prop: 'responsible',
width: '120'
}
],
// tableData: [],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'deviceList',
tableOption: true,
tableColumns: [
{
label: '物料代码',
prop: 'deviceNum',
width: '170'
},
{
label: '物料编码',
prop: 'deviceCode',
width: '170'
},
{
label: 'CRC物料号',
prop: 'crcCode',
width: '170'
},
{
label: '图号',
prop: 'drawNum',
width: '170'
},
{
label: '物料名称',
prop: 'deviceName',
minWidth: '200'
},
{
label: '规格',
prop: 'specifications',
width: '140'
},
{
label: '所在地',
prop: 'stationName',
width: '120'
},
{
label: '库存',
prop: 'stockCount',
width: '100'
},
{
label: '责任人',
prop: 'responsible',
width: '120'
}
]
},
baseData: {
station: []
},
......@@ -293,10 +295,6 @@ export default {
})
},
/* 接口请求-end */
// 搜索
handleSearch() {
this.getList()
},
handleEditClose() {
this.editVisible = false
......
......@@ -16,14 +16,12 @@
v-if="item.type == 'input'"
v-model="searchForm[item.model]"
:placeholder= "'请输入' + item.label"
@clear="getList"
clearable>
</el-input>
<el-select
v-else-if="item.type == 'select'"
v-model="searchForm[item.model]"
:placeholder= "'请选择' + item.label"
@clear="getList"
clearable
filterable>
<el-option
......@@ -43,17 +41,14 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="作业单列表"><auth-button category="Button"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
:tableOption="tableOption"
:tag="tag"
listName='maintainList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -154,104 +149,109 @@ export default {
// singleVal: 'creatTime',
model: 'creatTime'
}],
// 表格
tableOption: {
width: 100
},
tableColumns: [{
label: '订单编号',
prop: 'taskCode'
}, {
label: '创建时间',
prop: 'createTime'
}, {
label: '类型',
prop: 'taskType',
formatter: (cellValue) => {
if (cellValue.taskType) {
return {
1: '系统',
2: '人工'
}[cellValue.taskType]
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'maintainList',
tableOption: {
width: 100
},
tableColumns: [{
label: '订单编号',
prop: 'taskCode'
}, {
label: '创建时间',
prop: 'createTime'
}, {
label: '类型',
prop: 'taskType',
formatter: (cellValue) => {
if (cellValue.taskType) {
return {
1: '系统',
2: '人工'
}[cellValue.taskType]
}
}
}
}, {
label: '车辆编号',
prop: 'trafficCode'
}, {
label: '车辆站点',
prop: 'stationName'
}, {
label: '子系统编号',
prop: 'subsystemCode'
}, {
label: '子系统类型',
prop: 'subsystemType'
}, {
label: '故障类型',
prop: 'downType',
formatter: (cellValue) => {
if (cellValue.downType) {
return {
1: '临时维修',
2: '车辆整改',
3: '重点车次',
4: '181故障'
}[cellValue.downType]
}, {
label: '车辆编号',
prop: 'trafficCode'
}, {
label: '车辆站点',
prop: 'stationName'
}, {
label: '子系统编号',
prop: 'subsystemCode'
}, {
label: '子系统类型',
prop: 'subsystemType'
}, {
label: '故障类型',
prop: 'downType',
formatter: (cellValue) => {
if (cellValue.downType) {
return {
1: '临时维修',
2: '车辆整改',
3: '重点车次',
4: '181故障'
}[cellValue.downType]
}
}
}
}, {
label: '故障描述',
prop: 'downDescription',
width: '300'
}, {
label: '处理方式',
prop: 'treatment',
formatter: (cellValue) => {
if (cellValue.treatment) {
return {
1: '现场维修',
2: '更换'
}[cellValue.treatment]
}, {
label: '故障描述',
prop: 'downDescription',
width: '300'
}, {
label: '处理方式',
prop: 'treatment',
formatter: (cellValue) => {
if (cellValue.treatment) {
return {
1: '现场维修',
2: '更换'
}[cellValue.treatment]
}
}
}
}, {
label: '故障物料代码',
prop: 'downDeviceNum'
}, {
label: '故障物料编码',
prop: 'downDeviceCode'
}, {
label: '故障物料处理',
prop: 'downDeviceTreatment',
formatter: (cellValue) => {
if (cellValue.downDeviceTreatment) {
return {
1: '返厂维修',
2: '报废'
}[cellValue.downDeviceTreatment]
}, {
label: '故障物料代码',
prop: 'downDeviceNum'
}, {
label: '故障物料编码',
prop: 'downDeviceCode'
}, {
label: '故障物料处理',
prop: 'downDeviceTreatment',
formatter: (cellValue) => {
if (cellValue.downDeviceTreatment) {
return {
1: '返厂维修',
2: '报废'
}[cellValue.downDeviceTreatment]
}
}
}
}, {
label: '更换物料物料代码',
prop: 'replaceDeviceNum'
}, {
label: '更换物料物料编码',
prop: 'replaceDeviceCode'
}, {
label: '使用数量',
prop: 'usedCount'
}, {
label: '处理人',
prop: 'userName'
}],
}, {
label: '更换物料物料代码',
prop: 'replaceDeviceNum'
}, {
label: '更换物料物料编码',
prop: 'replaceDeviceCode'
}, {
label: '使用数量',
prop: 'usedCount'
}, {
label: '处理人',
prop: 'userName'
}]
},
getListApi: getListApi
}
},
watch: {
'creatTime'(value) {
!value && this.getList()
// !value && this.getList()
Object.assign(this.searchForm, util.formatTime(this.creatTime))
}
},
......@@ -281,8 +281,8 @@ export default {
this.$refs.table.refreshTable()
},
exportOrder() {
const params = this.getParams()
exportApi(params).then(res => {
// const params = this.getParams()
exportApi(this.searchForm).then(res => {
this.$open(res.url)
notice.okTips()
}).catch(() => {
......@@ -290,11 +290,6 @@ export default {
})
},
/* 接口请求-end */
// 搜索
handleSearch() {
this.getList()
},
handleDelete(row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
......
......@@ -8,19 +8,19 @@
slot="header"
>
<el-form-item label="订单编号">
<el-input v-model="searchForm.orderCode" placeholder="请输入订单编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.orderCode" placeholder="请输入订单编号" clearable></el-input>
</el-form-item>
<el-form-item label="订单类型">
<el-select v-model="searchForm.orderType" placeholder="请选择订单类型" @clear="getList" clearable filterable>
<el-select v-model="searchForm.orderType" placeholder="请选择订单类型" clearable filterable>
<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="searchForm.userName" placeholder="请输入申请人" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.userName" placeholder="请输入申请人" clearable></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="searchForm.status" placeholder="请选择订单状态" @clear="getList" clearable filterable>
<el-select v-model="searchForm.status" placeholder="请选择订单状态" clearable filterable>
<el-option
v-for="(item, index) in statusArr"
:key="index"
......@@ -39,17 +39,13 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="订单列表"><auth-button category="Button"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
tableOption=true
:tag="tag"
listName='orderList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -108,74 +104,63 @@ export default {
value: 5,
label: '已完成'
}],
// 表格
tag: Object.freeze({
type: ['', '', 'info', 'danger', 'warning', 'success'],
label: ['', '审批中', '审批完成', '已驳回', '待签收', '已完成']
}),
// tableData: [],
tableColumns: [{
label: '订单编号',
prop: 'orderCode',
minWidth: '200'
}, {
label: '创建时间',
prop: 'createTime',
minWidth: '180'
}, {
label: '类型',
prop: 'orderType',
width: '120',
formatter: (cellValue) => {
if (cellValue.orderType) {
return {
1: '物料申请',
2: '物料报废'
}[cellValue.orderType]
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'orderList',
tag: Object.freeze({
type: ['', '', 'info', 'danger', 'warning', 'success'],
label: ['', '审批中', '审批完成', '已驳回', '待签收', '已完成']
}),
tableOption: true,
tableColumns: [{
label: '订单编号',
prop: 'orderCode',
minWidth: '200'
}, {
label: '创建时间',
prop: 'createTime',
minWidth: '180'
}, {
label: '类型',
prop: 'orderType',
width: '120',
formatter: (cellValue) => {
if (cellValue.orderType) {
return {
1: '物料申请',
2: '物料报废'
}[cellValue.orderType]
}
}
}
}, {
label: '申请人',
prop: 'userName',
width: '140'
}, {
label: '状态',
prop: 'status',
tagLabel: true,
width: '140'
}],
}, {
label: '申请人',
prop: 'userName',
width: '140'
}, {
label: '状态',
prop: 'status',
tagLabel: true,
width: '140'
}]
},
getListApi: getListApi
}
},
watch: {
'createTime'(value) {
!value && this.getList()
Object.assign(this.searchForm, util.formatTime(this.createTime))
}
},
mounted() {},
methods: {
// test() {
// console.log('test---')
// },
// changePage() {
// this.getList()
// },
/* 接口请求-start */
getParams() {
return Object.assign(this.searchForm, util.formatTime(this.createTime))
},
getList() {
this.getParams()
this.$refs.table.refreshTable()
},
exportFile() {
const params = this.getParams()
const params = _.cloneDeep(this.searchForm)
!params.orderCode && delete params.orderCode
exportApi(params).then(res => {
this.$open(res.url)
......@@ -185,10 +170,6 @@ export default {
})
},
/* 接口请求-end */
// 搜索
handleSearch() {
this.getList()
},
handleDetailClose() {
this.pdfUrl = ''
......
......@@ -8,20 +8,25 @@
slot="header"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="物料列表"></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
listName='deviceList'
:tableParams="tableParams"
:getListApi="getListApi"
></d2-table>
<!-- <d2-table
ref="table"
:tableData="tableData"
:tableTotal="tableTotal"
:tableParams="tableParams"
@refreshTable="getList"
></d2-table> -->
</d2-container>
</template>
......@@ -37,45 +42,59 @@ export default {
},
getListApi: getListApi,
// 表格
tableData: [],
tableColumns: [{
label: '物料代码',
prop: 'deviceNum',
width: '170'
}, {
label: '物料编码',
prop: 'deviceCode',
width: '170'
}, {
label: 'CRC物料号',
prop: 'crcCode',
width: '170'
}, {
label: '图号',
prop: 'drawNum',
width: '170'
}, {
label: '物料名称',
prop: 'deviceName',
minWidth: '200'
}, {
label: '规格',
prop: 'specifications',
width: '140'
}, {
label: '责任人',
prop: 'responsible',
width: '120'
}]
// tableData: [],
// tableTotal: 10,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'deviceList',
tableColumns: [{
label: '物料代码',
prop: 'deviceNum',
width: '170'
}, {
label: '物料编码',
prop: 'deviceCode',
width: '170'
}, {
label: 'CRC物料号',
prop: 'crcCode',
width: '170'
}, {
label: '图号',
prop: 'drawNum',
width: '170'
}, {
label: '物料名称',
prop: 'deviceName',
minWidth: '200'
}, {
label: '规格',
prop: 'specifications',
width: '140'
}, {
label: '责任人',
prop: 'responsible',
width: '120'
}]
}
}
},
mounted() {},
methods: {
getList() {
this.$refs.table.refreshTable()
}
// getList(page) {
// const params = {
// ...(page || { pageCount: 10, pageSize: 1 }),
// ...this.searchForm
// }
// getListApi(params).then(res => {
// this.tableData = res.deviceList
// this.tableTotal = res.pagination.totalCount
// }).catch(() => {
// notice.errorTips()
// })
// }
}
}
......
......@@ -18,10 +18,10 @@
</el-date-picker>
</el-form-item>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable @clear="getList"></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="归属车辆段">
<el-select v-model="searchForm.stationCode" placeholder="请选择" clearable filterable @clear="getList">
<el-select v-model="searchForm.stationCode" placeholder="请选择" clearable filterable>
<el-option v-for="(item, index) in baseData.station"
:key="index"
:value="item.confCode"
......@@ -30,18 +30,16 @@
</el-select>
</el-form-item>
<el-form-item label="子系统编号">
<el-input v-model="searchForm.subSystemCode" placeholder="请输入子系统编号" clearable @clear="getList"></el-input>
<el-input v-model="searchForm.subSystemCode" placeholder="请输入子系统编号" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="上报日志列表"></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
listName='loges'
:tableParams="tableParams"
:getListApi="getListApi"
></d2-table>
</d2-container>
......@@ -65,36 +63,40 @@ export default {
stationCode: '',
subSystemCode: ''
},
tableData: [],
tableColumns: [{
label: '上报时间',
prop: 'reportTime',
minWidth: '200'
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName',
minWidth: '100'
}, {
label: '子系统编号',
prop: 'subSystemCode',
width: '160'
}, {
label: '子系统类型',
prop: 'subSystemType',
width: '100'
}, {
label: '子系统厂家',
prop: 'merchantName',
minWidth: '200'
}, {
label: '上报内容',
prop: 'reportValue',
minWidth: '200'
}],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'loges',
tableColumns: [{
label: '上报时间',
prop: 'reportTime',
minWidth: '200'
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName',
minWidth: '100'
}, {
label: '子系统编号',
prop: 'subSystemCode',
width: '160'
}, {
label: '子系统类型',
prop: 'subSystemType',
width: '100'
}, {
label: '子系统厂家',
prop: 'merchantName',
minWidth: '200'
}, {
label: '上报内容',
prop: 'reportValue',
minWidth: '200'
}]
},
baseData: {
station: []
}
......@@ -103,7 +105,7 @@ export default {
watch: {
'reportTime'(value) {
!value && this.getList()
Object.assign(this.searchForm, util.formatTime(this.reportTime))
}
},
......@@ -115,29 +117,17 @@ export default {
async loadBaseData() {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.STATION.KEY)
this.baseData.station = data
},
getList() {
Object.assign(this.searchForm, util.formatTime(this.reportTime))
this.$refs.table.refreshTable()
},
handleExport() {
Object.assign(this.searchForm, util.formatTime(this.reportTime))
exportApi(this.searchForm).then(res => {
// console.log(res)
// window.location.href = res.url
this.$open(res.url)
notice.okTips()
}).catch(() => {
notice.errorTips()
})
},
// 搜索
handleSearch() {
this.getList()
}
// 需求变更
// handleExport() {
// exportApi(this.searchForm).then(res => {
// this.$open(res.url)
// notice.okTips()
// }).catch(() => {
// notice.errorTips()
// })
// }
}
}
......
......@@ -8,7 +8,7 @@
slot="header"
>
<el-form-item label="子系统编号">
<el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" clearable></el-input>
<!-- <el-select
v-model="searchForm.subsystemCode"
placeholder="请输入子系统编号"
......@@ -27,7 +27,7 @@
</el-select> -->
</el-form-item>
<el-form-item label="类型">
<el-select v-model="searchForm.subsystemTypeCode" placeholder="请选择类型" @clear="getList" clearable filterable>
<el-select v-model="searchForm.subsystemTypeCode" placeholder="请选择类型" clearable filterable>
<el-option v-for="(item, index) in baseData.subsys"
:key="index"
:value="item.confCode"
......@@ -36,22 +36,20 @@
</el-select>
</el-form-item>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-input v-model="searchForm.merchantName" placeholder="请输入生产厂家" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.merchantName" placeholder="请输入生产厂家" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="子系统列表"><auth-button category="Button" :data="editFormReset"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
tableOption=true
listName='subsystemList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -119,40 +117,46 @@ export default {
trafficCode: '',
merchantName: ''
},
tableData: [],
tableColumns: [{
label: '子系统编号',
prop: 'subsystemCode',
width: '220'
}, {
label: '类型',
prop: 'subsystemType',
width: '120'
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '生产厂家',
prop: 'merchantName',
minWidth: '220'
}, {
label: '发送结点序列',
prop: 'sendSequence',
width: '120'
}, {
label: '发送结点接口',
prop: 'sendPort',
width: '120'
}, {
label: '网关地址',
prop: 'gatewayUrl',
width: '220'
}, {
label: '网关端口',
prop: 'gatewayPort',
width: '120'
}],
// tableData: [],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'subsystemList',
tableOption: true,
tableColumns: [{
label: '子系统编号',
prop: 'subsystemCode',
width: '220'
}, {
label: '类型',
prop: 'subsystemType',
width: '120'
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '生产厂家',
prop: 'merchantName',
minWidth: '220'
}, {
label: '发送结点序列',
prop: 'sendSequence',
width: '120'
}, {
label: '发送结点接口',
prop: 'sendPort',
width: '120'
}, {
label: '网关地址',
prop: 'gatewayUrl',
width: '220'
}, {
label: '网关端口',
prop: 'gatewayPort',
width: '120'
}]
},
// 页码
baseData: {
subsys: []
......@@ -217,10 +221,6 @@ export default {
})
},
/* 接口请求-end */
// 搜索
// handleSearch() {
// this.getList()
// },
handleEditClose() {
this.editVisible = !this.editVisible
......
......@@ -27,10 +27,10 @@
label-width="100px"
>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="归属车辆段">
<el-select v-model="searchForm.stationCode" placeholder="请选择归属车辆段" @clear="getList" filterable clearable>
<el-select v-model="searchForm.stationCode" placeholder="请选择归属车辆段" filterable clearable>
<el-option v-for="(item, index) in baseData.station"
:key="index"
:value="item.confCode"
......@@ -39,25 +39,22 @@
</el-select>
</el-form-item>
<el-form-item label="子系统编号">
<el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.subsystemCode" placeholder="请输入子系统编号" clearable></el-input>
</el-form-item>
<el-form-item label="子系统状态">
<el-select v-model="searchForm.onlineStatus" placeholder="请选择子系统状态" @clear="getList" filterable clearable>
<el-select v-model="searchForm.onlineStatus" placeholder="请选择子系统状态" filterable clearable>
<el-option value="1" label="在网"></el-option>
<el-option value="2" label="离网"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="子系统状态列表"><auth-button category="Button"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
:tag="tag"
listName='subsystemList'
:tableParams="tableParams"
:getListApi="getListApi"
></d2-table>
</div>
......@@ -73,10 +70,6 @@ export default {
data() {
return {
subSystemRadio: '全部',
tag: Object.freeze({
type: ['', 'success', 'info'],
label: ['', '在网', '离网']
}),
// 绘图
totalECharts: '',
totalOptions: {
......@@ -152,31 +145,40 @@ export default {
onlineStatus: ''
},
// 表格
tableData: [],
tableColumns: [{
label: '子系统编号',
prop: 'subsystemCode',
width: '160'
}, {
label: '子系统类型',
prop: 'subsystemType',
width: '120'
}, {
label: '子系统状态',
prop: 'onlineStatus',
width: '160',
tagLabel: true
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName'
}, {
label: '故障内容',
prop: 'errorCode'
}],
// tableData: [],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'subsystemList',
tag: Object.freeze({
type: ['', 'success', 'info'],
label: ['', '在网', '离网']
}),
tableColumns: [{
label: '子系统编号',
prop: 'subsystemCode',
width: '160'
}, {
label: '子系统类型',
prop: 'subsystemType',
width: '120'
}, {
label: '子系统状态',
prop: 'onlineStatus',
width: '160',
tagLabel: true
}, {
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName'
}, {
label: '故障内容',
prop: 'errorCode'
}]
},
baseData: {
station: [],
subsys: []
......@@ -203,9 +205,6 @@ export default {
this.baseData.subsys.unshift({ confCode: '', confValue: '全部' })
},
getList() {
this.$refs.table.refreshTable()
},
getPie(label = '') {
const params = {
subsystemTypeCode: label ? this.baseData.subsys.find(item => item.confValue === label).confCode : ''
......
......@@ -8,10 +8,10 @@
slot="header"
>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="归属车辆段">
<el-select v-model="searchForm.stationCode" placeholder="请选择归属车辆段" @clear="getList" clearable filterable>
<el-select v-model="searchForm.stationCode" placeholder="请选择归属车辆段" clearable filterable>
<el-option v-for="(item, index) in baseData.station"
:key="index"
:value="item.confCode"
......@@ -20,19 +20,17 @@
</el-select>
</el-form-item>
<el-form-item label="维修承包商">
<el-input v-model="searchForm.merchantName" placeholder="请输入维修承包商" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.merchantName" placeholder="请输入维修承包商" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="车辆列表"><auth-button category="Button" :data="editFormReset"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
tableOption=true
listName='trafficList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -89,32 +87,36 @@ export default {
openType: ''
},
// 表格
tableData: [],
tableColumns: [{
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName',
minWidth: '220'
}, {
label: '维修承包商',
prop: 'merchantName',
minWidth: '220'
}, {
label: '接口开放',
prop: 'openType',
width: '80px',
formatter: (cellValue) => {
if (cellValue.openType) {
return {
1: '是',
2: '否'
}[cellValue.openType]
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'trafficList',
tableOption: true,
tableColumns: [{
label: '车辆编号',
prop: 'trafficCode',
width: '120'
}, {
label: '归属车辆段',
prop: 'stationName',
minWidth: '220'
}, {
label: '维修承包商',
prop: 'merchantName',
minWidth: '220'
}, {
label: '接口开放',
prop: 'openType',
width: '80px',
formatter: (cellValue) => {
if (cellValue.openType) {
return {
1: '是',
2: '否'
}[cellValue.openType]
}
}
}
}],
}]
},
baseData: {
station: []
},
......@@ -153,10 +155,6 @@ export default {
})
},
/* 接口请求-end */
// 搜索
handleSearch() {
this.getList()
},
handleEditClose() {
this.editVisible = !this.editVisible
......
......@@ -8,10 +8,10 @@
slot="header"
>
<el-form-item label="用户">
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" @clear="getList" clearable></el-input>
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" clearable></el-input>
</el-form-item>
<el-form-item label="登录方式">
<el-select v-model="searchForm.loginType" placeholder="请选择" @clear="getList" clearable filterable>
<el-select v-model="searchForm.loginType" placeholder="请选择" clearable filterable>
<el-option label="PC" value="1"></el-option>
<el-option label="小程序" value="2"></el-option>
</el-select>
......@@ -27,15 +27,14 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="登录日志列表"></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
listName='loges'
:tableParams="tableParams"
:getListApi="getListApi"
></d2-table>
</d2-container>
......@@ -56,46 +55,45 @@ export default {
userName: '',
loginType: ''
},
tableData: [],
tableColumns: [{
label: '登录时间',
prop: 'loginTime',
width: '200px'
}, {
label: '登录用户',
prop: 'loginName'
}, {
label: '姓名',
prop: 'userName'
}, {
label: '联系电话',
prop: 'mobile',
width: '180px'
}, {
label: '登录方式',
prop: 'loginTypeValue'
}, {
label: '登录设备',
prop: 'deviceCode',
width: '300px'
}]
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'loges',
tableColumns: [{
label: '登录时间',
prop: 'loginTime',
width: '200px'
}, {
label: '登录用户',
prop: 'loginName'
}, {
label: '姓名',
prop: 'userName'
}, {
label: '联系电话',
prop: 'mobile',
width: '180px'
}, {
label: '登录方式',
prop: 'loginTypeValue'
}, {
label: '登录设备',
prop: 'deviceCode',
width: '300px'
}]
}
}
},
watch: {
'loginTime'(value) {
!value && this.getList()
Object.assign(this.searchForm, util.formatTime(this.loginTime))
}
},
mounted() {},
methods: {
getList() {
Object.assign(this.searchForm, util.formatTime(this.loginTime))
this.$refs.table.refreshTable()
}
}
methods: {}
}
</script>
......
<!-- 权限管理 -->
<template>
<d2-container class="role">
<d2-table-header title="角色列表"><auth-button category="action" label="创建角色"></auth-button></d2-table-header>
<d2-table-header title="角色列表"><auth-button category="action" label="创建角色"></auth-button></d2-table-header>
<d2-table
ref="table"
:tableColumns="tableColumns"
tableOption=true
listName='roles'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -39,20 +37,26 @@ export default {
editVisible: false,
// 表格
pagination: false,
tableColumns: Object.freeze([
{
label: '角色名称',
prop: 'roleName'
},
{
label: '描述',
prop: 'description'
},
{
label: '创建时间',
prop: 'createTime'
}
])
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'roles',
tableOption: true,
tableColumns: Object.freeze([
{
label: '角色名称',
prop: 'roleName'
},
{
label: '描述',
prop: 'description'
},
{
label: '创建时间',
prop: 'createTime'
}
])
}
}
},
mounted() {
......
......@@ -3,13 +3,13 @@
<d2-container class="user">
<el-form :inline="true" :model="searchForm" label-width="85px" slot="header">
<el-form-item label="用户:">
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" @clear="getUserList" clearable></el-input>
<el-input v-model="searchForm.userName" placeholder="请输入用户名/姓名/联系电话" clearable></el-input>
</el-form-item>
<el-form-item label="所属公司:">
<el-input v-model="searchForm.companyName" placeholder="请输入公司名" @clear="getUserList" clearable></el-input>
<el-input v-model="searchForm.companyName" placeholder="请输入公司名" clearable></el-input>
</el-form-item>
<el-form-item label="角色:">
<el-select v-model="searchForm.roleId" clearable placeholder="请选择" @clear="getUserList">
<el-select v-model="searchForm.roleId" clearable placeholder="请选择">
<el-option
:label="role.roleName"
:value="role.roleId"
......@@ -19,13 +19,13 @@
</el-select>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="searchForm.usedStatus" clearable placeholder="请选择状态" @clear="getUserList">
<el-select v-model="searchForm.usedStatus" clearable placeholder="请选择状态">
<el-option label="可用" value="1"></el-option>
<el-option label="不可用/删除" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属站点:">
<el-select v-model="searchForm.stationCode" clearable placeholder="请选择" @clear="getUserList" >
<el-select v-model="searchForm.stationCode" clearable placeholder="请选择" >
<el-option
:label="station.confValue"
:value="station.confCode"
......@@ -35,7 +35,7 @@
</el-select>
</el-form-item>
<el-form-item label="职务:">
<el-select v-model="searchForm.postCode" clearable placeholder="请选择" @clear="getUserList">
<el-select v-model="searchForm.postCode" clearable placeholder="请选择">
<el-option
:label="post.confValue"
:value="post.confCode"
......@@ -55,17 +55,14 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button type="primary" icon="el-icon-search" :id="tableParams.btnId">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="用户列表"><auth-button category="action" label="创建用户"></auth-button></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableColumns="tableColumns"
tableOption=true
:tag="tag"
listName='userList'
:tableParams="tableParams"
:getListApi="getListApi"
>
<auth-button
......@@ -102,11 +99,6 @@ export default {
return {
getListApi: UserList,
key: new Date(),
tag: Object.freeze({
effect: 'dark',
type: ['', 'success', 'info', 'danger', 'warning'],
label: ['未知', '正常', '已过期', '禁用', '待审核']
}),
mapping: Object.freeze({
field: 'status',
'1': ['重置密码', '编辑', '延期', '禁用'],
......@@ -129,57 +121,68 @@ export default {
companyName: '',
status: '',
stationCode: '',
postCode: ''
postCode: '',
startTime: '',
endTime: ''
},
searchTimes: [],
// 表格
// tableData: [],
tableColumns: [{
label: '用户名',
prop: 'loginName',
width: '200'
}, {
label: '角色',
prop: 'roleName',
width: '140'
}, {
label: '注册时间',
prop: 'registerTime',
width: '200'
}, {
label: '有效期',
prop: 'validTime',
width: '200'
}, {
label: '状态',
prop: 'status',
width: '100',
tagLabel: true
}, {
label: '姓名',
prop: 'userName',
width: '120'
}, {
label: '联系电话',
prop: 'mobile',
width: '200'
}, {
label: '所属公司',
prop: 'companyName',
width: '200'
}, {
label: '部门',
prop: 'departName',
width: '200'
}, {
label: '职务',
prop: 'postName',
width: '200'
}, {
label: '所属站点',
prop: 'stationName',
width: '200'
}],
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'userList',
tag: Object.freeze({
type: ['', 'success', 'info', 'danger', 'warning'],
label: ['未知', '正常', '已过期', '禁用', '待审核']
}),
tableOption: true,
tableColumns: [{
label: '用户名',
prop: 'loginName',
width: '200'
}, {
label: '角色',
prop: 'roleName',
width: '140'
}, {
label: '注册时间',
prop: 'registerTime',
width: '200'
}, {
label: '有效期',
prop: 'validTime',
width: '200'
}, {
label: '状态',
prop: 'status',
width: '100',
tagLabel: true
}, {
label: '姓名',
prop: 'userName',
width: '120'
}, {
label: '联系电话',
prop: 'mobile',
width: '200'
}, {
label: '所属公司',
prop: 'companyName',
width: '200'
}, {
label: '部门',
prop: 'departName',
width: '200'
}, {
label: '职务',
prop: 'postName',
width: '200'
}, {
label: '所属站点',
prop: 'stationName',
width: '200'
}]
},
/* -----------------------基础数据---------------------- */
baseData: {
// 所属站点
......@@ -194,7 +197,7 @@ export default {
watch: {
'searchTimes'(value) {
!value && this.getUserList()
Object.assign(this.searchForm, util.formatTime(this.searchTimes))
},
'$store.state.d2admin.base.role'(value) {
this.baseData.roles = value
......@@ -226,7 +229,7 @@ export default {
},
/* 接口请求-start */
getUserList() {
Object.assign(this.searchForm, util.formatTime(this.searchTimes))
// Object.assign(this.searchForm, util.formatTime(this.searchTimes))
this.$refs.table.refreshTable()
},
filterTag(value, row) {
......@@ -241,9 +244,9 @@ export default {
}
this.openDialog(row)
},
async handleSearch() {
this.getUserList()
},
// async handleSearch() {
// this.getUserList()
// },
handleEdit(row) {
row = util.deepClone(row)
row.data = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!