Browse Source

[客户档案] 大抽屉 字段添加

liangyan0105 3 years ago
parent
commit
b23ed79886

+ 24 - 0
README.md

@@ -90,3 +90,27 @@ Thank you to all our backers! 🙏
 ### License
 
 The MIT License (see the [LICENSE](https://github.com/ng-alain/ng-alain/blob/master/LICENSE) file for the full text)
+
+
+<!-- ------------------------------ -->
+
+新增 显示
+
+
+客商行业 树形选择
+销售
+客户档案 获取字典 
+
+字段   全在客户文件里  
+
+上级单位 需要弹框 搜索 点击后 
+
+<!-- -------------- -->
+
+详情显示 
+1.下拉存id   展示文字(name)
+2.其他字段一直
+3.详情不要框  直接显示
+
+
+接口参数 --系统管理-数据字典里的字典编码

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

@@ -27,11 +27,12 @@ export class Customer extends Page {
   pkOrg?: string; //组织id
 
   /**新加字段 */
-  //客商来源(数据字典)
-  customerSourceDictValue?: string;
   //客商分类(数据字典)
   customerClassificationDictValue?: string;
-  //客商行业id
+  //客商来源(数据字典)
+  customerSourceDictValue?: string;
+
+  //客商行业 id
   baseCustomerIndustryId?: string;
   //销售状态id
   baseSalesStatusId?: string;
@@ -41,6 +42,7 @@ export class Customer extends Page {
   customerGroupingDictValue?: string;
   //商务关系(数据字典)
   businessRelationsDictValue?: string;
+
   //上级单位(本表id)
   parentId?: string;
   //使用状态(数据字典)
@@ -67,7 +69,7 @@ export class Customer extends Page {
   //销售人员id
   salesmanId?: string;
   //销售人员名称
-  salesmanName?: string;
+  salesmanName?: string;   //用项目管理菜单里面新增 有个接口
   //开票单位名称
   billingUnitName?: string;
   //纳税人识别号

+ 346 - 130
src/app/routes/basedata/customer/edit/edit.component.html

@@ -1,131 +1,324 @@
 <nz-spin [nzSpinning]="isLoading">
-<form nz-form>
-  <nz-form-item>
-    <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 }}" />
+  <form nz-form>
+    <!-- 第一行 -->
+    <nz-form-item>
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.code' | translate }}</nz-form-label>
       <!--客户编码-->
-    </nz-form-control>
-    <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 [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]="3" [nzXs]="24">{{ 'customer.name' | translate }}</nz-form-label>
       <!--客户名称-->
-    </nz-form-control>
-    <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 [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-label [nzSm]="3" [nzXs]="24">{{ 'customer.shortName' | translate }}</nz-form-label>
       <!--客户简称-->
-    </nz-form-control>
-  </nz-form-item>
+      <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-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-item>
+      <nz-form-label nzRequired [nzSm]="3" [nzXs]="24">{{ 'customer.abbreviation' | translate }}</nz-form-label>
       <!--客户缩写-->
-    </nz-form-control>
-    <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 [nzSm]="4" [nzXs]="24">
+        <input [(ngModel)]="customer.abbreviation" maxlength="3" name="abbreviation" nz-input />
+      </nz-form-control>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.name' | translate }}</nz-form-label>
       <!--客户联系人-->
-    </nz-form-control>
-    <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 [nzSm]="4" [nzXs]="24">
+        <input [disabled]="true" name="contacts" nz-input [(ngModel)]="customer.contacts" maxlength="10" />
+      </nz-form-control>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.contacts.telephone' | translate }}</nz-form-label>
       <!--客户联系电话-->
-    </nz-form-control>
-  </nz-form-item>
-  <nz-form-item>
-    <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]="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-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-item>
-  <nz-form-item>
-    <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]="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]="3" [nzXs]="24">{{ 'customer.whether.using.or.not' | translate }}
-    </nz-form-label>
-    <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]="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=""
-          selected="selected">
-        </nz-option>
-        <!-- <ng-container *ngFor="let de of listClass">
+      <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]="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]="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-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-item>
+
+    <!-- 第四行 -->
+    <nz-form-item>
+      <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]="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]="3" [nzXs]="24">
+        {{ 'customer.whether.using.or.not' | translate }}
+      </nz-form-label>
+      <!-- 是否停用 -->
+      <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]="3" [nzXs]="24">{{ 'customer.credit.grade' | translate }}</nz-form-label>
+      <!-- 信用等级 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzAllowClear="false"
+          nzShowSearch
+          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=""
+            selected="selected"
+          >
+          </nz-option>
+          <!-- <ng-container *ngFor="let de of listClass">
           <nz-option nzLabel="{{de.name}}" nzValue="{{de.id}}"></nz-option>
         </ng-container> -->
