seimin месяцев назад: 8
Родитель
Сommit
f6ad5ff73e

+ 2 - 2
src/app/views/assets-info/assets-info.component.html

@@ -103,7 +103,7 @@
103 103
           <nz-form-item>
104 104
             <nz-form-label [nzSpan]="5" nzRequired nzFor="productId">关联产品</nz-form-label>
105 105
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择关联产品!">
106
-              <nz-select (nzOnSearch)="changeInp('add', 'assetProduct', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="productId" nzPlaceHolder="请选择关联产品" (ngModelChange)="changeAssetProduct($event)" (nzOpenChange)="changeInp('add', 'assetProduct', '')">
106
+              <nz-select (nzOnSearch)="changeInp('add', 'assetProduct', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch formControlName="productId" nzPlaceHolder="请选择关联产品" (ngModelChange)="changeAssetProduct($event)" (nzOpenChange)="changeInp('add', 'assetProduct', '')">
107 107
                 <ng-container *ngFor="let option of assetProductList">
108 108
                   <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
109 109
                 </ng-container>
@@ -177,7 +177,7 @@
177 177
           <nz-form-item>
178 178
             <nz-form-label [nzSpan]="5" nzRequired nzFor="supplierId">供应商</nz-form-label>
179 179
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择供应商!">
180
-              <nz-select (nzOnSearch)="changeInp('add', 'company', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="supplierId" nzPlaceHolder="请选择供应商" (nzOpenChange)="changeInp('add', 'company', '')">
180
+              <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear formControlName="supplierId" nzPlaceHolder="请选择供应商">
181 181
                 <ng-container *ngFor="let option of companyList">
182 182
                   <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
183 183
                 </ng-container>

+ 2 - 22
src/app/views/assets-info/assets-info.component.ts

@@ -55,8 +55,6 @@ export class AssetsInfoComponent implements OnInit {
55 55
         this.getFloors(v[0], v[2], this.validateForm.value.buildId);
56 56
       } else if(v[1] === 'assetProduct'){
57 57
         this.getAssetProductList(v[0], v[2]);
58
-      } else if(v[1] === 'company'){
59
-        this.getCompanyList(v[0], v[2]);
60 58
       } else if(v[1] === 'hospital'){
61 59
         this.getDutyList(v[0], v[2]);
62 60
       }
@@ -67,7 +65,6 @@ export class AssetsInfoComponent implements OnInit {
67 65
     this.getDeparts('search', '');
68 66
     this.getDeparts('add', '');
69 67
     this.getAssetProductList('add', '');
70
-    this.getCompanyList('add', '');
71 68
     this.getDutyList('add', '');
72 69
     this.getBuildings('add', '');
73 70
     this.getDispatchMethods();
@@ -206,24 +203,6 @@ export class AssetsInfoComponent implements OnInit {
206 203
 
207 204
   // 获取供应商
208 205
   companyList: any = [];
209
-  getCompanyList(type, keyword, init = false) {
210
-    let postData:any = {
211
-      company: {
212
-        name: keyword,
213
-        busiType: {key: "company_busi_type", value: "2"},
214
-        hosId: this.currentHospital.id,
215
-      },
216
-      idx: 0,
217
-      sum: 20,
218
-    };
219
-    this.mainService
220
-      .getFetchDataList("simple/data", "company", postData)
221
-      .subscribe((data) => {
222
-        this.companyList = data.list || [];
223
-
224
-        this.isLoading = false;
225
-      });
226
-  }
227 206
 
228 207
   // 获取责任部门
229 208
   dutyList: any = [];
@@ -275,7 +254,8 @@ export class AssetsInfoComponent implements OnInit {
275 254
     let obj = this.assetProductList.find(v => v.id == id);
276 255
     console.log(obj);
277 256
     this.validateForm.controls.brand.setValue(obj.brand);
278
-    this.validateForm.controls.supplierId.setValue((Array.isArray(obj.supplierList) && obj.supplierList.length) ? obj.supplierList[0].id : null);
257
+    this.companyList = obj.supplierList || [];
258
+    this.validateForm.controls.supplierId.setValue(null);
279 259
   }
280 260
 
281 261
   // 修改楼栋

+ 2 - 2
src/app/views/tripartite-company/tripartite-company.component.html

@@ -98,7 +98,7 @@
98 98
             </nz-form-control>
99 99
           </nz-form-item>
100 100
           <nz-form-item>
101
-            <nz-form-label [nzSpan]="5" nzFor="contacts">联&nbsp;系&nbsp;人</nz-form-label>
101
+            <nz-form-label [nzSpan]="5" nzFor="contacts">&nbsp;&nbsp;联&nbsp;系&nbsp;人</nz-form-label>
102 102
             <nz-form-control [nzSpan]="19" nzErrorTip="请输入联系人!">
103 103
               <nz-input-group>
104 104
                   <input formControlName="contacts" nz-input placeholder="请输入联系人">
@@ -106,7 +106,7 @@
106 106
             </nz-form-control>
107 107
           </nz-form-item>
108 108
           <nz-form-item>
109
-            <nz-form-label [nzSpan]="5" nzFor="mphone">联系电话</nz-form-label>
109
+            <nz-form-label [nzSpan]="5" nzFor="mphone">&nbsp;&nbsp;联系电话</nz-form-label>
110 110
             <nz-form-control [nzSpan]="19" nzErrorTip="请输入联系电话!">
111 111
               <nz-input-group>
112 112
                   <input formControlName="mphone" nz-input placeholder="请输入联系电话">

+ 6 - 1
src/app/views/tripartite-company/tripartite-company.component.ts

@@ -136,6 +136,11 @@ export class TripartiteCompanyComponent implements OnInit {
136 136
     }
137 137
 
138 138
     console.log(this.validateForm.value)
139
+    let companyList = this.validateForm.value.companyTypeIds.filter(v => v.checked);
140
+    if(!companyList.length){
141
+      this.message.info("请选择公司分类");
142
+      return;
143
+    }
139 144
 
140 145
     this.btnLoading = true;
141 146
     let postData:any = {};
@@ -146,7 +151,7 @@ export class TripartiteCompanyComponent implements OnInit {
146 151
         company: {
147 152
           name: this.validateForm.value.name,
148 153
           nickName: this.validateForm.value.nickName,
149
-          companyTypeIds: this.validateForm.value.companyTypeIds.filter(v => v.checked).map(v => v.value).toString(),
154
+          companyTypeIds: companyList.map(v => v.value).toString(),
150 155
           contacts: this.validateForm.value.contacts,
151 156
           mphone: this.validateForm.value.mphone,
152 157
           busiType: { key: 'company_busi_type', value: '2' },