From 18447a2ce4d67c666c72a03e6b5e6363ccd07529 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 21 Jul 2022 15:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device-list/device-list.component.html | 68 +++++++++++++------ .../device-list/device-list.component.ts | 29 +++++++- 2 files changed, 76 insertions(+), 21 deletions(-) diff --git a/src/app/admin/device/device-list/device-list.component.html b/src/app/admin/device/device-list/device-list.component.html index 24c2f38..3076443 100644 --- a/src/app/admin/device/device-list/device-list.component.html +++ b/src/app/admin/device/device-list/device-list.component.html @@ -4,10 +4,10 @@ -
+ +
–>
@@ -36,7 +36,7 @@
- + -->
共计 {{dataObject.total?dataObject.total:0}} 条数据 @@ -55,15 +55,18 @@ [nzScroll]="{ x: '1100px'}"> - 序号 - 设备类型 - 设备名称 - 设备SN - 设备KEY - 设备IMEI - 设备ICCID + 序号 + 设备类型 + + 设备SN + 设备KEY + 设备IMEI + 设备ICCID + 小票顶部标题 + 小票来源显示 + 小票底部文案 创建时间 - 操作 + 操作 @@ -73,16 +76,20 @@ 商鹏云打印机 ZKC云打印机 - {{data.deviceName}} + {{data.deviceSn?data.deviceSn:'未填写'}} {{data.deviceKey?data.deviceKey:'未填写'}} {{data.deviceImei?data.deviceImei:'未填写'}} {{data.deviceIccid?data.deviceIccid:'未填写'}} + {{data.receiptTop?data.receiptTop:'默认'}} + {{data.receiptSource?data.receiptSource:'默认'}} + {{data.receiptBottom?data.receiptBottom:'默认'}} {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} 操作列表 @@ -99,48 +106,69 @@ 设备类型 - + - + - + 设备SN - + 设备KEY - + 设备IMEI - + 设备ICCID + + 小票顶部标题 + + + + + + + 小票来源显示 + + + + + + + 小票底部文案 + + + + +
diff --git a/src/app/admin/device/device-list/device-list.component.ts b/src/app/admin/device/device-list/device-list.component.ts index 3d8f5f1..c1a0b31 100644 --- a/src/app/admin/device/device-list/device-list.component.ts +++ b/src/app/admin/device/device-list/device-list.component.ts @@ -62,13 +62,17 @@ export class DeviceListComponent implements OnInit { }); this.configDeviceForm = this.form.group({ + id: [null], merStoreId: [null], type: [null, [Validators.required]], - deviceName: [null, [Validators.required]], + // deviceName: [null, [Validators.required]], deviceSn: [null], deviceKey: [null], deviceImei: [null], deviceIccid: [null], + receiptTop: [null], + receiptSource: [null], + receiptBottom: [null], }); this.requestData(1); @@ -114,7 +118,14 @@ export class DeviceListComponent implements OnInit { showConfigDeviceModal(deviceData: object) { if (deviceData != null) { this.configDeviceModalTitle = '修改设备'; + deviceData['type'] = String(deviceData['type']); this.configDeviceForm.patchValue(deviceData); + + this.configDeviceForm.controls.type.disable(); + this.configDeviceForm.controls.deviceSn.disable(); + this.configDeviceForm.controls.deviceKey.disable(); + this.configDeviceForm.controls.deviceImei.disable(); + this.configDeviceForm.controls.deviceIccid.disable(); } if (deviceData == null) { this.configDeviceModalTitle = '新增设备'; @@ -126,6 +137,12 @@ export class DeviceListComponent implements OnInit { * 关闭配置设备模态框 */ closeConfigDeviceModal() { + this.configDeviceForm.controls.type.enable(); + this.configDeviceForm.controls.deviceSn.enable(); + this.configDeviceForm.controls.deviceKey.enable(); + this.configDeviceForm.controls.deviceImei.enable(); + this.configDeviceForm.controls.deviceIccid.enable(); + this.configDeviceForm.reset(); this.configDeviceModal = false; } @@ -144,6 +161,11 @@ export class DeviceListComponent implements OnInit { }); return; } + this.configDeviceForm.controls.type.enable(); + this.configDeviceForm.controls.deviceSn.enable(); + this.configDeviceForm.controls.deviceKey.enable(); + this.configDeviceForm.controls.deviceImei.enable(); + this.configDeviceForm.controls.deviceIccid.enable(); this.configDeviceForm.value.merStoreId = this.merStoreId; this.deviceService.editDevice(this.configDeviceForm.value, data => { if (data['return_code'] === '000000') { @@ -158,6 +180,11 @@ export class DeviceListComponent implements OnInit { nzTitle: '提示', nzContent: data['return_msg'], }); + this.configDeviceForm.controls.type.disable(); + this.configDeviceForm.controls.deviceSn.disable(); + this.configDeviceForm.controls.deviceKey.disable(); + this.configDeviceForm.controls.deviceImei.disable(); + this.configDeviceForm.controls.deviceIccid.disable(); } this.loadingObject.spinning = false; });