From ec4933fd1294e92041757e7ebbc78fe94835db71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com>
Date: Tue, 23 Jul 2024 17:33:51 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E6=96=B0=E5=A2=9E=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E6=9C=8D=E5=8A=A1=E8=B4=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/mixins.js | 12 +++++
src/views/system/device/detail.vue | 12 ++---
src/views/system/device/index.vue | 19 +++----
src/views/system/model/index.vue | 83 ++++++++++++++++++++----------
src/views/system/smUser/detail.vue | 8 +--
src/views/system/smUser/index.vue | 10 ++--
6 files changed, 90 insertions(+), 54 deletions(-)
diff --git a/src/utils/mixins.js b/src/utils/mixins.js
index 5070394..73d301e 100644
--- a/src/utils/mixins.js
+++ b/src/utils/mixins.js
@@ -64,3 +64,15 @@ export const $showColumns = {
}
},
}
+
+// 服务费
+export const $serviceType = {
+ computed: {
+ // 服务费单位
+ serviceUnit() {
+ return (type) => {
+ return type === '2' ? '元' : '%';
+ }
+ }
+ }
+}
diff --git a/src/views/system/device/detail.vue b/src/views/system/device/detail.vue
index 996d2e8..ed24f0d 100644
--- a/src/views/system/device/detail.vue
+++ b/src/views/system/device/detail.vue
@@ -74,7 +74,7 @@
跟随用户
-
+
{{deviceData.serviceRate}} {{serviceUnit(deviceData.serviceType)}}
@@ -168,9 +168,11 @@ import RecordTime from '@/views/ss/time/index.vue'
import { toDescriptionFromSecond } from '@/utils/date'
import StoreLink from '@/components/Business/Store/StoreLink.vue'
import UserLink from '@/components/Business/SmUser/UserLink.vue'
+import { $serviceType } from '@/utils/mixins'
export default {
name: 'deviceDetail',
+ mixins: [$serviceType],
components: {
UserLink,
StoreLink,
@@ -178,7 +180,7 @@ export default {
Suit,
SuitList,
TenantList, ResetRecord, BindRecord, ReadingRecord, MeterRecordReport, QrCode, RechargeRecord, LineChart},
- dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag', 'sm_device_online_status', 'device_service_type'],
+ dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag', 'sm_device_online_status', 'service_type'],
data() {
return {
loading: false,
@@ -211,12 +213,6 @@ export default {
},
isOpen() {
return this.deviceData != null && this.deviceData.powerStatus === '1';
- },
- // 服务费单位
- serviceUnit() {
- return (type) => {
- return type === '2' ? '元' : '%';
- }
}
},
created() {
diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue
index 7c6f71e..cb8ed65 100644
--- a/src/views/system/device/index.vue
+++ b/src/views/system/device/index.vue
@@ -177,7 +177,7 @@
跟随用户
-
+
{{d.row.serviceRate}} {{serviceUnit(d.row.serviceType)}}
@@ -262,7 +262,7 @@
{
- return type === '2' ? '元' : '%';
- }
- }
},
created() {
this.getList();
@@ -441,6 +437,11 @@ export default {
// 选中型号后
onSubmitModel(model) {
this.form.model = model?.modelName;
+ // 若是新增,则填入默认的服务费
+ if (this.form.deviceId == null) {
+ this.form.serviceType = model?.serviceType;
+ this.form.serviceRate = model?.serviceRate;
+ }
},
/** 查询设备列表 */
getList() {
diff --git a/src/views/system/model/index.vue b/src/views/system/model/index.vue
index cbc2a0c..d071a77 100644
--- a/src/views/system/model/index.vue
+++ b/src/views/system/model/index.vue
@@ -113,33 +113,54 @@
/>
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{option.label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{serviceUnit(form.serviceType)}}
+
+
+