Browse Source

序号设置和条码预制,条码预制生成功能暂未做

seimin 1 year ago
parent
commit
6b7901b1f9

+ 17 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication-routing.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { BarcodePrefabricationComponent } from './barcode-prefabrication.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: BarcodePrefabricationComponent,
10
+  }
11
+];
12
+
13
+@NgModule({
14
+  imports: [RouterModule.forChild(routes)],
15
+  exports: [RouterModule]
16
+})
17
+export class BarcodePrefabricationRoutingModule { }

+ 144 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication.component.html

@@ -0,0 +1,144 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='18' class="list-template__searchBox"></div>
5
+      <div nz-col nzXl='6' class="list-template__btns">
6
+        <button nz-button *ngIf="coopBtns.add" class="btn ml8 default" (click)="showModal()">新增</button>
7
+      </div>
8
+    </div>
9
+    <div class="list-template__bottom">
10
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
11
+        [nzLoading]="loading1">
12
+        <thead>
13
+          <tr class="thead">
14
+            <th nzWidth="25%">预制名称</th>
15
+            <th nzWidth="25%">序号名称</th>
16
+            <th nzWidth="25%">条码样式</th>
17
+            <th nzWidth="25%">操作</th>
18
+          </tr>
19
+        </thead>
20
+        <tbody>
21
+          <tr *ngFor="let data of listOfData;let index=index;">
22
+            <td>{{ data.title }}</td>
23
+            <td>{{ data.snConfigDTO ? data.snConfigDTO.title : '' }}</td>
24
+            <td>{{ data.codeType ? data.codeType.name : '' }}</td>
25
+            <td>
26
+              <div class="coop">
27
+                <span *ngIf="coopBtns.generateQRcode" (click)="generateQRcode(data.id)">生成</span>
28
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">修改</span>
29
+                <span *ngIf="coopBtns.del" (click)="del(data)">删除</span>
30
+              </div>
31
+            </td>
32
+          </tr>
33
+        </tbody>
34
+      </nz-table>
35
+      <div class="list-template__pagination">
36
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
37
+          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
38
+        </nz-pagination>
39
+      </div>
40
+    </div>
41
+  </div>
42
+</div>
43
+<!-- 新增/编辑模态框 -->
44
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
45
+  <div class="modalBody">
46
+    <div class="title">{{add?"新增":"编辑"}}条码预制<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
47
+    </div>
48
+    <overlay-scrollbars #osComponentRef1 class="content">
49
+      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
50
+        <nz-form-item>
51
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="title">预制名称</nz-form-label>
52
+          <nz-form-control nzErrorTip="请填写预制名称!">
53
+            <nz-input-group>
54
+              <input nz-input formControlName="title" placeholder="请填写预制名称" />
55
+            </nz-input-group>
56
+          </nz-form-control>
57
+        </nz-form-item>
58
+        <nz-form-item>
59
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="snConfig">序号名称</nz-form-label>
60
+          <nz-form-control nzErrorTip="请选择序号名称!">
61
+            <nz-select (nzOnSearch)="changeInp($event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="snConfig" nzPlaceHolder="请选择序号名称">
62
+              <ng-container *ngFor="let option of snConfigs">
63
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.title" [nzValue]="option.id"></nz-option>
64
+              </ng-container>
65
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
66
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
67
+              </nz-option>
68
+            </nz-select>
69
+          </nz-form-control>
70
+        </nz-form-item>
71
+        <nz-form-item>
72
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="codeType">条码样式</nz-form-label>
73
+          <nz-form-control nzErrorTip="请选择条码样式!">
74
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
75
+              formControlName="codeType" nzPlaceHolder="请选择条码样式">
76
+              <nz-option [nzLabel]="data.name" [nzValue]="data.id" *ngFor="let data of codeTypes">
77
+              </nz-option>
78
+            </nz-select>
79
+          </nz-form-control>
80
+        </nz-form-item>
81
+      </form>
82
+    </overlay-scrollbars>
83
+    <div class="display_flex justify-content_flex-center">
84
+      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
85
+      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
86
+    </div>
87
+  </div>
88
+</div>
89
+<!-- 生成模态框 -->
90
+<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="generateModal">
91
+  <div class="modalBody">
92
+    <div class="title">生成条码预制<i class="icon_transport transport-guanbi" (click)="hideGenerateModal()"></i>
93
+    </div>
94
+    <overlay-scrollbars #osComponentRef1 class="content">
95
+      <form nz-form [formGroup]="validateGenerateForm" class="addForm" (ngSubmit)="submitGenerateForm()">
96
+        <nz-form-item>
97
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="title">预制名称</nz-form-label>
98
+          <nz-form-control nzErrorTip="请填写预制名称!">
99
+            <nz-input-group>
100
+              <input nz-input formControlName="title" placeholder="请填写预制名称" />
101
+            </nz-input-group>
102
+          </nz-form-control>
103
+        </nz-form-item>
104
+        <nz-form-item>
105
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="snConfig">序号名称</nz-form-label>
106
+          <nz-form-control nzErrorTip="请选择序号名称!">
107
+            <nz-select (nzOnSearch)="changeInp($event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="snConfig" nzPlaceHolder="请选择序号名称">
108
+              <ng-container *ngFor="let option of snConfigs">
109
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.title" [nzValue]="option.id"></nz-option>
110
+              </ng-container>
111
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
112
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
113
+              </nz-option>
114
+            </nz-select>
115
+          </nz-form-control>
116
+        </nz-form-item>
117
+        <nz-form-item>
118
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="codeType">条码样式</nz-form-label>
119
+          <nz-form-control nzErrorTip="请选择条码样式!">
120
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
121
+              formControlName="codeType" nzPlaceHolder="请选择条码样式">
122
+              <nz-option [nzLabel]="data.name" [nzValue]="data.id" *ngFor="let data of codeTypes">
123
+              </nz-option>
124
+            </nz-select>
125
+          </nz-form-control>
126
+        </nz-form-item>
127
+      </form>
128
+    </overlay-scrollbars>
129
+    <div class="display_flex justify-content_flex-center">
130
+      <button nzType="primary" nz-button (click)="submitGenerateForm()" [nzLoading]="btnLoading">生成打印</button>
131
+      <button class="btn cancel" nz-button nzType="default" (click)="hideGenerateModal()">取消</button>
132
+    </div>
133
+  </div>
134
+</div>
135
+<!-- 删除模态框 -->
136
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
137
+  (confirmDelEvent)="confirmDel()" content="您确认要删除吗?">
138
+</app-dialog-delete>
139
+<!-- 操作成功/失败提示框 -->
140
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
141
+  [info]="promptInfo"></app-prompt-modal>
142
+
143
+<!-- 遮罩 -->
144
+<app-mask *ngIf="maskFlag"></app-mask>

