Browse Source

【客户档案】 新增完成

liangyan0105 3 years ago
parent
commit
d20aa7edbf

+ 6 - 6
src/app/entity/basedata/customer.ts

@@ -26,12 +26,11 @@ export class Customer extends Page {
   fdCustomerList?: []; //自身集合
   pkOrg?: string; //组织id
 
-  /**新加字段 */
+  /*------------------新加字段---------------------*/
   //客商分类(数据字典)
   customerClassificationDictValue?: string;
   //客商来源(数据字典)
   customerSourceDictValue?: string;
-
   //客商行业 id
   baseCustomerIndustryId?: string;
   //销售状态id
@@ -42,7 +41,7 @@ export class Customer extends Page {
   customerGroupingDictValue?: string;
   //商务关系(数据字典)
   businessRelationsDictValue?: string;
-
+  // -----------------------------------------
   //上级单位(本表id)
   parentId?: string;
   //使用状态(数据字典)
@@ -56,6 +55,7 @@ export class Customer extends Page {
   companyEstablishDate?: string;
   //单位规模(数据字典)
   unitSizeDictValue?: string;
+
   //人员规模(数据字典)
   personnelSizeDictValue?: string;
   //注册资金(数据字典)
@@ -69,7 +69,7 @@ export class Customer extends Page {
   //销售人员id
   salesmanId?: string;
   //销售人员名称
-  salesmanName?: string;   //用项目管理菜单里面新增 有个接口
+  salesmanName?: string; //[项目管理] 菜单里面新增 有个接口
   //开票单位名称
   billingUnitName?: string;
   //纳税人识别号
@@ -84,12 +84,12 @@ export class Customer extends Page {
   billingBankAccountNumber?: string;
   //开发人员
   developer?: string;
+  
   //开发时间
   /**开发时间 yyyy-MM-dd*/
   developmentDate?: string;
-  /////////////////////////////
 
-  /**用来详情显示字段 */
+  /*--------------用来详情显示字段----------------- */
   //客商分类名称(数据字典)
   customerClassificationDictName?: string;
   //客商来源名称(数据字典)

+ 4 - 2
src/app/routes/basedata/basedata-routing.module.ts

@@ -26,7 +26,8 @@ import { BasedataMerchantsIndustryAddComponent } from './merchants-industry/add/
 import { BasedataPersonnelSizeComponent } from './personnel-size/personnel-size.component';
 import { BasedataRegisteredCapitalComponent } from './registered-capital/registered-capital.component';
 import { BasedataSalesStatusComponent } from './sales-status/sales-status.component';
-import { BasedataSalesStatusAddComponent } from './sales-status/add/add.component';
+import { BasedataSalesStatusAddComponent } from './sales-status/add/add.component';
+import { BasedataCustomerModalTableComponent } from './customer/modal-table/modal-table.component';
 
 
 const routes: Routes = [
@@ -54,7 +55,8 @@ const routes: Routes = [
   { path: 'personnel-size', component: BasedataPersonnelSizeComponent },
   { path: 'registered-capital', component: BasedataRegisteredCapitalComponent },
   { path: 'sales-status', component: BasedataSalesStatusComponent },
-  { path: 'add', component: BasedataSalesStatusAddComponent }];
+  { path: 'add', component: BasedataSalesStatusAddComponent },
+  { path: 'modalTable', component: BasedataCustomerModalTableComponent }];
 @NgModule({
   imports: [RouterModule.forChild(routes)],
   exports: [RouterModule]

+ 4 - 2
src/app/routes/basedata/basedata.module.ts

@@ -38,7 +38,8 @@ import { BasedataMerchantsIndustryAddComponent } from './merchants-industry/add/
 import { BasedataPersonnelSizeComponent } from './personnel-size/personnel-size.component';
 import { BasedataRegisteredCapitalComponent } from './registered-capital/registered-capital.component';
 import { BasedataSalesStatusComponent } from './sales-status/sales-status.component';
-import { BasedataSalesStatusAddComponent } from './sales-status/add/add.component';
+import { BasedataSalesStatusAddComponent } from './sales-status/add/add.component';
+import { BasedataCustomerModalTableComponent } from './customer/modal-table/modal-table.component';
 
 
 const COMPONENTS = [
@@ -67,7 +68,8 @@ const COMPONENTS = [
   BasedataPersonnelSizeComponent,
   BasedataRegisteredCapitalComponent,
   BasedataSalesStatusComponent,
-  BasedataSalesStatusAddComponent];
+  BasedataSalesStatusAddComponent,
+  BasedataCustomerModalTableComponent];
 const COMPONENTS_NOROUNT = [BasedataCustomerEditComponent,
   BasedataCustomerIsAbbreviationComponent,
   BasedataPostAddComponent,

+ 77 - 63
src/app/routes/basedata/customer/customer.component.html

@@ -1,72 +1,86 @@
 <page-header [action]="phActionTpl">
-    <ng-template #phActionTpl>
-        <span id="titleAdd" hidden="true">{{ 'button.add' | translate }}{{ 'customer.archives' | translate }}</span>
-        <span id="titleUpdate" hidden="true">{{ 'table.update' | translate }}{{ 'customer.archives' | translate }}</span>
-        <button (click)="edit('')" nz-button nzType="primary" acl [acl-ability]="'customer:add'">{{ 'button.add' | translate }}</button>
-    </ng-template>
+  <ng-template #phActionTpl>
+    <span id="titleAdd" hidden="true">{{ 'button.add' | translate }}{{ 'customer.archives' | translate }}</span>
+    <span id="titleUpdate" hidden="true">{{ 'table.update' | translate }}{{ 'customer.archives' | translate }}</span>
+    <button (click)="edit('')" nz-button nzType="primary" acl [acl-ability]="'customer:add'">
+      {{ 'button.add' | translate }}
+    </button>
+  </ng-template>
 </page-header>
 
 <nz-card>
-    <form nz-form>
+  <form nz-form>
     <!-- 查询条件 -->
     <div nz-row nzGutter="24">
-        <div nz-col nzMd="24" nzLg="3">
-            <nz-form-label>{{ 'customer.abbreviation' | translate }}</nz-form-label>
-        </div>
-        <div nz-col nzMd="24" nzLg="6">
-            <input nz-input [(ngModel)]="customer.abbreviation" name="abbreviation">
-        </div>
-        <div nz-col nzMd="24" nzLg="3">
-            <nz-form-label>{{ 'customer.name' | translate }}</nz-form-label>
-        </div>
-        <div nz-col nzMd="24" nzLg="6">
-            <input nz-input [(ngModel)]="customer.name" name="name">
-        </div>
-        <div nz-col nzMd="24" nzLg="6">
-            <button (click)="query()" nz-button nzType="primary">{{ 'button.query' | translate }}</button>
-            <!-- <button nz-button nzType="primary">{{ 'button.reset' | translate }}</button> -->
-        </div>
+      <div nz-col nzMd="24" nzLg="3">
+        <nz-form-label>{{ 'customer.abbreviation' | translate }}</nz-form-label>
+      </div>
+      <div nz-col nzMd="24" nzLg="6">
+        <input nz-input [(ngModel)]="customer.abbreviation" name="abbreviation" />
+      </div>
+      <div nz-col nzMd="24" nzLg="3">
+        <nz-form-label>{{ 'customer.name' | translate }}</nz-form-label>
+      </div>
+      <div nz-col nzMd="24" nzLg="6">
+        <input nz-input [(ngModel)]="customer.name" name="name" />
+      </div>
+      <div nz-col nzMd="24" nzLg="6">
+        <button (click)="query()" nz-button nzType="primary">{{ 'button.query' | translate }}</button>
+        <!-- <button nz-button nzType="primary">{{ 'button.reset' | translate }}</button> -->
+      </div>
     </div>
-</form>
-    <!-- 数据表 -->
-    <div nz-row nzGutter="24">
-        <div nz-col nzMd="24" nzLg="24">
-            <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false" [nzTotal]="page.total"
-                [nzPageIndex]="page.current" (nzPageIndexChange)="pageIndexChange($event)" [nzLoading]="isSpinning">
-                <thead>
-                    <tr>
-                        <th>{{ 'customer.code' | translate }}</th>
-                        <th>{{ 'customer.name' | translate }}</th>
-                        <th>{{ 'customer.shortName' | translate }}</th>
-                        <th>{{ 'customer.abbreviation' | translate }}</th>
-                        <th>{{ 'customer.contacts.name' | translate }}</th>
-                        <th>{{ 'table.operation' | translate }}</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr *ngFor="let data of basicTable.data">
-                        <td>{{ data.code }}</td>
-                        <td>{{ data.name }}</td>
-                        <td>{{ data.shortName }}</td>
-                        <td>{{ data.abbreviation }}</td>
-                        <td>{{ data.contactPsn }}</td>
-                        <td>
-                            <a (click)="openDetails(data.id)">{{'table.view'|translate}}</a>
-                            <nz-divider nzType="vertical"></nz-divider>
-                            <a href="javascript:void(0);" (click)="edit(data.id)" acl [acl-ability]="'customer:update'">{{ 'table.update' | translate }}</a>
-                            <nz-divider nzType="vertical"></nz-divider>
-                            <a
-                            nz-popconfirm
-                            nzTitle="{{'confirm.to.delete'|translate}}?"
-                            nzOkText="{{ 'yes' | translate }}"
-                            nzCancelText="{{ 'no' | translate }}"
-                            (nzOnConfirm)="delete(data.id)"
-                            acl [acl-ability]="'customer:delete'"
-                            >{{ 'table.delete' | translate }}</a>
-                        </td>
-                    </tr>
-                </tbody>
-            </nz-table>
-        </div>
+  </form>
+  <!-- 数据表 -->
+  <div nz-row nzGutter="24">
+    <div nz-col nzMd="24" nzLg="24">
+      <nz-table
+        nzSize="small"
+        #basicTable
+        [nzData]="listOfData"
+        [nzFrontPagination]="false"
+        [nzTotal]="page.total"
+        [nzPageIndex]="page.current"
+        (nzPageIndexChange)="pageIndexChange($event)"
+        [nzLoading]="isSpinning"
+      >
+        <thead>
+          <tr>
+            <th>{{ 'customer.code' | translate }}</th>
+            <th>{{ 'customer.name' | translate }}</th>
+            <th>{{ 'customer.shortName' | translate }}</th>
+            <th>{{ 'customer.abbreviation' | translate }}</th>
+            <th>{{ 'customer.contacts.name' | translate }}</th>
+            <th>{{ 'table.operation' | translate }}</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr *ngFor="let data of basicTable.data">
+            <td>{{ data.code }}</td>
+            <td>{{ data.name }}</td>
+            <td>{{ data.shortName }}</td>
+            <td>{{ data.abbreviation }}</td>
+            <td>{{ data.contactPsn }}</td>
+            <td>
+              <a (click)="openDetails(data.id)">{{ 'table.view' | translate }}</a>
+              <nz-divider nzType="vertical"></nz-divider>
+              <a href="javascript:void(0);" (click)="edit(data.id)" acl [acl-ability]="'customer:update'">{{
+                'table.update' | translate
+              }}</a>
+              <nz-divider nzType="vertical"></nz-divider>
+              <a
+                nz-popconfirm
+                nzTitle="{{ 'confirm.to.delete' | translate }}?"
+                nzOkText="{{ 'yes' | translate }}"
+                nzCancelText="{{ 'no' | translate }}"
+                (nzOnConfirm)="delete(data.id)"
+                acl
+                [acl-ability]="'customer:delete'"
+                >{{ 'table.delete' | translate }}</a
+              >
+            </td>
+          </tr>
+        </tbody>
+      </nz-table>
     </div>
+  </div>
 </nz-card>

+ 300 - 19
src/app/routes/basedata/customer/edit/edit.component.html

@@ -159,7 +159,7 @@
       </nz-form-control>
 
       <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.Postal.address' | translate }}</nz-form-label>
-      <!-- 通讯地址 -->
+      <!-- 注册地址 -->
       <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.postalAddress" name="postalAddress" nz-input maxlength="100" />
       </nz-form-control>
@@ -221,7 +221,7 @@
       </nz-form-control>
 
       <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'sales.status' | translate }}</nz-form-label>
-      <!-- 销售状态 -->
+      <!-- 销售状态 -->
       <nz-form-control [nzSm]="4" [nzXs]="24">
         <nz-tree-select
           nzAllowClear="false"
@@ -244,11 +244,9 @@
       <!-- 客商属性 -->
       <nz-form-control [nzSm]="4" [nzXs]="24">
         <nz-radio-group [(ngModel)]="customer.customerAttribute" name="customerAttribute">
-          <label nz-radio nzValue="{{ 'customer' | translate }}">{{ 'customer' | translate }}</label>
-          <label nz-radio nzValue="{{ 'supplier' | translate }}">{{ 'supplier' | translate }}</label>
-          <label nz-radio nzValue="{{ 'customer' | translate }}、{{ 'supplier' | translate }}">
-            {{ 'customer' | translate }}、{{ 'supplier' | translate }}
-          </label>
+          <label nz-radio nzValue="1">{{ 'customer' | translate }}</label>
+          <label nz-radio nzValue="2">{{ 'supplier' | translate }}</label>
+          <label nz-radio nzValue="3"> {{ 'customer' | translate }}、{{ 'supplier' | translate }} </label>
         </nz-radio-group>
       </nz-form-control>
 
@@ -295,22 +293,305 @@
       <nz-form-label [nzSm]="3" [nzXs]="24">
         {{ 'higher.unit' | translate }}
       </nz-form-label>
-      <!-- 上级单位  -->
-      <nz-form-control [nzSm]="4" [nzXs]="24">
-        <nz-input-group 
-          nzSearch 
-          [nzAddOnAfter]="suffixIconButton"   
-          [(ngModel)]="customer.parentId" 
-          name="parentId">
-          <input type="text" nz-input placeholder="{{ 'select.please.choose' | translate }}" [disabled]="true" />
-        </nz-input-group>
-        <ng-template #suffixIconButton>
-          <button nz-button nzType="primary" nzSearch><i nz-icon type="search"></i></button>
-        </ng-template>
+      <!-- 上级单位  禁选 -->
+      <span ng-if="customer.parentId">
+        <nz-form-control [nzSm]="4" [nzXs]="24">
+          <nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
+            <input
+              type="text"
+              [(ngModel)]="customer.parentName"
+              name="parentName"
+              nz-input
+              placeholder="{{ 'select.please.choose' | translate }}"
+              [disabled]="true"
+            />
+          </nz-input-group>
+          <ng-template #suffixIconButton>
+            <!-- 放大镜  勾选列表 -->
+            <button nz-button nzType="primary" nzSearch (click)="modalTable()">
+              <i nz-icon type="search"></i>
+            </button>
+          </ng-template>
+        </nz-form-control>
+      </span>
+
+      <!-- 回显 -->
+      <!-- <span ng-if="!customer.parentId">
+        <nz-form-control [nzSm]="4" [nzXs]="24">
+          <nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
+            <input type="text" [(ngModel)]="customer.parentId" name="parentId" nz-input [disabled]="false" />
+          </nz-input-group>
+          <ng-template #suffixIconButton> -->
+      <!-- 放大镜 -->
+      <!-- <button nz-button nzType="primary" nzSearch (click)="modalTable()">
+              <i nz-icon type="search"></i>
+            </button>
+          </ng-template>
+        </nz-form-control>
+      </span> -->
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'use.status' | translate }}
+      </nz-form-label>
+      <!-- 使用状态-->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.useStatusDictValue"
+          name="useStatusDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of useStatusList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"> </nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'sleep.type' | translate }}
+      </nz-form-label>
+      <!-- 休眠类型 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.sleepTypeDictValue"
+          name="sleepTypeDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of sleepTypeList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
       </nz-form-control>
     </nz-form-item>
 
     <!-- 第十行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'unit' | translate }}{{ 'web.address' | translate }}</nz-form-label>
