故障上报、订单、商户合作申请

This commit is contained in:
墨大叔 2024-05-05 17:10:21 +08:00
parent 7b648de997
commit 24462ed7d5
8 changed files with 430 additions and 32 deletions

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

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备故障列表
export function listAbnormal(query) {
return request({
url: '/ss/abnormal/list',
method: 'get',
params: query
})
}
// 查询设备故障详细
export function getAbnormal(abnormalId) {
return request({
url: '/ss/abnormal/' + abnormalId,
method: 'get'
})
}
// 新增设备故障
export function addAbnormal(data) {
return request({
url: '/ss/abnormal',
method: 'post',
data: data
})
}
// 修改设备故障
export function updateAbnormal(data) {
return request({
url: '/ss/abnormal',
method: 'put',
data: data
})
}
// 删除设备故障
export function delAbnormal(abnormalId) {
return request({
url: '/ss/abnormal/' + abnormalId,
method: 'delete'
})
}

View File

@ -61,6 +61,7 @@ export default {
province: component.province,
city: component.city === '' ? '市辖区' : component.city,
county: component.district,
name: component.street + component.streetNumber
}
},
onSelectChange(addr) {
@ -73,6 +74,7 @@ export default {
province: data.pname,
city: data.cityname === data.pname ? '市辖区' : data.cityname,
county: data.adname,
name: data.address + data.name,
}
},
//

View File