+ 126 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication.component.less

@@ -0,0 +1,126 @@
1
+@import "../../../../src/theme.less";
2
+.save {
3
+  position: fixed;
4
+  left: 0;
5
+  top: 0;
6
+  width: 100%;
7
+  height: 100%;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 99;
10
+
11
+  .modalBody {
12
+    width: 350px;
13
+    background: #fff;
14
+    border-radius: 5px;
15
+    padding: 10px 20px;
16
+    color: #333;
17
+
18
+    .title {
19
+      width: 100%;
20
+      text-align: center;
21
+      font-size: 18px;
22
+      position: relative;
23
+
24
+      i {
25
+        position: absolute;
26
+        right: 0;
27
+        top: 0;
28
+        font-size: 20px;
29
+        color: #666;
30
+        cursor: pointer;
31
+        padding: 0 5px;
32
+      }
33
+    }
34
+
35
+    .content {
36
+      width: 100%;
37
+      height: 117px;
38
+      background: #f9fafb;
39
+      border: 1px solid #e5e9ed;
40
+      border-radius: 5px;
41
+      overflow: hidden;
42
+      margin-top: 12px;
43
+
44
+      div {
45
+        text-align: center;
46
+        margin: 0;
47
+
48
+        &.icon {
49
+          margin-top: 17px;
50
+
51
+          i {
52
+            color: #34b349;
53
+            font-size: 30px !important;
54
+
55
+            &.transport-wenhao {
56
+              color: #f5a523;
57
+            }
58
+
59
+            &.transport-shibai {
60
+              color: #ff3a52;
61
+            }
62
+          }
63
+        }
64
+
65
+        &.defeat {
66
+          color: #333;
67
+          font-size: 18px;
68
+        }
69
+
70
+        &:nth-child(3) {
71
+          font-size: 14px;
72
+          color: #666;
73
+        }
74
+      }
75
+    }
76
+
77
+    button {
78
+      margin-top: 10px;
79
+
80
+      &.btn {
81
+        margin-left: 8px;
82
+      }
83
+    }
84
+  }
85
+
86
+  // 新增
87
+  &.add {
88
+    .modalBody {
89
+      width: 480px;
90
+      height: auto;
91
+
92
+      .content {
93
+        width: 100%;
94
+        height: auto;
95
+        padding: 19px 14px 0 14px;
96
+        max-height: 500px;
97
+        overflow-y: auto;
98
+
99
+        .addForm {
100
+          .ant-form-item {
101
+            margin-bottom: 8px;
102
+
103
+            .ant-form-item-label {
104
+              line-height: 14px;
105
+              text-align: left;
106
+            }
107
+          }
108
+        }
109
+
110
+        .editForm {
111
+          .ant-form-item {
112
+            margin-bottom: 14px;
113
+
114
+            .ant-form-item-label {
115
+              line-height: 0;
116
+            }
117
+          }
118
+        }
119
+      }
120
+
121
+      button:nth-child(1) {
122
+        margin-right: 20px;
123
+      }
124
+    }
125
+  }
126
+}

