chenc %!s(int64=3) %!d(string=hai) anos
pai
achega
47cce52f4c

+ 117 - 110
src/app/entity/basedata/customer.ts

@@ -1,113 +1,120 @@
 import { Page } from '../page';
 // 客户档案
-export class Customer extends Page{
-    id?:string;
-    code?:string; // 客户编码 (非空)
-    name?:string; // 客户名称 (非空)
-    shortName?:string;// 客户简称
-    abbreviation?:string;// 客户缩写
-    enName?:string;// 英文名称
-    address?:string;// 公司地址
-    phone?:string;// 电话
-    taxNo?:string;// 税号
-    bank?:string;// 开户行
-    account?:string;// 账号
-    enable?:string;// 是否停用 (非空)
-    creditGrade?:string;// 信用等级
-    creditPeriod?:string;// 信用期
-    delFlag?:string;// 是否删除
-    fdCustomerContactsList?:[];// 联系人
-    contacts?:string;// 默认联系人
-    telephone?:string;// 默认联系人电话
-    email?:string;// 默认联系人邮箱
-    zipCode?:string;//邮编
-    postalAddress?:string;//注册地址
-    isAbbreviation?:string;//是否存在同样客户缩写1不存在2存在
-    fdCustomerList?:[];//自身集合
-    pkOrg?:string;//组织id
-    //客商来源(数据字典)
-	customerSourceDictValue?:string;
-
-	//客商分类(数据字典)
-	customerClassificationDictValue?:string;
-
-	//客商行业id
-	baseCustomerIndustryId?:string;
-
-	//销售状态id
-	baseSalesStatusId?:string;
-
-	//客商属性
-	customerAttribute?:string;
-
-	//客商分组(数据字典)
-	customerGroupingDictValue?:string;
-
-	//商务关系(数据字典)
-	businessRelationsDictValue?:string;
-
-	//上级单位(本表id)
-	parentId?:string;
-
-	//使用状态(数据字典)
-	useStatusDictValue?:string;
-
-	//休眠类型(数据字典)
-	sleepTypeDictValue?:string;
-
-	//单位网址
-	companyWebsite?:string;
-
-	//公司成立日期
-	/**公司成立日期 yyyy-MM-dd*/
-	companyEstablishDate?:string;
-
-	//单位规模(数据字典)
-	unitSizeDictValue?:string;
-
-	//人员规模(数据字典)
-	personnelSizeDictValue?:string;
-
-	//注册资金(数据字典)
-	registeredCapitalDictValue?:string;
-
-	//年营业额
-	annualTurnover?:number;
-
-	//客户关系(数据字典)
-	customerRelationshipDictValue?:string;
-
-	//价值级别(数据字典)
-	valueLevelDictValue?:string;
-
-	//销售人员id
-	salesmanId?:string;
-
-	//销售人员名称
-	salesmanName?:string;
-
-	//开票单位名称
-	billingUnitName?:string;
-
-	//纳税人识别号
-	taxpayerIdentificationNumber?:string;
-
-	//开票地址
-	billingAddress?:string;
-
-	//开票电话
-	billingTelephone?:string;
-
-	//开票银行
-	billingBank?:string;
-
-	//开票银行账号
-	billingBankAccountNumber?:string;
-
-	//开发人员
-	developer?:string;
-
-	//开发时间
-	/**开发时间 yyyy-MM-dd*/
-	developmentDate?:string;
+export class Customer extends Page {
+  id?: string;
+  code?: string; // 客户编码 (非空)
+  name?: string; // 客户名称 (非空)
+  shortName?: string; // 客户简称
+  abbreviation?: string; // 客户缩写
+  enName?: string; // 英文名称
+  address?: string; // 公司地址
+  phone?: string; // 电话
+  taxNo?: string; // 税号
+  bank?: string; // 开户行
+  account?: string; // 账号
+  enable?: string; // 是否停用 (非空)
+  creditGrade?: string; // 信用等级
+  creditPeriod?: string; // 信用期
+  delFlag?: string; // 是否删除
+  fdCustomerContactsList?: []; // 联系人
+  contacts?: string; // 默认联系人
+  telephone?: string; // 默认联系人电话
+  email?: string; // 默认联系人邮箱
+  zipCode?: string; //邮编
+  postalAddress?: string; //注册地址
+  isAbbreviation?: string; //是否存在同样客户缩写1不存在2存在
+  fdCustomerList?: []; //自身集合
+  pkOrg?: string; //组织id
+
+  /**新加字段 */
+  //客商来源(数据字典)
+  customerSourceDictValue?: string;
+  //客商分类(数据字典)
+  customerClassificationDictValue?: string;
+  //客商行业id
+  baseCustomerIndustryId?: string;
+  //销售状态id
+  baseSalesStatusId?: string;
+  //客商属性
+  customerAttribute?: string;
+  //客商分组(数据字典)
+  customerGroupingDictValue?: string;
+  //商务关系(数据字典)
+  businessRelationsDictValue?: string;
+  //上级单位(本表id)
+  parentId?: string;
+  //使用状态(数据字典)
+  useStatusDictValue?: string;
+  //休眠类型(数据字典)
+  sleepTypeDictValue?: string;
+  //单位网址
+  companyWebsite?: string;
+  //公司成立日期
+  /**公司成立日期 yyyy-MM-dd*/
+  companyEstablishDate?: string;
+  //单位规模(数据字典)
+  unitSizeDictValue?: string;
+  //人员规模(数据字典)
+  personnelSizeDictValue?: string;
+  //注册资金(数据字典)
+  registeredCapitalDictValue?: string;
+  //年营业额
+  annualTurnover?: number;
+  //客户关系(数据字典)
+  customerRelationshipDictValue?: string;
+  //价值级别(数据字典)
+  valueLevelDictValue?: string;
+  //销售人员id
+  salesmanId?: string;
+  //销售人员名称
+  salesmanName?: string;
+  //开票单位名称
+  billingUnitName?: string;
+  //纳税人识别号
+  taxpayerIdentificationNumber?: string;
+  //开票地址
+  billingAddress?: string;
+  //开票电话
+  billingTelephone?: string;
+  //开票银行
+  billingBank?: string;
+  //开票银行账号
+  billingBankAccountNumber?: string;
+  //开发人员
+  developer?: string;
+  //开发时间
+  /**开发时间 yyyy-MM-dd*/
+  developmentDate?: string;
+  /////////////////////////////
+
+  /**用来详情显示字段 */
+  //客商分类名称(数据字典)
+  customerClassificationDictName?: string;
+  //客商来源名称(数据字典)
+  customerSourceDictName?: string;
+  //客商行业名称
+  baseCustomerIndustryName?: string;
+  //销售状态名称
+  baseSalesStatusName?: string;
+  //客商分组名称(数据字典)
+  customerGroupingDictName?: string;
+  //商务关系名称(数据字典)
+  businessRelationsDictName?: string;
+  //上级单位名称(本表)
+  parentName?: string;
+  //使用状态名称(数据字典)
+  useStatusDictName?: string;
+  //休眠类型名称(数据字典)
+  sleepTypeDictName?: string;
+  //单位规模名称(数据字典)
+  unitSizeDictName?: string;
+  //人员规模名称(数据字典)
+  personnelSizeDictName?: string;
+  //注册资金名称(数据字典)
+  registeredCapitalDictName?: string;
+  //客户关系名称(数据字典)
+  customerRelationshipDictName?: string;
+  //价值级别名称(数据字典)
+  valueLevelDictName?: string;
+  ////////////////////////////////////
 }

+ 2 - 2
src/app/routes/basedata/customer/customer.component.ts

@@ -82,7 +82,7 @@ export class BasedataCustomerComponent implements OnInit, OnDestroy {
     const drawerAddDepar = this.drawerService.create<BasedataCustomerEditComponent, { id: string }, string>({
       nzTitle: title,
       nzPlacement: 'right',
-      nzWidth: 1200,
+      nzWidth: '100%',
       nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
       nzContent: BasedataCustomerEditComponent,
       nzContentParams: {
@@ -127,7 +127,7 @@ export class BasedataCustomerComponent implements OnInit, OnDestroy {
   openDetails(id) {
     this.drawerService.create({
       nzTitle: this.i18Nservice.fanyi('check.customer.file'),
-      nzWidth: 900,
+      nzWidth: '100%',
       nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
       nzContent: BasedataCustomerDetailsComponent,
       nzContentParams: {

+ 48 - 47
src/app/routes/basedata/customer/details/details.component.html

@@ -1,83 +1,80 @@
 <nz-spin [nzSpinning]="isLoading">
   <form nz-form>
     <nz-form-item>
-      <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.code' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.code' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.code" name="code" nz-input [disabled]="true"
           placeholder="{{ 'automatic.generated' | translate }}" />
         <!--客户编码-->
       </nz-form-control>
-      <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.name' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.name' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.name" name="name" nz-input [disabled]="true"
           placeholder="{{ 'placeholder' | translate }}{{ 'customer.name' | translate }}" />
         <!--客户名称-->
       </nz-form-control>
-    </nz-form-item>
-    <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.shortName' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.shortName' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.shortName" name="shortName" nz-input [disabled]="true"
           placeholder="{{ 'placeholder' | translate }}{{ 'customer.shortName' | translate }}" />
         <!--客户简称-->
       </nz-form-control>
-      <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.abbreviation' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+    </nz-form-item>
+    <nz-form-item>
+
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.abbreviation' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.abbreviation" maxlength="3" [disabled]="true" name="abbreviation" nz-input />
         <!--客户缩写-->
       </nz-form-control>
-    </nz-form-item>
-    <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.name' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.name' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [disabled]="true" name="contacts" nz-input [(ngModel)]="customer.contacts" />
         <!--客户联系人-->
       </nz-form-control>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.telephone' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.telephone' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [disabled]="true" name="telephone" nz-input [(ngModel)]="customer.telephone" />
         <!--客户联系电话-->
       </nz-form-control>
     </nz-form-item>
     <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.mail' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.mail' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [disabled]="true" name="email" nz-input [(ngModel)]="customer.email" />
       </nz-form-control>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.company.address' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.company.address' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.address" name="address" nz-input [disabled]="true" />
       </nz-form-control>
-    </nz-form-item>
-    <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.company.phone' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.company.phone' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.phone" name="phone" nz-input [disabled]="true" />
       </nz-form-control>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.tax.no' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
-        <input [(ngModel)]="customer.taxNo" name="taxNo" nz-input [disabled]="true" />
-      </nz-form-control>
     </nz-form-item>
     <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.account.bank' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.tax.no' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.taxNo" name="taxNo" nz-input [disabled]="true" />
+      </nz-form-control>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.account.bank' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.bank" name="bank" nz-input [disabled]="true" />
       </nz-form-control>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.account.number' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.account.number' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [(ngModel)]="customer.account" name="account" nz-input [disabled]="true" />
       </nz-form-control>
     </nz-form-item>
     <nz-form-item>
-      <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.whether.using.or.not' | translate }}
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.whether.using.or.not' | translate }}
       </nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <nz-switch [nzDisabled]="true" [(ngModel)]="enable" name="enable" [ngModelOptions]="{standalone: true}"
           nzCheckedChildren="{{'store.yes' | translate}}" nzUnCheckedChildren="{{'store.no' | translate}}"></nz-switch>
       </nz-form-control>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.credit.grade' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.credit.grade' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <nz-select nzShowSearch nzAllowClear nzPlaceHolder="{{ 'select.please.choose' | translate }}"
           [nzDisabled]="true" [(ngModel)]="customer.creditGrade" name="creditGrade">
           <nz-option *ngIf="customer.creditGrade==''" nzLabel="{{ 'select.please.choose' | translate }}" nzValue=""
@@ -92,33 +89,37 @@
           <nz-option nzLabel="D" nzValue="4"></nz-option>
         </nz-select>
       </nz-form-control>
-    </nz-form-item>
-    <nz-form-item>
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.credit.period' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.credit.period' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <nz-input-number [nzDisabled]="true" [(ngModel)]="customer.creditPeriod" name="creditPeriod" nzMin="1">
         </nz-input-number>
         <!-- <input [(ngModel)]="customer.creditPeriod" name="creditPeriod" nz-input /> -->
       </nz-form-control>
+    </nz-form-item>
+    <nz-form-item>
       <!-- 邮编 -->
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.zipCode' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.zipCode' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [disabled]="true" [(ngModel)]="customer.zipCode" name="zipCode" nz-input />
       </nz-form-control>
-    </nz-form-item>
-    <nz-form-item>
       <!-- 通讯地址 -->
-      <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.Postal.address' | translate }}</nz-form-label>
-      <nz-form-control [nzSm]="7" [nzXs]="24">
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.Postal.address' | translate }}</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
         <input [disabled]="true" [(ngModel)]="customer.postalAddress" name="postalAddress" nz-input />
       </nz-form-control>
+      <!-- 客商分类 -->
+      <nz-form-label [nzSm]="3" [nzXs]="24">客商分类</nz-form-label>
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        {{customer.customerClassificationDictName}}
+      </nz-form-control>
     </nz-form-item>
     <!-- 联系人 -->
     <nz-form-item>
       <!-- 数据表 -->
       <div nz-row nzGutter="24">
         <div nz-col nzMd="24" nzLg="24">
-          <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false" [nzShowPagination]="false">
+          <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false"
+            [nzShowPagination]="false">
             <thead>
               <tr>
                 <th style="width:150px;">{{ 'customer.contacts.name' | translate }}</th>

+ 54 - 46
src/app/routes/basedata/customer/edit/edit.component.html

@@ -1,83 +1,80 @@
 <nz-spin [nzSpinning]="isLoading">
 <form nz-form>
   <nz-form-item>
-    <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.code' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.code' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.code" name="code" nz-input [disabled]="true"
         placeholder="{{ 'automatic.generated' | translate }}" />
       <!--客户编码-->
     </nz-form-control>
-    <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.name' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.name' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.name" name="name" nz-input
         placeholder="{{ 'placeholder' | translate }}{{ 'customer.name' | translate }}" maxlength=20/>
       <!--客户名称-->
     </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.shortName' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.shortName' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.shortName" name="shortName" nz-input
         placeholder="{{ 'placeholder' | translate }}{{ 'customer.shortName' | translate }}" maxlength=20/>
       <!--客户简称-->
     </nz-form-control>
-    <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.abbreviation' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+  </nz-form-item>
+
+  <nz-form-item>
+    <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.abbreviation' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.abbreviation" maxlength="3" name="abbreviation" nz-input />
       <!--客户缩写-->
     </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.name' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.name' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [disabled]="true" name="contacts" nz-input [(ngModel)]="customer.contacts" maxlength=10/>
       <!--客户联系人-->
     </nz-form-control>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.telephone' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.telephone' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [disabled]="true" name="telephone" nz-input [(ngModel)]="customer.telephone" maxlength=20/>
       <!--客户联系电话-->
     </nz-form-control>
   </nz-form-item>
   <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.contacts.mail' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.mail' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [disabled]="true" name="email" nz-input [(ngModel)]="customer.email" maxlength=30/>
     </nz-form-control>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.company.address' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.company.address' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.address" name="address" nz-input maxlength=100/>
     </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.company.phone' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.company.phone' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.phone" name="phone" nz-input maxlength=30/>
     </nz-form-control>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.tax.no' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
-      <input [(ngModel)]="customer.taxNo" name="taxNo" nz-input maxlength=30/>
-    </nz-form-control>
   </nz-form-item>
   <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.account.bank' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.tax.no' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
+      <input [(ngModel)]="customer.taxNo" name="taxNo" nz-input maxlength=30/>
+    </nz-form-control>
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.account.bank' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.bank" name="bank" nz-input maxlength=30/>
     </nz-form-control>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.account.number' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.account.number' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.account" name="account" nz-input maxlength=30/>
     </nz-form-control>
   </nz-form-item>
   <nz-form-item>
-    <nz-form-label nzRequired [nzSm]="5" [nzXs]="24">{{ 'customer.whether.using.or.not' | translate }}
+    <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.whether.using.or.not' | translate }}
     </nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <nz-switch [(ngModel)]="enable" name="enable" [ngModelOptions]="{standalone: true}"
         nzCheckedChildren="{{'store.yes' | translate}}" nzUnCheckedChildren="{{'store.no' | translate}}"></nz-switch>
     </nz-form-control>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.credit.grade' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.credit.grade' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <nz-select nzShowSearch nzAllowClear nzPlaceHolder="{{ 'select.please.choose' | translate }}" [nzDisabled]="false"
         [(ngModel)]="customer.creditGrade" name="creditGrade" (ngModelChange)="creditGradeChange($event)">
         <nz-option *ngIf="customer.creditGrade==''" nzLabel="{{ 'select.please.choose' | translate }}" nzValue=""
@@ -92,25 +89,36 @@
         <nz-option nzLabel="D" nzValue="4"></nz-option>
       </nz-select>
     </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.credit.period' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.credit.period' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <nz-input-number [(ngModel)]="customer.creditPeriod" name="creditPeriod" nzMin="1" [nzMax]=100000></nz-input-number>
       <!-- <input [(ngModel)]="customer.creditPeriod" name="creditPeriod" nz-input /> -->
     </nz-form-control>
+  </nz-form-item>
+  <nz-form-item>
     <!-- 邮编 -->
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.zipCode' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.zipCode' | translate }}</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
       <input [(ngModel)]="customer.zipCode" name="zipCode" nz-input maxlength=20/>
     </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
     <!-- 通讯地址 -->
-    <nz-form-label [nzSm]="5" [nzXs]="24">{{ 'customer.Postal.address' | translate }}</nz-form-label>
-    <nz-form-control [nzSm]="7" [nzXs]="24">
+    <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>
+    <!-- 客商分类 -->
+    <nz-form-label [nzSm]="3" [nzXs]="24">客商分类</nz-form-label>
+    <nz-form-control [nzSm]="4" [nzXs]="24">
+      <nz-select nzShowSearch nzPlaceHolder="{{ 'select.please.choose' | translate }}" [nzDisabled]="false"
+        [(ngModel)]="customer.customerClassificationDictValue" name="customerClassificationDictValue">
+        <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue=""
+          selected="selected">
+        </nz-option>
+        <ng-container *ngFor="let customerClassification of customerClassificationList">
+          <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+        </ng-container>
+      </nz-select>
+    </nz-form-control>
   </nz-form-item>
 </form>
   <!-- 联系人 -->

+ 80 - 12
src/app/routes/basedata/customer/edit/edit.component.ts

@@ -8,6 +8,7 @@ import { I18NService } from '@core';
 import { CustomerContacts } from 'app/entity/basedata/customer-contacts';
 import { messageShared } from '@shared/utils/message';
 import { BasedataCustomerIsAbbreviationComponent } from '../is-abbreviation/is-abbreviation.component';
+import { DictService } from 'app/services/dict.service';
 
 @Component({
   selector: 'app-basedata-customer-edit',
@@ -51,8 +52,67 @@ export class BasedataCustomerEditComponent implements OnInit {
     email: '',
     zipCode: '',
     postalAddress: '',
-    pkOrg:''
+    pkOrg: '',
+    //客商来源(数据字典)
+    customerSourceDictValue: '',
+    //客商分类(数据字典)
+    customerClassificationDictValue: '',
+    //客商行业id
+    baseCustomerIndustryId: '',
+    //销售状态id
+    baseSalesStatusId: '',
+    //客商属性
+    customerAttribute: '',
+    //客商分组(数据字典)
+    customerGroupingDictValue: '',
+    //商务关系(数据字典)
+    businessRelationsDictValue: '',
+    //上级单位(本表id)
+    parentId: '',
+    //使用状态(数据字典)
+    useStatusDictValue: '',
+    //休眠类型(数据字典)
+    sleepTypeDictValue: '',
+    //单位网址
+    companyWebsite: '',
+    //公司成立日期
+    /**公司成立日期 yyyy-MM-dd*/
+    companyEstablishDate: '',
+    //单位规模(数据字典)
+    unitSizeDictValue: '',
+    //人员规模(数据字典)
+    personnelSizeDictValue: '',
+    //注册资金(数据字典)
+    registeredCapitalDictValue: '',
+    //年营业额
+    annualTurnover: 0,
+    //客户关系(数据字典)
+    customerRelationshipDictValue: '',
+    //价值级别(数据字典)
+    valueLevelDictValue: '',
+    //销售人员id
+    salesmanId: '',
+    //销售人员名称
+    salesmanName: '',
+    //开票单位名称
+    billingUnitName: '',
+    //纳税人识别号
+    taxpayerIdentificationNumber: '',
+    //开票地址
+    billingAddress: '',
+    //开票电话
+    billingTelephone: '',
+    //开票银行
+    billingBank: '',
+    //开票银行账号
+    billingBankAccountNumber: '',
+    //开发人员
+    developer: '',
+    //开发时间
+    /**开发时间 yyyy-MM-dd*/
+    developmentDate: '',
   };
+
   listOfData = []; //客户联系人集合
   enable = false; //是否停用
   codeDisabled = false;
@@ -67,9 +127,12 @@ export class BasedataCustomerEditComponent implements OnInit {
     private notification: NzNotificationService,
     private el: ElementRef,
     private i18NService: I18NService,
+    private dictService: DictService,
   ) {}
 
   ngOnInit() {
+    //数据字典数据
+    this.getDictList();
     if (this.id == '') {
       //新增
     } else {
@@ -78,6 +141,20 @@ export class BasedataCustomerEditComponent implements OnInit {
     }
   }
 
+  /**
+   * 获取数据字典数据
+   */
+  customerClassificationList = []; //客商分类
+  getDictList() {
+    return new Promise(resolve => {
+      //获取客商分类数据
+      this.dictService.getByDictCode('customer_classification').then(response => {
+        this.customerClassificationList = response.result;
+        resolve();
+      });
+    });
+  }
+
   getById() {
     this.customerService.getById(this.id).then(response => {
       this.customer = response.result;
@@ -322,15 +399,6 @@ export class BasedataCustomerEditComponent implements OnInit {
     }
   }
 
-  /**
-   * @description: 信用等级change事件
-   * @param {type}
-   * @author: 段亚鑫
-   */
-  creditGradeChange(event) {
-    !event ? (this.customer.creditGrade = '') : (this.customer.creditGrade = this.customer.creditGrade);
-  }
-
   //客户保存
   saveCustomer() {
     if (this.enable) {
@@ -356,7 +424,7 @@ export class BasedataCustomerEditComponent implements OnInit {
       //查询条件
       let customer = new Customer();
       customer.abbreviation = this.customer.abbreviation;
-      customer.pkOrg=sessionStorage.getItem("pkOrg");
+      customer.pkOrg = sessionStorage.getItem('pkOrg');
       //查询是否存在同样客户缩写
       this.customerService.isAbbreviation(customer).then(response => {
         let customerResult: Customer = JSON.parse(JSON.stringify(response.result));
@@ -429,7 +497,7 @@ export class BasedataCustomerEditComponent implements OnInit {
 
   addCustomerServerce() {
     this.isLoading = true;
-    this.customer.pkOrg=sessionStorage.getItem("pkOrg");
+    this.customer.pkOrg = sessionStorage.getItem('pkOrg');
     this.customerService.addCustomer(this.customer).then(response => {
       if (response.success) {
         // this.message.success(this.i18NService.fanyi("newsuccess"));