+      <!-- 单位网址 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.companyWebsite" name="companyWebsite" nz-input maxlength="120" />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'in.company' | translate }}{{ 'establish.date' | translate }}
+      </nz-form-label>
+      <!-- 公司成立日期 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-date-picker
+          [nzAllowClear]="false"
+          [(ngModel)]="customer.companyEstablishDate"
+          name="companyEstablishDate"
+          (ngModelChange)="companyDateChange($event)"
+        ></nz-date-picker>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24"> {{ 'unit' | translate }}{{ 'size' | translate }} </nz-form-label>
+      <!-- 单位规模 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.unitSizeDictValue"
+          name="unitSizeDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of unitSizeList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第11行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24"> {{ 'personnel' | translate }}{{ 'size' | translate }} </nz-form-label>
+      <!-- 人员规模 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.personnelSizeDictValue"
+          name="personnelSizeDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of personnelSizeList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'app.register.register' | translate }}{{ 'capital' | translate }}
+      </nz-form-label>
+      <!-- 注册资金 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.registeredCapitalDictValue"
+          name="registeredCapitalDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of registeredCapitalList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24"> {{ 'annual.turnover' | translate }}</nz-form-label>
+      <!-- 年营业额 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-input-number
+          [(ngModel)]="customer.annualTurnover"
+          name="annualTurnover"
+          [nzMin]="0"
+          [nzParser]="parserDollar"
+          [nzFormatter]="formatterDollar"
+          [nzMax]="100000000000000000"
+          [nzStep]="5000"
+        ></nz-input-number>
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第12行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24"> {{ 'customer' | translate }}{{ 'relation' | translate }} </nz-form-label>
+      <!-- 客户关系 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.customerRelationshipDictValue"
+          name="customerRelationshipDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of customerRelationshipList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'value.level' | translate }}
+      </nz-form-label>
+      <!-- 价值级别 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.valueLevelDictValue"
+          name="valueLevelDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of valueLevelList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'sales.staff' | translate }}
+      </nz-form-label>
+      <!-- 销售人员 树 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-tree-select
+          [nzNodes]="salesStaffList"
+          nzShowSearch
+          id="salesmanId"
+          name="salesmanId"
+          nzAllowClear="false"
+          [(ngModel)]="customer.salesmanId"
+          (ngModelChange)="onChangeSalesmanId($event)"
+          (getCheckedNodeList)="getSalesId()"
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+        >
+        </nz-tree-select>
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第13行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'billing.unit.name' | translate }}</nz-form-label>
+      <!-- 开票单位名称 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.billingUnitName" name="billingUnitName" nz-input maxlength="120" />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'taxpayer.identification.Num' | translate }}</nz-form-label>
+      <!-- 纳税人识别号 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input
+          [(ngModel)]="customer.taxpayerIdentificationNumber"
+          name="taxpayerIdentificationNumber"
+          nz-input
+          maxlength="120"
+        />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'billing.address' | translate }}</nz-form-label>
+      <!-- 开票地址 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.billingAddress" name="billingAddress" nz-input maxlength="120" />
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第14行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'billing.telephone' | translate }}</nz-form-label>
+      <!--开票电话-->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input name="billingTelephone" nz-input [(ngModel)]="customer.billingTelephone" maxlength="20" />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'billing.bank' | translate }}</nz-form-label>
+      <!-- 开票银行 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.billingBank" name="billingBank" nz-input maxlength="120" />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'billing.bank' | translate }}{{ 'customer.account.number' | translate }}
+      </nz-form-label>
+      <!--开票银行账号-->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input
+          name="billingBankAccountNumber"
+          nz-input
+          [(ngModel)]="customer.billingBankAccountNumber"
+          maxlength="20"
+        />
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第15行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'development' | translate }}{{ 'personnel' | translate }}</nz-form-label>
+      <!-- 开发人员 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.developer" name="developer" nz-input maxlength="120" />
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24"> {{ 'development' | translate }}{{ 'date' | translate }} </nz-form-label>
+      <!-- 开发日期-->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-date-picker
+          [nzAllowClear]="false"
+          [(ngModel)]="customer.developmentDate"
+          name="developmentDate"
+          (ngModelChange)="companyDateChange($event)"
+        ></nz-date-picker>
+      </nz-form-control>
+    </nz-form-item>
   </form>
 
   <!-- 新增  联系人 -->