+ 283 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication.component.ts

@@ -0,0 +1,283 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+
5
+import { MainService } from "../../services/main.service";
6
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
7
+import { ToolService } from "../../services/tool.service";
8
+import { NzMessageService } from "ng-zorro-antd";
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
11
+
12
+@Component({
13
+  selector: "app-barcode-prefabrication",
14
+  templateUrl: "./barcode-prefabrication.component.html",
15
+  styleUrls: ["./barcode-prefabrication.component.less"],
16
+})
17
+export class BarcodePrefabricationComponent implements OnInit {
18
+  @ViewChild("osComponentRef1", {
19
+    read: OverlayScrollbarsComponent,
20
+    static: false,
21
+  })
22
+  osComponentRef1: OverlayScrollbarsComponent;
23
+  constructor(
24
+    private message: NzMessageService,
25
+    private fb: FormBuilder,
26
+    private route: ActivatedRoute,
27
+    private router: Router,
28
+    private mainService: MainService,
29
+    private tool: ToolService
30
+  ) {}
31
+
32
+  listOfData: any[] = []; //表格数据
33
+
34
+  modal: boolean = false; //新增/编辑模态框
35
+  add: boolean; //true:新增;false:编辑
36
+  validateForm: FormGroup; //新增/编辑表单
37
+  coopId: number; //表格中执行操作的id
38
+  hosId: any; //院区(搜索)
39
+  codeTypes: Array<any> = []; //所有条码样式
40
+  pageIndex: number = 1; //页码
41
+  listLength: number = 10; //总条数
42
+  pageSize: number = 10; //每页条数
43
+
44
+  promptContent: string; //操作提示框提示信息
45
+  ifSuccess: boolean; //操作成功/失败
46
+  promptInfo: string; //操作结果提示信息
47
+  promptModalShow: boolean; //操作提示框是否展示
48
+
49
+  btnLoading: boolean = false; //提交按钮loading状态
50
+
51
+  changeInpSubject = new Subject(); //防抖
52
+
53
+  ngOnInit() {
54
+    //防抖
55
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
56
+      this.getSnConfigs(v[0]);
57
+    });
58
+    this.coopBtns = this.tool.initCoopBtns(this.route);
59
+    this.initForm();
60
+    this.getCodeType();
61
+    this.getSnConfigs();
62
+  }
63
+
64
+  // 初始化增删改按钮
65
+  coopBtns: any = {};
66
+  // 表格数据
67
+  loading1 = false;
68
+  getList() {
69
+    let data = {
70
+      idx: this.pageIndex - 1,
71
+      sum: this.pageSize,
72
+      precastCode: {
73
+        hosId: this.hosId,
74
+      },
75
+    };
76
+    this.loading1 = true;
77
+    this.mainService
78
+      .getFetchDataList("simple/data", "precastCode", data)
79
+      .subscribe((data) => {
80
+        this.loading1 = false;
81
+        this.listOfData = data.list;
82
+        this.listLength = data.totalNum;
83
+      });
84
+  }
85
+
86
+  // 获取所有条码样式
87
+  getCodeType() {
88
+    this.mainService.getDictionary("list", "precastCode_code_type").subscribe((data) => {
89
+      this.codeTypes = data;
90
+      this.getAllHospital();
91
+    });
92
+  }
93
+
94
+  // 获取相应的院区
95
+  getAllHospital() {
96
+    this.hosId = this.tool.getCurrentHospital().id;
97
+    this.getList();
98
+  }
99
+
100
+  // 获取序号名称
101
+  snConfigs: Array<any> = [];
102
+  getSnConfigs(keyword = "") {
103
+    this.mainService.getFetchDataList("simple/data", "serialnumberConfig", {idx: 0, sum: 9999, precastCode: { hosId: this.hosId, title: keyword }}).subscribe((data) => {
104
+      this.isLoading = false;
105
+      this.snConfigs = data.list || [];
106
+    });
107
+  }
108
+
109
+  // 边输边搜节流阀
110
+  isLoading = false;
111
+  changeInp(e) {
112
+    this.isLoading = true;
113
+    this.changeInpSubject.next([e]);
114
+  }
115
+
116
+  // 新增弹框
117
+  showModal() {
118
+    this.add = true;
119
+    this.initForm();
120
+    this.modal = true;
121
+  }
122
+  hideModal() {
123
+    this.modal = false;
124
+    this.initForm();
125
+  }
126
+
127
+  // 初始化新增form表单
128
+  initForm() {
129
+    this.validateForm = this.fb.group({
130
+      title: [null, [Validators.required]],
131
+      snConfig: [null, [Validators.required]],
132
+      codeType: [null, [Validators.required]],
133
+    });
134
+  }
135
+  // 表单提交
136
+  submitForm(): void {
137
+    var that = this;
138
+    for (const i in that.validateForm.controls) {
139
+      that.validateForm.controls[i].markAsDirty({ onlySelf: true });
140
+      that.validateForm.controls[i].updateValueAndValidity();
141
+    }
142
+    if (that.validateForm.invalid) return;
143
+    that.btnLoading = true;
144
+    let data:any = {
145
+      title: that.validateForm.value.title,
146
+      snConfig: that.validateForm.value.snConfig,
147
+      codeType: that.validateForm.value.codeType ? { id: that.validateForm.value.codeType } : undefined,
148
+      hosId: that.hosId,
149
+    };
150
+    if (!that.add) {
151
+      data = {...data, ...this.coopData};
152
+    }
153
+    that.mainService
154
+      .simplePost("addData", "precastCode", data)
155
+      .subscribe((data) => {
156
+        that.btnLoading = false;
157
+        that.hideModal();
158
+        that.initForm();
159
+        if (data.status == 200) {
160
+          that.showPromptModal(that.add ? "新增" : "编辑", true, "");
161
+        } else {
162
+          that.showPromptModal(that.add ? "新增" : "编辑", false, data.msg);
163
+        }
164
+      });
165
+  }
166
+
167
+  // 编辑
168
+  maskFlag: any = false;
169
+  coopData:any = {};
170
+  edit(data) {
171
+    this.modal = true;
172
+    this.add = false;
173
+    this.coopId = data.id;
174
+    this.coopData = data;
175
+    this.validateForm.controls.title.setValue(data.title);
176
+    this.validateForm.controls.snConfig.setValue(data.snConfig);
177
+    this.validateForm.controls.codeType.setValue(data.codeType? data.codeType.id : null);
178
+  }
179
+
180
+  // 删除
181
+  delModal: boolean = false; //删除模态框
182
+  del(data) {
183
+    this.coopId = data.id;
184
+    this.delModal = true;
185
+  }
186
+  // 确认删除
187
+  confirmDel() {
188
+    let that = this;
189
+    that.btnLoading = true;
190
+    that.mainService
191
+      .simplePost("rmvData", "precastCode", [that.coopId])
192
+      .subscribe((data) => {
193
+        that.btnLoading = false;
194
+        that.hideDelModal();
195
+        if (data["status"] == 200) {
196
+          if (
197
+            that.listOfData.length == 1 &&
198
+            that.pageIndex == Math.ceil(that.listLength / that.pageSize)
199
+          ) {
200
+            that.listLength--;
201
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
202
+          }
203
+          that.showPromptModal("删除", true, "");
204
+        } else {
205
+          that.showPromptModal("删除", false, data["msg"]);
206
+        }
207
+      });
208
+  }
209
+  // 关闭删除模态框
210
+  hideDelModal() {
211
+    this.delModal = false;
212
+  }
213
+
214
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
215
+  showPromptModal(con, success, promptInfo?) {
216
+    this.promptModalShow = false;
217
+    this.promptContent = con;
218
+    this.ifSuccess = success;
219
+    this.promptInfo = promptInfo;
220
+    setTimeout(() => {
221
+      this.promptModalShow = true;
222
+    }, 100);
223
+    this.getList();
224
+  }
225
+
226
+  // 生成
227
+  generateQRcode(id) {
228
+    this.coopId = id;
229
+    this.showGenerateModal();
230
+  }
231
+
232
+  // 新增弹框
233
+  generateModal: boolean = false; //新增/编辑模态框
234
+  validateGenerateForm: FormGroup; //新增/编辑表单
235
+  showGenerateModal() {
236
+    this.initGenerateForm();
237
+    this.generateModal = true;
238
+  }
239
+  hideGenerateModal() {
240
+    this.generateModal = false;
241
+    this.initGenerateForm();
242
+  }
243
+  // 初始化新增form表单
244
+  initGenerateForm() {
245
+    this.validateGenerateForm = this.fb.group({
246
+      title: [null, [Validators.required]],
247
+      snConfig: [null, [Validators.required]],
248
+      codeType: [null, [Validators.required]],
249
+    });
250
+  }
251
+  // 生成表单提交
252
+  submitGenerateForm(): void {
253
+    // todo
254
+    return;
255
+    for (const i in this.validateForm.controls) {
256
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
257
+      this.validateForm.controls[i].updateValueAndValidity();
258
+    }
259
+    if (this.validateForm.invalid) return;
260
+    this.btnLoading = true;
261
+    let data:any = {
262
+      title: this.validateForm.value.title,
263
+      snConfig: this.validateForm.value.snConfig,
264
+      codeType: this.validateForm.value.codeType ? { id: this.validateForm.value.codeType } : undefined,
265
+      hosId: this.hosId,
266
+    };
267
+    if (!this.add) {
268
+      data = {...data, ...this.coopData};
269
+    }
270
+    this.mainService
271
+      .simplePost("addData", "precastCode", data)
272
+      .subscribe((data) => {
273
+        this.btnLoading = false;
274
+        this.hideModal();
275
+        this.initForm();
276
+        if (data.status == 200) {
277
+          this.showPromptModal(this.add ? "新增" : "编辑", true, "");
278
+        } else {
279
+          this.showPromptModal(this.add ? "新增" : "编辑", false, data.msg);
280
+        }
281
+      });
282
+  }
283
+}