@ -0,0 +1,296 @@
<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="deviceNo">
<el-input
v-model="queryParams.deviceNo"
placeholder="请输入设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入联系电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.ss_abnormal_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ss:abnormal:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="abnormalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="abnormalId" width="50" />
<el-table-column label="设备编号" align="center" prop="deviceNo" />
<el-table-column label="提交用户" align="center" prop="userName" />
<el-table-column label="故障描述" align="center" prop="content" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="联系电话" align="center" prop="mobile" />
<el-table-column label="联系地址" align="center" prop="address" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.ss_abnormal_status" :value="scope.row.status"/>
</template>
</el-table-column>
<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-view"
@click="handleView(scope.row)"
v-hasPermi="['ss:abnormal:edit']"
>查看详情</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="deviceNo">
<el-input v-model="form.deviceNo" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="故障描述">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="联系地址" prop="address">
<el-input v-model="form.address" placeholder="请输入联系地址" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.ss_abnormal_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</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 { listAbnormal, getAbnormal, delAbnormal, addAbnormal, updateAbnormal } from "@/api/ss/abnormal";
export default {
name: "Abnormal",
dicts: ['ss_abnormal_status'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
abnormalList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
abnormalId: null,
deviceNo: null,
content: null,
name: null,
mobile: null,
address: null,
status: null,
},
//
form: {},
//
rules: {
deviceNo: [
{ required: true, message: "设备编号不能为空", trigger: "blur" }
],
content: [
{ required: true, message: "故障描述不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "状态不能为空", trigger: "change" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备故障列表 */
getList() {
this.loading = true;
listAbnormal(this.queryParams).then(response => {
this.abnormalList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
abnormalId: null,
deviceNo: null,
content: null,
name: null,
mobile: null,
address: null,
status: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
deleted: 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.abnormalId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备故障";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const abnormalId = row.abnormalId || this.ids
getAbnormal(abnormalId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备故障";
});
},
//
handleView(row) {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.abnormalId != null) {
updateAbnormal(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAbnormal(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const abnormalIds = row.abnormalId || this.ids;
this.$modal.confirm('是否确认删除设备故障编号为"' + abnormalIds + '"的数据项?').then(function() {
return delAbnormal(abnormalIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ss/abnormal/export', {
...this.queryParams
}, `abnormal_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -89,7 +89,11 @@
{{d.row.businessTimeStart}} {{d.row.businessTimeEnd}}
</template>
</el-table-column>
<el-table-column label="门店地址" align="center" prop="address" />
<el-table-column label="门店地址" align="center">
<template slot-scope="d">
{{d.row.province}}{{d.row.city}}{{d.row.county}}{{d.row.address}}
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -127,7 +131,7 @@
<user-input v-model="form.userId" :query="userQuery"/>
</form-col>
<form-col label="店铺图片" prop="picture" :span="span * 2">
<image-upload v-model="form.picture"/>
<image-upload v-model="form.picture" :limit="1"/>
</form-col>
<form-col label="店铺名称" prop="name" :span="span * 2">
<el-input v-model="form.name" placeholder="请输入店铺名称" />
@ -156,11 +160,23 @@
placeholder="请选择营业时间范围">
</el-time-picker>
</form-col>
<form-col label="定位" prop="address" :span="span * 2">
<el-input :value="form.address" placeholder="请选择店铺地址" @focus="showPlaceSearchMap = true"/>
<form-col label="定位地址" prop="address" :span="span * 2">
<el-input v-model="form.address" placeholder="请输入店铺地址">
<template #prepend>
<div>
{{form.province}}{{form.city}}{{form.county}}
</div>
</template>
<template #append>
<el-button @click="showPlaceSearchMap = true" icon="el-icon-location">选择定位</el-button>
</template>
</el-input>
</form-col>
<form-col label="详细地址" prop="specificAddress" :span="span * 2">
<el-input v-model="form.specificAddress" placeholder="请输入详细地址"/>
<form-col label="联系人" prop="contactName" :span="span">
<el-input v-model="form.contactName" placeholder="请输入联系人"/>
</form-col>
<form-col label="联系电话" prop="contactMobile" :span="span">
<el-input v-model="form.contactMobile" placeholder="请输入联系电话" maxlength="11" show-word-limit/>
</form-col>
</el-row>
</el-form>
@ -232,14 +248,20 @@ export default {
{ required: true, message: "店铺名称不能为空", trigger: "change" }
],
address: [
{ required: true, message: "详细地址不能为空", trigger: "change" }
{ required: true, message: "定位地址不能为空", trigger: "change" }
],
type: [
{ required: true, message: "详细地址不能为空", trigger: "change" }
{ required: true, message: "店铺类型不能为空", trigger: "change" }
],
businessTimeStart: [
{ required: true, message: "营业时间不允许为空", trigger: "change" }
],
contactName: [
{ required: true, message: "联系人不允许为空", trigger: "change" }
],
contactMobile: [
{ required: true, message: "联系电话不允许为空", trigger: "change" }
],
},
showPlaceSearchMap: false,
span: 12,
@ -270,12 +292,13 @@ export default {
methods: {
parseTime,
onSubmitAddress(addr) {
this.form.address = addr.address;
this.form.address = addr.name;
this.form.lat = addr.lat;
this.form.lng = addr.lng;
this.form.province = addr.province;
this.form.city = addr.city;
this.form.county = addr.county;
this.form.specificAddress = addr.name;
},
/** 查询商户列表列表 */
getList() {
@ -302,9 +325,9 @@ export default {
specificAddress: null,
businessTimeStart: "08:00",
businessTimeEnd: "18:00",
province: null,
city: null,
county: null,
province: "福建省",
city: "宁德市",
county: "福鼎市",
lng: null,
lat: null,
createTime: null,

View File

@ -79,7 +79,7 @@
<el-table v-loading="loading" :data="suitList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="套餐id" align="center" prop="suitId" width="50"/>
<el-table-column label="ID" align="center" prop="suitId" width="50"/>
<el-table-column label="设备" align="center" prop="deviceName" />
<el-table-column label="套餐名称" align="center" prop="name" />
<el-table-column label="通电时间" align="center" prop="value" >

View File

@ -18,9 +18,12 @@
<el-descriptions-item label="MAC">{{deviceData.mac | defaultValue}}
<dict-tag :options="dict.type.sm_device_status" :value="deviceData.status" size="mini"/>
</el-descriptions-item>
<el-descriptions-item label="型号" span="2">
<el-descriptions-item label="型号">
<el-link type="primary" href="#">{{deviceData.model | defaultValue}}</el-link>
</el-descriptions-item>
<el-descriptions-item label="型号标签">
<dict-tag :options="dict.type.sm_model_tag" :value="deviceData.modelTags" size="mini"/>
</el-descriptions-item>
<el-descriptions-item label="所属用户">{{deviceData.userName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="分组">{{deviceData.groupName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="备注">{{deviceData.remark | defaultValue}}</el-descriptions-item>
@ -89,7 +92,7 @@ import TenantList from "@/views/system/device/components/tenantList.vue";
export default {
name: 'deviceDetail',
components: {TenantList, ResetRecord, BindRecord, ReadingRecord, MeterRecordReport, QrCode, RechargeRecord, LineChart},
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way'],
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag'],
data() {
return {
loading: false,

View File

@ -82,6 +82,9 @@
<el-table-column label="型号id" align="center" prop="modelId" />
<el-table-column label="型号名称" align="center" prop="modelName" />
<el-table-column label="型号" align="center" prop="model" />
<el-table-column label="型号标签" align="center" prop="tags">
<dict-tag slot-scope="d" :value="d.row.tags" :options="dict.type.sm_model_tag"/>
</el-table-column>
<el-table-column label="累计激活" align="center" prop="activationCount" />
<el-table-column label="图片" align="center" prop="picture" width="100">
<template slot-scope="scope">
@ -133,13 +136,26 @@
<el-input v-model="form.modelName" placeholder="请输入型号名称" />
</el-form-item>
<el-form-item label="型号" prop="model">
<el-input v-model="form.model" placeholder="请输入型号" />
<el-input v-model="form.model" placeholder="请输入型号" :disabled="isEdit" />
</el-form-item>
<el-form-item label="型号标签" prop="tags">
<el-select v-model="form.tags" placeholder="请选择型号标签" style="width: 100%" :disabled="isEdit" multiple>
<el-option
v-for="option of dict.type.sm_model_tag"
:label="option.label"
:key="option.value"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item label="图片" prop="picture">
<image-upload v-model="form.picture"/>
</el-form-item>
<el-form-item label="识别码" prop="idCode">
<el-input v-model="form.idCode" placeholder="请输入识别码" />
<el-input v-model="form.idCode" placeholder="请输入识别码" :disabled="isEdit"/>
</el-form-item>
<el-form-item label="硬件版本" prop="versionId">
<el-input v-model="form.versionId" placeholder="请输入硬件版本" :disabled="isEdit"/>
</el-form-item>
<el-form-item label="产品介绍" prop="introduce">
<el-input v-model="form.introduce" type="textarea" placeholder="请输入内容" />
@ -161,6 +177,7 @@ import {listModel, getModel, addModel, updateModel, logicDelModel} from "@/api/s
export default {
name: "Model",
dicts: ['sm_model_tag'],
data() {
return {
//
@ -194,9 +211,27 @@ export default {
form: {},
//
rules: {
modelName: [
{ required: true, message: "型号名称不能为空", trigger: "blur" }
],
model: [
{ required: true, message: "型号不能为空", trigger: "blur" }
],
idCode: [
{ required: true, message: "识别码不能为空", trigger: "blur" }
],
tags: [
{ required: true, message: "型号标签不能为空", trigger: "blur" },
{ min: 1, type: 'array', message: "型号标签不能为空", trigger: "blur" }
]
}
};
},
computed: {
isEdit() {
return this.title === "修改型号列表";
}
},
created() {
this.getList();
},

View File

@ -17,10 +17,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="房东(到账用户)" label-width="120" prop="landlordId">
<el-form-item label="商户(到账用户)" label-width="120" prop="landlordId">
<el-input
v-model="queryParams.landlordName"
placeholder="请输入房东"
placeholder="请输入商户"
clearable
@keyup.enter.native="handleQuery"
/>
@ -50,32 +50,27 @@
<el-table-column label="主键" align="center" prop="billId" />
<el-table-column label="充值用户" align="center" prop="userName" />
<el-table-column label="设备" align="center" prop="deviceName" />
<el-table-column label="房东(到账用户)" align="center" prop="landlordName" />
<el-table-column label="商户" align="center" prop="mchName" />
<el-table-column label="交易金额" align="center">
<template slot-scope="d">
{{d.row.money | money}}
</template>
</el-table-column>
<el-table-column label="设备到账金额" align="center">
<template slot-scope="d">
{{d.row.deviceAmount | money}}
</template>
</el-table-column>
<el-table-column label="房东到账金额" align="center">
<el-table-column label="商户到账金额" align="center">
<template slot-scope="d">
{{d.row.arrivalAmount | money}}
</template>
</el-table-column>
<el-table-column label="成本" align="center">
<template slot-scope="d">
{{d.row.channelCost | money}}
</template>
</el-table-column>
<el-table-column label="手续费" align="center">
<template slot-scope="d">
{{d.row.serviceCharge | money}}
</template>
</el-table-column>
<el-table-column label="成本" align="center">
<template slot-scope="d">
{{d.row.channelCost | money}}
</template>
</el-table-column>
<el-table-column label="利润" align="center">
<template slot-scope="d">
{{d.row.serviceCharge - d.row.channelCost | money}}
@ -83,7 +78,7 @@
</el-table-column>
<el-table-column label="支付方式" align="center">
<template slot-scope="d">
<dict-tag :value="d.row.payType" :options="dict.type.sm_transaction_bill_pay_type"/>
<dict-tag :value="d.row.channelId" :options="dict.type.sm_transaction_bill_pay_type"/>
</template>
</el-table-column>
<el-table-column label="交易状态" align="center">