Explorar o código

产品增加单位

seimin hai 8 meses
pai
achega
59ea3b8637

+ 14 - 4
src/app/views/assets-product-management/assets-product-management.component.html

@@ -37,12 +37,13 @@
37 37
             <th nzWidth="8%">名称</th>
38 38
             <th nzWidth="8%">型号</th>
39 39
             <th nzWidth="8%">品牌</th>
40
+            <th nzWidth="8%">单位</th>
40 41
             <th nzWidth="8%">大类</th>
41 42
             <th nzWidth="8%">小类</th>
42
-            <th nzWidth="12%">描述</th>
43
-            <th nzWidth="14%">供应商</th>
44
-            <th nzWidth="14%">生产商</th>
45
-            <th nzWidth="12%">操作</th>
43
+            <th nzWidth="11%">描述</th>
44
+            <th nzWidth="11%">供应商</th>
45
+            <th nzWidth="11%">生产商</th>
46
+            <th nzWidth="11%">操作</th>
46 47
           </tr>
47 48
         </thead>
48 49
         <tbody>
@@ -51,6 +52,7 @@
51 52
             <td>{{data.name}}</td>
52 53
             <td>{{data.model}}</td>
53 54
             <td>{{data.brand}}</td>
55
+            <td>{{data.unit}}</td>
54 56
             <td>{{data.mainTypeDTO?.name}}</td>
55 57
             <td>{{data.subTypeDTO?.name}}</td>
56 58
             <td>{{data.description}}</td>
@@ -105,6 +107,14 @@
105 107
             </nz-form-control>
106 108
           </nz-form-item>
107 109
           <nz-form-item>
110
+            <nz-form-label [nzSpan]="5" nzRequired nzFor="unit">单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位</nz-form-label>
111
+            <nz-form-control [nzSpan]="19" nzErrorTip="请输入单位!">
112
+              <nz-input-group>
113
+                  <input formControlName="unit" nz-input placeholder="请输入单位">
114
+              </nz-input-group>
115
+            </nz-form-control>
116
+          </nz-form-item>
117
+          <nz-form-item>
108 118
             <nz-form-label [nzSpan]="5" nzRequired nzFor="mainType">大&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类</nz-form-label>
109 119
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择大类!">
110 120
               <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="mainType" nzShowSearch

+ 4 - 0
src/app/views/assets-product-management/assets-product-management.component.ts

@@ -137,6 +137,7 @@ export class AssetsProductManagementComponent implements OnInit {
137 137
       name: ['', [Validators.required, Validators.pattern(/\S/)]],
138 138
       model: ['', [Validators.required, Validators.pattern(/\S/)]],
139 139
       brand: ['', [Validators.required, Validators.pattern(/\S/)]],
140
+      unit: ['', [Validators.required, Validators.pattern(/\S/)]],
140 141
       mainType: [null, [Validators.required]],
141 142
       subType: [null],
142 143
       description: [''],
@@ -258,6 +259,7 @@ export class AssetsProductManagementComponent implements OnInit {
258 259
           name: this.validateForm.value.name,
259 260
           model: this.validateForm.value.model,
260 261
           brand: this.validateForm.value.brand,
262
+          unit: this.validateForm.value.unit,
261 263
           mainType: this.validateForm.value.mainType,
262 264
           subType: this.validateForm.value.subType || undefined,
263 265
           description: this.validateForm.value.description,
@@ -275,6 +277,7 @@ export class AssetsProductManagementComponent implements OnInit {
275 277
             name: this.validateForm.value.name,
276 278
             model: this.validateForm.value.model,
277 279
             brand: this.validateForm.value.brand,
280
+            unit: this.validateForm.value.unit,
278 281
             mainType: this.validateForm.value.mainType,
279 282
             subType: this.validateForm.value.subType || undefined,
280 283
             description: this.validateForm.value.description,
@@ -316,6 +319,7 @@ export class AssetsProductManagementComponent implements OnInit {
316 319
     this.validateForm.controls.name.setValue(data.name);
317 320
     this.validateForm.controls.model.setValue(data.model);
318 321
     this.validateForm.controls.brand.setValue(data.brand);
322
+    this.validateForm.controls.unit.setValue(data.unit);
319 323
     this.validateForm.controls.mainType.setValue(data.mainType ? data.mainType.toString() : null);
320 324
     this.validateForm.controls.subType.setValue(data.subType ? data.subType.toString() : null);
321 325
     this.validateForm.controls.description.setValue(data.description);