+ 19 - 0
src/app/views/barcode-prefabrication/barcode-prefabrication.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { BarcodePrefabricationRoutingModule } from './barcode-prefabrication-routing.module';
5
+import { BarcodePrefabricationComponent } from './barcode-prefabrication.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    BarcodePrefabricationComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    BarcodePrefabricationRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class BarcodePrefabricationModule { }

+ 2 - 2
src/app/views/clinical-users-management/clinical-users-management.component.ts

@@ -459,7 +459,7 @@ export class ClinicalUsersManagementComponent implements OnInit {
459 459
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
460 460
           ) {
461 461
             that.listLength--;
462
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
462
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
463 463
           }
464 464
           that.showPromptModal("删除", true, "");
465 465
         } else {
@@ -483,7 +483,7 @@ export class ClinicalUsersManagementComponent implements OnInit {
483 483
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
484 484
           ) {
485 485
             that.listLength--;
486
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
486
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
487 487
           }
488 488
           that.showPromptModal("删除", true, "");
489 489
         } else {

+ 1 - 1
src/app/views/hospital-management/hospital-management.component.ts

@@ -292,7 +292,7 @@ export class HospitalManagementComponent implements OnInit {
292 292
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
293 293
           ) {
294 294
             that.listLength--;
295
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
295
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
296 296
           }
297 297
           this.showPromptModal("删除", true, "");
298 298
         } else {

+ 5 - 0
src/app/views/main/main-routing.module.ts

@@ -408,6 +408,11 @@ const routes: Routes = [
408 408
         path: "questionnaireAnswer",
409 409
         loadChildren: () => import("../questionnaire-answer/questionnaire-answer.module").then((m) => m.QuestionnaireAnswerModule),
410 410
       },
411
+      // 条码预制
412
+      {
413
+        path: "barcodePrefabrication",
414
+        loadChildren: () => import("../barcode-prefabrication/barcode-prefabrication.module").then((m) => m.BarcodePrefabricationModule),
415
+      },
411 416
     ],