+ 148 - 19
src/app/routes/basedata/customer/edit/edit.component.ts

@@ -2,8 +2,8 @@ import { Component, OnInit, HostListener, ElementRef, Input } from '@angular/cor
 import { _HttpClient } from '@delon/theme';
 import { NzDrawerRef, NzMessageService, NzModalService, NzNotificationService } from 'ng-zorro-antd';
 import { CustomerService } from 'app/services/basedata/customer.service';
-import { BasedataCustomerCustomerAddComponent } from '../customer-add/customer-add.component';
 import { Customer } from 'app/entity/basedata/customer';
+import { BasedataCustomerCustomerAddComponent } from '../customer-add/customer-add.component';
 import { I18NService } from '@core';
 import { CustomerContacts } from 'app/entity/basedata/customer-contacts';
 import { messageShared } from '@shared/utils/message';
@@ -13,6 +13,9 @@ import { BaseCustomerIndustry } from 'app/entity/basedata/base-customer-industry
 import { BaseCustomerIndustryService } from 'app/services/basedata/base-customer-industry.service';
 import { BaseSalesStatus } from 'app/entity/basedata/base-sales-status';
 import { BaseSalesStatusService } from 'app/services/basedata/base-sales-status.service';
+import { PersonnelService } from 'app/services/basedata/personnel.service'; //销售人员
+import { BasedataCustomerModalTableComponent } from '../modal-table/modal-table.component';
+import { recursiveQuery } from '@shared/utils/yuan copy'; //筛选可选择
 
 @Component({
   selector: 'app-basedata-customer-edit',
@@ -35,6 +38,7 @@ import { BaseSalesStatusService } from 'app/services/basedata/base-sales-status.
 })
 export class BasedataCustomerEditComponent implements OnInit {
   @Input() id: string; //项目id
+
   customer = {
     code: '',
     name: '',
@@ -66,13 +70,16 @@ export class BasedataCustomerEditComponent implements OnInit {
     //销售状态id
     baseSalesStatusId: '',
     //客商属性
-    customerAttribute: '',
+    customerAttribute: '1', //默认选中 1 客户
+    // pageNo: '1', //默认页码
     //客商分组(数据字典)
     customerGroupingDictValue: '',
     //商务关系(数据字典)
     businessRelationsDictValue: '',
     //上级单位(本表id)
     parentId: '',
+    //上级单位名称
+    parentName: '',
     //使用状态(数据字典)
     useStatusDictValue: '',
     //休眠类型(数据字典)
@@ -92,7 +99,7 @@ export class BasedataCustomerEditComponent implements OnInit {
     annualTurnover: 0,
     //客户关系(数据字典)
     customerRelationshipDictValue: '',
-    //价值级别(数据字典)
+    // 价值级别(数据字典)
     valueLevelDictValue: '',
     //销售人员id
     salesmanId: '',
@@ -115,21 +122,17 @@ export class BasedataCustomerEditComponent implements OnInit {
     //开发时间
     /**开发时间 yyyy-MM-dd*/
     developmentDate: '',
-
-    radioValue: 'c' //客商属性 单选框默认值
   };
 
-  //  客商行业 字段规范
-  baseCustomerIndustry: BaseCustomerIndustry = {};
-  //  销售状态
-  baseSalesStatus: BaseSalesStatus = {};
-
+  baseCustomerIndustry: BaseCustomerIndustry = {}; //  客商行业 字段规范
+  baseSalesStatus: BaseSalesStatus = {}; //  销售状态
   listOfData = []; //客户联系人集合
+
   enable = false; //是否停用
   codeDisabled = false;
   cryptoJS = require('crypto-js');
   tripledes = require('crypto-js/tripledes');
- 
+  selectId: { [key: string]: boolean } = {};
 
   constructor(
     private nzDrawerRef: NzDrawerRef,
@@ -142,20 +145,30 @@ export class BasedataCustomerEditComponent implements OnInit {
     private dictService: DictService,
     private baseCustomerIndustryService: BaseCustomerIndustryService,
     private baseSalesStatusService: BaseSalesStatusService,
+    private personnelService: PersonnelService, //销售人员
   ) {}
 
   ngOnInit() {
     //所有字典数据
     this.getDictList()
       .then(res => {
-        //客商行业数树
+        //客商行业数 
         return this.getListIndustryTree();
       })
       .then(res => {
-        //销售状态
+        //销售状态
         return this.getSalesStatusTree();
+      })
+      // .then(res => {
+      //   //上级单位 弹框内列表
+      //   return this.getTableList();
+      // })
+      .then(res => {
+        //销售人员 树
+        return this.getSalesStaffTree();
       });
 
+    //根据id 判断新增 or 编辑
     if (this.id == '') {
       //新增
     } else {
@@ -171,11 +184,59 @@ export class BasedataCustomerEditComponent implements OnInit {
   customerSourceList = []; //客商来源数据
   baseCustomerIndustryId = String; //客商行业字段(树)
   merchantsIndustryList: any = []; //客商行业数据
-  salesStatusList: any = []; //销售状态数据
+  salesStatusList: any = []; //销售状态数据(树)
   customerGroupList = []; //客商分组
   busRelDictList = []; //商务关系数据
+  useStatusList = []; //使用状态
+  sleepTypeList = []; //休眠状态
+  unitSizeList = []; //单位规模
+  personnelSizeList = []; //人员规模
+  registeredCapitalList = []; //注册资金
+  customerRelationshipList = []; //客户关系
+  valueLevelList = []; //价值级别
+  salesStaffList: any = []; //销售人员数据(树)
 
-  // 查询所有字典数据
+  //金额格式化 (公司注册资金)
+  formatterDollar = (value: number) => {
+    if (value) {
+      return `$ ${value}`;
+    } else {
+      return `$ `;
+    }
+  };
+
+  parserDollar = (value: string) => value.replace('$ ', '');
+
+  //点击放大镜 上级单位 弹框
+  modalTable() {
+    const modalRef = this.modalService.create({
+      nzTitle: '选择上级单位',
+      nzContent: BasedataCustomerModalTableComponent,
+      nzWidth: 1400,
+      nzFooter: [
+        {
+          label: '关闭',
+          type: 'default',
+          onClick: addModel => {
+            addModel.handleCancel();
+          },
+        },
+        {
+          label: '确定',
+          type: 'primary',
+          onClick: addModel => {
+            addModel.handleOk();
+            // addModel.selectObj 包含勾选项的 id 和 name
+            this.customer.parentName = addModel.selectObj[0].name;
+            this.customer.parentId = addModel.selectObj[0].id;
+            console.log('addModel.selectObj:', this.customer.parentName, this.customer.parentId);
+          },
+        },
+      ],
+    });
+  }
+
+  // 所有字典数据
   getDictList() {
     return new Promise(resolve => {
       //获取客商分类数据
@@ -185,18 +246,54 @@ export class BasedataCustomerEditComponent implements OnInit {
         //客商来源
         this.dictService.getByDictCode('information_sources').then(response => {
           this.customerSourceList = response.result;
-          console.log(this.customerSourceList);
+          // console.log(this.customerSourceList);
           resolve();
           //客商分组
           this.dictService.getByDictCode('customer_grouping').then(response => {
             this.customerGroupList = response.result;
-            console.log(this.customerGroupList);
+            // console.log(this.customerGroupList);
             resolve();
             //客商分组
             this.dictService.getByDictCode('business_relations').then(response => {
               this.busRelDictList = response.result;
-              console.log(this.customerGroupList);
+              // console.log(this.customerGroupList);
               resolve();
+              //使用状态
+              this.dictService.getByDictCode('use_status').then(response => {
+                this.useStatusList = response.result;
+                // console.log(this.customerGroupList);
+                resolve();
+                //休眠类型
+                this.dictService.getByDictCode('sleep_type').then(response => {
+                  this.sleepTypeList = response.result;
+                  resolve();
+                  //单位规模
+                  this.dictService.getByDictCode('unit_size').then(response => {
+                    this.unitSizeList = response.result;
+                    resolve();
+                    //人员规模
+                    this.dictService.getByDictCode('personnel_size').then(response => {
+                      this.personnelSizeList = response.result;
+                      resolve();
+                      //注册资金
+                      this.dictService.getByDictCode('registered_capital').then(response => {
+                        this.registeredCapitalList = response.result;
+                        resolve();
+                        //客户关系
+                        this.dictService.getByDictCode('customer-relationship').then(response => {
+                          this.customerRelationshipList = response.result;
+                          resolve();
+                          //价值级别
+                          this.dictService.getByDictCode('value_level').then(response => {
+                            this.valueLevelList = response.result;
+                            resolve();
+                          });
+                        });
+                      });
+                    });
+                  });
+                });
+              });
             });
           });
         });
@@ -214,6 +311,7 @@ export class BasedataCustomerEditComponent implements OnInit {
       // console.log('merchantsIndustryList--->', this.merchantsIndustryList);
     });
   }
+
   //销售状态 树
   getSalesStatusTree() {
     let baseSalesStatus = new BaseSalesStatus();
@@ -225,6 +323,32 @@ export class BasedataCustomerEditComponent implements OnInit {
     });
   }
 
+  // 销售人员 树 (筛选可选择项)
+  getSalesStaffTree() {
+    this.personnelService
+      .queryApprover(sessionStorage.getItem('pkOrg'))
+      .then(res => {
+        //赋值第一行是 “ 请选择 ”
+        this.salesStaffList = [{ id: '', value: '', title: '请选择', isLeaf: true }];
+        this.salesStaffList = this.salesStaffList.concat(res.result);
+        console.log('销售人员树--->', this.salesStaffList);
+      })
+      // 调用筛选 可选择的 树方法recursiveQuery
+      .then(res => {
+        console.log('000');
+        recursiveQuery(this.salesStaffList);
+      });
+  }
+
+  //拿到选择的 销售人员ID
+  onChangeSalesmanId($event) {
+  console.log('????', $event);
+    this.customer.salesmanId = $event;
+    console.log('选择销售的id', this.customer.salesmanId);
+  }
+  //公司成立日期自带方法
+  companyDateChange() {}
+
   // 客商行业 自带方法
   onChangeMI($event) {}
   // 销售状态 自带方法
@@ -453,7 +577,7 @@ export class BasedataCustomerEditComponent implements OnInit {
 
   //最后保存
   save() {
-    console.log(this.listOfData);
+    console.log('edit最后的保存', this.listOfData);
     var isdefault = 0;
     this.listOfData.forEach(element => {
       if (element.isDefault == '1') {
@@ -473,6 +597,11 @@ export class BasedataCustomerEditComponent implements OnInit {
     } else {
       this.saveCustomer();
     }
+    //判断是否选择销售人员
+    if (!this.customer.salesmanId) {
+      this.notification.warning('错误提示', '必须选择销售人员'); //通知提醒框
+      console.log('选择的销售人员', this.customer.salesmanId);
+    }
   }
 
   //客户保存

+ 65 - 0
src/app/routes/basedata/customer/modal-table/modal-table.component.html

@@ -0,0 +1,65 @@
+<!-- nzAlign="center" whereCustomer-->
+
+<form nz-form>
+  <!-- 查询条件 -->
+  <div nz-row nzGutter="24">
+    <div nz-col nzMd="24" nzLg="3">
+      <nz-form-label>{{ 'customer.abbreviation' | translate }}</nz-form-label>
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <input nz-input [(ngModel)]="customer.abbreviation" name="abbreviation" />
+    </div>
+    <div nz-col nzMd="24" nzLg="3">
+      <nz-form-label>{{ 'customer.name' | translate }}</nz-form-label>
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <input nz-input [(ngModel)]="customer.name" name="name" />
+    </div>
+    <div nz-col nzMd="24" nzLg="6">
+      <button (click)="query()" nz-button nzType="primary">{{ 'button.query' | translate }}</button>
+      <!-- <button nz-button nzType="primary">{{ 'button.reset' | translate }}</button> -->
+    </div>
+  </div>
+</form>
+
+<nz-table
+  #rowSelectTable
+  [nzData]="selectData"
+  [nzTotal]="page.total"
+  [nzPageIndex]="page.current"
+  [nzFrontPagination]="false"
+  (nzPageIndexChange)="pageIndexChange($event)"
+  [nzLoading]="isSpinning"
+  nzBordered
+  nzAlign
+  (nzCurrentPageDataChange)="currentPageDataChange($event)"
+  
+>
+  <thead>
+    <tr>
+      <th
+        [nzSelections]="listOfSelection"
+        [nzIndeterminate]="isIndeterminate"
+        [(nzChecked)]="isAllDisplayDataChecked" 
+      ></th>
+      <th>{{ 'customer.code' | translate }}</th>
+      <th>{{ 'customer.name' | translate }}</th>
+      <th>{{ 'customer.shortName' | translate }}</th>
+      <th>{{ 'customer.abbreviation' | translate }}</th>
+      <th>{{ 'customer.contacts.name' | translate }}</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr *ngFor="let data of rowSelectTable.data">
+      <td 
+        nzShowCheckbox 
+        [(nzChecked)]="mapOfCheckedId[data.id]" 
+        (nzCheckedChange)="refreshStatus()"></td>
+      <td>{{ data.code }}</td>
+      <td>{{ data.name }}</td>
+      <td>{{ data.shortName }}</td>
+      <td>{{ data.abbreviation }}</td>
+      <td>{{ data.contactPsn }}</td>
+    </tr>
+  </tbody>
+</nz-table>

+ 24 - 0
src/app/routes/basedata/customer/modal-table/modal-table.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { BasedataCustomerModalTableComponent } from './modal-table.component';
+
+describe('BasedataCustomerModalTableComponent', () => {
+  let component: BasedataCustomerModalTableComponent;
+  let fixture: ComponentFixture<BasedataCustomerModalTableComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ BasedataCustomerModalTableComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(BasedataCustomerModalTableComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 102 - 0
src/app/routes/basedata/customer/modal-table/modal-table.component.ts

@@ -0,0 +1,102 @@
+import { Component, OnInit } from '@angular/core';
+import { _HttpClient } from '@delon/theme';
+
+import { Customer } from 'app/entity/basedata/customer';
+import { CustomerService } from 'app/services/basedata/customer.service';
+import { NzModalRef, NzNotificationService } from 'ng-zorro-antd';
+
+@Component({
+  selector: 'app-basedata-customer-modal-table',
+  templateUrl: './modal-table.component.html',
+})
+export class BasedataCustomerModalTableComponent implements OnInit {
+  customer: Customer = {};
+
+  //页码
+  page = {
+    total: 0,
+    current: 0,
+    // pageNo: '',
+  };
+
+  constructor(
+    private customerService: CustomerService,
+    private modal: NzModalRef,
+    private notification: NzNotificationService,
+  ) {}
+
+  ngOnInit() {
+    this.getTableList();
+  }
+
+  selectData = []; //弹框所有列表数据
+  isSpinning = false;
+
+  //查询按钮
+  query() {
+    this.customer.pageNo = 1;
+    this.getTableList();
+  }
+  //查询列表数据
+  getTableList() {
+    this.isSpinning = true;
+    this.customer.pkOrg = sessionStorage.getItem('pkOrg');
+    this.customerService.getCustomer1(this.customer).then(res => {
+      // console.log('!!!!!--->', res);
+      this.selectData = res.result.records;
+      console.log('弹框列表集合--->', this.selectData);
+      this.page = res.result; //页码信息
+      this.isSpinning = false;
+    });
+  }
+
+  listOfDisplayData: any[] = []; //所有列表集合(包含勾选框)
+  mapOfCheckedId: { [key: string]: boolean } = {}; //已勾选 and 层勾选的项
+  selectComName: ''; //勾选的公司名称
+  selectObj: any = []; //被勾选的集合
+  //勾选 的回调
+  refreshStatus(): void {
+    // console.log('所有列表集合(包含勾选)', this.listOfDisplayData);
+  }
+
+  //勾选弹框 确定
+  handleOk(): void {
+    console.log('111111');
+    this.selectObj = []; //清空其他的勾选记录
+    this.listOfDisplayData.forEach(element => {
+      //判断 出 已勾选 true
+      if (this.mapOfCheckedId[element.id]) {
+        var obj = {
+          id: element.id,
+          name: element.name,
+        };
+        this.selectObj.push(obj);
+        console.log('勾选的上级单位', obj);
+        // console.log(this.selectObj);
+      }
+    });
+    //判断勾选个数
+    if (this.selectObj.length == 1) {
+      // console.log('勾选的名称', this.selectObj[0].name);
+      console.log( this.selectObj[0].name);
+      console.log('该对象selectObj',this.selectObj);
+      this.modal.destroy();
+    } else {
+      this.notification.warning('错误提示', '上级单位只可选择一个!'); //通知提醒框
+    }
+  }
+
+  handleCancel(): void {
+    this.modal.destroy();
+    console.log('销毁该弹框');
+  }
+  //按页码显示数据
+  pageIndexChange(event) {
+    this.customer.pageNo = event; //当前页码
+    this.getTableList();
+  }
+  currentPageDataChange($event: Array<{ id: number; name: string; age: number; address: string }>): void {
+    this.listOfDisplayData = $event;
+    this.refreshStatus();
+  }
+}

File diff suppressed because it is too large
+ 301 - 409
src/assets/tmp/i18n/zh-CN.json


Some files were not shown because too many files changed in this diff