设备接收接口调试完成

This commit is contained in:
BianLzhaoMin 2024-07-31 18:03:57 +08:00
parent d0aec00ce0
commit bea1a53543
4 changed files with 311 additions and 202 deletions

View File

@ -3,4 +3,17 @@ import request from '@/utils/request'
// 推送设备
export const pushNotificationsApi = (data) => {
return request.post('/base/machine/pushNotifications', data)
}
}
// 接收设备
export const receiveNotificationsApi = (params) => {
return request.get('/base/receive/getDataReceive', {
params
})
}
// 接收设备详情
export const receiveNotificationsDetailsApi = (params) => {
return request.get('/base/receive/getDataReceiveDetails', {
params
})
}

View File

@ -1,178 +1,250 @@
<template>
<div class="app-container">
<!-- 表单 -->
<el-form :inline="true" :model="queryForm" ref="queryForm" label-width="68px" size="small" v-show="showSearch">
<el-form-item label="关键字" prop="keyWord">
<el-input v-model="queryForm.keyWord" clearable placeholder="请输入关键字" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryForm.status" placeholder="请选择状态" filterable clearable>
<el-option label="未接收" value="0"></el-option>
<el-option label="已接收" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="推送日期" prop="pushDate">
<el-date-picker
v-model="queryForm.pushDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
<div class="app-container">
<!-- 表单 -->
<el-form
:inline="true"
:model="queryForm"
ref="queryForm"
label-width="68px"
size="small"
v-show="showSearch"
>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryForm.keyWord"
clearable
placeholder="请输入关键字"
/>
</el-form-item>
<el-form-item label="状态" prop="receiveStatus">
<el-select
v-model="queryForm.receiveStatus"
placeholder="请选择状态"
filterable
clearable
>
<el-option label="未接收" value="0"></el-option>
<el-option label="已接收" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="推送日期" prop="pushDate">
<el-date-picker
v-model="pushDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
type="primary"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" plain @click="resetQueryForm"
>重置</el-button
>
<el-button
icon="el-icon-download"
type="warning"
plain
@click="handleExport"
:loading="loading"
>导出</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
/>
</el-row>
<!-- 列表 -->
<el-table
:data="tableData"
style="width: 100%"
@selection-change="selection"
>
<el-table-column
type="selection"
width="55"
align="center"
></el-table-column>
<el-table-column
type="index"
label="序号"
width="50"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
prop="receiveDate"
label="推送日期"
align="center"
></el-table-column>
<el-table-column
prop="pushNum"
label="推送机具数量"
align="center"
></el-table-column>
<el-table-column
prop="receiveNum"
label="已接收数量"
align="center"
></el-table-column>
<el-table-column
prop="status"
label="接收状态"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
v-if="scope.row.receiveStatus == 0"
type="warning"
size="mini"
>未接收</el-tag
>
<el-tag
v-else-if="scope.row.receiveStatus == 1"
type="success"
size="mini"
>已接收</el-tag
>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<template slot-scope="{ row }">
<el-button type="text" size="mini" @click="accept(row.id)"
>接收</el-button
>
<el-button type="text" size="mini" @click="pushDetail(row)"
>明细</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-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" plain @click="resetQueryForm">重置</el-button>
<el-button icon="el-icon-download" type="warning" plain @click="handleExport" :loading="loading">导出</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 列表 -->
<el-table :data="tableData" style="width: 100%" @selection-change="selection">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column
type="index"
label="序号"
width="50"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column prop="pushDate" label="推送日期" align="center"></el-table-column>
<el-table-column prop="pushMachineryNum" label="推送机具数量" align="center"></el-table-column>
<el-table-column prop="acceptMachineryNum" label="已接收数量" align="center"></el-table-column>
<el-table-column prop="status" label="接收状态" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 0" type="danger">未接收</el-tag>
<el-tag v-else-if="scope.row.status == 1" type="success">已接收</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="accept(scope.row)">接收</el-button>
<el-button type="text" size="mini" @click="pushDetail(scope.row)">明细</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"
/>
</div>
</div>
</template>
<script>
import { receiveNotificationsApi } from '@/api/dataPush/index.js'
export default {
name: 'PushAndAccept',
data() {
return {
loading: false,
showSearch: true,
queryForm: {
keyWord: '',
status: '',
pushDate: '',
},
tableData: [
{
id: 1,
pushDate: '2021-08-01',
pushMachineryNum: 10,
acceptMachineryNum: 5,
status: 0,
name: 'PushAndAccept',
data() {
return {
loading: false,
showSearch: true,
queryForm: {
keyWord: '',
receiveStatus: '',
// pushDate: '',
},
tableData: [],
queryParams: {
pageNum: 1,
pageSize: 10,
},
total: 0,
ids: [],
pushDate: '',
}
},
mounted() {
console.log('🚀 ~ mounted ~ mounted')
this.getList()
},
methods: {
//
handleQuery() {
console.log('🚀 ~ handleQuery ~ 搜索:', this.queryForm.pushDate)
this.getList()
},
{
id: 2,
pushDate: '2021-08-02',
pushMachineryNum: 20,
acceptMachineryNum: 10,
status: 1,
//
resetQueryForm() {
console.log('🚀 ~ resetQueryForm ~ 重置:')
this.$refs.queryForm.resetFields()
this.pushDate = ''
this.getList()
},
//
handleExport() {
this.loading = true
console.log('🚀 ~ handleExport ~ 导出:')
this
.download
// '',
// {
// ...this.queryParams,
// dataCondition: this.ids,
// },
// `_${new Date().getTime()}.xlsx`
()
.then(() => {
this.loading = false
})
},
//
async getList() {
console.log(this.pushDate, '时间')
const params = {
...this.queryForm,
startTime: this.pushDate[0],
endTime: this.pushDate[1],
}
// console.log('🚀 ~ getList ~ :', params)
// (params).then(res => {
// this.tableData = res.data
// this.total = res.total
// }).catch(err => {
// console.log('🚀 ~ getList ~ err:', err
// })
const res = await receiveNotificationsApi(params)
this.tableData = res.rows
this.total = res.total
console.log(res, '接收数据')
},
//
accept(id) {
console.log('🚀 ~ accept ~ 接收:')
const params = {
id,
isDetail: false,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
pushDetail(row) {
console.log('🚀 ~ pushDetail ~ 明细:')
const params = {
id: row.id,
isDetail: true,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
selection(val) {
console.log('🚀 ~ selection ~ 选择:', val)
this.ids = val.map((item) => item.id)
},
],
queryParams: {
pageNum: 1,
pageSize: 10,
},
total: 0,
ids: [],
}
},
mounted() {
console.log('🚀 ~ mounted ~ mounted')
this.getList()
},
methods: {
//
handleQuery() {
console.log('🚀 ~ handleQuery ~ 搜索:', this.queryForm.pushDate)
this.getList()
},
//
resetQueryForm() {
console.log('🚀 ~ resetQueryForm ~ 重置:')
this.$refs.queryForm.resetFields()
this.getList()
},
//
handleExport() {
this.loading = true
console.log('🚀 ~ handleExport ~ 导出:')
this.download(
// '',
// {
// ...this.queryParams,
// dataCondition: this.ids,
// },
// `_${new Date().getTime()}.xlsx`
).then(() => {
this.loading = false
})
},
//
getList() {
const params = {
...this.queryParams,
...this.queryForm,
}
console.log('🚀 ~ getList ~ 获取列表:', params)
// (params).then(res => {
// this.tableData = res.data
// this.total = res.total
// }).catch(err => {
// console.log('🚀 ~ getList ~ err:', err
// })
},
//
accept(row) {
console.log('🚀 ~ accept ~ 接收:', row)
const params = {
id: row.id,
isDetail: false,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
pushDetail(row) {
console.log('🚀 ~ pushDetail ~ 明细:')
const params = {
id: row.id,
isDetail: true,
}
this.$router.push({ path: 'pushAndAcceptDetail', query: params })
},
//
selection(val) {
console.log('🚀 ~ selection ~ 选择:', val)
this.ids = val.map(item => item.id)
},
},
}
</script>

View File

@ -98,7 +98,7 @@
type="selection"
width="55"
align="center"
:selectable="(row) => row.status == '1'"
:selectable="(row) => row.status == 0"
/>
<el-table-column
type="index"
@ -110,91 +110,106 @@
"
/>
<el-table-column
prop="machineryNum"
prop="maCode"
label="机具编号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="machineryName"
prop="machineName"
label="机具名称"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="machineryType"
prop="typeName"
label="机具类型"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="specificationModel"
prop="modelName"
label="规格型号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="rentalDate"
prop="rentTime"
label="租赁日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="rentalPrice"
prop="rentPrice"
label="租赁价格"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="unit"
prop="unitId"
label="所属单位"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="manufacturer"
prop="supplier"
label="生产厂家"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="productionDate"
prop="checkDate"
label="出厂日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="isNewEquipment"
prop="isNew"
label="是否是新装备"
align="center"
show-overflow-tooltip
/>
>
<template slot-scope="scope">
<el-tag
v-if="scope.row.isNew == 0"
type="success"
size="mini"
></el-tag
>
<el-tag
v-else-if="scope.row.status == 1"
type="danger"
size="mini"
></el-tag
>
</template>
</el-table-column>
<el-table-column
prop="verificationNum"
prop="checkCode"
label="检验证编号"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="inspectionUnit"
prop="checkUnit"
label="检验单位"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="inspectionDate"
prop="checkDate"
label="检验日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="nextInspectionDate"
prop="nextCheckDate"
label="下次检验日期"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="machinistName"
prop="maUserName"
label="机手姓名"
align="center"
show-overflow-tooltip
@ -202,27 +217,28 @@
>
<template slot-scope="scope">
<el-button
v-if="scope.row.machinistName"
v-if="scope.row.maUserName"
type="text"
size="mini"
@click="getMachinistDetail(scope.row)"
>
{{ scope.row.machinistName }}
{{ scope.row.maUserName }}
</el-button>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
prop="status"
label="状态"
align="center"
show-overflow-tooltip
>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 0" type="danger"
<el-tag
v-if="scope.row.status == 0"
type="danger"
size="mini"
>未接收</el-tag
>
<el-tag v-else-if="scope.row.status == 1" type="success"
<el-tag
v-else-if="scope.row.status == 1"
type="success"
size="mini"
>已接收</el-tag
>
</template>
@ -307,6 +323,7 @@
</template>
<script>
import { receiveNotificationsDetailsApi } from '@/api/dataPush/index.js'
export default {
name: 'pushAndAcceptDetail',
data() {
@ -438,12 +455,19 @@ export default {
this.getList()
},
//
getList() {
const params = {
...this.queryParams,
...this.queryForm,
}
console.log('🚀 ~ getList ~ 获取列表:', params)
async getList() {
// const params = {
// ...this.queryParams,
// ...this.queryForm,
// }
const res = await receiveNotificationsDetailsApi({
receiveId: this.$route.query.id,
})
console.log(res, '接收的数据')
this.tableData = res.rows
this.total = res.total
// console.log('🚀 ~ getList ~ :', params)
},
//
getGoodsTypeList() {

View File

@ -42,11 +42,11 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
// target: `http://192.168.2.134:48080`, //超
target: `http://192.168.2.134:48080`, //超
// target: `http://10.40.92.81:8080`, //韩/
// target: `http://192.168.2.81:28080`,//旭/
// target: `http://192.168.2.248:28080`, //帅
target: `http://192.168.2.240:28080`, //福
// target: `http://192.168.2.240:28080`, //福
//******** 注意事项 ********* */
//1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target;