412 417
   },
413 418
 ];

+ 1 - 1
src/app/views/office-management/office-management.component.ts

@@ -608,7 +608,7 @@ export class OfficeManagementComponent implements OnInit {
608 608
               that.pageIndex == Math.ceil(that.listLength / that.pageSize)
609 609
             ) {
610 610
               that.listLength--;
611
-              that.pageIndex = Math.ceil(that.listLength / that.pageSize);
611
+              that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
612 612
             }
613 613
             that.showPromptModal("删除", true, "");
614 614
           } else {

+ 1 - 1
src/app/views/serial-number-setting/serial-number-setting.component.html

@@ -63,7 +63,7 @@
63 63
           <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="prefix">开头字母</nz-form-label>
64 64
           <nz-form-control nzErrorTip="请填写开头字母!">
65 65
             <nz-input-group>
66
-              <input nz-input formControlName="prefix" placeholder="请填写开头字母" />
66
+              <input nz-input formControlName="prefix" placeholder="请填写开头字母" [disabled]="!add" [readonly]="!add" />
67 67
             </nz-input-group>
68 68
           </nz-form-control>
69 69
         </nz-form-item>

+ 5 - 3
src/app/views/serial-number-setting/serial-number-setting.component.ts

@@ -155,7 +155,7 @@ export class SerialNumberSettingComponent implements OnInit {
155 155
       hosId: that.hosId,
156 156
     };
157 157
     if (!that.add) {
158
-      data.id = that.coopId;
158
+      data = {...data, ...this.coopData};
159 159
     }
160 160
     that.mainService
161 161
       .simplePost("addData", "serialnumberConfig", data)
@@ -177,10 +177,12 @@ export class SerialNumberSettingComponent implements OnInit {
177 177
 
178 178
   // 编辑
179 179
   maskFlag: any = false;
180
+  coopData:any = {};
180 181
   edit(data) {
181 182
     this.modal = true;
182 183
     this.add = false;
183 184
     this.coopId = data.id;
185
+    this.coopData = data;
184 186
     this.validateForm.controls.title.setValue(data.title);
185 187
     this.validateForm.controls.prefix.setValue(data.prefix);
186 188
     this.validateForm.controls.length.setValue(data.length);
@@ -209,9 +211,9 @@ export class SerialNumberSettingComponent implements OnInit {
209 211
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
210 212
           ) {
211 213
             that.listLength--;
212
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
214
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
213 215
           }
214
-          that.showPromptModal("删除", true, "");
216
+          that.showPromptModal("删除", true, "已删除序号规则,请重新配置序号");
215 217
         } else {
216 218
           that.showPromptModal("删除", false, data["msg"]);
217 219
         }

+ 2 - 2
src/app/views/users-management/users-management.component.ts

@@ -435,7 +435,7 @@ export class UsersManagementComponent implements OnInit {
435 435
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
436 436
           ) {
437 437
             that.listLength--;
438
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
438
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
439 439
           }
440 440
           that.showPromptModal("删除", true, "");
441 441
         } else {
@@ -459,7 +459,7 @@ export class UsersManagementComponent implements OnInit {
459 459
             that.pageIndex == Math.ceil(that.listLength / that.pageSize)
460 460
           ) {
461 461
             that.listLength--;
462
-            that.pageIndex = Math.ceil(that.listLength / that.pageSize);
462
+            that.pageIndex = Math.ceil(that.listLength / that.pageSize) || 1;
463 463
           }
464 464
           that.showPromptModal("删除", true, "");
465 465
         } else {