-        <nz-option nzLabel="A" nzValue="1"></nz-option>
-        <nz-option nzLabel="B" nzValue="2"></nz-option>
-        <nz-option nzLabel="C" nzValue="3"></nz-option>
-        <nz-option nzLabel="D" nzValue="4"></nz-option>
-      </nz-select>
-    </nz-form-control>
-    <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-option nzLabel="A" nzValue="1"></nz-option>
+          <nz-option nzLabel="B" nzValue="2"></nz-option>
+          <nz-option nzLabel="C" nzValue="3"></nz-option>
+          <nz-option nzLabel="D" nzValue="4"></nz-option>
+        </nz-select>
+      </nz-form-control>
+      <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]="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-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"
+        >{{ 'quotation.merchants' | translate }}{{ 'cost.item.category' | translate }}</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>
+
+    <!-- 第七行 ------------->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">{{ 'customer.source' | translate }}</nz-form-label>
+      <!-- 客商来源 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.customerSourceDictValue"
+          name="customerSourceDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of customerSourceList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'quotation.merchants' | translate }}{{ 'industry' | translate }}
+      </nz-form-label>
+      <!-- 客商行业 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-tree-select
+          nzAllowClear="false"
+          [nzNodes]="merchantsIndustryList"
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [(ngModel)]="customer.phonebaseCustomerIndustryId"
+          name="baseCustomerIndustryId"
+          (ngModelChange)="onChangeMI($event)"
+        >
+        </nz-tree-select>
+      </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"
+          [nzNodes]="salesStatusList"
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [(ngModel)]="customer.baseSalesStatusId"
+          name="baseSalesStatusId"
+          (ngModelChange)="onChangeSS($event)"
+        >
+        </nz-tree-select>
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第八行 -->
+    <nz-form-item>
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'quotation.merchants' | translate }}{{ 'property' | translate }}
+      </nz-form-label>
+      <!-- 客商属性 -->
+      <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>
+        </nz-radio-group>
+      </nz-form-control>
+
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'quotation.merchants' | translate }}{{ 'group' | translate }}
+      </nz-form-label>
+      <!-- 客商分组 -->
+      <nz-form-control [nzSm]="4" [nzXs]="24">
+        <nz-select
+          nzShowSearch
+          nzPlaceHolder="{{ 'select.please.choose' | translate }}"
+          [nzDisabled]="false"
+          [(ngModel)]="customer.customerGroupingDictValue"
+          name="customerGroupingDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of customerGroupList">
+            <nz-option [nzValue]="customerClassification.value" [nzLabel]="customerClassification.text"></nz-option>
+          </ng-container>
+        </nz-select>
+      </nz-form-control>
+      <nz-form-label [nzSm]="3" [nzXs]="24">
+        {{ 'business.affairs' | 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.businessRelationsDictValue"
+          name="businessRelationsDictValue"
+        >
+          <nz-option nzLabel="{{ 'select.please.choose' | translate }}" nzValue="" selected="selected"> </nz-option>
+          <ng-container *ngFor="let customerClassification of busRelDictList">
+            <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">
+        {{ '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>
+      </nz-form-control>
+    </nz-form-item>
+
+    <!-- 第十行 -->
+  </form>
+
+  <!-- 新增  联系人 -->
   <nz-form-item>
-    <!-- 邮编 -->
-    <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-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>
-  <!-- 联系人 -->
-  <!-- <nz-form-item> -->
     <span id="titleAdd" hidden="true">{{ 'button.add' | translate }}{{ 'customer.contacts.name' | translate }}</span>
-    <span id="titleUpdate"
-      hidden="true">{{ 'table.update' | translate }}{{ 'customer.contacts.name' | translate }}</span>
+    <span id="titleUpdate" hidden="true"
+      >{{ 'table.update' | translate }}{{ 'customer.contacts.name' | translate }}</span
+    >
     <!-- 按钮 -->
     <div nz-row nzGutter="24">
       <div nz-col nzMd="24" nzLg="24">
@@ -134,11 +327,16 @@
       </div>
     </div>
 
-
     <!-- 数据表 -->
     <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.code' | translate }}</th> -->
@@ -163,34 +361,52 @@
                   {{ 'yes' | translate }}
                 </ng-container>
               </td> -->
-              <td><input type="text" [(ngModel)]="data.contactPsn" nz-input maxlength=20/></td>
-              <td><input type="text" [(ngModel)]="data.contectTel" nz-input maxlength=20/></td>
-              <td><input type="text" [(ngModel)]="data.email" nz-input maxlength=30/></td>
+              <td><input type="text" [(ngModel)]="data.contactPsn" nz-input maxlength="20" /></td>
+              <td><input type="text" [(ngModel)]="data.contectTel" nz-input maxlength="20" /></td>
+              <td><input type="text" [(ngModel)]="data.email" nz-input maxlength="30" /></td>
               <td>
-                <nz-switch [(ngModel)]="data.isDefaultBool" (ngModelChange)="isDefaultBoolChange(data)"
-                  nzCheckedChildren="{{'store.yes' | translate}}" nzUnCheckedChildren="{{'store.no' | translate}}">
+                <nz-switch
+                  [(ngModel)]="data.isDefaultBool"
+                  (ngModelChange)="isDefaultBoolChange(data)"
+                  nzCheckedChildren="{{ 'store.yes' | translate }}"
+                  nzUnCheckedChildren="{{ 'store.no' | translate }}"
+                >
                 </nz-switch>
               </td>
-              <td><input  [(ngModel)]="data.address" nz-input maxlength=100/></td>
+              <td><input [(ngModel)]="data.address" nz-input maxlength="100" /></td>
               <td>
                 <!-- <a href="javascript:void(0);" (click)="addContacts(data)"
                   *ngIf="id!=''">{{ 'table.update' | translate }}</a>
                 <nz-divider *ngIf="id!=''" nzType="vertical"></nz-divider> -->
-                <a nz-popconfirm nzTitle="{{'confirm.to.delete'|translate}}?" nzOkText="{{ 'yes' | translate }}"
+                <a
+                  nz-popconfirm
+                  nzTitle="{{ 'confirm.to.delete' | translate }}?"
+                  nzOkText="{{ 'yes' | translate }}"
                   nzCancelText="{{ 'no' | translate }}"
-                  (nzOnConfirm)="deleteContacts(data)">{{ 'table.delete' | translate }}</a>
+                  (nzOnConfirm)="deleteContacts(data)"
+                  >{{ 'table.delete' | translate }}</a
+                >
               </td>
             </tr>
           </tbody>
         </nz-table>
       </div>
     </div>
-  <!-- </nz-form-item> -->
+  </nz-form-item>
 </nz-spin>
+
+<!-- 关闭 保存 -->
 <div class="footer">
-  <a nz-popconfirm style="margin-right: 2%" nzTitle="{{'pm.contract.contract.add.button.cancel' | translate}}"
-    (nzOnConfirm)="close()">
+  <a
+    nz-popconfirm
+    style="margin-right: 2%"
+    nzTitle="{{ 'pm.contract.contract.add.button.cancel' | translate }}"
+    (nzOnConfirm)="close()"
+  >
     <button nz-button>{{ 'button.close' | translate }}</button>
   </a>
-  <button nz-button (click)="save()" nzType="primary"><span>{{ 'button.save' | translate }}</span></button>
+
+  <button nz-button (click)="save()" nzType="primary">
+    <span>{{ 'button.save' | translate }}</span>
+  </button>
 </div>

+ 79 - 3
src/app/routes/basedata/customer/edit/edit.component.ts

@@ -9,6 +9,10 @@ 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';
+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';
 
 @Component({
   selector: 'app-basedata-customer-edit',
@@ -111,13 +115,21 @@ export class BasedataCustomerEditComponent implements OnInit {
     //开发时间
     /**开发时间 yyyy-MM-dd*/
     developmentDate: '',
+
+    radioValue: 'c' //客商属性 单选框默认值
   };
 
+  //  客商行业 字段规范
+  baseCustomerIndustry: BaseCustomerIndustry = {};
+  //  销售状态
+  baseSalesStatus: BaseSalesStatus = {};
+
   listOfData = []; //客户联系人集合
   enable = false; //是否停用
   codeDisabled = false;
   cryptoJS = require('crypto-js');
   tripledes = require('crypto-js/tripledes');
+ 
 
   constructor(
     private nzDrawerRef: NzDrawerRef,
@@ -128,11 +140,22 @@ export class BasedataCustomerEditComponent implements OnInit {
     private el: ElementRef,
     private i18NService: I18NService,
     private dictService: DictService,
+    private baseCustomerIndustryService: BaseCustomerIndustryService,
+    private baseSalesStatusService: BaseSalesStatusService,
   ) {}
 
   ngOnInit() {
-    //数据字典数据
-    this.getDictList();
+    //所有字典数据
+    this.getDictList()
+      .then(res => {
+        //客商行业数树
+        return this.getListIndustryTree();
+      })
+      .then(res => {
+        //销售状态
+        return this.getSalesStatusTree();
+      });
+
     if (this.id == '') {
       //新增
     } else {
@@ -144,17 +167,69 @@ export class BasedataCustomerEditComponent implements OnInit {
   /**
    * 获取数据字典数据
    */
-  customerClassificationList = []; //客商分类
+  customerClassificationList = []; //客商分类数据
+  customerSourceList = []; //客商来源数据
+  baseCustomerIndustryId = String; //客商行业字段(树)
+  merchantsIndustryList: any = []; //客商行业数据
+  salesStatusList: any = []; //销售状态数据
+  customerGroupList = []; //客商分组
+  busRelDictList = []; //商务关系数据
+
+  // 查询所有字典数据
   getDictList() {
     return new Promise(resolve => {
       //获取客商分类数据
       this.dictService.getByDictCode('customer_classification').then(response => {
         this.customerClassificationList = response.result;
         resolve();
+        //客商来源
+        this.dictService.getByDictCode('information_sources').then(response => {
+          this.customerSourceList = response.result;
+          console.log(this.customerSourceList);
+          resolve();
+          //客商分组
+          this.dictService.getByDictCode('customer_grouping').then(response => {
+            this.customerGroupList = response.result;
+            console.log(this.customerGroupList);
+            resolve();
+            //客商分组
+            this.dictService.getByDictCode('business_relations').then(response => {
+              this.busRelDictList = response.result;
+              console.log(this.customerGroupList);
+              resolve();
+            });
+          });
+        });
       });
     });
   }
 
+  //客商行业 树
+  getListIndustryTree() {
+    let baseCustomerIndustry = new BaseCustomerIndustry();
+    baseCustomerIndustry.pkOrg = sessionStorage.getItem('pkOrg');
+    this.baseCustomerIndustryService.getTreeList(baseCustomerIndustry).then(res => {
+      this.merchantsIndustryList = [{ id: '', key: '', title: '请选择', isLeaf: true }];
+      this.merchantsIndustryList = this.merchantsIndustryList.concat(res.result);
+      // console.log('merchantsIndustryList--->', this.merchantsIndustryList);
+    });
+  }
+  //销售状态 树
+  getSalesStatusTree() {
+    let baseSalesStatus = new BaseSalesStatus();
+    baseSalesStatus.pkOrg = sessionStorage.getItem('pkOrg');
+    this.baseSalesStatusService.getTreeList(baseSalesStatus).then(res => {
+      this.salesStatusList = [{ id: '', value: '', title: '请选择', isLeaf: true }];
+      this.salesStatusList = this.salesStatusList.concat(res.result);
+      console.log('salesStatusList--->', this.salesStatusList);
+    });
+  }
+
+  // 客商行业 自带方法
+  onChangeMI($event) {}
+  // 销售状态 自带方法
+  onChangeSS($event) {}
+
   getById() {
     this.customerService.getById(this.id).then(response => {
       this.customer = response.result;
@@ -375,6 +450,7 @@ export class BasedataCustomerEditComponent implements OnInit {
     }
   }
   isLoading = false;
+
   //最后保存
   save() {
     console.log(this.listOfData);

+ 1 - 1
src/app/routes/basedata/merchants-industry/merchants-industry.component.ts

@@ -52,7 +52,7 @@ export class BasedataMerchantsIndustryComponent implements OnInit {
   //  客商行业 字段规范
   baseCustomerIndustry: BaseCustomerIndustry = {};
 
-  //查询 客商行业类型
+  //查询 客商行业 树
   getListIndustryTree() {
     let baseCustomerIndustry = new BaseCustomerIndustry();
     baseCustomerIndustry.pkOrg = sessionStorage.getItem('pkOrg');

+ 6 - 9
src/app/routes/basedata/sales-status/add/add.component.ts

@@ -24,10 +24,10 @@ export class BasedataSalesStatusAddComponent implements OnInit {
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
-      code: [{ value: '', disabled: true }, []], //客商编码
-      name: [null, [Validators.required]], //客商名称
+      code: [{ value: '', disabled: true }, []], //销售编码
+      name: [null, [Validators.required]], //销售名称
       status: [null], //是否启用
-      sort: ['number', [Validators.required]], //数字输入框 客商名称排序
+      sort: ['number', [Validators.required]],
     });
     //新增子集获取父节点id
     // if(this.parentId&&this.parentId!=="0"){
@@ -36,10 +36,9 @@ export class BasedataSalesStatusAddComponent implements OnInit {
   }
 
   validateForm!: FormGroup;
-  parentId = ''; //父级id parentId = '0'; 
+  parentId = ''; //父级id parentId = '0';
   status = true; //是否启用
 
-  
   // 确定 按钮(添加一级)
   submitForm(): any {
     return new Promise(resolve => {
@@ -50,7 +49,7 @@ export class BasedataSalesStatusAddComponent implements OnInit {
       let valid = this.validateForm.valid;
       if (valid) {
         console.log('valid有效--->', valid);
-        //格式化是否期
+        //判断启
         if (this.status) {
           // console.log(this.status);
           this.baseSalesStatus.status = '1';
@@ -60,8 +59,7 @@ export class BasedataSalesStatusAddComponent implements OnInit {
         this.baseSalesStatus.pkOrg = sessionStorage.getItem('pkOrg'); //组织
         this.baseSalesStatusService.add(this.baseSalesStatus).then(response => {
           if (response.success) {
-            console.log(response);
-            
+            // console.log(response);
             //保存成功
             this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
             this.modal.destroy();
@@ -71,7 +69,6 @@ export class BasedataSalesStatusAddComponent implements OnInit {
             this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
           }
         });
-        
       }
     });
   }

+ 3 - 4
src/app/routes/basedata/sales-status/sales-status.component.ts

@@ -59,13 +59,12 @@ export class BasedataSalesStatusComponent implements OnInit {
     // 带参 查询 请求
     this.baseSalesStatusService.getTreeList(baseSalesStatus).then(res => {
       console.log(res);
-
       this.nodes = res.result;
       console.log('销售状态 数据', this.nodes);
     });
   }
 
-  //双击节点自动打开树分支
+  //双击节点 打开树分支
   openFolder(data: NzTreeNode | Required<NzFormatEmitEvent>): void {
     if (data instanceof NzTreeNode) {
       data.isExpanded = !data.isExpanded;
@@ -172,12 +171,12 @@ export class BasedataSalesStatusComponent implements OnInit {
     baseSalesStatus.id = this.id;
     this.baseSalesStatusService.delete(this.id).then(response => {
       if (response.success) {
-        //删除成功
+        // console.log(response);
+        
         this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
         this.dropdown.close();
         this.getSalesStatusTree();
       } else {
-        //删除失败
         this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
       }
     });

+ 10 - 0
src/assets/tmp/i18n/zh-CN.json

@@ -2032,4 +2032,14 @@
   ,"aoto.create": "自动生成"
   ,"sales.code": "销售编码"
   ,"sales.name": "销售名称"
+  ,"customer.source": "客商来源"
+  ,"sales.status": "销售状态"
+  ,"property": "属性"
+  ,"group": "分组"
+  ,"relation": "关系"
+  ,"industry": "行业"
+  ,"supplier": "供应商"
+  ,"higher.unit": "上级单位"
+
+  
 }

+ 3 - 3
src/environments/environment.ts

@@ -3,12 +3,12 @@
 // The list of file replacements can be found in `angular.json`.
 
 export const environment = {
-
   // SERVER_URL: `http://103.40.192.17:8087/fangda/`,// 测试版本
   // SERVER_URL: `http://103.40.192.17:8088/fangda/`,// 测试版本
-  // SERVER_URL: `http://10.21.2.116:8080/fangda/`,
-  SERVER_URL: `http://127.0.0.1:8088/fangda/`,
+  // // SERVER_URL: `http://10.21.2.116:8080/fangda/`,
+  // SERVER_URL: `http://127.0.0.1:8088/fangda/`,//本地
 
+  SERVER_URL: `http://106.15.206.14:8086/fangda/`,//本地
   production: false,
   useHash: true,
   hmr: false,