diff --git a/.gitignore b/.gitignore index 7b70918a..b5af4d96 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ scripts/var.less # IDE - VSCode .vscode/* +.vscode !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..a1c49108 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "compile-hero.disable-compile-files-on-did-save-code": true +} \ No newline at end of file diff --git a/_mock/_rule.ts b/_mock/_rule.ts index c1e91847..4a145ba3 100644 --- a/_mock/_rule.ts +++ b/_mock/_rule.ts @@ -41,7 +41,7 @@ function getRule(params: any): any { if (params.no) { ret = ret.filter(data => data.no.indexOf(params.no) > -1); } - return { data: ret, success: true }; + return { data: { records: ret, total: ret.length }, success: true }; } function removeRule(nos: string): any { @@ -51,7 +51,7 @@ function removeRule(nos: string): any { list.splice(idx, 1); } }); - + return { data: true, success: true }; } @@ -78,6 +78,6 @@ function saveRule(description: string): void { export const RULES = { 'POST /rule': (req: MockRequest) => getRule(req.queryString), - 'POST /delete/rule': (req: MockRequest) => removeRule(req.body.nos), + 'POST /delete/rule': (req: MockRequest) => removeRule(req.body.nos) // 'POST /rule': (req: MockRequest) => saveRule(req.body.description) }; diff --git a/angular.json b/angular.json index b04d04a7..a59093a6 100644 --- a/angular.json +++ b/angular.json @@ -35,11 +35,23 @@ "styles": [ "node_modules/perfect-scrollbar/css/perfect-scrollbar.css", "node_modules/quill/dist/quill.snow.css", - "src/styles.less" + "src/styles.less", + { + "input": "src/styles/default.less", + "bundleName": "default", + "inject": false + }, + { + "input": "src/styles/compact.less", + "bundleName": "compact", + "inject": false + } ], + "scripts": [ "node_modules/quill/dist/quill.min.js", - "node_modules/perfect-scrollbar/dist/perfect-scrollbar.js" + "node_modules/perfect-scrollbar/dist/perfect-scrollbar.js", + "node_modules/qrious/dist/qrious.min.js" ], "allowedCommonJsDependencies": [ "ajv", @@ -48,20 +60,28 @@ }, "configurations": { "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], + "fileReplacements": [{ + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + }], "outputHashing": "all", - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - } - ] + "budgets": [{ + "type": "initial", + "maximumWarning": "4mb", + "maximumError": "10mb" + }] + }, + "dev": { + "fileReplacements": [{ + "replace": "src/environments/environment.ts", + "with": "src/environments/eascs/environment.dev.ts" + }], + "outputHashing": "all", + "budgets": [{ + "type": "initial", + "maximumWarning": "4mb", + "maximumError": "10mb" + }] }, "development": { "buildOptimizer": false, @@ -84,6 +104,9 @@ "production": { "browserTarget": "ng-alain:build:production" }, + "dev": { + "browserTarget": "app:build:dev" + }, "development": { "browserTarget": "ng-alain:build:development" } @@ -131,6 +154,9 @@ "configurations": { "production": { "devServerTarget": "ng-alain:serve:production" + }, + "dev": { + "devServerTarget": "app:build:dev" } } } diff --git a/package-lock.json b/package-lock.json index cf0055a0..93e9c26a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "ng-alain-pro", + "name": "tms-obc-web", "version": "0.0.0", "lockfileVersion": 1, "requires": true, @@ -19,6 +19,11 @@ } } }, + "@amap/amap-jsapi-loader": { + "version": "1.0.1", + "resolved": "https://registry.nlark.com/@amap/amap-jsapi-loader/download/@amap/amap-jsapi-loader-1.0.1.tgz", + "integrity": "sha1-nsS01dJGfqxFH2yFLjXbaen58MA=" + }, "@ampproject/remapping": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/@ampproject/remapping/download/@ampproject/remapping-1.0.1.tgz", @@ -2728,11 +2733,46 @@ "integrity": "sha1-ayxRCnrXA56Y57jT1lmPQ1nlwIA=", "dev": true }, + "@types/d3-geo": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.0.2.tgz", + "integrity": "sha512-DbqK7MLYA8LpyHQfv6Klz0426bQEf7bRTvhMy44sNGVyZoWn//B0c+Qbeg8Osi2Obdc9BLLXYAKpyWege2/7LQ==", + "dev": true, + "requires": { + "@types/geojson": "*" + } + }, "@types/d3-path": { "version": "2.0.1", "resolved": "https://registry.nlark.com/@types/d3-path/download/@types/d3-path-2.0.1.tgz", "integrity": "sha1-ygPfqLlNit2XrQzZfpbiAGtHY8s=" }, + "@types/d3-sankey": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@types/d3-sankey/-/d3-sankey-0.11.2.tgz", + "integrity": "sha512-U6SrTWUERSlOhnpSrgvMX64WblX1AxX6nEjI2t3mLK2USpQrnbwYYK+AS9SwiE7wgYmOsSSKoSdr8aoKBH0HgQ==", + "dev": true, + "requires": { + "@types/d3-shape": "^1" + }, + "dependencies": { + "@types/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-NaIeSIBiFgSC6IGUBjZWcscUJEq7vpVu7KthHN8eieTV9d9MqkSOZLH4chq1PmcKy06PNe3axLeKmRIyxJ+PZQ==", + "dev": true + }, + "@types/d3-shape": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.8.tgz", + "integrity": "sha512-gqfnMz6Fd5H6GOLYixOZP/xlrMtJms9BaS+6oWxTKHNqPGZ93BkWWupQSCYm6YHqx6h9wjRupuJb90bun6ZaYg==", + "dev": true, + "requires": { + "@types/d3-path": "^1" + } + } + } + }, "@types/d3-shape": { "version": "2.1.3", "resolved": "https://registry.npmmirror.com/@types/d3-shape/download/@types/d3-shape-2.1.3.tgz", @@ -2778,6 +2818,12 @@ "integrity": "sha512-sPZYQEIF/SOnLAvaz9lTuydniP+afBMtElRTdYkeV1QtEgvtJ7qolCPjly6O32QI8CbEmP5O/fztMXEDWfEcrg==", "dev": true }, + "@types/geojson": { + "version": "7946.0.8", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.8.tgz", + "integrity": "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==", + "dev": true + }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmmirror.com/@types/glob/download/@types/glob-7.2.0.tgz?cache=0&sync_timestamp=1637267477186&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40types%2Fglob%2Fdownload%2F%40types%2Fglob-7.2.0.tgz", @@ -3426,14 +3472,6 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, - "angular-baidu-maps": { - "version": "12.0.0", - "resolved": "https://registry.nlark.com/angular-baidu-maps/download/angular-baidu-maps-12.0.0.tgz", - "integrity": "sha1-I/Sn52ggJcLJRnGdIR6eNmt6sXQ=", - "requires": { - "tslib": "^2.1.0" - } - }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.nlark.com/ansi-colors/download/ansi-colors-4.1.1.tgz", @@ -5175,6 +5213,14 @@ } } }, + "css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "requires": { + "utrie": "^1.0.2" + } + }, "css-loader": { "version": "6.2.0", "resolved": "https://registry.npmmirror.com/css-loader/download/css-loader-6.2.0.tgz?cache=0&sync_timestamp=1635967924209&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcss-loader%2Fdownload%2Fcss-loader-6.2.0.tgz", @@ -8116,6 +8162,15 @@ "integrity": "sha1-e15vfmZen7QfMAB+2eDUHpf7IUA=", "dev": true }, + "html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "requires": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + } + }, "htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmmirror.com/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1636640940074&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz", @@ -14814,6 +14869,11 @@ "integrity": "sha1-xF6cYYAL0IfviNfiVkI73Unl0HE=", "dev": true }, + "qrious": { + "version": "4.0.2", + "resolved": "http://npm.eascs.com/qrious/-/qrious-4.0.2.tgz", + "integrity": "sha1-CcTUB50rlhYX9ixpz/O5u2ajlpM=" + }, "qs": { "version": "6.7.0", "resolved": "https://registry.nlark.com/qs/download/qs-6.7.0.tgz", @@ -22660,6 +22720,14 @@ } } }, + "text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "requires": { + "utrie": "^1.0.2" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", @@ -23209,6 +23277,21 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "requires": { + "base64-arraybuffer": "^1.0.2" + }, + "dependencies": { + "base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==" + } + } + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmmirror.com/uuid/download/uuid-3.4.0.tgz", diff --git a/package.json b/package.json index 7084f7c1..f7a7e591 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "ng-alain-pro", + "name": "tms-obc-web", "version": "0.0.0", - "description": "Ng-alain business theme, ng-zorro-antd admin panel front-end framework", + "description": "运营后台-WEB", "author": "cipchk ", "repository": { "type": "git", @@ -11,9 +11,11 @@ "scripts": { "ng-high-memory": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng", "ng": "ng", - "start": "ng s -o --port 4202", + "start": "ng s -o --port 4202 --host 0.0.0.0", + "startIp": "ng serve -o --port 4202 --host 172.29.9.71 --open", "hmr": "ng s -o --hmr", - "build": "npm run ng-high-memory build", + "build": "npm run ng-high-memory build --", + "build:dev": "npm run build -- -c dev", "analyze": "npm run ng-high-memory build -- --source-map", "analyze:view": "source-map-explorer dist/**/*.js", "lint": "npm run lint:ts && npm run lint:style", @@ -29,6 +31,7 @@ }, "dependencies": { "@agm/core": "^1.1.0", + "@amap/amap-jsapi-loader": "^1.0.1", "@angular/animations": "~12.2.0", "@angular/common": "~12.2.0", "@angular/compiler": "~12.2.0", @@ -53,8 +56,8 @@ "@fullcalendar/timegrid": "^5.9.0", "@swimlane/ngx-charts": "^18.0.1", "ajv": "^8.6.2", - "angular-baidu-maps": "^12.0.0", "file-saver": "^2.0.5", + "html2canvas": "^1.4.1", "js-base64": "^3.6.1", "masonry-layout": "^4.2.2", "ng-gallery": "^5.0.0", @@ -62,6 +65,7 @@ "ngx-tinymce": "^12.0.0", "ngx-trend": "^7.0.0", "perfect-scrollbar": "^1.5.2", + "qrious": "^4.0.2", "quill": "^1.3.7", "quill-image-resize-module": "^3.0.0", "rxjs": "~6.6.0", @@ -71,22 +75,22 @@ }, "devDependencies": { "@angular-devkit/build-angular": "~12.2.0", - "@angular/cli": "~12.2.0", - "@angular/compiler-cli": "~12.2.0", - "@types/jasmine": "~3.8.0", - "@types/node": "^12.11.1", - "jasmine-core": "~3.8.0", - "karma": "~6.3.0", - "karma-chrome-launcher": "~3.1.0", - "karma-coverage": "~2.0.3", - "karma-jasmine": "~4.0.0", - "karma-jasmine-html-reporter": "~1.7.0", - "typescript": "~4.3.5", "@angular-eslint/builder": "~12.3.1", "@angular-eslint/eslint-plugin": "~12.3.1", "@angular-eslint/eslint-plugin-template": "~12.3.1", "@angular-eslint/schematics": "~12.3.1", "@angular-eslint/template-parser": "~12.3.1", + "@angular/cli": "~12.2.0", + "@angular/compiler-cli": "~12.2.0", + "@angular/language-service": "~12.2.0", + "@delon/testing": "^12.3.0", + "@types/d3-geo": "^3.0.2", + "@types/d3-sankey": "^0.11.2", + "@types/file-saver": "^2.0.3", + "@types/jasmine": "~3.8.0", + "@types/jasminewd2": "~2.0.3", + "@types/js-base64": "^3.0.0", + "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "~4.29.2", "@typescript-eslint/parser": "~4.29.2", "eslint": "^7.32.0", @@ -95,29 +99,31 @@ "eslint-plugin-jsdoc": "~36.0.7", "eslint-plugin-prefer-arrow": "~1.2.3", "eslint-plugin-prettier": "~3.4.1", - "@angular/language-service": "~12.2.0", - "source-map-explorer": "^2.5.2", + "husky": "^6.0.0", + "jasmine-core": "~3.8.0", + "jasmine-spec-reporter": "~5.0.0", + "karma": "~6.3.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage": "~2.0.3", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "~1.7.0", + "lint-staged": "^11.1.2", + "ng-alain": "^12.3.0", + "ng-alain-plugin-theme": "^12.0.0", + "ng-alain-sts": "^0.0.1", + "node-fetch": "^2.6.1", "prettier": "^2.2.1", + "protractor": "~7.0.0", + "source-map-explorer": "^2.5.2", "stylelint": "^13.13.1", "stylelint-config-prettier": "^8.0.2", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^22.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.4.0", "stylelint-order": "^4.1.0", - "@delon/testing": "^12.3.0", - "ng-alain": "^12.3.0", - "ng-alain-plugin-theme": "^12.0.0", - "ng-alain-sts": "^0.0.1", - "@types/jasminewd2": "~2.0.3", - "jasmine-spec-reporter": "~5.0.0", - "karma-coverage-istanbul-reporter": "~3.0.2", - "protractor": "~7.0.0", "ts-node": "~8.3.0", - "node-fetch": "^2.6.1", - "husky": "^6.0.0", - "lint-staged": "^11.1.2", - "@types/file-saver": "^2.0.3", - "@types/js-base64": "^3.0.0" + "typescript": "~4.3.5" }, "lint-staged": { "(src)/**/*.{html,ts}": [ diff --git a/proxy.conf.js b/proxy.conf.js index 50258c5a..9a8ab637 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -1,10 +1,14 @@ -/** - * For more configuration, please refer to https://angular.io/guide/build#proxying-to-a-backend-server - * - * 更多配置描述请参考 https://angular.cn/guide/build#proxying-to-a-backend-server - * - * Note: The proxy is only valid for real requests, Mock does not actually generate requests, so the priority of Mock will be higher than the proxy +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-18 09:51:21 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-08 14:26:28 + * @FilePath : \\tms-obc-web\\proxy.conf.js + * Copyright (C) 2022 huzhenhong. All rights reserved. */ + module.exports = { /** * The following means that all requests are directed to the backend `https://localhost:9000/` @@ -14,4 +18,14 @@ module.exports = { // secure: false, // Ignore invalid SSL certificates // changeOrigin: true // } + '//api': { + target: { + host: 'tms-api-dev.eascs.com', + protocol: 'https:', + port: 443 + }, + secure: false, + changeOrigin: true, + logLevel: 'debug' + }, }; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e91655e8..69b42ef3 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,8 +2,10 @@ import { Component, ElementRef, OnInit, Renderer2 } from '@angular/core'; import { NavigationEnd, NavigationError, RouteConfigLoadStart, Router } from '@angular/router'; import { TitleService, VERSION as VERSION_ALAIN } from '@delon/theme'; import { environment } from '@env/environment'; +import { NzIconService } from 'ng-zorro-antd/icon'; import { NzModalService } from 'ng-zorro-antd/modal'; import { VERSION as VERSION_ZORRO } from 'ng-zorro-antd/version'; +import { ThemeService } from './theme.service'; @Component({ selector: 'app-root', @@ -15,10 +17,15 @@ export class AppComponent implements OnInit { renderer: Renderer2, private router: Router, private titleSrv: TitleService, - private modalSrv: NzModalService + private modalSrv: NzModalService, + private iconService: NzIconService, + private themeService: ThemeService ) { renderer.setAttribute(el.nativeElement, 'ng-alain-version', VERSION_ALAIN.full); renderer.setAttribute(el.nativeElement, 'ng-zorro-version', VERSION_ZORRO.full); + this.iconService.fetchFromIconfont({ + scriptUrl: 'https://at.alicdn.com/t/font_3153207_udngwyp35db.js' + }); } ngOnInit(): void { @@ -42,5 +49,15 @@ export class AppComponent implements OnInit { this.modalSrv.closeAll(); } }); + // 适配放大150%的屏幕 + const screen: any = window.screen + var zoom = window.devicePixelRatio || screen.deviceXDPI / screen?.logicalXDPI; + // console.log(zoom) + if (document.body.clientWidth >= 1280) { + if (zoom != 1 && zoom != 2 && zoom != 3) { + this.themeService.toggleTheme().then(); + } + } + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9a6efff4..32f1b6a4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,7 +2,7 @@ /* eslint-disable import/no-duplicates */ import { HttpClientModule } from '@angular/common/http'; import { default as ngLang } from '@angular/common/locales/zh'; -import { APP_INITIALIZER, LOCALE_ID, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, DEFAULT_CURRENCY_CODE, LOCALE_ID, NgModule, Type } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { SimpleInterceptor } from '@delon/auth'; @@ -19,10 +19,11 @@ const GLOBAL_THIRD_MODULES: Array> = [BidiModule]; // #region Http Interceptors import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import { DefaultInterceptor } from '@core'; +import { BusinessInterceptor, DefaultInterceptor } from '@core'; const INTERCEPTOR_PROVIDES = [ { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true }, + { provide: HTTP_INTERCEPTORS, useClass: BusinessInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true } ]; // #endregion @@ -39,7 +40,9 @@ const APPINIT_PROVIDES = [ useFactory: StartupServiceFactory, deps: [StartupService], multi: true - } + }, + { provide: DEFAULT_CURRENCY_CODE, useValue: '¥' }, + AuthGuard ]; // #endregion @@ -50,8 +53,8 @@ import { LayoutModule } from './layout/layout.module'; import { RoutesModule } from './routes/routes.module'; import { SharedModule } from './shared/shared.module'; import { STWidgetModule } from './shared/widget/st-widget.module'; -import { Observable } from 'rxjs'; import { registerLocaleData } from '@angular/common'; +import { AuthGuard } from './core/guards/auth.guard'; @NgModule({ declarations: [AppComponent], diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 58522fc1..777d8016 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -1,9 +1,10 @@ import { NgModule, Optional, SkipSelf } from '@angular/core'; +import { EATokenGuard } from './guards/token.guard'; import { throwIfAlreadyLoaded } from './module-import-guard'; @NgModule({ - providers: [] + providers: [EATokenGuard] }) export class CoreModule { constructor(@Optional() @SkipSelf() parentModule: CoreModule) { diff --git a/src/app/core/core.service.ts b/src/app/core/core.service.ts index ab9b87dc..53cd814a 100644 --- a/src/app/core/core.service.ts +++ b/src/app/core/core.service.ts @@ -15,14 +15,16 @@ import { EnvironmentService } from '@env/environment.service'; import { NzMessageService } from 'ng-zorro-antd/message'; @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class CoreService { // 获取当前登录用户信息 public $api_get_current_user_info = `/scm/cuc/cuc/user/getUserDetail`; // 获取当前用户所拥有的菜单 - public $api_get_current_user_menus = `/scm/cuc/cuc/functionInfo/getUserHaveFunctionsList`; + public $api_get_current_user_menus = `/api/mdc/cuc/functionInfo/getUserHaveFunctionsList`; + + position = { lat: '', lng: '' }; constructor(private injector: Injector) {} // 注入路由 diff --git a/src/app/core/guards/auth.guard.ts b/src/app/core/guards/auth.guard.ts new file mode 100644 index 00000000..b5a30a58 --- /dev/null +++ b/src/app/core/guards/auth.guard.ts @@ -0,0 +1,89 @@ +import { Injectable, Injector } from '@angular/core'; +import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router'; +import { ACLGuard, ACLService } from '@delon/acl'; +import { MenuService, SettingsService } from '@delon/theme'; +import { EAUserService } from '@shared'; +import { Observable, of } from 'rxjs'; +import { switchMap } from 'rxjs/operators'; + +@Injectable() +export class AuthGuard extends ACLGuard { + constructor( + srv: ACLService, + public srv1: ACLService, + private menuService: MenuService, + private settings: SettingsService, + private userService: EAUserService, + router: Router, + private inject: Injector + ) { + super(srv, router, inject); + } + + canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable { + // if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) { + // return super.canActivate(route, _state); + // } else { + // return super.canActivate(route, _state); + // } + return super.canActivate(route, _state); + } + + canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + if (childRoute.routeConfig?.loadChildren || childRoute.routeConfig?.children) { + return super.canActivateChild(childRoute, state); + } else { + return this.handle(childRoute, state, 2, this.settingRoute(childRoute.params, state.url)); + } + } + + private handle(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, type: 1 | 2, router?: string): Observable { + if (!router) { + return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state); + } + return this.userService + .request('/api/mdc/cuc/userAuthority/isUserAdmin', { + appUserId: this.settings.user.appUserId + }) + .pipe( + switchMap(res => { + if (res) { + // 超级管理员赋值全量权限 + this.srv1.setFull(true); + return of(true); + } else { + // 如果不是超级管理员 获取权限 + return this.userService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }); + } + }), + switchMap(res => { + if (res?.abilities) { + this.srv1.setAbility(res.abilities || []); + // this.menuService.resume(); + this.userService.loadUserMenus(); + } + return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state); + }) + ); + } + + /** + * 根据参数拼接原始路由 + * @param params 参数 + * @param route 实际路由 + * @returns + */ + private settingRoute(params: any, route: string) { + let _route = route; + if (_route.indexOf('?') > -1) { + _route = route.split('?')[0]; + } + for (const key of Object.keys(params)) { + if (_route.indexOf(params[key]) > -1) { + _route = _route.replace(params[key], ':' + key); + } + } + + return _route; + } +} diff --git a/src/app/core/guards/token.guard.ts b/src/app/core/guards/token.guard.ts new file mode 100644 index 00000000..c043a978 --- /dev/null +++ b/src/app/core/guards/token.guard.ts @@ -0,0 +1,38 @@ +import { Inject, Injectable, Injector } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router'; +import { sysConf } from '@conf/sys.conf'; +import { CoreService } from '@core'; +import { ACLGuard, ACLService } from '@delon/acl'; +import { EAUserService } from '@shared'; +import { Observable, of } from 'rxjs'; + +@Injectable() +export class EATokenGuard implements CanActivate, CanActivateChild { + constructor(srv: ACLService, router: Router, private eaUserSrv: CoreService, private router2: Router, private inject: Injector) {} + + canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot | null): Observable { + const canOpen = this.eaUserSrv.loginStatus; + if (!canOpen) { + this.router2.navigate([sysConf.login_url], { + queryParams: { + returnUrl: _state?.url + } + }); + return of(!canOpen); + } + return of(true); + } + + canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const canOpen = this.eaUserSrv.loginStatus; + if (!canOpen) { + this.router2.navigate([sysConf.login_url], { + queryParams: { + returnUrl: state?.url + } + }); + return of(!canOpen); + } + return of(true); + } +} diff --git a/src/app/core/index.ts b/src/app/core/index.ts index c7024606..9f525334 100644 --- a/src/app/core/index.ts +++ b/src/app/core/index.ts @@ -1,6 +1,9 @@ export * from './module-import-guard'; export * from './net/default.interceptor'; +export * from './net/business.interceptor'; // Services export * from './core.service'; export * from './startup/startup.service'; + +export * from './guards/token.guard'; diff --git a/src/app/core/net/business.interceptor.ts b/src/app/core/net/business.interceptor.ts new file mode 100644 index 00000000..9e34709e --- /dev/null +++ b/src/app/core/net/business.interceptor.ts @@ -0,0 +1,108 @@ +import { + HttpErrorResponse, + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, + HttpResponse, + HttpResponseBase +} from '@angular/common/http'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; +import { environment } from '@env/environment'; +import { EAEnvironmentService, EAUserService } from '@shared'; +import { Observable, of } from 'rxjs'; +import { catchError, mergeMap } from 'rxjs/operators'; +import { CoreService } from '../core.service'; + +@Injectable() +export class BusinessInterceptor implements HttpInterceptor { + constructor( + private envSrv: EAEnvironmentService, + private eaUserSrv: EAUserService, + @Optional() + @Inject(DA_SERVICE_TOKEN) + private tokenSrv: ITokenService, + private coreSrv: CoreService + ) {} + intercept(req: HttpRequest, next: HttpHandler): Observable> { + // 构造新的请求URL + req = this.constructNewRequestUrl(req); + // 附加额外的请求头 + req = this.attachAdditionalHeaders(req); + // 后续操作 + return next.handle(req).pipe( + mergeMap(ev => this.handlingBussinessResponseData(ev)), + catchError((err: HttpErrorResponse) => this.handlingBusinessErrors(err)) + ); + } + + /** + * 构造新的请求URL + */ + private constructNewRequestUrl(req: HttpRequest): HttpRequest { + let url = req.url; + if (!url.startsWith('https://') && !url.startsWith('http://')) { + if (!url.startsWith('assets')) { + url = environment.api.baseUrl + url; + } + } + return req.clone({ url }); + } + + /** + * 附加额外的请求头 + */ + private attachAdditionalHeaders(req: HttpRequest): HttpRequest { + let position = {}; + if (this.coreSrv.position.lat && this.coreSrv.position.lng) { + position = { lat: this.coreSrv.position.lat.toString(), lng: this.coreSrv.position.lng.toString() }; + } + // 附加环境变量 + const header: any = { + appId: this.envSrv.env.appId, + tenantId: this.envSrv.env.tenantId, + enterpriseId: this.envSrv.env.enterpriseId, + ...position + }; + + // 附加授权声明 + const token = this.tokenSrv.get()?.token; + if (token) { + header.Authorization = `Bearer ${token}`; + } + return req.clone({ setHeaders: header }); + } + + /** + * 处理业务数据 + */ + private handlingBussinessResponseData(ev: HttpEvent): Observable { + if (ev instanceof HttpResponseBase) { + const body = (ev as HttpResponse).body; + if (body) { + switch (body.status) { + case 505001: + case 505002: + this.eaUserSrv.logout(); + break; + default: + break; + } + } + } + if (ev instanceof HttpErrorResponse) { + return this.handlingBusinessErrors(ev); + } + return of(ev); + } + + /** + * 处理响应错误 + */ + private handlingBusinessErrors(err: HttpErrorResponse): Observable { + /** Http响应异常已在默认拦截器处理完成 ,该处不再处理 */ + + return of(err); + } +} diff --git a/src/app/core/net/default.interceptor.ts b/src/app/core/net/default.interceptor.ts index 8f5892aa..7b390379 100644 --- a/src/app/core/net/default.interceptor.ts +++ b/src/app/core/net/default.interceptor.ts @@ -1,20 +1,8 @@ -import { - HttpErrorResponse, - HttpEvent, - HttpHandler, - HttpHeaders, - HttpInterceptor, - HttpRequest, - HttpResponseBase -} from '@angular/common/http'; -import { Injectable, Injector } from '@angular/core'; -import { Router } from '@angular/router'; -import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; -import { _HttpClient } from '@delon/theme'; -import { environment } from '@env/environment'; -import { NzNotificationService } from 'ng-zorro-antd/notification'; -import { BehaviorSubject, Observable, of, throwError } from 'rxjs'; -import { catchError, filter, mergeMap, switchMap, take } from 'rxjs/operators'; +import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponseBase } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; +import { catchError, mergeMap } from 'rxjs/operators'; +import { CoreService } from './../core.service'; const CODEMESSAGE: { [key: number]: string } = { 200: '服务器成功返回请求的数据。', @@ -34,228 +22,38 @@ const CODEMESSAGE: { [key: number]: string } = { 504: '网关超时。' }; -/** - * 默认HTTP拦截器,其注册细节见 `app.module.ts` - */ @Injectable() export class DefaultInterceptor implements HttpInterceptor { - private refreshTokenEnabled = environment.api.refreshTokenEnabled; - private refreshTokenType: 're-request' | 'auth-refresh' = environment.api.refreshTokenType; - private refreshToking = false; - private refreshToken$: BehaviorSubject = new BehaviorSubject(null); - - constructor(private injector: Injector) { - if (this.refreshTokenType === 'auth-refresh') { - this.buildAuthRefresh(); - } - } - - private get notification(): NzNotificationService { - return this.injector.get(NzNotificationService); - } - - private get tokenSrv(): ITokenService { - return this.injector.get(DA_SERVICE_TOKEN); - } - - private get http(): _HttpClient { - return this.injector.get(_HttpClient); - } - - private goTo(url: string): void { - setTimeout(() => this.injector.get(Router).navigateByUrl(url)); - } - - private checkStatus(ev: HttpResponseBase): void { - if ((ev.status >= 200 && ev.status < 300) || ev.status === 401) { - return; - } - - const errortext = CODEMESSAGE[ev.status] || ev.statusText; - this.notification.error(`请求错误 ${ev.status}: ${ev.url}`, errortext); - } - - /** - * 刷新 Token 请求 - */ - private refreshTokenRequest(): Observable { - const model = this.tokenSrv.get(); - return this.http.post(`/api/auth/refresh`, null, null, { headers: { refresh_token: model?.refresh_token || '' } }); - } - - // #region 刷新Token方式一:使用 401 重新刷新 Token - - private tryRefreshToken(ev: HttpResponseBase, req: HttpRequest, next: HttpHandler): Observable { - // 1、若请求为刷新Token请求,表示来自刷新Token可以直接跳转登录页 - if ([`/api/auth/refresh`].some(url => req.url.includes(url))) { - this.toLogin(); - return throwError(ev); - } - // 2、如果 `refreshToking` 为 `true` 表示已经在请求刷新 Token 中,后续所有请求转入等待状态,直至结果返回后再重新发起请求 - if (this.refreshToking) { - return this.refreshToken$.pipe( - filter(v => !!v), - take(1), - switchMap(() => next.handle(this.reAttachToken(req))) - ); - } - // 3、尝试调用刷新 Token - this.refreshToking = true; - this.refreshToken$.next(null); - - return this.refreshTokenRequest().pipe( - switchMap(res => { - // 通知后续请求继续执行 - this.refreshToking = false; - this.refreshToken$.next(res); - // 重新保存新 token - this.tokenSrv.set(res); - // 重新发起请求 - return next.handle(this.reAttachToken(req)); - }), - catchError(err => { - this.refreshToking = false; - this.toLogin(); - return throwError(err); - }) - ); - } - - /** - * 重新附加新 Token 信息 - * - * > 由于已经发起的请求,不会再走一遍 `@delon/auth` 因此需要结合业务情况重新附加新的 Token - */ - private reAttachToken(req: HttpRequest): HttpRequest { - // 以下示例是以 NG-ALAIN 默认使用 `SimpleInterceptor` - const token = this.tokenSrv.get()?.token; - return req.clone({ - setHeaders: { - token: `Bearer ${token}` - } - }); - } - - // #endregion - - // #region 刷新Token方式二:使用 `@delon/auth` 的 `refresh` 接口 - - private buildAuthRefresh(): void { - if (!this.refreshTokenEnabled) { - return; - } - this.tokenSrv.refresh - .pipe( - filter(() => !this.refreshToking), - switchMap(res => { - console.log(res); - this.refreshToking = true; - return this.refreshTokenRequest(); - }) - ) - .subscribe( - res => { - // TODO: Mock expired value - res.expired = +new Date() + 1000 * 60 * 5; - this.refreshToking = false; - this.tokenSrv.set(res); - }, - () => this.toLogin() - ); - } - - // #endregion - - private toLogin(): void { - this.notification.error(`未登录或登录已过期,请重新登录。`, ``); - this.goTo(this.tokenSrv.login_url!); - } - - private handleData(ev: HttpResponseBase, req: HttpRequest, next: HttpHandler): Observable { - this.checkStatus(ev); - // 业务处理:一些通用操作 - switch (ev.status) { - case 200: - // 业务层级错误处理,以下是假定restful有一套统一输出格式(指不管成功与否都有相应的数据格式)情况下进行处理 - // 例如响应内容: - // 错误内容:{ status: 1, msg: '非法参数' } - // 正确内容:{ status: 0, response: { } } - // 则以下代码片断可直接适用 - // if (ev instanceof HttpResponse) { - // const body = ev.body; - // if (body && body.status !== 0) { - // this.injector.get(NzMessageService).error(body.msg); - // // 注意:这里如果继续抛出错误会被行254的 catchError 二次拦截,导致外部实现的 Pipe、subscribe 操作被中断,例如:this.http.get('/').subscribe() 不会触发 - // // 如果你希望外部实现,需要手动移除行254 - // return throwError({}); - // } else { - // // 忽略 Blob 文件体 - // if (ev.body instanceof Blob) { - // return of(ev); - // } - // // 重新修改 `body` 内容为 `response` 内容,对于绝大多数场景已经无须再关心业务状态码 - // return of(new HttpResponse(Object.assign(ev, { body: body.response }))); - // // 或者依然保持完整的格式 - // return of(ev); - // } - // } - break; - case 401: - if (this.refreshTokenEnabled && this.refreshTokenType === 're-request') { - return this.tryRefreshToken(ev, req, next); - } - this.toLogin(); - break; - case 403: - case 404: - case 500: - this.goTo(`/exception/${ev.status}`); - break; - default: - if (ev instanceof HttpErrorResponse) { - console.warn( - '未可知错误,大部分是由于后端不支持跨域CORS或无效配置引起,请参考 https://ng-alain.com/docs/server 解决跨域问题', - ev - ); - } - break; - } - if (ev instanceof HttpErrorResponse) { - return throwError(ev); - } else { - return of(ev); - } - } - - private getAdditionalHeaders(headers?: HttpHeaders): { [name: string]: string } { - const res: { [name: string]: string } = {}; - // const lang = this.injector.get(ALAIN_I18N_TOKEN).currentLang; - // if (!headers?.has('Accept-Language') && lang) { - // res['Accept-Language'] = lang; - // } - - return res; - } - + constructor(private coreSrv: CoreService) {} intercept(req: HttpRequest, next: HttpHandler): Observable> { - // 统一加上服务端前缀 - let url = req.url; - if (!url.startsWith('https://') && !url.startsWith('http://')) { - const { baseUrl } = environment.api; - url = baseUrl + (baseUrl.endsWith('/') && url.startsWith('/') ? url.substring(1) : url); - } - - const newReq = req.clone({ url, setHeaders: this.getAdditionalHeaders(req.headers) }); - return next.handle(newReq).pipe( - mergeMap(ev => { - // 允许统一对请求错误处理 - if (ev instanceof HttpResponseBase) { - return this.handleData(ev, newReq, next); - } - // 若一切都正常,则后续操作 - return of(ev); - }), - catchError((err: HttpErrorResponse) => this.handleData(err, newReq, next)) + return next.handle(req).pipe( + mergeMap(ev => this.handlingHttpResponseData(ev)), + catchError((err: HttpErrorResponse) => this.handlingHttpErrorResponse(err)) ); } + + /** + * 处理Http响应数据 + */ + private handlingHttpResponseData(ev: HttpEvent): Observable { + if (ev instanceof HttpResponseBase) { + // 正常情况直接返回到下个业务拦截器处理 + if (ev.status >= 200 && ev.status < 300) { + return of(ev); + } + + // 所有状态不是2xx和3xx都当作异常处理 + if (ev instanceof HttpErrorResponse) { + return this.handlingHttpErrorResponse(ev); + } + } + return of(ev); + } + + /** + * 处理默认Http响应错误 + */ + private handlingHttpErrorResponse(err: HttpErrorResponse): Observable { + return of(err); + } } diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index b331af95..4b746335 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -1,7 +1,11 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; +import { cacheConf } from '@conf/cache.conf'; +import { sysConf } from '@conf/sys.conf'; import { ACLService } from '@delon/acl'; import { MenuService, SettingsService, TitleService, _HttpClient } from '@delon/theme'; +import { environment } from '@env/environment'; +import { AmapService, EACacheService, EAUserService } from '@shared'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzIconService } from 'ng-zorro-antd/icon'; import { Observable, zip } from 'rxjs'; @@ -24,15 +28,25 @@ export class StartupService { private aclService: ACLService, private titleService: TitleService, private httpClient: _HttpClient, + private userSrv: EAUserService, + private amapService: AmapService, + public cacheSrv: EACacheService, private coreSrv: CoreService ) { iconSrv.addIcon(...ICONS_AUTO, ...ICONS); + this.settingService.setLayout('fixSiderbar', true); } // TODO: 退出登录时需要清理用户信息 load(): Promise { return new Promise(resolve => { + this.amapService.getCurrentPosition().subscribe(res => { + if (res.position) { + this.coreSrv.position = { lat: res.position.lat, lng: res.position.lng }; + } + }); + let data; if (this.coreSrv.loginStatus) { // 本地菜单 @@ -74,10 +88,17 @@ export class StartupService { this.settingService.setApp(appData); // 用户信息:包括姓名、头像、邮箱地址 this.settingService.setUser(userData); + this.cacheSrv.set(cacheConf.env, { + appId: sysConf.appId, + tenantId: userData?.tenantId || sysConf.tenantId, + enterpriseId: userData?.enterpriseId || sysConf.enterpriseId + }); // ACL:设置权限为全量 - this.aclService.setFull(true); + this.aclService.setFull(false); // 初始化菜单 - this.menuService.add(menuData); + if (menuData) { + this.menuService.add(menuData); + } // 设置页面标题的后缀 this.titleService.default = ''; this.titleService.suffix = appData.name; @@ -94,12 +115,10 @@ export class StartupService { const appData = this.httpClient.get(`assets/mocks/app-data.json`).pipe(map((res: any) => res.app)); // 用户数据 - const userData = this.coreSrv.loginStatus - ? this.httpClient.post(this.coreSrv.$api_get_current_user_info, {}).pipe(map((res: any) => res.data)) - : this.httpClient.get('assets/mocks/user-data.json').pipe(map((res: any) => res.user)); + const userData = this.httpClient.get('assets/mocks/user-data.json').pipe(map((res: any) => res.user)); // 菜单数据 - const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.menu)); + const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu)); return zip(appData, userData, menuData); } @@ -115,9 +134,7 @@ export class StartupService { const appData = this.httpClient.get(`assets/mocks/app-data.json`).pipe(map((res: any) => res.app)); // 用户数据 - const userData = this.coreSrv.loginStatus - ? this.httpClient.post(this.coreSrv.$api_get_current_user_info, {}).pipe(map((res: any) => res.data)) - : this.httpClient.get('assets/mocks/user-data.json').pipe(map((res: any) => res.user)); + const userData = this.httpClient.post(this.userSrv.$api_get_user_by_token, {}).pipe(map((res: any) => res.data)); // 菜单数据 const menuData = this.httpClient @@ -125,6 +142,7 @@ export class StartupService { appId: this.coreSrv.envSrv.getEnvironment().appId }) .pipe(map((res: any) => res.data)); + // const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu)); return zip(appData, userData, menuData); } diff --git a/src/app/global-config.module.ts b/src/app/global-config.module.ts index a09fa770..af9999b1 100644 --- a/src/app/global-config.module.ts +++ b/src/app/global-config.module.ts @@ -11,9 +11,23 @@ import { environment } from '@env/environment'; // #region NG-ALAIN Config const alainConfig: AlainConfig = { - st: { modal: { size: 'lg' } }, + st: { + req: { method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' } }, + res: { reName: { list: 'data.records', total: 'data.total' } }, + page: { show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000], toTop: false }, + modal: { size: 'lg' } + }, + sf: { button: { search: '查询' } }, pageHeader: { homeI18n: 'home', recursiveBreadcrumb: true }, - auth: { login_url: '/passport/login' } + auth: { login_url: '/passport/login' }, + acl: { guard_url: '/exception/403' }, + chart: { + // 以下是默认配置,如果项目无法外网访问,可以根据 `angular.json` 配置将依赖包直接使用 `./assets***` 路径 + libs: [ + 'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.4/dist/g2.min.js', + 'https://gw.alipayobjects.com/os/lib/antv/data-set/0.11.7/dist/data-set.js' + ] + }, }; const alainModules = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()]; @@ -21,12 +35,12 @@ const alainProvides = [{ provide: ALAIN_CONFIG, useValue: alainConfig }]; // #region reuse-tab -import { RouteReuseStrategy } from '@angular/router'; -alainProvides.push({ - provide: RouteReuseStrategy, - useClass: ReuseTabStrategy, - deps: [ReuseTabService] -} as any); +// import { RouteReuseStrategy } from '@angular/router'; +// alainProvides.push({ +// provide: RouteReuseStrategy, +// useClass: ReuseTabStrategy, +// deps: [ReuseTabService] +// } as any); // #endregion @@ -51,9 +65,9 @@ export class GlobalConfigModule { throwIfAlreadyLoaded(parentModule, 'GlobalConfigModule'); // NOTICE: Only valid for menus with reuse property // Pls refer to the E-Mail demo effect - reuseTabService.mode = ReuseTabMatchMode.MenuForce; + // reuseTabService.mode = ReuseTabMatchMode.MenuForce; // Shouled be trigger init, you can ingore when used `reuse-tab` component in layout component - reuseTabService.init(); + // reuseTabService.init(); } static forRoot(): ModuleWithProviders { diff --git a/src/app/layout/layout.module.ts b/src/app/layout/layout.module.ts index 5c0eac3c..3afd4206 100644 --- a/src/app/layout/layout.module.ts +++ b/src/app/layout/layout.module.ts @@ -24,7 +24,7 @@ import { NzSpinModule } from 'ng-zorro-antd/spin'; import { NzSwitchModule } from 'ng-zorro-antd/switch'; import { NzTimelineModule } from 'ng-zorro-antd/timeline'; import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; - +import { NzGridModule } from 'ng-zorro-antd/grid'; import { LayoutPassportComponent } from './passport/passport.component'; import { PRO_COMPONENTS } from './pro/index'; @@ -56,6 +56,7 @@ const COMPONENTS: Array> = [...PRO_COMPONENTS, LayoutPassportComponent NoticeIconModule, ThemeBtnModule, ScrollbarModule, + NzGridModule, NzMessageModule ], declarations: COMPONENTS, diff --git a/src/app/layout/passport/passport.component.html b/src/app/layout/passport/passport.component.html index e9beaece..0f37d045 100644 --- a/src/app/layout/passport/passport.component.html +++ b/src/app/layout/passport/passport.component.html @@ -1,13 +1,15 @@ -
- -
-
-
- - ng-alain pro + + +
+
+ +
-
武林中最有影响力的《葵花宝典》;欲练神功,挥刀自宫
- -
-
\ No newline at end of file + + +
+ +
+
+ \ No newline at end of file diff --git a/src/app/layout/passport/passport.component.less b/src/app/layout/passport/passport.component.less index a17b975f..fc77bde8 100644 --- a/src/app/layout/passport/passport.component.less +++ b/src/app/layout/passport/passport.component.less @@ -1,74 +1,22 @@ @import '~@delon/theme/index'; + :host { ::ng-deep { - .container { - display: flex; - flex-direction: column; - min-height: 100%; - background: #f0f2f5; - } - .langs { - width: 100%; - height: 40px; - line-height: 44px; - text-align: right; - .ant-dropdown-trigger { - display: inline-block; - } - .anticon { - margin-top: 24px; - margin-right: 24px; - font-size: 14px; - vertical-align: top; - cursor: pointer; - } - } - .wrap { - flex: 1; - padding: 32px 0; - } - .ant-form-item { - margin-bottom: 24px; + .layout { + height: 100%; } - @media (min-width: @screen-md-min) { - .container { - background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); - background-repeat: no-repeat; - background-position: center 110px; - background-size: 100%; - } - .wrap { - padding: 32px 0 24px; - } - } - .top { - text-align: center; - } - .header { - height: 44px; - line-height: 44px; - a { - text-decoration: none; - } - } - .logo { - height: 44px; - margin-right: 16px; - } - .title { - position: relative; - color: @heading-color; - font-weight: 600; - font-size: 33px; - font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif; - vertical-align: middle; - } - .desc { - margin-top: 12px; - margin-bottom: 40px; - color: @text-color-secondary; - font-size: @font-size-base; + .ant-layout-header { + background: #ffffff; + box-shadow: 0px 5px 5px #d1d1d1; } + + } } + +.title { + font-size : 18px; + font-weight: 600; + color : #26282A; +} \ No newline at end of file diff --git a/src/app/layout/passport/passport.component.ts b/src/app/layout/passport/passport.component.ts index c48bb161..8a4ef9da 100644 --- a/src/app/layout/passport/passport.component.ts +++ b/src/app/layout/passport/passport.component.ts @@ -7,24 +7,9 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; styleUrls: ['./passport.component.less'] }) export class LayoutPassportComponent implements OnInit { - links = [ - { - title: '帮助', - href: '' - }, - { - title: '隐私', - href: '' - }, - { - title: '条款', - href: '' - } - ]; - - constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {} + constructor() {} ngOnInit(): void { - this.tokenService.clear(); + // this.tokenService.clear(); } } diff --git a/src/app/layout/pro/components/header/header.component.html b/src/app/layout/pro/components/header/header.component.html index eee9c54f..f3b58f4a 100644 --- a/src/app/layout/pro/components/header/header.component.html +++ b/src/app/layout/pro/components/header/header.component.html @@ -1,7 +1,7 @@
- +
diff --git a/src/app/layout/pro/components/logo/logo.component.html b/src/app/layout/pro/components/logo/logo.component.html index c6891a91..511e16c7 100644 --- a/src/app/layout/pro/components/logo/logo.component.html +++ b/src/app/layout/pro/components/logo/logo.component.html @@ -1,4 +1,4 @@ - {{ name }} + {{ name }}

{{ name }}

diff --git a/src/app/layout/pro/components/menu/menu.component.html b/src/app/layout/pro/components/menu/menu.component.html index 2d85d439..272c43b3 100644 --- a/src/app/layout/pro/components/menu/menu.component.html +++ b/src/app/layout/pro/components/menu/menu.component.html @@ -1,9 +1,9 @@ - + - + @@ -17,39 +17,22 @@ {{ i.text }} {{ i.text }} -
    +
      -
    • +
    • - +
    • -
    • +
    • @@ -61,34 +44,17 @@
        -
      • +
      • -
      • +
        • -
        • +
        • @@ -98,4 +64,4 @@
      • -
      +
    \ No newline at end of file diff --git a/src/app/layout/pro/components/menu/menu.component.ts b/src/app/layout/pro/components/menu/menu.component.ts index dd3d7467..a478429f 100644 --- a/src/app/layout/pro/components/menu/menu.component.ts +++ b/src/app/layout/pro/components/menu/menu.component.ts @@ -51,7 +51,6 @@ export class LayoutProMenuComponent implements OnInit, OnDestroy { } }); this.menus = res; - this.openStatus(); } diff --git a/src/app/layout/pro/components/notify/notify.component.html b/src/app/layout/pro/components/notify/notify.component.html index a38da23a..ddd01574 100644 --- a/src/app/layout/pro/components/notify/notify.component.html +++ b/src/app/layout/pro/components/notify/notify.component.html @@ -1,10 +1,4 @@ - + + + diff --git a/src/app/layout/pro/components/user/user.component.html b/src/app/layout/pro/components/user/user.component.html index ece6ea2f..6d615e26 100644 --- a/src/app/layout/pro/components/user/user.component.html +++ b/src/app/layout/pro/components/user/user.component.html @@ -1,21 +1,21 @@
    - - {{ settings.user.name }} + + {{ settings.user?.realName }}
    -
    +
    个人中心
    -
    +
  • diff --git a/src/app/layout/pro/components/widget/widget.component.html b/src/app/layout/pro/components/widget/widget.component.html index 52de221e..f16d7571 100644 --- a/src/app/layout/pro/components/widget/widget.component.html +++ b/src/app/layout/pro/components/widget/widget.component.html @@ -9,6 +9,10 @@ + diff --git a/src/app/layout/pro/pro.service.ts b/src/app/layout/pro/pro.service.ts index 258dbf4b..ba597366 100644 --- a/src/app/layout/pro/pro.service.ts +++ b/src/app/layout/pro/pro.service.ts @@ -23,7 +23,7 @@ export class BrandService { * @alain-pro-sider-menu-width: 256px; * ``` */ - readonly width = 256; + readonly width = 205; /** * Specify width of the sidebar after collapsed, If you change it, muse be synchronize change less parameter: diff --git a/src/app/layout/pro/styles/theme-default.less b/src/app/layout/pro/styles/theme-default.less index 38d3e54f..3805df6e 100644 --- a/src/app/layout/pro/styles/theme-default.less +++ b/src/app/layout/pro/styles/theme-default.less @@ -29,7 +29,7 @@ @alain-pro-light-color: #fff; @alain-pro-light-slider-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05); -@alain-pro-logo-font-size: 20px; +@alain-pro-logo-font-size: 17px; @alain-pro-logo-font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif; @alain-pro-content-margin: 24px; diff --git a/src/app/routes/account/account-routing.module.ts b/src/app/routes/account/account-routing.module.ts new file mode 100644 index 00000000..8a7ce180 --- /dev/null +++ b/src/app/routes/account/account-routing.module.ts @@ -0,0 +1,31 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 20:15:41 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:30 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\account-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { AccountComponentsCenterComponent } from './components/center/center.component'; + +const routes: Routes = [ + { path: '', redirectTo: 'center', pathMatch: 'full' }, + { + path: 'center', + component: AccountComponentsCenterComponent, + data: { + title: '账户中心' + } + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AccountRoutingModule {} diff --git a/src/app/routes/account/account.module.ts b/src/app/routes/account/account.module.ts new file mode 100644 index 00000000..96606efa --- /dev/null +++ b/src/app/routes/account/account.module.ts @@ -0,0 +1,30 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-11-29 11:06:01 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\account.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { SharedModule } from '@shared'; +import { AccountRoutingModule } from './account-routing.module'; +import { AccountComponentsCenterComponent } from './components/center/center.component'; +import { AccountComponentsEditNameComponent } from './components/edit-name/edit-name.component'; +import { AccountComponentsCenterEditComponent } from './components/edit-password/edit-password.component'; + +const COMPONENTS = [ + AccountComponentsCenterComponent, + AccountComponentsEditNameComponent, + AccountComponentsCenterEditComponent +]; +const COMPONENTS_NOROUNT = [AccountComponentsEditNameComponent]; + +@NgModule({ + imports: [SharedModule, AccountRoutingModule], + declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT], +}) +export class AccountModule {} diff --git a/src/app/routes/account/components/center/center.component.html b/src/app/routes/account/components/center/center.component.html new file mode 100644 index 00000000..d9df68c0 --- /dev/null +++ b/src/app/routes/account/components/center/center.component.html @@ -0,0 +1,48 @@ +
    + +

    个人中心

    + + + + +
    +
    + 手机号码/账号 +
    +
    {{ infoData.phone }}
    +
    + 已绑定 + 未绑定 +
    +
    +
    +
    + +
    + + + +
    +
    + 账户密码 +
    +
    定期更换密码有助于账号安全
    +
    + 已设置 + 未设置 +
    +
    +
    +
    + +
    +
    + +
    +
    diff --git a/src/app/routes/account/components/center/center.component.less b/src/app/routes/account/components/center/center.component.less new file mode 100644 index 00000000..96f8b59c --- /dev/null +++ b/src/app/routes/account/components/center/center.component.less @@ -0,0 +1,46 @@ +:host { + ::ng-deep { + .info-main { + padding: 30px; + } + .info-main h3 { + margin-bottom: 30px; + color: #333; + font-size: 24px; + } + .info { + position: relative; + } + .info-btn { + position: absolute; + top: 20px; + right: 20px; + } + .item-btn { + width: 28px; + text-align: center; + } + .li-label { + color: #333; + font-weight: bold; + font-size: 14px; + } + page-grid { + background-color: #f0f3f7; + + div.container { + width: 80%; + margin: 0 auto; + padding: 1rem; + } + } + } + .info-row { + padding: 24px 0; + .info-icon { + margin-right: 15px; + color: #3875fb; + font-size: 16px; + } + } +} diff --git a/src/app/routes/account/components/center/center.component.spec.ts b/src/app/routes/account/components/center/center.component.spec.ts new file mode 100644 index 00000000..cdcb358d --- /dev/null +++ b/src/app/routes/account/components/center/center.component.spec.ts @@ -0,0 +1,23 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AccountComponentsCenterComponent } from './center.component'; + +describe('AccountComponentsCenterComponent', () => { + let component: AccountComponentsCenterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AccountComponentsCenterComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountComponentsCenterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/account/components/center/center.component.ts b/src/app/routes/account/components/center/center.component.ts new file mode 100644 index 00000000..713b106b --- /dev/null +++ b/src/app/routes/account/components/center/center.component.ts @@ -0,0 +1,202 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { Observable, Observer } from 'rxjs'; +import { AccountService } from '../../services/account.service'; +import { AccountComponentsEditNameComponent } from '../edit-name/edit-name.component'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountComponentsCenterEditComponent } from '../edit-password/edit-password.component'; + +@Component({ + selector: 'app-account-components-center', + templateUrl: './center.component.html', + styleUrls: ['./center.component.less'], +}) +export class AccountComponentsCenterComponent implements OnInit { + url = `/rule?_allow_anonymous=true`; + @ViewChild('sf', { static: false }) sf!: SFComponent; + i: any; + formDate: any = {}; + schema!: SFSchema; + ui: SFUISchema = {}; + infoData: any = { + appId: '', + appTypeId: 0, + appTypeName: '', + appUserId: 0, + avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png?_allow_anonymous=true', + birthday: '', + cert: 0, + createTime: '', + email: '', + id: 0, + isPwd: true, + lastLoginDate: '', + name: '', + nickName: '', + openId: '', + phone: '', + remark: '', + sex: 0, + state: 0, + stateLocked: true, + token: '', + userType: 0, + }; + tabs = [ + { + name: '基本设置', + }, + { + name: '安全设置', + }, + ]; + idx: any = 0; + constructor(public service: AccountService, private modal: ModalHelper, private http: _HttpClient, private router: Router, private modalService: NzModalService,) {} + + ngOnInit() { + this.initSF(); + this.getInfo(); + } + initSF() { + this.schema = { + properties: { + avatar: { + type: 'string', + title: '头像', + ui: { + action: `/cms/upload/multipartFile/fileModel?_allow_anonymous=true`, + fileType: 'image/png,image/jpeg,image/jpg,image/png,image/gif,image/bmp', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '支持JPG、GIF、PNG、JPEG、BMP格式,文件小于2M', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url, + }, + }, + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + nickName: { + title: '昵称', + type: 'string', + minLength: 1, + maxLength: 18, + ui: { + placeholder: '请输入昵称', + width: 400, + errors: { + required: '请输入昵称', + }, + }, + }, + }, + required: ['nickName', 'avatar'], + }; + this.ui = { + '*': { + spanLabel: 5, + grid: { span: 24 }, + }, + }; + } + getInfo() { + this.service.http.post(this.service.$api_get_current_user_info).subscribe((res) => { + this.infoData = res.data; + }); + } + + edit(tpye: string) { + if (tpye === 'phone') { + const modalRef = this.modalService.create({ + nzTitle: '验证手机号码', + nzContent: AccountComponentsEditNameComponent, + nzComponentParams: { + i: this.infoData + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + if (result === true) { + // this.st.load(1); + } + }); + } + if (tpye === 'password') { + + const modalRef = this.modalService.create({ + nzTitle: '设置/修改登录密码', + nzContent: AccountComponentsCenterEditComponent, + nzComponentParams: { + record: this.infoData + }, + }); + modalRef.afterClose.subscribe((result: any) => { + if (result === true) { + // this.st.load(1); + } + }); + } + // if (tpye === 'info') { + // this.router.navigate(['/account/editInfo'], { + // queryParams: { realName: this.infoData.realName, certificateNumber: this.infoData.certificateNumber }, + // }); + // } + // if (tpye === 'name') { + // this.modal + // .createStatic(AccountComponentsEditNameComponent, { i: { name: this.infoData.name, phone: this.infoData.phone } }) + // .subscribe(() => { + // this.getInfo(); + // // this.st.reload(); + // }); + // } + } + + changeType(type: number): void { + this.idx = type; + } + + formSubmit(value: any): void { + const params = { ...value }; + this.service.request(`${this.service.$api_get_current_user_info}`, params).subscribe((res) => { + if (res === true) { + this.service.msgSrv.success('保存成功'); + this.getInfo(); + // this.initSF(); + } + }); + } +} diff --git a/src/app/routes/account/components/edit-name/edit-name.component.html b/src/app/routes/account/components/edit-name/edit-name.component.html new file mode 100644 index 00000000..a300858e --- /dev/null +++ b/src/app/routes/account/components/edit-name/edit-name.component.html @@ -0,0 +1,75 @@ + + + + +
    + + +
    +
    +
    + + + + + + + +
    + + +
    +
    +
    +
    + + + + +
    + + + +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/account/components/edit-name/edit-name.component.less b/src/app/routes/account/components/edit-name/edit-name.component.less new file mode 100644 index 00000000..2c58b9fb --- /dev/null +++ b/src/app/routes/account/components/edit-name/edit-name.component.less @@ -0,0 +1,20 @@ +:host { + .valid-code { + position: relative; + } + .btn-code { + position: absolute; + top: 0; + right: 0; + z-index: 9; + } + .valid-code2 { + position: relative; + } + .btn-code2 { + position: absolute; + top: 0; + right: 0; + z-index: 9; + } +} diff --git a/src/app/routes/account/components/edit-name/edit-name.component.spec.ts b/src/app/routes/account/components/edit-name/edit-name.component.spec.ts new file mode 100644 index 00000000..a5f8d13a --- /dev/null +++ b/src/app/routes/account/components/edit-name/edit-name.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-11-29 11:06:01 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:44 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\components\\edit-name\\edit-name.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AccountComponentsEditNameComponent } from './edit-name.component'; + +describe('AccountComponentsEditNameComponent', () => { + let component: AccountComponentsEditNameComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AccountComponentsEditNameComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountComponentsEditNameComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/account/components/edit-name/edit-name.component.ts b/src/app/routes/account/components/edit-name/edit-name.component.ts new file mode 100644 index 00000000..fdc0d05e --- /dev/null +++ b/src/app/routes/account/components/edit-name/edit-name.component.ts @@ -0,0 +1,271 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ErrorData, SFComponent, SFSchema, SFStringWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +// import { CaptchaComponent } from '@shared'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { interval, Observable, Observer } from 'rxjs'; +import { take } from 'rxjs/operators'; +import { AccountService } from '../../services/account.service'; + +@Component({ + selector: 'app-account-components-edit-name', + templateUrl: './edit-name.component.html', + styleUrls: ['./edit-name.component.less'], +}) +export class AccountComponentsEditNameComponent implements OnInit, AfterViewInit { + // @ViewChild('dun', { static: false }) + // private dun!: CaptchaComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + record: any = {}; + i: any; + schema!: SFSchema; + schemaView!: SFSchema; + ui!: SFUISchema; + uiView: SFUISchema = {}; + isVisibleView = false; + isVisibleOk = false; + formData: any = {}; + count = 0; + count2 = 0; + oldName: any; + voucher: any; + codeTips: any; + interval$: any; + + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public http: _HttpClient, public service: AccountService,private cdr: ChangeDetectorRef,) {} + ngAfterViewInit(): void { + // this.dun.init(); + } + + ngOnInit() { + this.codeTips = '为了账户安全,需您的手机验证(' + this.i?.phone + ')'; + this.formData.oldName = this.i?.phone; + this.initSF(); + this.initSFNew(); + // this.getInfo(); + } + initSF() { + this.schema = { + properties: { + oldName: { + title: '手机号', + type: 'string', + default: this.formData?.oldName, + ui: { + widget: 'text', + }, + }, + // userName: { + // title: '用户名(新)', + // type: 'string', + // minLength: 3, + // maxLength: 30, + // description: '3-30个字符,支持中英文、数字、符号“_”和“-”,只能修改一次', + // ui: { + // placeholder: '请输入新用户名', + // errors: { + // required: '请输入新用户名', + // }, + // } as SFStringWidgetSchema, + // }, + smsVerifyCode: { + title: '验证码', + type: 'string', + maxLength: 6, + minLength: 6, + description: this.codeTips, + ui: { + widget: 'custom', + placeholder: '请输入验证码', + errors: { + required: '请输入6位数字验证码', + minLength: '请输入6位数字验证码', + }, + }, + }, + }, + required: ['userName', 'smsVerifyCode'], + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 24 }, + }, + }; + } + initSFNew() { + this.schemaView = { + properties: { + phone: { + title: '新手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + placeholder: '请输入新手机号', + errors: { + required: '请输入新手机号', + }, + } as SFStringWidgetSchema, + }, + smsVerifyCode: { + title: '验证码', + type: 'string', + maxLength: 6, + minLength: 6, + ui: { + widget: 'custom', + placeholder: '请输入验证码', + errors: { + required: '请输入6位验证码', + minLength: '请输入6位验证码', + }, + }, + }, + }, + required: ['phone', 'smsVerifyCode'], + }; + this.uiView = { + '*': { + spanLabelFixed: 100, + grid: { span: 24 }, + }, + }; + } + + getCaptcha() { + const params = { + // phoneNumber: phone + }; + this.service.request(this.service.$api_get_current_user_smVerification, params, 'POST', true, 'FORM').subscribe((res) => { + // code==503046 弹出网易盾 + if (res && res.code === '1') { + this.service.msgSrv.success('发送成功'); + this.createInterval(); + } else if (res.code === '503046') { + // this.dun.popUp(); + } else { + this.service.msgSrv.success(res.msg); + } + }); + } + + getCaptcha2() { + const params = { + phoneNumber: this.sfView.value.phone + }; + this.service.request(this.service.$api_get_getSMVerificationCode, params, 'POST', true, 'FORM').subscribe((res) => { + // code==503046 弹出网易盾 + if (res && res.code === '1') { + this.service.msgSrv.success('发送成功'); + this.createInterval2(); + } else if (res.code === '503046') { + // this.dun.popUp(); + } else { + this.service.msgSrv.success(res.msg); + } + }); + } + + // /* code倒计时 */ + // codeCountDown() { + // this.count = 59; + // this.interval$ = setInterval(() => { + // this.count -= 1; + // if (this.count <= 0) { + // clearInterval(this.interval$); + // } + // }, 1000); + // } + private createInterval() { + this.count = 59; + interval(1000) + .pipe(take(60)) + .subscribe((x: any) => { + this.count = 59 - (x + 1); + this.cdr.detectChanges(); + }); + } + private createInterval2() { + this.count2 = 59; + interval(1000) + .pipe(take(60)) + .subscribe((x: any) => { + this.count2 = 59 - (x + 1); + this.cdr.detectChanges(); + }); + } + // codeCountDown2() { + // this.count2 = 59; + // this.interval$ = setInterval(() => { + // this.count2 -= 1; + // if (this.count <= 0) { + // clearInterval(this.interval$); + // } + // }, 1000); + // } + /* 网易盾验证通过 */ + captchaDone(validate: any) { + this.createInterval(); + } + + getInfo() { + const params = { + // id: this.i.id, + }; + this.service.http.post(this.service.$api_get_current_user_info, params).subscribe((res) => { + // if (res) { + // this.getCaptcha(res.data.phone); + // } + }); + } + + close() { + this.modal.destroy(); + } + submitForm() { + const params = { + smsVerifyCode: this.sf.value.smsVerifyCode, + }; + + this.service.http.post(this.service.$api_get_verifyPhone, params).subscribe((res) => { + if (res.success) { + // this.modal.close(true); + this.voucher = res.data.voucher + this.isVisibleView = true + } else { + this.service.msgSrv.error(res.msg) + } + }); + } + handleCancel(type: string) { + if(type === '1') { + this.isVisibleView = false + } else if(type === '2') { + console.log(type) + } else if(type === '3') { + this.modal.close() + } + } + handleOK() { + + } + handleNew() { + if(!this.sfView.valid) { + return; + } + const params = { + voucher: this.voucher, + ...this.sfView.value, + } + this.service.http.post(this.service.$api_set_voucherUpdatePhone, params).subscribe((res) => { + if (res.success) { + this.isVisibleOk = true; + } else { + this.service.msgSrv.error(res.msg) + } + }); + } +} diff --git a/src/app/routes/account/components/edit-password/edit-password.component.html b/src/app/routes/account/components/edit-password/edit-password.component.html new file mode 100644 index 00000000..0fd3cc15 --- /dev/null +++ b/src/app/routes/account/components/edit-password/edit-password.component.html @@ -0,0 +1,94 @@ + + + +
    + + 新密码 + + + + + + + + + + + 确认新密码 + + + + + + + + + + + 手机号 + {{this.record?.phone}} + + + + 验证码 + + +
    +
    + +
    +
    + + {{ count > 0 ? '请等待' + count + 's' : '获取验证码' }} +
    +
    +
    +
    +
    +
    + + +
    + + + + + +
    + +
    +
    +
    +
    diff --git a/src/app/routes/account/components/edit-password/edit-password.component.ts b/src/app/routes/account/components/edit-password/edit-password.component.ts new file mode 100644 index 00000000..3f4cd9b7 --- /dev/null +++ b/src/app/routes/account/components/edit-password/edit-password.component.ts @@ -0,0 +1,130 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 10:30:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:54 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\components\\edit-password\\edit-password.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, Inject, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; + +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'; +import { NzFormTooltipIcon } from 'ng-zorro-antd/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { AccountService } from '../../services/account.service'; + +@Component({ + selector: 'app-account-components-edit', + templateUrl: './edit-password.component.html' +}) +export class AccountComponentsCenterEditComponent implements OnInit { + validateForm!: FormGroup; + record: any; + count = 0; + type = 'create'; + isVisibleView = false + passwordVisible = false; + passwordVisible2 = false; + password: any; + password2: any; + interval$: any; + confirmationValidator = + (control: FormControl): { [s: string]: boolean } => { + if (!control.value) { + return { required: true }; + } else if (control?.value !== this.validateForm?.value?.passWord) { + return { confirm: true, error: true }; + } + return {}; + }; + captchaTooltipIcon: NzFormTooltipIcon = { + type: 'info-circle', + theme: 'twotone' + }; + constructor( + public router: Router, + public ar: ActivatedRoute, + private modalRef: NzModalRef, + private fb: FormBuilder, + public service: AccountService, + @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService + ) {} + + ngOnInit() { + this.initForm(); + } + initForm () { + this.validateForm = this.fb.group({ + passWord: [null, + [ + Validators.required, + Validators.maxLength(16), + Validators.minLength(8), + Validators.pattern('^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z-_]{8,16}$') + ]], + passWordTo: [null, [ Validators.required, Validators.maxLength(16), Validators.minLength(8), this.confirmationValidator,]], + smsVerifyCode: [null, [Validators.required]], + }); +} + destroyModal(): void { + this.modalRef.destroy(); + } + getCaptcha(e: MouseEvent): void { + this.service.request(this.service.$api_get_current_user_smVerification).subscribe(res => { + // code==503046 弹出网易盾 + if (res && res.code === '1') { + this.service.msgSrv.success('发送成功'); + e.preventDefault(); + this.codeCountDown(); + }else { + this.service.msgSrv.success(res.msg); + } + }); + } + save() { + if(!this.validateForm.valid) { + this.service.msgSrv.warning('必填项为空或格式错误,请检查!') + return; + } + const params = { + ...this.validateForm.value + }; + this.service.request(this.service.$api_set_phoneUpdatePassword, params).subscribe((res) => { + if (res) { + this.service.msgSrv.success('修改密码成功!'); + this.isVisibleView = true; + setTimeout(() => { + this.tokenService.clear(); + this.router.navigate(['/passport/login']) + this.modalRef.close() + }, 3000) + } + }); + } + /* code倒计时 */ + codeCountDown() { + this.count = 59; + this.interval$ = setInterval(() => { + this.count -= 1; + if (this.count <= 0) { + clearInterval(this.interval$); + } + }, 1000); + } + handleCancel() { + this.isVisibleView = false + } + handleOK() { + this.modalRef.close() + this.tokenService.clear(); + this.router.navigate(['/passport/login']) + } +} diff --git a/src/app/routes/account/services/account.service.ts b/src/app/routes/account/services/account.service.ts new file mode 100644 index 00000000..69608398 --- /dev/null +++ b/src/app/routes/account/services/account.service.ts @@ -0,0 +1,42 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 10:30:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:59 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\services\\account.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { map } from 'rxjs/operators'; +import { BaseService } from 'src/app/shared/services/core/base.service'; +import { EAFileUtil } from 'src/app/shared/utils/file.util'; + +@Injectable({ + providedIn: 'root', +}) +export class AccountService extends BaseService { + + // 获取当前登录用户详情 + $api_get_current_user_info = `/api/mdc/cuc/user/getUserInfo`; + + // 根据当前登录用户绑定的手机号码获取短信验证码 + $api_get_current_user_smVerification = `/api/mdc/pbc/smsSend/getSmVerificationCodeByToken`; + // 获取短信验证码 + $api_get_getSMVerificationCode = `/api/mdc/pbc/smsSend/getSMVerificationCode`; + + // 验证手机号 + $api_get_verifyPhone = `/api/mdc/cuc/userBasicInfo/forgetPassword/verifyPhone`; + + // 凭证修改手机号 + $api_set_voucherUpdatePhone = `/api/mdc/cuc/userBasicInfo/forgetPassword/voucherUpdatePhone`; + // 凭证修改密码 + $api_set_phoneUpdatePassword = `/api/mdc/cuc/userBasicInfo/phoneUpdatePassword`; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/commom/components/basic-table/basic-table.component.ts b/src/app/routes/commom/components/basic-table/basic-table.component.ts new file mode 100644 index 00000000..99def7f4 --- /dev/null +++ b/src/app/routes/commom/components/basic-table/basic-table.component.ts @@ -0,0 +1,40 @@ +import { AfterViewInit, Component, OnInit } from '@angular/core'; +import { fromEvent } from 'rxjs'; +import { debounceTime } from 'rxjs/operators'; + +@Component({ + template: '' +}) +export class BasicTableComponent implements AfterViewInit { + scrollY = '400px'; + + constructor() {} + + ngAfterViewInit(): void { + setTimeout(() => { + this.getScrollY(); + }, 100); + fromEvent(window, 'resize') + .pipe(debounceTime(100)) + .subscribe(event => { + this.getScrollY(); + }); + } + + getScrollY() { + const windowHeight = window.innerHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight); + const header = document.getElementsByTagName('layout-pro-header')?.[0]; + if (windowHeight && header) { + let scrollY = windowHeight - header.clientHeight - 35 - 49; + const headerWrapper = document.getElementsByTagName('page-header-wrapper')?.[0]; + if (headerWrapper) { + scrollY -= headerWrapper.clientHeight; + } + const tabset = document.getElementsByTagName('nz-tabset')?.[0]; + if (tabset) { + scrollY -= tabset.clientHeight; + } + this.scrollY = scrollY + 'px'; + } + } +} diff --git a/src/app/routes/commom/less/basic-board.less b/src/app/routes/commom/less/basic-board.less new file mode 100644 index 00000000..84354724 --- /dev/null +++ b/src/app/routes/commom/less/basic-board.less @@ -0,0 +1,5 @@ +:host::ng-deep { + .ant-form-item { + margin-bottom: 0; + } +} \ No newline at end of file diff --git a/src/app/routes/commom/less/box.less b/src/app/routes/commom/less/box.less new file mode 100644 index 00000000..b4da38e9 --- /dev/null +++ b/src/app/routes/commom/less/box.less @@ -0,0 +1,42 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-right: 16px; + padding-left : 16px; + } + + .text-truncate { + white-space: normal; + } + + .bold { + .ant-statistic-title { + font-weight: 600; + color : #000; + font-size : 16px; + } + } +} + +.total-footer { + position : absolute; + bottom : 25px; + height : 32px; + margin : 16px 0; + line-height: 32px; +} \ No newline at end of file diff --git a/src/app/routes/commom/less/commom-table.less b/src/app/routes/commom/less/commom-table.less new file mode 100644 index 00000000..1eb73d94 --- /dev/null +++ b/src/app/routes/commom/less/commom-table.less @@ -0,0 +1,70 @@ +:host { + ::ng-deep { + nz-card { + margin: -24px -24px 0; + + .ant-tabs-nav { + margin: 0; + } + } + + .ant-tabs-tab { + margin: 0 0 0 16px; + padding: 12px 0; + } + + .ant-table-body { + border-bottom: 1px solid #f0f0f0; + } + + .table-box { + .ant-card-body { + padding: 0; + } + } + + .ant-table-pagination.ant-pagination { + margin: 8px; + } + + .ant-table-thead > tr > th, + .ant-table-tbody > tr > td, + .ant-table tfoot > tr > th, + .ant-table tfoot > tr > td { + padding: 8px; + } + + .ant-table.ant-table-bordered > .ant-table-container { + border-top: 0; + } + + .ant-pagination-item { + min-width: 24px; + height: 24px; + line-height: 21px; + } + + .ant-pagination-total-text { + height: 24px; + line-height: 24px; + } + + .ant-pagination-prev, + .ant-pagination-next, + .ant-pagination-jump-prev, + .ant-pagination-jump-next { + min-width: 24px; + height: 24px; + line-height: 21px; + } + + .ant-select-single:not(.ant-select-customize-input) .ant-select-selector { + height: 24px; + } + + .ant-select-single .ant-select-selector .ant-select-selection-item, + .ant-select-single .ant-select-selector .ant-select-selection-placeholder { + line-height: 21px; + } + } +} diff --git a/src/app/routes/commom/less/expend-but.less b/src/app/routes/commom/less/expend-but.less new file mode 100644 index 00000000..f454e789 --- /dev/null +++ b/src/app/routes/commom/less/expend-but.less @@ -0,0 +1,13 @@ +.expend-options { + margin-top: 0; +} + + +@media (min-width: 1200px) { + .expend-options { + position : absolute; + right : 0; + bottom : 25px; + max-width: 450px; + } +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-detail/contract-detail.component.html b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.html new file mode 100644 index 00000000..dfdcf8f2 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    + +
    +
    +
    +
    diff --git a/src/app/routes/contract-management/components/contract-detail/contract-detail.component.less b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.less new file mode 100644 index 00000000..ed026470 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.less @@ -0,0 +1,4 @@ +.title { +padding-right: 4px; +padding-left: 14px !important; +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-detail/contract-detail.component.spec.ts b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.spec.ts new file mode 100644 index 00000000..e4586857 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-10 14:44:57 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:15:18 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-detail\\contract-detail.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementDetailComponent } from './contract-detail.component'; + +describe('ContractManagementDetailComponent', () => { + let component: ContractManagementDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ContractManagementDetailComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/contract-detail/contract-detail.component.ts b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.ts new file mode 100644 index 00000000..2070a2e2 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-detail/contract-detail.component.ts @@ -0,0 +1,59 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-10 14:44:57 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:15:43 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-detail\\contract-detail.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { DatePipe } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; + +@Component({ + selector: 'app-contract-management-detail-complaint', + templateUrl: './contract-detail.component.html', + styleUrls: ['./contract-detail.component.less'], + providers: [DatePipe] +}) +export class ContractManagementDetailComponent implements OnInit { + constructor( + private nzModalService: NzModalService, + public service: ContractManagementService, + public route: ActivatedRoute, + private datePipe: DatePipe, + private router: Router + ) {} + textStatus = '合同详情'; + name: any; + code: any; + templateHTML: any; + detailList: any = { + templateName: '' + }; + ngOnInit() { + this.initData(this.service.$api_contract_get); + } + goBack() { + window.history.go(-1); + } + + initData(url: string) { + this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res) { + this.detailList = res; + this.detailList = res; + let value: any = JSON.parse(res.contractParameter); + this.code = value['${code}']; + this.name = value['${name}']; + } + }); + } + cancel() { + window.history.go(-1); + } +} diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html new file mode 100644 index 00000000..37e24dfb --- /dev/null +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.html @@ -0,0 +1,101 @@ + + +
    + +
    + +
    + + + +
    + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + + +
    + + + + {{ item?.contractCode }} + + +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.less b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.less new file mode 100644 index 00000000..7151df68 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.less @@ -0,0 +1,35 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-right: 16px; + padding-left : 16px; + } +} + +.expend-options { + margin-top: 0; +} + + +@media (min-width: 1200px) { + .expend-options { + z-index : -99; + margin-top: -40px; + } + +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts new file mode 100644 index 00000000..517ec984 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts @@ -0,0 +1,307 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFSelectWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; + +@Component({ + selector: 'app-contract-management-contract-frame', + templateUrl: './contract-frame.component.html', + styleUrls: ['./contract-frame.component.less'], + providers: [DatePipe] +}) +export class ContractManagementFrameComponent implements OnInit { + url = `/rule?_allow_anonymous=true`; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + _$expand = false; + selectedRows: any[] = []; + isLoading: boolean = false; + constructor( + public service: ContractManagementService, + private nzModalService: NzModalService, + private router: Router, + public shipperservice: ShipperBaseService, + private datePipe: DatePipe, + ) {} + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + /** + * 查询参数 + */ + get reqParams() { + const params = { + ...this.sf?.value, + } + delete params.signTime; + delete params._$expand; + if(this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + params.signTime = { + start: this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss'), + end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss'), + } + } + if(this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + params.effectiveEndTime = { + start: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss'), + end: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss'), + } + } + return { + ...params + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同编号', + width: '100px', + className: 'text-center', + render: 'contractCode' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractTypeLabel' + }, + { + title: '合同名称', + width: '100px', + className: 'text-center', + index: 'templateName' + }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, + { title: '合同对象', index: 'contractObjectName', width: '120px', className: 'text-center' }, + { + title: '有效期至', + className: 'text-center', + width: '120px', + index: 'effectiveEndTime' + }, + { + title: '签署日期', + className: 'text-center', + width: '120px', + index: 'signTime' + }, + { + title: '状态', + className: 'text-center', + width: '120px', + type: 'badge', + index: 'esignFlowStatus', + badge: { + '0': { text: '未发起', color: 'default' }, + '1': { text: '待签章', color: 'default' }, + '2': { text: '已生效', color: 'success' }, + '3': { text: '已撤销', color: 'warning' }, + '4': { text: '已作废', color: 'warning' }, + '5': { text: '已过期', color: 'warning' }, + '7': { text: '已拒签', color: 'warning' } + } + } + ]; + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号' + }, + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 }, + ], + ui: { + widget: 'select', + placeholder: '请选择', + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable:true, + } as SFSelectWidgetSchema, + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + contractObjectName: { + type: 'string', + title: '合同对象', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + effectiveEndTime: { + title: '有效期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + esignFlowStatus: { + title: '状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'esign:flow:status' }, + containAllLable:true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + approval(): void {} + + add(): void {} + + routeTo(item: any) { + this.router.navigate(['/ticket/invoice-requested-detail/1']); + } + + auditAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + modal.destroy(); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true; + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } +} diff --git a/src/app/routes/contract-management/components/contract-list/contract-list.component.html b/src/app/routes/contract-management/components/contract-list/contract-list.component.html new file mode 100644 index 00000000..2c054c6a --- /dev/null +++ b/src/app/routes/contract-management/components/contract-list/contract-list.component.html @@ -0,0 +1,72 @@ + + + +
    + +
    + +
    + + + +
    + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + + +
    + + + + {{ item?.contractCode }} + + + + + + +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-list/contract-list.component.less b/src/app/routes/contract-management/components/contract-list/contract-list.component.less new file mode 100644 index 00000000..e275a512 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-list/contract-list.component.less @@ -0,0 +1,35 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } +} + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + margin-top: -40px; + z-index : -99; + } + +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-list/contract-list.component.ts b/src/app/routes/contract-management/components/contract-list/contract-list.component.ts new file mode 100644 index 00000000..cccc353b --- /dev/null +++ b/src/app/routes/contract-management/components/contract-list/contract-list.component.ts @@ -0,0 +1,248 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFSelectWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; +import { DatePipe } from '@angular/common'; +import { ShipperBaseService } from '@shared'; + +@Component({ + selector: 'app-contract-management-contract-list', + templateUrl: './contract-list.component.html', + styleUrls: ['./contract-list.component.less'], + providers: [DatePipe] +}) +export class ContractManagementContractListComponent implements OnInit { + url = `/rule?_allow_anonymous=true`; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + _$expand = false; + isLoading: boolean = false; + /** + * 查询参数 + */ + get reqParams() { + const params = { + ...this.sf?.value, + } + delete params.signTime; + delete params._$expand; + if (this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + params.signTime = { + start: this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss'), + end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss'), + } + } + return { + ...params + }; + } + selectedRows: any[] = []; + constructor( + public service: ContractManagementService, + private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router, + private datePipe: DatePipe, + ) { } + + ngOnInit(): void { + this.initST() + this.initSF() + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同编号', + width: '100px', + className: 'text-center', + render: 'contractCode' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractName' + }, + { + title: '业务单号', + className: 'text-center', + width: '120px', + index: 'businessCode' + }, + { + title: '签署日期', + className: 'text-center', + width: '120px', + index: 'signTime' + }, + { + title: '状态', + className: 'text-center', + width: '120px', + type: 'badge', + index: 'esignFlowStatus', + badge: { + '0': { text: '未发起', color: 'default' }, + '1': { text: '待签章', color: 'default' }, + '2': { text: '已生效', color: 'success' }, + '3': { text: '已撤销', color: 'warning' }, + '4': { text: '已作废', color: 'warning' }, + '5': { text: '已过期', color: 'warning' }, + '7': { text: '已拒签', color: 'warning' }, + }, + }, + + ]; + } + /** +* 初始化查询表单 +*/ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号', + }, + businessCode: { + type: 'string', + title: '业务单号' + }, + shipperName: { + type: 'string', + title: '托运人' + }, + carrierName: { + type: 'string', + title: '承运人', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + documentType: { + title: '单据类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'contract:document:type' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** +* 查询字段个数 +*/ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + routeTo(item: any) { + this.router.navigate(['/ticket/invoice-requested-detail/1']); + } + + auditAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + modal.destroy(); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } +} diff --git a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html new file mode 100644 index 00000000..4b5e20cd --- /dev/null +++ b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.html @@ -0,0 +1,101 @@ + + +
    + +
    + +
    + + + +
    + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + + +
    + + + + {{ item?.contractCode }} + + +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.less b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.less new file mode 100644 index 00000000..7151df68 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.less @@ -0,0 +1,35 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-right: 16px; + padding-left : 16px; + } +} + +.expend-options { + margin-top: 0; +} + + +@media (min-width: 1200px) { + .expend-options { + z-index : -99; + margin-top: -40px; + } + +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts new file mode 100644 index 00000000..5517e3f9 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-partner/contract-partner.component.ts @@ -0,0 +1,305 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFSelectWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; + +@Component({ + selector: 'app-contract-management-contract-partner', + templateUrl: './contract-partner.component.html', + styleUrls: ['./contract-partner.component.less'], + providers: [DatePipe] +}) +export class ContractManagementPartnerComponent implements OnInit { + url = `/rule?_allow_anonymous=true`; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + _$expand = false; + selectedRows: any[] = []; + constructor( + public service: ContractManagementService, + private nzModalService: NzModalService, + private router: Router, + public shipperservice: ShipperBaseService, + private datePipe: DatePipe, + ) {} + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + /** + * 查询参数 + */ + get reqParams() { + const params = { + ...this.sf?.value, + } + delete params.signTime; + delete params._$expand; + if(this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + params.signTime = { + start: this.datePipe.transform(this.sf?.value?.signTime?.[0], 'yyyy-MM-dd HH:mm:ss'), + end: this.datePipe.transform(this.sf?.value?.signTime?.[1], 'yyyy-MM-dd HH:mm:ss'), + } + } + if(this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss') && this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss')) { + params.effectiveEndTime = { + start: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[0], 'yyyy-MM-dd HH:mm:ss'), + end: this.datePipe.transform(this.sf?.value?.effectiveEndTime?.[1], 'yyyy-MM-dd HH:mm:ss'), + } + } + return { + ...params + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同编号', + width: '100px', + className: 'text-center', + render: 'contractCode' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractType' + }, + { title: '合同名称', index: 'contractName', width: '120px', className: 'text-center' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, + { + title: '合同对象', + className: 'text-center', + width: '120px', + index: 'contractObjectName' + }, + { + title: '有效期至', + className: 'text-center', + width: '120px', + index: 'effectiveEndTime' + }, + { + title: '签署日期', + className: 'text-center', + width: '120px', + index: 'signTime' + }, + { + title: '状态', + className: 'text-center', + width: '120px', + type: 'badge', + index: 'esignFlowStatus', + badge: { + '0': { text: '未发起', color: 'default' }, + '1': { text: '待签章', color: 'default' }, + '2': { text: '已生效', color: 'success' }, + '3': { text: '已撤销', color: 'warning' }, + '4': { text: '已作废', color: 'warning' }, + '5': { text: '已过期', color: 'warning' }, + '7': { text: '已拒签', color: 'warning' } + } + } + ]; + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + contractCode: { + type: 'string', + title: '合同编号' + }, + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable: true, + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + contractObjectName: { + type: 'string', + title: '合同对象', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + signTime: { + title: '签署日期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + effectiveEndTime: { + title: '有效期', + type: 'string', + ui: { + widget: 'custom', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + esignFlowStatus: { + title: '状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'esign:flow:status' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + approval(): void {} + + add(): void {} + + routeTo(item: any) { + this.router.navigate(['/ticket/invoice-requested-detail/1']); + } + + auditAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + modal.destroy(); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } +} diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.html b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.html new file mode 100644 index 00000000..6594186e --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.html @@ -0,0 +1,60 @@ + + + + + + + + +
    +
    + + +
    +
    +
    +
    + + + + + + + +
    + +
    +
    {{detailList?.templateName}}
    +
    +
    +
    + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.less b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.less new file mode 100644 index 00000000..ed026470 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.less @@ -0,0 +1,4 @@ +.title { +padding-right: 4px; +padding-left: 14px !important; +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.spec.ts b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.spec.ts new file mode 100644 index 00000000..0dff5ef3 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 11:01:55 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:16:31 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementTemplateDetailComponent } from './contract-template-detail.component'; + +describe('ContractManagementTemplateDetailComponent', () => { + let component: ContractManagementTemplateDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ContractManagementTemplateDetailComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementTemplateDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts new file mode 100644 index 00000000..a942aff9 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts @@ -0,0 +1,248 @@ +import { OnChanges } from '@angular/core'; +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 11:01:55 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-30 10:45:19 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; + +@Component({ + selector: 'app-contract-management-template-text-complaint', + templateUrl: './contract-template-detail.component.html', + styleUrls: ['./contract-template-detail.component.less'], + providers: [DatePipe] +}) +export class ContractManagementTemplateTextComponent implements OnInit { + constructor( + private nzModalService: NzModalService, + public service: ContractManagementService, + public route: ActivatedRoute, + private datePipe: DatePipe, + private router: Router, + public shipperservice: ShipperBaseService + ) {} + textStatus = '新建模板'; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + schema2: SFSchema = {}; + ui!: SFUISchema; + sfdata: any; + sfdata2: any; + title: any; + Types: any; + templateHTML: any; + detailList: any = { + templateName: '' + }; + isUpdate = false; + ngOnInit() { + this.initSF(); + this.initSF2(); + if (this.route.snapshot.queryParams.status == 1) { + // 新建 + this.isUpdate = true; + } else if (this.route.snapshot.queryParams.status == 2) { + // 编辑 + this.textStatus = '编辑模板'; + this.isUpdate = true; + this.initData(this.service.$api_get_contractTemplate); + } else if (this.route.snapshot.queryParams.status == 3) { + // 编辑 + this.textStatus = '查看模板'; + this.isUpdate = false; + this.initData(this.service.$api_get_contractTemplate); + } + } + goBack() { + window.history.go(-1); + } + initSF() { + this.schema = { + properties: { + templateName: { + type: 'string', + title: '模版名称' + }, + templateType: { + title: '模板类型', + type: 'string', + enum: [ + { label: '框架合同', value: 'KJ' }, + { label: '明细合同', value: 'MX' }, + { label: '合伙人合同', value: 'HHR' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (tag: any, org: any) => { + console.log(tag); + switch (tag) { + case 'MX': + this.Types = [ + { label: '订单合同', value: '1' }, + { label: '订单补充协议', value: '2' }, + { label: '运单合同', value: '3' }, + { label: '运单补充协议', value: '4' }, + { label: '委托代收合同', value: '5' }, + { label: '电子提货单', value: '10' }, + { label: '电子卸货单', value: '11' }, + ]; + this.sf.getProperty('/contractType')!.schema.enum = this.Types; + this.sf.getProperty('/contractType')!.widget.reset(this.Types); + this.sf.setValue('/contractType', this.Types); + return; + break; + case 'KJ': + this.Types = [ + { label: '网络货物运输服务合同', value: '6' }, + { label: '运输服务承揽合同', value: '7' } + ]; + this.sf.getProperty('/contractType')!.schema.enum = this.Types; + this.sf.getProperty('/contractType')!.widget.reset(this.Types); + this.sf.setValue('/contractType', this.Types); + return; + break; + case 'HHR': + this.Types = [ + { label: '企业合伙人入驻合同', value: '8' }, + { label: '个人合伙人入驻合同', value: '9' } + ]; + this.sf.getProperty('/contractType')!.schema.enum = this.Types; + this.sf.getProperty('/contractType')!.widget.reset(this.Types); + this.sf.setValue('/contractType', this.Types); + return; + break; + default: + break; + } + } + } + }, + signingObject: { + type: 'string', + title: '承包商对象', + enum: [ + { label: '货主', value: '1' }, + { label: '司机', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + enum: this.Types, + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + resourceType: { + title: '货源类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:type' }, + containsAllLable: true, + visibleIf: { + templateType: value => value === 'MX' + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + templateType: value => value === 'KJ' || value === 'HHR' + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + } + }, + required: ['templateName', 'templateType'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 8 } + } + }; + } + initSF2(data?: any) { + this.schema2 = { + properties: { + templateContent: { + type: 'string', + title: '', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 650 + } + }, + default: data?.agreementContent || '' + } + } + }; + } + initData(url: string) { + console.log('编辑'); + + this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res) { + this.detailList = res; + this.title = this.detailList?.templateName; + this.sfdata = res; + this.sfdata2 = res; + } + }); + } + cancel() { + window.history.go(-1); + } + + save() { + // if (!this.sf.value.templateName || !this.sf.value.templateType || !this.sf2.value.templateContent || !this.title) { + // this.service.msgSrv.error('必填参数为空,请检查再重新保存!'); + // return; + // } + // if (this.sf.value.templateType == 'MX') { + // if (this.sf.value.contractType == '') { + // this.service.msgSrv.error('必填参数为空,请检查再重新保存!'); + // return; + // } + // } + const params = { + ...this.sf.value, + ...this.sf2.value, + templateTitle: this.title || this.detailList.templateName + }; + console.log(params); + this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.router.navigate(['/contract-management/template']); + } + }); + } +} diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.html b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.html new file mode 100644 index 00000000..ff37b3f7 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.html @@ -0,0 +1,86 @@ + + + + +
    + +
    + +
    + + + +
    + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + +
    +
    + + + {{ item.templateName }} + + + 货主 + 司机 + + +
    +
    diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.less b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.less new file mode 100644 index 00000000..9df98f26 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.less @@ -0,0 +1,4 @@ +.NewBtn{ + float: right; + margin-bottom: 15px; +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.spec.ts b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.spec.ts new file mode 100644 index 00000000..953a80ed --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 09:45:47 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 10:25:58 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template\\contract-template.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementTemplateFrameComponent } from './contract-template-frame.component'; + +describe('ContractManagementTemplateFrameComponent', () => { + let component: ContractManagementTemplateFrameComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementTemplateFrameComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementTemplateFrameComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts new file mode 100644 index 00000000..0241608e --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts @@ -0,0 +1,252 @@ +import { Router } from '@angular/router'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { ContractManagementService } from '../../services/contract-management.service'; + + +@Component({ + selector: 'app-contract-management-template-frame-complaint', + templateUrl: './contract-template-frame.component.html', + styleUrls: ['./contract-template-frame.component.less'] +}) +export class ContractManagementTemplateFrameComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + _$expand = false; + channelId: any; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + datass: any = [ + { + one: '1', + two: '1', + three: '1', + id: 1 + }, + { + one: '2', + two: '2', + three: '2', + id: 2 + }, +]; + constructor( + public service: ContractManagementService, + private modal: NzModalService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + return { + templateType: 'kj', + ...this.sf?.value, + }; + } + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.initSTAudit(); + } + + + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + templateName: { + type: 'string', + title: '模板名称', + }, + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable: true, + } as SFSelectWidgetSchema + }, + resourceType: { + title: '货源类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:type' }, + containsAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema, + }, + }, + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同模板名称', + className: 'text-center', + render: 'templateName' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractTypeLabel' + }, + { + title: '货源类型', + width: '100px', + className: 'text-center', + index: 'resourceTypeLabel' + }, + { title: '创建人', index: 'createUserIdLabel', width: '120px', className: 'text-center' }, + { + title: '创建时间', + className: 'text-center', + index: 'createTime', + width: '200px' + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record) => this.edit(_record), + acl: { ability: ['CONTRACT-TEMPLATE-edit'] }, + }, + { + text: '删除', + click: (_record) => this.delete(_record), + acl: { ability: ['CONTRACT-TEMPLATE-delete'] }, + }, + ], + }, + ]; + } + initSTAudit() { + this.schemaView = { + properties: { + handleResult: { + title: '处理结果', + type: 'string', + maxLength: 50, + ui: { + placeholder: '最多不超过50字', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + }, + }, + }, + required: ['handleResult'] + }; + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + edit(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 2 + } + }) + } + creatTemplate() { + this.router.navigate(['/contract-management/template/text/' + 0], { + queryParams: { + status: 1 + } + }) + } + goBack() { + window.history.go(-1) + } + view(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 3 + } + }) + } + delete(value: any) { + this.modal.confirm({ + nzTitle: '删除确认', + nzOnOk: () => + this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload() + } + }) + }); + } +} diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.html b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.html new file mode 100644 index 00000000..1ecef42c --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.html @@ -0,0 +1,82 @@ + + + + +
    + +
    + +
    + + + +
    + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + +
    + +
    diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.less b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.less new file mode 100644 index 00000000..9df98f26 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.less @@ -0,0 +1,4 @@ +.NewBtn{ + float: right; + margin-bottom: 15px; +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.spec.ts b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.spec.ts new file mode 100644 index 00000000..8d20aa3b --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 09:45:47 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 14:09:28 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-partner\\contract-template-partner.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementTemplatePartnerComponent } from './contract-template-partner.component'; + +describe('ContractManagementTemplatePartnerComponent', () => { + let component: ContractManagementTemplatePartnerComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementTemplatePartnerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementTemplatePartnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts new file mode 100644 index 00000000..24d93d4e --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts @@ -0,0 +1,252 @@ +import { Router } from '@angular/router'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { ContractManagementService } from '../../services/contract-management.service'; + + +@Component({ + selector: 'app-contract-management-template-partner-complaint', + templateUrl: './contract-template-partner.component.html', + styleUrls: ['./contract-template-partner.component.less'] +}) +export class ContractManagementTemplatePartnerComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + _$expand = false; + channelId: any; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + datass: any = [ + { + one: '1', + two: '1', + three: '1', + id: 1 + }, + { + one: '2', + two: '2', + three: '2', + id: 2 + }, +]; + constructor( + public service: ContractManagementService, + private modal: NzModalService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + return { + templateType: 'HHR', + ...this.sf?.value, + }; + } + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.initSTAudit(); + } + + + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + templateName: { + type: 'string', + title: '模板名称', + }, + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable: true, + } as SFSelectWidgetSchema + }, + resourceType: { + title: '货源类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:type' }, + containsAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema, + }, + }, + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同模板名称', + className: 'text-center', + render: 'templateName' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractTypeLabel' + }, + { + title: '货源类型', + width: '100px', + className: 'text-center', + index: 'resourceTypeLabel' + }, + { title: '创建人', index: 'createUserIdLabel', width: '120px', className: 'text-center' }, + { + title: '创建时间', + className: 'text-center', + index: 'createTime', + width: '200px' + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record) => this.edit(_record), + acl: { ability: ['CONTRACT-TEMPLATE-edit'] }, + }, + { + text: '删除', + click: (_record) => this.delete(_record), + acl: { ability: ['CONTRACT-TEMPLATE-delete'] }, + }, + ], + }, + ]; + } + initSTAudit() { + this.schemaView = { + properties: { + handleResult: { + title: '处理结果', + type: 'string', + maxLength: 50, + ui: { + placeholder: '最多不超过50字', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + }, + }, + }, + required: ['handleResult'] + }; + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + edit(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 2 + } + }) + } + creatTemplate() { + this.router.navigate(['/contract-management/template/text/' + 0], { + queryParams: { + status: 1 + } + }) + } + goBack() { + window.history.go(-1) + } + view(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 3 + } + }) + } + delete(value: any) { + this.modal.confirm({ + nzTitle: '删除确认', + nzOnOk: () => + this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload() + } + }) + }); + } +} diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.html b/src/app/routes/contract-management/components/contract-template/contract-template.component.html new file mode 100644 index 00000000..1ecef42c --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.html @@ -0,0 +1,82 @@ + + + + +
    + +
    + +
    + + + +
    + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + +
    + +
    + +
    diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.less b/src/app/routes/contract-management/components/contract-template/contract-template.component.less new file mode 100644 index 00000000..9df98f26 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.less @@ -0,0 +1,4 @@ +.NewBtn{ + float: right; + margin-bottom: 15px; +} \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.spec.ts b/src/app/routes/contract-management/components/contract-template/contract-template.component.spec.ts new file mode 100644 index 00000000..b7fbac9a --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-05 09:45:47 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 10:25:58 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template\\contract-template.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementTemplateDetailComponent } from './contract-template.component'; + +describe('ContractManagementTemplateDetailComponent', () => { + let component: ContractManagementTemplateDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementTemplateDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementTemplateDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.ts b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts new file mode 100644 index 00000000..e295eb52 --- /dev/null +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts @@ -0,0 +1,252 @@ +import { Router } from '@angular/router'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { ContractManagementService } from '../../services/contract-management.service'; + + +@Component({ + selector: 'app-contract-management-template-detail-complaint', + templateUrl: './contract-template.component.html', + styleUrls: ['./contract-template.component.less'] +}) +export class ContractManagementTemplateDetailComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + _$expand = false; + channelId: any; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + datass: any = [ + { + one: '1', + two: '1', + three: '1', + id: 1 + }, + { + one: '2', + two: '2', + three: '2', + id: 2 + }, + ]; + constructor( + public service: ContractManagementService, + private modal: NzModalService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + return { + templateType: 'MX', + ...this.sf?.value, + }; + } + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.initSTAudit(); + } + + + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + templateName: { + type: 'string', + title: '模板名称', + }, + signingObject: { + type: 'string', + title: '签约对象', + enum: [ + { label: '全部', value: '' }, + { label: '货主', value: 1 }, + { label: '司机', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + contractType: { + title: '合同类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'contract:type' }, + containAllLable: true, + } as SFSelectWidgetSchema + }, + resourceType: { + title: '货源类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:type' }, + containsAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema, + }, + }, + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '合同模板名称', + className: 'text-center', + render: 'templateName' + }, + { + title: '签约对象', + width: '100px', + className: 'text-center', + index: 'signingObjectLabel' + }, + { + title: '合同类型', + width: '100px', + className: 'text-center', + index: 'contractTypeLabel' + }, + { + title: '货源类型', + width: '100px', + className: 'text-center', + index: 'resourceTypeLabel' + }, + { title: '创建人', index: 'createUserIdLabel', width: '120px', className: 'text-center' }, + { + title: '创建时间', + className: 'text-center', + index: 'createTime', + width: '200px' + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record) => this.edit(_record), + acl: { ability: ['CONTRACT-TEMPLATE-edit'] }, + }, + { + text: '删除', + click: (_record) => this.delete(_record), + acl: { ability: ['CONTRACT-TEMPLATE-delete'] }, + }, + ], + }, + ]; + } + initSTAudit() { + this.schemaView = { + properties: { + handleResult: { + title: '处理结果', + type: 'string', + maxLength: 50, + ui: { + placeholder: '最多不超过50字', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + }, + }, + }, + required: ['handleResult'] + }; + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + edit(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 2 + } + }) + } + creatTemplate() { + this.router.navigate(['/contract-management/template/text/' + 0], { + queryParams: { + status: 1 + } + }) + } + goBack() { + window.history.go(-1) + } + view(value: any) { + this.router.navigate(['/contract-management/template/text/' + value.id],{ + queryParams: { + status: 3 + } + }) + } + delete(value: any) { + this.modal.confirm({ + nzTitle: '删除确认', + nzOnOk: () => + this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + }); + } +} diff --git a/src/app/routes/contract-management/components/index/index.component.html b/src/app/routes/contract-management/components/index/index.component.html new file mode 100644 index 00000000..e8670348 --- /dev/null +++ b/src/app/routes/contract-management/components/index/index.component.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/contract-management/components/index/index.component.spec.ts b/src/app/routes/contract-management/components/index/index.component.spec.ts new file mode 100644 index 00000000..9601ea0c --- /dev/null +++ b/src/app/routes/contract-management/components/index/index.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementIndexComponent } from './index.component'; + +describe('SupplyManagementIndexComponent', () => { + let component: SupplyManagementIndexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementIndexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementIndexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/index/index.component.ts b/src/app/routes/contract-management/components/index/index.component.ts new file mode 100644 index 00000000..dfb5474a --- /dev/null +++ b/src/app/routes/contract-management/components/index/index.component.ts @@ -0,0 +1,27 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-07 13:27:10 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:17:01 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\index\\index.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, OnInit } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-supply-management-index', + templateUrl: './index.component.html', +}) +export class ContractManagementIndexComponent implements OnInit { + selectedIndex = 0; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + +} diff --git a/src/app/routes/contract-management/components/policy/policy.component.html b/src/app/routes/contract-management/components/policy/policy.component.html new file mode 100644 index 00000000..dfb762fc --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.html @@ -0,0 +1,72 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + + + + + +
    +
    + + + {{paramValue}} + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/contract-management/components/policy/policy.component.spec.ts b/src/app/routes/contract-management/components/policy/policy.component.spec.ts new file mode 100644 index 00000000..b369df96 --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementPolicyComponent } from './policy.component'; + +describe('ContractManagementPolicyComponent', () => { + let component: ContractManagementPolicyComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementPolicyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementPolicyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/policy/policy.component.ts b/src/app/routes/contract-management/components/policy/policy.component.ts new file mode 100644 index 00000000..542a5cbe --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.ts @@ -0,0 +1,213 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ContractManagementService } from '../../services/contract-management.service'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-contract-management-policy', + templateUrl: './policy.component.html' +}) +export class ContractManagementPolicyComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + _$expand = false; + + selectedRows: any[] = []; + paramValue = ''; + isLoading: boolean = false; + constructor(public service: ContractManagementService, private modal: NzModalService, private router: Router) {} + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value) + }; + delete params.expand; + return params; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + openDetail(item?: any) { + this.paramValue = item?.paramValue + const modal = this.modal.create({ + nzTitle: '传入值', + nzContent: this.promoterModal, + nzOnOk: () => { + return; + } + }); + + } + + initST() { + this.columns = [ + { title: '', type: 'checkbox', width: '50px', className: 'text-center' }, + { + title: '订单ID', + width: '100px', + className: 'text-center', + index: 'billId' + }, + { + title: '项目ID', + width: '100px', + className: 'text-center', + index: 'enterpriseProjectId' + }, + { + title: '保险公司', + width: '100px', + className: 'text-center', + index: 'insuranceCompany' + }, + { + title: '投保金额', + width: '100px', + className: 'text-center', + index: 'insureAmount' + }, + + { + title: '保单号', + width: '100px', + className: 'text-center', + index: 'policyNo' + }, + { + title: '保单地址', + width: '100px', + className: 'text-center', + index: 'policyUrl' + }, + { + title: '保费', + width: '100px', + className: 'text-center', + index: 'premium' + }, + { + title: '处理消息', + width: '100px', + className: 'text-center', + index: 'processMessage' + }, + { + title: '处理结果', + width: '100px', + className: 'text-center', + index: 'processResult' + }, + { + title: '操作', + width: '170px', + className: 'text-center', + buttons: [ + { + text: '查看传入值', + click: item => { + this.openDetail(item) + }, + acl: { ability: ['CONTRACT-POLICY-view'] }, + } + ] + } + ]; + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billId: { + type: 'string', + title: '订单id' + }, + enterpriseProjectId: { + type: 'string', + title: '项目id' + }, + insuranceCompany: { + type: 'string', + title: '保险公司' + }, + policyNo: { + type: 'string', + title: '保单号', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, + processResult: { + type: 'string', + title: '处理结果', + enum: [ + { label: '全部', value: '' }, + { label: '成功', value: 1 }, + { label: '失败', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } +} diff --git a/src/app/routes/contract-management/components/template/template.component.html b/src/app/routes/contract-management/components/template/template.component.html new file mode 100644 index 00000000..fefd0d8f --- /dev/null +++ b/src/app/routes/contract-management/components/template/template.component.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/contract-management/components/template/template.component.spec.ts b/src/app/routes/contract-management/components/template/template.component.spec.ts new file mode 100644 index 00000000..f3c8d5d4 --- /dev/null +++ b/src/app/routes/contract-management/components/template/template.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementTemplateComponent } from './template.component'; + +describe('ContractManagementTemplateComponent', () => { + let component: ContractManagementTemplateComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementTemplateComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementTemplateComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/template/template.component.ts b/src/app/routes/contract-management/components/template/template.component.ts new file mode 100644 index 00000000..9d1cef16 --- /dev/null +++ b/src/app/routes/contract-management/components/template/template.component.ts @@ -0,0 +1,27 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-07 13:27:10 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 10:20:23 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\template\\template.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, OnInit } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-supply-management-template', + templateUrl: './template.component.html', +}) +export class ContractManagementTemplateComponent implements OnInit { + selectedIndex = 0; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + +} diff --git a/src/app/routes/contract-management/contract-management-routing.module.ts b/src/app/routes/contract-management/contract-management-routing.module.ts new file mode 100644 index 00000000..35948446 --- /dev/null +++ b/src/app/routes/contract-management/contract-management-routing.module.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-04 21:05:49 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 10:24:16 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\contract-management-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { ContractManagementDetailComponent } from './components/contract-detail/contract-detail.component'; +import { ContractManagementContractListComponent } from './components/contract-list/contract-list.component'; +import { ContractManagementPartnerComponent } from './components/contract-partner/contract-partner.component'; +import { ContractManagementTemplateTextComponent } from './components/contract-template-detail/contract-template-detail.component'; +import { ContractManagementIndexComponent } from './components/index/index.component'; +import { ContractManagementPolicyComponent } from './components/policy/policy.component'; +import { ContractManagementTemplateComponent } from './components/template/template.component'; +const routes: Routes = [ + { path: 'index', component: ContractManagementIndexComponent }, + { path: 'index/detail/:id', component: ContractManagementDetailComponent }, + { path: 'template', component: ContractManagementTemplateComponent }, + { path: 'template/text/:id', component: ContractManagementTemplateTextComponent }, + { path: 'policy', component: ContractManagementPolicyComponent }, + { path: 'partner', component: ContractManagementPartnerComponent }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ContractManagementManagementRoutingModule {} diff --git a/src/app/routes/contract-management/contract-management.module.ts b/src/app/routes/contract-management/contract-management.module.ts new file mode 100644 index 00000000..497ef5a2 --- /dev/null +++ b/src/app/routes/contract-management/contract-management.module.ts @@ -0,0 +1,47 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-04 21:05:49 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 14:09:24 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\contract-management.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '@shared'; +import { ContractManagementManagementRoutingModule } from './contract-management-routing.module'; +import { ContractManagementContractListComponent } from './components/contract-list/contract-list.component'; +import { ContractManagementPolicyComponent } from './components/policy/policy.component'; +import { ContractManagementTemplateDetailComponent } from './components/contract-template/contract-template.component'; +import { ContractManagementIndexComponent } from './components/index/index.component'; +import { ContractManagementFrameComponent } from './components/contract-frame/contract-frame.component'; +import { ContractManagementDetailComponent } from './components/contract-detail/contract-detail.component'; +import { ContractManagementPartnerComponent } from './components/contract-partner/contract-partner.component'; +import { ContractManagementTemplateComponent } from './components/template/template.component'; +import { ContractManagementTemplateTextComponent } from './components/contract-template-detail/contract-template-detail.component'; +import { ContractManagementTemplateFrameComponent } from './components/contract-template-frame/contract-template-frame.component'; +import { ContractManagementTemplatePartnerComponent } from './components/contract-template-partner/contract-template-partner.component'; + +const COMPONENTS: any = [ + ContractManagementContractListComponent, + ContractManagementPolicyComponent, + ContractManagementTemplateDetailComponent, + ContractManagementTemplateDetailComponent, + ContractManagementIndexComponent, + ContractManagementFrameComponent, + ContractManagementDetailComponent, + ContractManagementPartnerComponent, + ContractManagementTemplateComponent, + ContractManagementTemplateTextComponent, + ContractManagementTemplateFrameComponent, + ContractManagementTemplatePartnerComponent +]; +const NOTROUTECOMPONENTS: any = []; +@NgModule({ + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, ContractManagementManagementRoutingModule, SharedModule] +}) +export class ContractManagementManagementModule {} diff --git a/src/app/routes/contract-management/services/contract-management.service.ts b/src/app/routes/contract-management/services/contract-management.service.ts new file mode 100644 index 00000000..17cc75ca --- /dev/null +++ b/src/app/routes/contract-management/services/contract-management.service.ts @@ -0,0 +1,41 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-04 21:05:49 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-24 10:00:59 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\services\\contract-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from 'src/app/shared/services'; + +@Injectable({ + providedIn: 'root' +}) +export class ContractManagementService extends BaseService { + $api_get_getPremiumInformationPage = `/api/sdc/billOperate/listPremiumInformationPage`; + // 查询投诉列表 + $api_get_operate_listPage = `/api/sdc/complaint/operate/listPage`; + // 新增/更新信息 + $api_save_contractTemplate = `/api/sdc/contractTemplate/save`; + // 查询合同模板表 + $api_get_contractTemplate_page = `/api/sdc/contractTemplate/list/page`; + // 查询合同模板表详情 + $api_get_contractTemplate = `/api/sdc/contractTemplate/get`; + // 删除合同模板 + $api_deletebatch_contractTemplate = `/api/sdc/contractTemplate/deletebatch`; + + // 查询明细合同 + $api_listDetailed_page = `/api/sdc/contract/listDetailed/page`; + // 查询框架合同 + $api_listFrame_page = `/api/sdc/contract/listFrame/page`; + // 查询合伙人合同 + $api_listPartner_page = `/api/sdc/contract/listPartner/page`; + // 获取订单合同表 + $api_contract_get = `/api/sdc/contract/get`; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/dashboard/dashboard.component.html b/src/app/routes/dashboard/dashboard.component.html index 8303d109..e69de29b 100644 --- a/src/app/routes/dashboard/dashboard.component.html +++ b/src/app/routes/dashboard/dashboard.component.html @@ -1,9 +0,0 @@ - - - - diff --git a/src/app/routes/dashboard/dashboard.component.less b/src/app/routes/dashboard/dashboard.component.less index dcb4cf4f..e69de29b 100644 --- a/src/app/routes/dashboard/dashboard.component.less +++ b/src/app/routes/dashboard/dashboard.component.less @@ -1,6 +0,0 @@ -@import '~@delon/theme/index'; - -:host { - ::ng-deep { - } -} diff --git a/src/app/routes/dashboard/dashboard.component.ts b/src/app/routes/dashboard/dashboard.component.ts index a069694d..fe11f0cf 100644 --- a/src/app/routes/dashboard/dashboard.component.ts +++ b/src/app/routes/dashboard/dashboard.component.ts @@ -1,66 +1,8 @@ -import { Component, ChangeDetectionStrategy, ChangeDetectorRef, TemplateRef, ViewChild } from '@angular/core'; -import { STComponent, STColumn, STData, STChange } from '@delon/abc/st'; -import { SFSchema, SFUISchema } from '@delon/form'; -import { _HttpClient } from '@delon/theme'; -import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; -import { map, tap } from 'rxjs/operators'; +import { Component } from '@angular/core'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + styleUrls: ['./dashboard.component.less'] }) -export class DashboardComponent { - @ViewChild('sf') - sf!: SFSchema; - record: any = {}; - i: any; - schema: any = { - properties: { - no: { type: 'string', title: '编号' }, - owner: { type: 'string', title: '姓名' }, - callNo: { type: 'number', title: '调用次数' }, - href: { type: 'string', title: '链接', format: 'uri', ui: { errors: { uri: '11' } } }, - description: { type: 'string', title: '描述' } - }, - required: ['owner', 'callNo', 'href', 'description'] - }; - ui: SFUISchema = { - '*': { - spanLabelFixed: 100, - grid: { span: 12 } - }, - $no: { - widget: 'text' - }, - $href: { - widget: 'string' - }, - $description: { - widget: 'textarea', - grid: { span: 24 } - } - }; - - constructor(private msgSrv: NzMessageService, public http: _HttpClient) {} - - ngOnInit(): void { - // if (this.record.id > 0) this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res)); - } - - save(value: any): void { - console.log(this.sf.value); - - // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { - // this.msgSrv.success('保存成功'); - // // this.modal.close(true); - // }); - } - - close(): void { - // this.modal.destroy(); - } -} +export class DashboardComponent {} diff --git a/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.html b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.html new file mode 100644 index 00000000..ae51e0e3 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.html @@ -0,0 +1,58 @@ + + + + +
    + +
    + + + + + + +
    + + +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    环比(%) +
    + + + +
    +
    +
    +
    业绩量(元) +
    + +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.less b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.less new file mode 100644 index 00000000..af1850ca --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.less @@ -0,0 +1,21 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} +.title{ + display: flex; + align-items: center; + .box{ + width: 8px; + height: 8px; + margin-right: 10px; + border-radius: 100px; + } +} diff --git a/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.spec.ts b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.spec.ts new file mode 100644 index 00000000..00c629be --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableBusiindexComponent } from './busiindex.component'; + +describe('DatatableBusiindexComponent', () => { + let component: DatatableBusiindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableBusiindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableBusiindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.ts b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.ts new file mode 100644 index 00000000..6a27ee0b --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/busiindex.component.ts @@ -0,0 +1,138 @@ +import { Component, OnInit, ViewChild, NgZone } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { differenceInCalendarDays } from 'date-fns'; +import { DataService } from '../../../services/data.service'; +import { BusitablePillarComponent } from '../pillar/pillar.component'; +import { BusitableCurveComponent } from './curve/curve.component'; + +@Component({ + selector: 'app-datatable-busiindex', + templateUrl: './busiindex.component.html', + styleUrls: ['./busiindex.component.less'], + providers: [DatePipe] + +}) +export class DatatableBusiindexComponent implements OnInit { + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('curve') private readonly curve!: BusitableCurveComponent; + @ViewChild('pillar') private readonly pillar!: BusitablePillarComponent; + type = 1; + mode = 'year'; + date: any = null; + time: any = ['2022-01-01 00:00:00'] + defineDate = []; + dateNext: any = null; + modeNext = 'year'; + timeNext: any = ['2022-01-01 00:00:00'] + dateFormat = 'yyyy'; + today = new Date(); + chartData: any = {} + + columns: STColumn[] = [ + { title: '运营主体', index: 'networkTransporterName', className: 'text-center' }, + { title: '合伙人数', index: 'partnerNumber', className: 'text-center' }, + { title: '客户数', index: 'enterpriseNumbe', className: 'text-center' }, + { title: '订单数', index: 'zsl', className: 'text-center' }, + { title: '客户预存款', index: 'czcgje', className: 'text-right', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.czcgje }) } }, + { title: '业绩量', index: 'yisje', className: 'text-center' }, + { title: '已收附加费', index: 'yisfjf', className: 'text-right', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisfjf }) } }, + { title: '平均附加费率', index: 'fjfl', className: 'text-center',format: (item)=> { + return item.fjfl + '%' + } }, + { title: '已开票金额', index: 'ykpje', className: 'text-right', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ykpje }) } }, + ]; + /** + * 查询参数 + */ + get reqParams() { + if(this.mode === 'year') { + this.type = 1 + } else if(this.mode === 'month') { + this.type = 2 + } else if(this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type + }; + + delete params._$expand; + return { ...params }; + } + + constructor(public service: DataService, private datePipe: DatePipe, private ngZone: NgZone) { } + ngOnInit(): void { + this.initData() + } + initData(flag?: boolean){ + let type = 1 + if(this.mode === 'year') { + type = 1 + } else if(this.mode === 'month') { + type = 2 + } + const params: any = { + time: this.timeNext, + type + }; + this.service.request(this.service.$api_performanceReportHistogram, params).subscribe(res => { + if (res) { + this.chartData = res + if(flag) { + this.pillar.reRender() + this.curve.reRender() + } + } + }) + } + changeData(){ + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if(this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if(this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else{ + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + + changeDataNext() { + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + } + onChangeNext(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00'] + } + this.initData(true) + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + exportFun(){ + + } +} diff --git a/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.html b/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.html new file mode 100644 index 00000000..315c4e18 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/demo/components/zorro-demo/zorro-demo.component.less b/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.less similarity index 100% rename from src/app/routes/demo/components/zorro-demo/zorro-demo.component.less rename to src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.less diff --git a/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.ts b/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.ts new file mode 100644 index 00000000..00d9e8b5 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/busiindex/curve/curve.component.ts @@ -0,0 +1,68 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-busitable-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class BusitableCurveComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + this.chart.data(this.chartData); + this.chart.render(); + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 500) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + this.chart.scale({ + year: { + range: [0, 1], + }, + value: { + min: 0, + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, // 展示 Tooltip 辅助线 + shared: true, + }); + + this.chart.line().position('time*value').label('value'); + this.chart.point().position('time*value'); + + this.chart.render(); + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/busitable/mantable/mantable.component.html b/src/app/routes/datatable/components/busitable/mantable/mantable.component.html new file mode 100644 index 00000000..d6117749 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/mantable/mantable.component.html @@ -0,0 +1,42 @@ + + + + +
    +
    + + + + + + +
    + + +
    + +
    +
    + +
    + +
    + + +
    +
    + + + + +
    + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/busitable/mantable/mantable.component.less b/src/app/routes/datatable/components/busitable/mantable/mantable.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/busitable/mantable/mantable.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/busitable/mantable/mantable.component.spec.ts b/src/app/routes/datatable/components/busitable/mantable/mantable.component.spec.ts new file mode 100644 index 00000000..2aa60931 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/mantable/mantable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableMantableComponent } from './mantable.component'; + +describe('DatatableMantableComponent', () => { + let component: DatatableMantableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableMantableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableMantableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/busitable/mantable/mantable.component.ts b/src/app/routes/datatable/components/busitable/mantable/mantable.component.ts new file mode 100644 index 00000000..c1f60ff0 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/mantable/mantable.component.ts @@ -0,0 +1,138 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { differenceInCalendarDays } from 'date-fns'; +import { DataService } from '../../../services/data.service'; +import { BusitablePillarComponent } from '../pillar/pillar.component'; + +@Component({ + selector: 'app-datatable-mantable', + templateUrl: './mantable.component.html', + styleUrls: ['./mantable.component.less'], + providers: [DatePipe] + +}) +export class DatatableMantableComponent implements OnInit { + @ViewChild('pillar') private readonly pillar!: BusitablePillarComponent; + @ViewChild('st') private readonly st!: STComponent; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + time: any = ['2022-01-01 00:00:00'] + dateFormat = 'yyyy'; + today = new Date(); + dateNext: any = null; + modeNext = 'year'; + chartData: any = {} + timeNext: any = ['2022-01-01 00:00:00'] + flag = false; + + columns: STColumn[] = [ + { title: '部门', index: 'bm', className: 'text-center' }, + { title: '业务员', index: 'ywy', className: 'text-center' }, + { title: '合伙人数', index: 'hhrs', className: 'text-center' }, + { title: '客户数', index: 'khs', className: 'text-center' }, + { title: '客户活跃率', index: 'khhyl', className: 'text-center' }, + { title: '客户预存款', index: 'kfyck', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.kfyck }) } }, + { title: '订单数', index: 'dds', className: 'text-center' }, + { title: '订单金额', index: 'ddje', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ddje }) } }, + { title: '业绩量', index: 'yjl', className: 'text-center' }, + { title: '附加费金额', index: 'fjfje', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfje }) } }, + { title: '平均附加费率', index: 'pjfjl', className: 'text-center' }, + { title: '已开票金额', index: 'ykpje', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ykpje }) } }, + ]; + /** + * 查询参数 + */ + get reqParams() { + if(this.mode === 'year') { + this.type = 1 + } else if(this.mode === 'month') { + this.type = 2 + } else if(this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type + }; + + delete params._$expand; + return { ...params }; + } + + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { } + + initData(){ + let type = 1 + if(this.mode === 'year') { + type = 1 + } else if(this.mode === 'month') { + type = 2 + } + const params: any = { + time: this.timeNext, + type + }; + this.service.request(this.service.$api_performanceReportHistogram, params).subscribe(res => { + if (res) { + this.chartData = res + if(this.flag) { + this.pillar.reRender() + } + } + }) + } + changeData(){ + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if(this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if(this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else{ + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + + changeDataNext() { + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + } + onChangeNext(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00'] + } + this.flag = true + this.initData() + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + exportFun(){ + + } + +} diff --git a/src/app/routes/datatable/components/busitable/pillar/pillar.component.html b/src/app/routes/datatable/components/busitable/pillar/pillar.component.html new file mode 100644 index 00000000..315c4e18 --- /dev/null +++ b/src/app/routes/datatable/components/busitable/pillar/pillar.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/busitable/pillar/pillar.component.less b/src/app/routes/datatable/components/busitable/pillar/pillar.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/busitable/pillar/pillar.component.ts b/src/app/routes/datatable/components/busitable/pillar/pillar.component.ts new file mode 100644 index 00000000..ddb0569b --- /dev/null +++ b/src/app/routes/datatable/components/busitable/pillar/pillar.component.ts @@ -0,0 +1,56 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-busitable-pillar', + templateUrl: './pillar.component.html', + styleUrls: ['./pillar.component.less'] +}) +export class BusitablePillarComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + this.chart.data(this.chartData); + this.chart.render(); + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 500) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + + this.chart.tooltip({ + showMarkers: false, + }); + + this.chart.interval().position('time*number'); + this.chart.render(); + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/compliance/customer/customer.component.html b/src/app/routes/datatable/components/compliance/customer/customer.component.html new file mode 100644 index 00000000..56092666 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/customer/customer.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/routes/datatable/components/compliance/customer/customer.component.ts b/src/app/routes/datatable/components/compliance/customer/customer.component.ts new file mode 100644 index 00000000..1546a048 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/customer/customer.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-compliance-customer', + templateUrl: './customer.component.html', +}) +export class DatatableComplianceCustomerComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/compliance/index/curve/curve.component.html b/src/app/routes/datatable/components/compliance/index/curve/curve.component.html new file mode 100644 index 00000000..7ceba0b7 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/index/curve/curve.component.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/routes/datatable/components/compliance/index/curve/curve.component.less b/src/app/routes/datatable/components/compliance/index/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/compliance/index/curve/curve.component.ts b/src/app/routes/datatable/components/compliance/index/curve/curve.component.ts new file mode 100644 index 00000000..0dbacb97 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/index/curve/curve.component.ts @@ -0,0 +1,91 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { G2MiniAreaClickItem } from '@delon/chart/mini-area'; + +// import DataSet from '@antv/data-set'; +const DataSet = require('@antv/data-set'); +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-compliance-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class ComplianceCurveComponent implements OnInit,OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + console.log(this.chartData) + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 1000) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + this.chart.scale({ + time: { + range: [0, 1], + }, + number: { + min: 0, + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + this.chart.axis('proportion', { + label: { + formatter: (val: any) => { + return val*100+ ' %'; + }, + }, + }); + + this.chart + .line() + .position('situationDate*proportion') + .color('type') + .tooltip('proportion*type', function(name: any, value: any) { + return { + name: name*100+'%', + value: value + }; + }); + + this.chart.render(); + + } +} diff --git a/src/app/routes/datatable/components/compliance/index/index.component.html b/src/app/routes/datatable/components/compliance/index/index.component.html new file mode 100644 index 00000000..0d55f76b --- /dev/null +++ b/src/app/routes/datatable/components/compliance/index/index.component.html @@ -0,0 +1,67 @@ + + + + +
    +
    + +
    +
    +
    +
    + + + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    + 合格:{{cardData1?.leftQuantity}} 不合格:{{cardData1?.rightQuantity}} +
    +
    +
    +
    +
    + + +
    + 货源单:{{cardData2?.leftQuantity}} 合同单:{{cardData2?.rightQuantity}} +
    +
    +
    +
    +
    + + +
    + 司机:{{cardData3?.leftQuantity}} 车队长:{{cardData3?.rightQuantity}} +
    +
    +
    +
    +
    + + +
    + 准时:{{cardData4?.leftQuantity}} 逾期:{{cardData4?.rightQuantity}} +
    +
    +
    +
    +
    + + + + + diff --git a/src/app/routes/datatable/components/compliance/index/index.component.less b/src/app/routes/datatable/components/compliance/index/index.component.less new file mode 100644 index 00000000..3d0d3e63 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/index/index.component.less @@ -0,0 +1,17 @@ +.card-f{ + color: #5a5a5a; + .card-f-l{ + margin-right: 24px; + } +} +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/compliance/index/index.component.ts b/src/app/routes/datatable/components/compliance/index/index.component.ts new file mode 100644 index 00000000..b545a4f5 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/index/index.component.ts @@ -0,0 +1,263 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { DatePipe, ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { format } from 'date-fns'; +import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { G2TimelineData, G2TimelineMap } from '@delon/chart/timeline'; +import { Chart } from '@antv/g2'; +import { DataService } from '../../../services/data.service'; +import { ComplianceCurveComponent } from './curve/curve.component'; + +@Component({ + selector: 'app-datatable-compliance-index', + templateUrl: './index.component.html', + styleUrls: ['./index.component.less'], + providers: [DatePipe] +}) +export class DatatableComplianceIndexComponent implements OnInit { + @ViewChild('curve') private readonly curve!: ComplianceCurveComponent; + @ViewChild('sf', { static: false }) + + sf!: SFComponent; + ui!: SFUISchema; + schema: SFSchema = {}; + + mode = 'year'; + date: any = null; + dateFormat = 'yyyy'; + time: any = '2022' + chartData: any = {} + + cardData1:any; + cardData2:any; + cardData3:any; + cardData4:any; + + constructor(private http: _HttpClient, private modal: ModalHelper, private ngZone: NgZone,public service: DataService, private datePipe: DatePipe) {} + + ngOnInit(): void { + this.initSF(); + this.initdData(); + } + + initdData(){ + const params ={ + ...this.sf?.value, + timeType:this.mode ==='month'?'M':'Y', + time:this.time + } + this.service.request(this.service.$api_getBillRateQualified, params).subscribe(res => { + if (res) { + this.cardData1 = res; + this.cardData1.proportion = this.cardData1.proportion*100 +'%' + } + }); + this.service.request(this.service.$api_getBillRateProportion, params).subscribe(res => { + if (res) { + this.cardData2 = res; + this.cardData2.proportion = this.cardData2.proportion*100 +'%' + } + }); + this.service.request(this.service.$api_getBillRateDirectPayment, params).subscribe(res => { + if (res) { + this.cardData3 = res; + this.cardData3.proportion = this.cardData3.proportion*100 +'%' + } + }); + this.service.request(this.service.$api_getBillTimelyPayment, params).subscribe(res => { + if (res) { + this.cardData4 = res; + this.cardData4.proportion = this.cardData4.proportion*100 +'%' + } + }); + + this.service.request(this.service.$api_listMonitorSituation, params).subscribe(res => { + if (res) { + this.chartData = res + this.curve.reRender(); + + } + }) + } + + + changeData(){ + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + + } + + onChange(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.time = this.datePipe.transform(this.date, 'yyyy') + } else if(this.mode === 'month') { + this.time = this.datePipe.transform(this.date, 'yyyy-MM') + } + this.initdData(); + } + + initSF() { + this.schema = { + properties: { + enterpriseInfoId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '网络货运人', + asyncData: () => this.service.getNetworkFreightForwarder({}), + change:()=>{ + this.initdData(); + }, + allowClear: true + } + }, + enterpriseProjectId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '部门' + } + }, + salesmanId: { + type: 'string', + title: '', + ui: { + placeholder: '业务员', + enter: () => this.initdData(), + } + } + } + }; + this.ui = { + '*': { + grid: { span: 4 } + } + }; + + } + + + + + render(el: ElementRef) { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + + private init(el: HTMLElement): void { + const chart = new Chart({ + container: el, + autoFit: true, + height: 400 + }); + // 以三组数据为例, 需要展示 91/92/93年中a/b/c数据走势 + const data = [ + { data: '1月', label: '订单合格率', value: 5 }, + { data: '2月', label: '订单合格率', value: 10 }, + { data: '3月', label: '订单合格率', value: 25 }, + { data: '4月', label: '订单合格率', value: 35 }, + { data: '5月', label: '订单合格率', value: 15 }, + { data: '6月', label: '订单合格率', value: 5 }, + { data: '7月', label: '订单合格率', value: 95 }, + { data: '8月', label: '订单合格率', value: 45 }, + + { data: '1月', label: '付款及时率', value: 10 }, + { data: '2月', label: '付款及时率', value: 15 }, + { data: '3月', label: '付款及时率', value: 30 }, + { data: '4月', label: '付款及时率', value: 8 }, + { data: '5月', label: '付款及时率', value: 9 }, + { data: '6月', label: '付款及时率', value: 5 }, + { data: '7月', label: '付款及时率', value: 80 }, + { data: '8月', label: '付款及时率', value: 55 }, + + { data: '1月', label: '货源占比率', value: 90 }, + { data: '2月', label: '货源占比率', value: 30 }, + { data: '3月', label: '货源占比率', value: 45 }, + { data: '4月', label: '货源占比率', value: 35 }, + { data: '5月', label: '货源占比率', value: 95 }, + { data: '6月', label: '货源占比率', value: 35 }, + { data: '7月', label: '货源占比率', value: 65 }, + { data: '8月', label: '货源占比率', value: 63 }, + + { data: '1月', label: '运费直付占比', value: 30 }, + { data: '2月', label: '运费直付占比', value: 60 }, + { data: '3月', label: '运费直付占比', value: 25 }, + { data: '4月', label: '运费直付占比', value: 35 }, + { data: '5月', label: '运费直付占比', value: 15 }, + { data: '6月', label: '运费直付占比', value: 55 }, + { data: '7月', label: '运费直付占比', value: 50 }, + { data: '8月', label: '运费直付占比', value: 30 }, + ]; + + chart.data(data); + //刻度自定义 + chart.scale({ + data: { + range: [0, 1], + }, + value: { + min: 0, + nice: true, + }, + }); + // 图表下方图形文字自定义 + chart.legend({ + items:[ + { + name: '订单合格率', + value: 'node_load1', + marker: { + symbol: 'circle', + style: {fill: '#6193f7'} + }, + }, + { + name: '付款及时率', + value: 'node_load2', + marker: {symbol: 'circle',style: {fill: '#58d3a2'}}, + }, + { + name: '货源占比率', + value: 'node_load13', + marker: {symbol: 'circle',style: {fill: '#5b6d8f'}}, + }, + { + name: '运费直付占比', + value: 'node_load13', + marker: {symbol: 'circle',style: {fill: '#f0b915'}}, + }, + ] + }); + // 提示自定义 + chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + //数据格式化 + chart.axis('value', { + label: { + formatter: (val) => { + return val + ' %'; + }, + }, + }); + // 在x*y的坐标点上按z值绘制线条, 如果z值相同将使用直线连接 + chart.line().position('data*value').color('label').tooltip('label*value', (name:any, value:any) => { + return { + name: name, + value: value + '%' + }; + });; + // 在x*y的坐标上按z值绘制圆点 + chart.point().position('data*value').size(4).color('label').shape('circle'); + chart.render(); + } +} diff --git a/src/app/routes/datatable/components/compliance/salesman/salesman.component.html b/src/app/routes/datatable/components/compliance/salesman/salesman.component.html new file mode 100644 index 00000000..56092666 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/salesman/salesman.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/routes/datatable/components/compliance/salesman/salesman.component.ts b/src/app/routes/datatable/components/compliance/salesman/salesman.component.ts new file mode 100644 index 00000000..3b6cd019 --- /dev/null +++ b/src/app/routes/datatable/components/compliance/salesman/salesman.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-compliance-salesman', + templateUrl: './salesman.component.html', +}) +export class DatatableComplianceSalesmanComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.html b/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.html new file mode 100644 index 00000000..0640a4d4 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.less b/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.ts b/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.ts new file mode 100644 index 00000000..ff90b80c --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/curve/curve.component.ts @@ -0,0 +1,92 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-04-06 13:43:29 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-06 19:20:24 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\customtable\\customindex\\curve\\curve.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-datatable-customindex-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class DatatableCustomindexCurveComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + },500) + console.log(this.chartData); + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + this.chart.scale({ + time: { + range: [0, 1], + }, + number: { + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + this.chart.axis('number', { + label: { + formatter: (val: any) => { + return val; + }, + }, + }); + + this.chart + .line() + .position('time*number') + .color('name') + + + this.chart.render(); + + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.html b/src/app/routes/datatable/components/customtable/customindex/customindex.component.html new file mode 100644 index 00000000..9dfc91aa --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.html @@ -0,0 +1,99 @@ + + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + + + + + +
    + + +
    +
    +
    +
    + + +
    货主
    +
    合伙人
    +
    司机
    +
    车辆
    +
    +
    +
    + + +
    +
    + + + + +
    + +
    +
    +
    +
    + +
    diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.less b/src/app/routes/datatable/components/customtable/customindex/customindex.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts b/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts new file mode 100644 index 00000000..09bf44a2 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableCustomindexComponent } from './customindex.component'; + +describe('DatatableCustomindexComponent', () => { + let component: DatatableCustomindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableCustomindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableCustomindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts b/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts new file mode 100644 index 00000000..27b8a1ff --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts @@ -0,0 +1,231 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent } from '@delon/form'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { differenceInCalendarDays } from 'date-fns'; +import { DataService } from '../../../services/data.service'; +import { DatatableCustomindexCurveComponent } from './curve/curve.component'; + +@Component({ + selector: 'app-datatable-customindex', + templateUrl: './customindex.component.html', + styleUrls: ['./customindex.component.less'], + providers: [DatePipe] +}) +export class DatatableCustomindexComponent implements OnInit { + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('curve') private readonly curve!: DatatableCustomindexCurveComponent; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + timeStart: any = '2022-01-01'; + timeEnd: any = '2022-12-31'; + dateFormat = 'yyyy'; + today = new Date(); + dateNext: any = null; + modeNext = 'year'; + timeNext: any = ['2022-01-01 00:00:00']; + chartData: any = []; + flag = false; + + columns: STColumn[] = [ + { title: '用户类型', render: 'type', className: 'text-center' }, + { title: '用户总数', index: 'total', className: 'text-center' }, + { title: '已认证数量', index: 'auditPassTotal', className: 'text-center' }, + { title: '活跃用户数', index: 'activeTotal', className: 'text-center' }, + { title: '未激活用户数', index: 'notActivationTotal', className: 'text-center' }, + { title: '沉默用户数', index: 'silentTotal', className: 'text-center' }, + { title: '流失用户数', index: 'drainTotal', className: 'text-center' }, + { title: '流失率', index: 'drainRate', className: 'text-center',format: (item: any) => {return (item?.drainRate)*100 + '%' }} + ]; + hzData: any; + hhrData: any; + sjData: any; + clData: any; + reportData: any = []; + + constructor(public service: DataService, private datePipe: DatePipe) {} + ngOnInit(): void { + this.initCurveData(); + } + initCurveData() { + this.cardData(); + this.listData(); + this.addData('year', '2022-01-01'); + } + listData(type?: string, stime?: any, etime?: any) { + this.reportData = []; + this.service + .request(this.service.$api_statistics_totalDetail, { + dateStart: stime || this.timeStart, + dateEnd: etime || this.timeEnd, + type: 1 //用户角色类型 1:货主 2:合伙人 3:司机 4:车辆 + }) + .subscribe(res => { + if (res) { + this.reportData.push(res); + this.st.reload(); + } + }); + this.service + .request(this.service.$api_statistics_totalDetail, { + dateStart: stime || this.timeStart, + dateEnd: etime || this.timeEnd, + type: 2 + }) + .subscribe(res => { + if (res) { + this.reportData.push(res); + this.st.reload(); + } + }); + this.service + .request(this.service.$api_statistics_totalDetail, { + dateStart: stime || this.timeStart, + dateEnd: etime || this.timeEnd, + type: 3 + }) + .subscribe(res => { + if (res) { + this.reportData.push(res); + this.st.reload(); + } + }); + this.service + .request(this.service.$api_statistics_totalDetail, { + dateStart: stime || this.timeStart, + dateEnd: etime || this.timeEnd, + type: 4 + }) + .subscribe(res => { + if (res) { + this.reportData.push(res); + this.st.reload(); + } + }); + } + cardData() { + this.service.request(this.service.$api_statistics_total, { type: 1 }).subscribe(res => { + if (res) { + this.hzData = res; + } + }); + this.service.request(this.service.$api_statistics_total, { type: 2 }).subscribe(res => { + if (res) { + this.hhrData = res; + } + }); + this.service.request(this.service.$api_statistics_total, { type: 3 }).subscribe(res => { + if (res) { + this.sjData = res; + } + }); + this.service.request(this.service.$api_statistics_total, { type: 4 }).subscribe(res => { + if (res) { + this.clData = res; + } + }); + } + addData(type?: string, time?: any) { + this.chartData = [] + this.service + .request(this.service.$api_statistics_totalAdd, { + date: time, + dateType: type === 'month' ? 2 : 1, //日期类型 1:年 2:月 + type: 1 + }) + .subscribe(res => { + if (res) { + this.chartData.push(...res); + console.log(this.curve); + this.curve.reRender(); + } + }); + this.service + .request(this.service.$api_statistics_totalAdd, { + date: time, + dateType: type === 'month' ? 2 : 1, //日期类型 1:年 2:月 + type: 2 + }) + .subscribe(res => { + if (res) { + this.chartData.push(...res); + this.curve.reRender(); + } + }); + this.service + .request(this.service.$api_statistics_totalAdd, { + date: time, + dateType: type === 'month' ? 2 : 1, //日期类型 1:年 2:月 + type: 3 + }) + .subscribe(res => { + if (res) { + this.chartData.push(...res); + this.curve.reRender(); + } + }); + this.service + .request(this.service.$api_statistics_totalAdd, { + date: time, + dateType: type === 'month' ? 2 : 1, //日期类型 1:年 2:月 + type: 4 + }) + .subscribe(res => { + if (res) { + this.chartData.push(...res); + this.curve.reRender(); + } + }); + } + changeData() { + if (this.mode === 'year') { + this.dateFormat = 'yyyy'; + } else if (this.mode === 'month') { + this.dateFormat = 'yyyy-MM'; + } else { + this.dateFormat = 'yyyy-MM-dd'; + } + } + onChange(result: any) { + if (this.mode === 'year') { + this.timeStart = this.datePipe.transform(this.date, 'yyyy') + '-01-01'; + this.timeEnd = this.datePipe.transform(this.date, 'yyyy') + '-12-31'; + + } else if (this.mode === 'month') { + this.timeStart = this.datePipe.transform(this.date, 'yyyy-MM') + '-01' ; + this.timeEnd = this.datePipe.transform(this.date, 'yyyy-MM') + '-31'; + } else if (this.mode === 'date') { + this.timeStart=this.datePipe.transform(this.date, 'yyyy-MM-dd'); + this.timeEnd = this.datePipe.transform(this.date, 'yyyy-MM-dd') ; + } else { + this.timeStart = this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') ; + this.timeEnd = this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd'); + } + this.listData(this.mode, this.timeStart, this.timeEnd); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + + changeDataNext2() { + if (this.modeNext === 'year') { + this.dateFormat = 'yyyy'; + } else if (this.modeNext === 'month') { + this.dateFormat = 'yyyy-MM'; + } + } + onChangeNext(result: any) { + if (result === null) { + return; + } + if (this.modeNext === 'year') { + this.timeNext = this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01'; + } else if (this.modeNext === 'month') { + this.timeNext = this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01'; + } + this.addData(this.modeNext, this.timeNext); + } +} diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.html b/src/app/routes/datatable/components/customtable/driver/driver.component.html new file mode 100644 index 00000000..383fe343 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.html @@ -0,0 +1,46 @@ + + + + +
    + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    + + + + + + +
    + + +
    + +
    +
    +
    + + +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.less b/src/app/routes/datatable/components/customtable/driver/driver.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts b/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts new file mode 100644 index 00000000..6a2084a2 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDriverComponent } from './driver.component'; + +describe('DatatableDriverComponent', () => { + let component: DatatableDriverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDriverComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDriverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.ts b/src/app/routes/datatable/components/customtable/driver/driver.component.ts new file mode 100644 index 00000000..3050a847 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.ts @@ -0,0 +1,167 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { differenceInCalendarDays } from 'date-fns'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-datatable-driver', + templateUrl: './driver.component.html', + styleUrls: ['./driver.component.less'], + providers: [DatePipe] +}) +export class DatatableDriverComponent implements OnInit { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + _$expand = false; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + queryTime: any = '' + dateFormat = 'yyyy'; + today = new Date(); + ui: SFUISchema = {}; + schema: SFSchema = {}; + + columns: STColumn[] = [ + { title: '司机姓名', index: 'driverName', className: 'text-center' }, + { title: '手机号', index: 'driverPhone', className: 'text-center' }, + { title: '注册时间', index: 'driverRegisterTime', className: 'text-center' }, + { + title: '司机状态', index: 'driverStatus', className: 'text-center', type: 'enum', enum: { + 0: '未激活', + 1: '活跃', + 2: '沉默', + 3: '流失', + } + }, + { title: '运单数', index: 'wbAllCount', className: 'text-center' }, + { title: '待接单运单', index: 'wbWaitCount', className: 'text-center' }, + { title: '已完成运单', index: 'wbOverCount', className: 'text-center' }, + { title: '运费金额', index: 'wbAllAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbAllAmount }) } }, + { title: '已收运费金额', index: 'wbGetAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbGetAmount }) } }, + { title: '待收运费金额', index: 'wbWaitAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbWaitAmount }) } }, + ]; + isLoading: boolean = false; + /** + * 查询参数 + */ + get reqParams() { + if (this.mode === 'year') { + this.type = 1 + } else if (this.mode === 'month') { + this.type = 2 + } else if (this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + queryTime: this.queryTime, + ...this.sf?.value + }; + + delete params._$expand; + return { ...params }; + } + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { + this.initSF(); + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + driverName: { + type: 'string', + title: '司机姓名', + ui: { + placeholder: '请输入', + } + }, + driverPhone: { + type: 'string', + title: '手机号', + ui: { + placeholder: '请选择', + } + }, + driverStatus: { + type: 'string', + title: '司机状态', + ui: { + widget: 'select', + placeholder: '请选择', + }, + enum: [ + { label: '未激活', value: 0 }, + { label: '活跃', value: 1 }, + { label: '沉默', value: 2 }, + { label: '流失', value: 3 }, + ] + }, + driverRegisterTime: { + title: '注册时间', + type: 'string', + ui: { + widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd', visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + changeData() { + if (this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if (this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + } + onChange(result: any) { + if(result === null) { + return + } + if (this.mode === 'year') { + this.queryTime = [this.datePipe.transform(this.date, 'yyyy')] + } else if (this.mode === 'month') { + this.queryTime = [this.datePipe.transform(this.date, 'yyyy-MM')] + } + this.st.reload({ ...this.reqParams }); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + + export() { + // this.service.downloadFile(this.service.$api_exportUploadBill, this.sf.value, {}); + } + search() { + this.st?.load(1) + + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } +} diff --git a/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.html b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.html new file mode 100644 index 00000000..482ccb06 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.spec.ts b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.spec.ts new file mode 100644 index 00000000..8df0f556 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableMancustomtableComponent } from './mancustomtable.component'; + +describe('DatatableMancustomtableComponent', () => { + let component: DatatableMancustomtableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableMancustomtableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableMancustomtableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.ts b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.ts new file mode 100644 index 00000000..7f41c8ca --- /dev/null +++ b/src/app/routes/datatable/components/customtable/mancustomtable/mancustomtable.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-mancustomtable', + templateUrl: './mancustomtable.component.html', +}) +export class DatatableMancustomtableComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.html b/src/app/routes/datatable/components/customtable/owner/owner.component.html new file mode 100644 index 00000000..e805efd9 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.html @@ -0,0 +1,46 @@ + + + + +
    + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    + + + + + + +
    + + +
    + +
    +
    +
    + + +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.less b/src/app/routes/datatable/components/customtable/owner/owner.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts b/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts new file mode 100644 index 00000000..8c518688 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOwnerComponent } from './owner.component'; + +describe('DatatableOwnerComponent', () => { + let component: DatatableOwnerComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOwnerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOwnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.ts b/src/app/routes/datatable/components/customtable/owner/owner.component.ts new file mode 100644 index 00000000..f3a81454 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.ts @@ -0,0 +1,190 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { differenceInCalendarDays } from 'date-fns'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-datatable-owner', + templateUrl: './owner.component.html', + styleUrls: ['./owner.component.less'], + providers: [DatePipe] +}) +export class DatatableOwnerComponent implements OnInit { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + _$expand = false; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + time: any = ['2022-01-01 00:00:00'] + dateFormat = 'yyyy'; + today = new Date(); + ui: SFUISchema = {}; + schema: SFSchema = {}; + isLoading: boolean = false; + + columns: STColumn[] = [ + { title: '货主名称', index: 'enterpriseName', className: 'text-center', width: '200px' }, + { title: '注册时间', index: 'registerTime', className: 'text-center', width: '200px' }, + { title: '客户类型', index: 'customerType', className: 'text-center', width: '100px', type: 'enum', enum: { + 1: '平台客户', + 2: '直客', + 3: '渠道客户' + } + }, + { title: '业务员', index: 'salesmanName', className: 'text-center', width: '100px' }, + { title: '合伙人', index: 'partnerName', className: 'text-center', width: '100px' }, + { title: '客户状态', index: 'customerStatus', className: 'text-center', width: '100px', type: 'enum', enum: { + 1: '未激活', + 2: '沉默', + 3: '流失', + 4: '活跃' + } }, + { title: '订单数', index: 'zsl', className: 'text-center', width: '100px' }, + { title: '订单金额', index: 'ddje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ddje }) } }, + { title: '应收订单数', index: 'ysdds', className: 'text-center', width: '120px' }, + { title: '应收金额', index: 'yingsje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingsje }) } }, + { title: '待开票订单数', index: 'yifyf', className: 'text-center', width: '130px' }, + { title: '待开票金额', index: 'dkpdds', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.dkpdds }) } }, + { title: '已收金额', index: 'yisje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisje }) } }, + { title: '应收附加费', index: 'yingsfjf', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingsfjf }) } }, + { title: '已收附加费', index: 'yisfjf', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisfjf }) } }, + { title: '附加费率', index: 'fjfl', className: 'text-center', width: '100px' }, + { title: '已开票金额', index: 'ykpje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ykpje }) } }, + ]; + /** + * 查询参数 + */ + get reqParams() { + if(this.mode === 'year') { + this.type = 1 + } else if(this.mode === 'month') { + this.type = 2 + } else if(this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type, + ...this.sf?.value + }; + + delete params._$expand; + return { ...params }; + } + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { + this.initSF(); + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + type: 'string', + title: '货主名称', + ui: { + placeholder: '请输入', + } + }, + customerType: { + type: 'string', + title: '客户类型', + ui: { + widget: 'select', + placeholder: '请选择', + }, + enum: [ + {label: '直客', value: 2}, + {label: '渠道客户', value: 3}, + {label: '平台客户', value: 1}, + ] + }, + customerStatus: { + type: 'string', + title: '客户状态', + ui: { + widget: 'select', + placeholder: '请选择', + }, + enum: [ + {label: '未激活', value: 1}, + {label: '沉默', value: 2}, + {label: '流失', value: 3}, + {label: '活跃', value: 4}, + ] + }, + registerTime: { + title: '注册时间', + type: 'string', + ui: { + widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd', visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + changeData(){ + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if(this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else{ + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + + export() { + // this.service.downloadFile(this.service.$api_exportUploadBill, this.sf.value, {}); + } + search() { + this.st?.load(1) + + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } +} diff --git a/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.html b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.html new file mode 100644 index 00000000..4d75b400 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.html @@ -0,0 +1,43 @@ + + + +
    + +
    + + + + +
    + + + +
    + +
    +
    + + + +
    +
    +
    + +
    + +
    + +
    + + + + +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.spec.ts b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.spec.ts new file mode 100644 index 00000000..69ae8c3b --- /dev/null +++ b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatablePartnertableComponent } from './partnertable.component'; + +describe('DatatablePartnertableComponent', () => { + let component: DatatablePartnertableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatablePartnertableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatablePartnertableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.ts b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.ts new file mode 100644 index 00000000..0a289a0b --- /dev/null +++ b/src/app/routes/datatable/components/customtable/partnertable/partnertable.component.ts @@ -0,0 +1,149 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-datatable-partnertable', + templateUrl: './partnertable.component.html', +}) +export class DatatablePartnertableComponent implements OnInit { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + phone = ''; + columns!: STColumn[]; + isLoading: boolean = false; + + constructor( + public service: DataService, + private modalSrv: NzModalService, + private modal: ModalHelper, + private envSrv: EAEnvironmentService, + ) {} + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST() + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + title: '合伙人名称', + type: 'string', + ui: { placeholder: '请输入' }, + readOnly: false, + }, + phone: { + title: '合伙人类型', + type: 'string', + ui: { + widget: 'select', + placeholder: '请输入' }, + readOnly: false, + }, + phone01: { + title: '合伙人状态', + type: 'string', + ui: { + widget: 'select', + placeholder: '请输入' }, + readOnly: false, + }, + createTime: { + type: 'string', + title: '注册时间', + ui: { widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema, + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 }, enter: () => this.st?.load(1) } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '合伙人名称', index: 'name', className: 'text-center' }, + { title: '注册时间', index: 'telephone', className: 'text-center' }, + { title: '注册时间', index: 'roleName', className: 'text-center' }, + { title: '业务员', index: 'lastLoginDate', className: 'text-center' }, + { + title: '合伙人状态', + index: 'stateLocked', + className: 'text-center', + type: 'enum', + enum: { 0: '正常', 1: '冻结' }, + }, + { title: '客户数', index: 'lastLoginDate', className: 'text-center' }, + { title: '收益额', index: 'lastLoginDate', className: 'text-center' }, + { title: '已提现金额', index: 'lastLoginDate', className: 'text-center' }, + { title: '订单数', index: 'lastLoginDate', className: 'text-center' }, + { title: '订单金额', index: 'lastLoginDate', className: 'text-center' }, + { title: '应收订单数', index: 'lastLoginDate', className: 'text-center' }, + ]; + } + + /** + * 数据列表状态变化事件 + */ + change(change: STChange) { + // console.log(change); + } + + +} diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.html b/src/app/routes/datatable/components/dataindex/dataindex.component.html new file mode 100644 index 00000000..3f148bfd --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.html @@ -0,0 +1,69 @@ + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    + + + +
    +
    + + + +
    +
    +
    +
    + + + + +
    +
    + + + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.less b/src/app/routes/datatable/components/dataindex/dataindex.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.spec.ts b/src/app/routes/datatable/components/dataindex/dataindex.component.spec.ts new file mode 100644 index 00000000..cd009e56 --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDataindexComponent } from './dataindex.component'; + +describe('DatatableDataindexComponent', () => { + let component: DatatableDataindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDataindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDataindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.ts b/src/app/routes/datatable/components/dataindex/dataindex.component.ts new file mode 100644 index 00000000..0881c73c --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.ts @@ -0,0 +1,249 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { DataService } from '../../services/data.service'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; + +@Component({ + selector: 'app-datatable-dataindex', + templateUrl: './dataindex.component.html', + styleUrls: ['./dataindex.component.less'] +}) +export class DatatableDataindexComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData(){ + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html new file mode 100644 index 00000000..3f148bfd --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html @@ -0,0 +1,69 @@ + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    + + + +
    +
    + + + +
    +
    +
    +
    + + + + +
    +
    + + + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.less b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts new file mode 100644 index 00000000..cd009e56 --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDataindexComponent } from './dataindex.component'; + +describe('DatatableDataindexComponent', () => { + let component: DatatableDataindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDataindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDataindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts new file mode 100644 index 00000000..eb15c985 --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts @@ -0,0 +1,249 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { DataindexService } from '../services/dataindex.service'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; + +@Component({ + selector: 'app-datatable-dataindex', + templateUrl: './dataindex.component.html', + styleUrls: ['./dataindex.component.less'] +}) +export class DatatableDataindexComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataindexService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData(){ + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/datascreen/curve/curve.component.html b/src/app/routes/datatable/components/datascreen/curve/curve.component.html new file mode 100644 index 00000000..f47cc41a --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/curve/curve.component.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/routes/datatable/components/datascreen/curve/curve.component.less b/src/app/routes/datatable/components/datascreen/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/datascreen/curve/curve.component.ts b/src/app/routes/datatable/components/datascreen/curve/curve.component.ts new file mode 100644 index 00000000..dc30343e --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/curve/curve.component.ts @@ -0,0 +1,132 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-04-07 17:57:23 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 19:28:24 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\curve\\curve.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { G2MiniAreaClickItem } from '@delon/chart/mini-area'; +import { DataService } from '../../../services/data.service'; +// import DataSet from '@antv/data-set'; +const DataSet = require('@antv/data-set'); +import { Chart } from '@antv/g2'; +@Component({ + selector: 'app-financetable-curve-min', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class DatatableCustomindexCurveMinComponent implements OnInit,OnChanges { + el: any; + @Input() chartData: any; + chart: any; + data = [ + { time: '01', type: '订单数', temperature: 7 }, + { time: '02', type: '运单数', temperature: 3.9 }, + { time: '03', type: '订单数', temperature: 6.9 }, + { time: '04', type: '订单数', temperature: 4.2 }, + { time: '05', type: '订单数', temperature: 9.5 }, + { time: '06', type: '订单数', temperature: 5.7 }, + { time: '06', type: '运单数', temperature: 5.7 }, + { time: '07', type: '运单数', temperature: 14.5 }, + { time: '08', type: '订单数', temperature: 8.5 }, + { time: '09', type: '订单数', temperature: 18.4 }, + { time: '10', type: '订单数', temperature: 11.9 }, + { time: '11', type: '订单数', temperature: 21.5 }, + { time: '12', type: '订单数', temperature: 15.2 }, + { time: '08', type: '运单数', temperature: 8.5 }, + { time: '09', type: '运单数', temperature: 18.4 }, + { time: '10', type: '运单数', temperature: 11.9 }, + { time: '11', type: '运单数', temperature: 21.5 }, + { time: '12', type: '订单数', temperature: 15.2 }, + ]; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 1000) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 200, + }); + let value: any = [] + this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => { + if(res) { + res.forEach((element: any) => { + value.push({ + time: element?.time, + type: element?.type == 'DD' ? '订单数' : '运单数', + temperature: element?.value, + }); + }); + console.log(value); + this.chartData = value + this.chart.data(this.chartData); + this.chart.scale({ + time: { + range: [0, 1], + }, + number: { + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + + this.chart.axis('temperature', { + label: { + formatter: (val: any) => { + return val + '万'; + }, + }, + }); + this.chart + .line() + .position('time*temperature') + .color('type') + .shape('smooth'); + + this.chart + .point() + .position('time*temperature') + .color('type') + .shape('circle'); + this.chart.render(); + }; + }); + + + } +} diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.html b/src/app/routes/datatable/components/datascreen/datascreen.component.html new file mode 100644 index 00000000..ee417920 --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.html @@ -0,0 +1,174 @@ + + + +
    +
    +

    运多星网络货运平台

    +
    +   + {{todayTime}} +
    +
    + +

    实时交易监控

    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + {{ index }} + + + {{ item.weight ? item.weight + '吨' : '' }} + {{ item.volume ? item.volume + '方' : '' }} + + + {{ item.weight ? item.weight + '吨' : '' }} + {{ item.volume ? item.volume + '方' : '' }} + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    +
    + + + + {{ item?.driverName }}{{ item?.carNo ? '/' + item?.carNo : '' }} + + + +
    +
    diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.less b/src/app/routes/datatable/components/datascreen/datascreen.component.less new file mode 100644 index 00000000..69baee23 --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.less @@ -0,0 +1,11 @@ +:host{ + ::ng-deep { + .ant-statistic-content-value{ + color: #399ffd; + font-weight: bold; + } + .nz-statistic-number,.ant-statistic-content-value { + font-size: 20px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.spec.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.spec.ts new file mode 100644 index 00000000..78be800e --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDatascreenComponent } from './datascreen.component'; + +describe('DatatableDatascreenComponent', () => { + let component: DatatableDatascreenComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDatascreenComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDatascreenComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.ts new file mode 100644 index 00000000..08babea1 --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.ts @@ -0,0 +1,150 @@ +import { map } from 'rxjs/operators'; +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-04-06 10:57:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 19:48:19 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { DataService } from '../../services/data.service'; +import { DatatableCustomindexMapComponent } from './map/map.component'; +import { G2TimelineComponent, G2TimelineData } from '@delon/chart/timeline'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { FinanceTableCurveComponent } from '../financetable/curve/curve.component'; + + +@Component({ + selector: 'app-datatable-datascreen', + templateUrl: './datascreen.component.html', + styleUrls: ['./datascreen.component.less'] +}) +export class DatatableDatascreenComponent implements OnInit { + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('orderSt') private readonly orderSt!: STComponent; + @ViewChild('map') private readonly map!: DatatableCustomindexMapComponent; + @ViewChild('timeline', { static: false }) timeline!: G2TimelineComponent; + @ViewChild('curve') private readonly curve!: FinanceTableCurveComponent; + + columns: STColumn[] = []; + chartData: any[] = []; + orderColumns: STColumn[] = []; + chartData2: any = {} + allDeal: any; + headDeal: any; + classifyDeal: any; + todaysDeal: any; + todayTime: string = ''; + + monthData: G2TimelineData[] = []; + monthData2:G2TimelineData[] =[]; + salesData2: Array = this.genData(); + constructor(public service: DataService) {} + ngOnChanges(changes: any): void { + console.log(changes); + } + /** + * 查询参数 + */ + get reqOrderParams() { + const params = {}; + return { ...params }; + } + get reqParams() { + const params = {}; + return { ...params }; + } + ngOnInit(): void { + setInterval(() => { + this.setTime(); + }, 1000); + this.initST(); + this.initOrderST(); + this.initData(); + // this.initLineData(); + } + setTime() { + var myDate = new Date(); + var mytime = myDate.toLocaleTimeString(); //获取当前时间 + myDate.getFullYear(); //获取完整的年份(4位,1970-????) + myDate.getMonth(); //获取当前月份(0-11,0代表1月) + myDate.getDate(); //获取当前日(1-31) + this.todayTime = myDate.getFullYear() + '-' + myDate.getMonth() + 1 + '-' + myDate.getDate() + ' ' + mytime; + } + initData() { + this.service.request(this.service.$api_getAnnualTransactions).subscribe((res: any) => { + this.allDeal = res; + }); + this.service.request(this.service.$api_getTransactionAmount).subscribe((res: any) => { + this.headDeal = res; + }); + this.service.request(this.service.$api_getCustomerStatistics).subscribe((res: any) => { + this.classifyDeal = res; + }); + this.service.request(this.service.$api_getTradingToday).subscribe((res: any) => { + this.todaysDeal = res; + }); + let value: any = []; + this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => { + if (res) { + res.forEach((element: any) => { + value.push({ + name: element.province, + value: element.weight + }); + }); + console.log(value); + this.chartData = value; + this.map.reRender(); + } + }); + } + public genData(): G2MiniAreaData[] { + let value: any = []; + this.service.request(this.service.$api_getShipmentRanking).subscribe((res: any) => { + console.log(res); + res.forEach((element: any) => { + value.push({ + x: element.city, + y: element.weight + }); + }); + }); + console.log(value); + return value; + } + initPillarData(){ + this.curve.reRender() + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '序号', render: 'index', className: 'text-center', width: '70px' }, + { title: '发货地', index: 'loadAddress', className: 'text-center', width: '90px' }, + { title: '卸货地', index: 'dischargeAddress', className: 'text-center', width: '90px' }, + { title: '货物', index: 'goodsName', className: 'text-center', width: '90px' }, + { title: '数量', render: 'weight', className: 'text-center', width: '120px' } + ]; + } + initOrderST() { + this.orderColumns = [ + { title: '运单号', index: 'wayCode', className: 'text-center', width: '150px' }, + { title: '司机/车辆', index: 'carNo', className: 'text-center', width: '120px' }, + { title: '货主', index: 'shipperName', className: 'text-center', width: '70px' }, + { title: '时间', index: 'createTime', className: 'text-center', width: '200px' }, + { title: '异常预警', index: 'warningTypeLabel', className: 'text-center', width: '120px' } + ]; + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } +} diff --git a/src/app/routes/datatable/components/datascreen/map/map.component.html b/src/app/routes/datatable/components/datascreen/map/map.component.html new file mode 100644 index 00000000..99a40aa8 --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/map/map.component.html @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/src/app/routes/datatable/components/datascreen/map/map.component.less b/src/app/routes/datatable/components/datascreen/map/map.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/datascreen/map/map.component.ts b/src/app/routes/datatable/components/datascreen/map/map.component.ts new file mode 100644 index 00000000..66c3a677 --- /dev/null +++ b/src/app/routes/datatable/components/datascreen/map/map.component.ts @@ -0,0 +1,157 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import DataSet from '@antv/data-set'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-datatable-customindex-map', + templateUrl: './map.component.html', + styleUrls: ['./map.component.less'] +}) +export class DatatableCustomindexMapComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + mapData: any; + ds!: DataSet ; + worldMap: any; + userView: any; + userDv: any; + userData: any = []; + constructor(private service: DataService, private ngZone: NgZone) {} + + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + } + } + + ngOnInit(): void {} + reRender() { + console.log('5454545'); + setTimeout(() => { + this.chart.render(); + }, 1000); + } + render(el: ElementRef): void { + this.el = el.nativeElement; + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 500); + } + + private init(el: HTMLElement): void { + fetch('https://gw.alipayobjects.com/os/antvdemo/assets/data/china.json') + .then(res => res.json()) + .then(mapData => { + this.mapData =mapData + this.chart = new Chart({ + container: el, + autoFit: true, + height: 680, + padding: [0, 0] + }); + this.chart.tooltip({ + showTitle: false, + showMarkers: false, + shared: true + }); + // 同步度量 + this.chart.scale({ + longitude: { + sync: true + }, + latitude: { + sync: true + } + }); + this.chart.axis(false); + this.chart.legend('trend', { + position: 'left' + }); + console.log('8888'); + + // 绘制世界地图背景 + this.ds = new DataSet(); + this.worldMap = this.ds.createView('back').source(this.mapData, { + type: 'GeoJSON' + }); + const worldMapView = this.chart.createView(); + worldMapView.data(this.worldMap.rows); + worldMapView.tooltip(false); + worldMapView.polygon().position('longitude*latitude').style({ + fill: '#fff', + stroke: '#ccc', + lineWidth: 1 + }); + + // 可视化用户数据 + // this.userData = [ + // { name: '山东', value: 21 }, + // { name: '山东', value: 22}, + // { name: '广东', value: 20, }, + // { name: '广东', value: 20 }, + // { name: '四川', value: 120 }, + // { name: '湖南', value: 200 }, + // { name: '河北', value: 30 }, + + // ]; + let value: any = [] + this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => { + if(res) { + res.forEach((element: any) => { + value.push({ + name: element.province, + value: element.weight, + }); + }); + console.log(value); + this.userData = value + this.userDv = this.ds.createView().source(this.userData).transform({ + geoDataView: this.worldMap, + field: 'name', + type: 'geo.region', + as: ['longitude', 'latitude'] + }).transform({ + type: 'map', + callback: (obj: { trend: string; value: number }) => { + if(obj.value < 500) { + obj.trend = '500以下'; + } else if(obj.value >= 500 && obj.value < 1000){ + obj.trend = '500-1000'; + } else if(obj.value >= 1000 ){ + obj.trend = '>1000'; + } + return obj; + } + }); + this.userView = this.chart.createView(); + this.userView.data(this.userDv.rows); + this.userView.scale({ + trend: { + alias: '蓝色地区数量' + } + }); + console.log(this.userView); + console.log('45545'); + + this.userView.polygon().position('longitude*latitude').color('trend', ['#0a3f80', '#1b6aca', '#5d93d4']).tooltip('name*trend*value').style({fillOpacity: 0.85 }) + .animate({ + leave: { + animation: 'fade-out' + } + }); + this.userView.interaction('element-active'); + this.chart.render(); + + } + }) + }); + + console.log('9999'); + + + } + +} diff --git a/src/app/routes/datatable/components/financetable/curve/curve.component.html b/src/app/routes/datatable/components/financetable/curve/curve.component.html new file mode 100644 index 00000000..7ceba0b7 --- /dev/null +++ b/src/app/routes/datatable/components/financetable/curve/curve.component.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/routes/datatable/components/financetable/curve/curve.component.less b/src/app/routes/datatable/components/financetable/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/financetable/curve/curve.component.ts b/src/app/routes/datatable/components/financetable/curve/curve.component.ts new file mode 100644 index 00000000..66ef76b1 --- /dev/null +++ b/src/app/routes/datatable/components/financetable/curve/curve.component.ts @@ -0,0 +1,89 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { G2MiniAreaClickItem } from '@delon/chart/mini-area'; +import { DataService } from '../../../services/data.service'; +// import DataSet from '@antv/data-set'; +const DataSet = require('@antv/data-set'); +import { Chart } from '@antv/g2'; +@Component({ + selector: 'app-financetable-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class FinanceTableCurveComponent implements OnInit,OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 1000) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + this.chart.scale({ + time: { + range: [0, 1], + }, + number: { + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + this.chart.axis('number', { + label: { + formatter: (val: any) => { + return val*100+ ' %'; + }, + }, + }); + + + this.chart + .line() + .position('time*number') + .color('name') + .tooltip('name*number', (name:any, value:any) => { + return { + name: name, + value: value*100 + '%' + }; + }); + + this.chart.render(); + + } +} diff --git a/src/app/routes/datatable/components/financetable/financetable.component.html b/src/app/routes/datatable/components/financetable/financetable.component.html new file mode 100644 index 00000000..8af9b874 --- /dev/null +++ b/src/app/routes/datatable/components/financetable/financetable.component.html @@ -0,0 +1,75 @@ + + + + +
    + +
    + + + + + + +
    + + +
    + +
    +
    + +
    + + + {{item.czcgje | currency}} + + + {{item.yingsje | currency}} + + + {{item.yisje | currency}} + + + {{item.yingfyf | currency}} + + + {{item.yifyf | currency}} + + + {{item.ykpje | currency}} + + + {{item.dkpje | currency}} + + +
    + + +
    + + + +
    + + + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/financetable/financetable.component.less b/src/app/routes/datatable/components/financetable/financetable.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/financetable/financetable.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/financetable/financetable.component.ts b/src/app/routes/datatable/components/financetable/financetable.component.ts new file mode 100644 index 00000000..6a109564 --- /dev/null +++ b/src/app/routes/datatable/components/financetable/financetable.component.ts @@ -0,0 +1,159 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { DatePipe, ModalHelper, _HttpClient } from '@delon/theme'; +import { DataService } from '../../services/data.service'; +import { differenceInCalendarDays } from 'date-fns'; +import { OperationCurveComponent } from '../operationtable/curve/curve.component'; +import { OperationPillarComponent } from '../operationtable/pillar/pillar.component'; +import { FinanceTableCurveComponent } from './curve/curve.component'; +import { FinancetablePillarComponent } from './pillar/pillar.component'; + +@Component({ + selector: 'app-datatable-financetable', + templateUrl: './financetable.component.html', + styleUrls: ['./financetable.component.less'], + providers: [DatePipe] +}) +export class DatatableFinancetableComponent implements OnInit { + @ViewChild('curve') private readonly curve!: FinanceTableCurveComponent; + @ViewChild('pillar') private readonly pillar!: FinancetablePillarComponent; + @ViewChild('st') private readonly st!: STComponent; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + time: any = ['2022-01-01 00:00:00'] + dateFormat = 'yyyy'; + dateNext: any = null; + modeNext = 'year'; + timeNext: any = ['2022-01-01 00:00:00'] + today = new Date(); + enterpriseInfoId = '' + interManlist: any = [] + chartData: any = {} + flag = false; + columns: STColumn[] = [ + { title: '运营主体', index: 'networkTransporterName', className: 'text-center' }, + { title: '客户预存款', index: 'czcgje',render: 'czcgje', className: 'text-center' }, + { title: '应收金额', index: 'yingsje',render: 'yingsje', className: 'text-center' }, + { title: '已收金额', index: 'yisje',render: 'yisje', className: 'text-center' }, + { title: '应付运费', index: 'yingfyf', render: 'yingfyf',className: 'text-center' }, + { title: '已付运费', index: 'yifyf',render: 'yifyf', className: 'text-center' }, + { title: '已开票金额', index: 'ykpje',render: 'ykpje', className: 'text-center' }, + { title: '待开票金额', index: 'dkpje',render: 'dkpje', className: 'text-center' }, + { title: '应收附加费', index: 'yingsfjf', className: 'text-center' }, + { title: '已收附加费', index: 'yisfjf', className: 'text-center' }, + { title: '平均附加费率', index: 'fjfl', className: 'text-center' } + ]; + /** + * 查询参数 + */ + get reqParams() { + if (this.mode === 'year') { + this.type = 1 + } else if (this.mode === 'month') { + this.type = 2 + } else if (this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type + }; + + delete params._$expand; + return { ...params }; + } + + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { + this.initData(); + this.initPillarData(); + } + + initPillarData(){ + let type = 1 + if(this.mode === 'year') { + type = 1 + } else if(this.mode === 'month') { + type = 2 + } + const params: any = { + time: this.timeNext, + type, + enterpriseInfoId: this.enterpriseInfoId + }; + this.flag = true + this.service.request(this.service.$api_financialReportHistogram, params).subscribe(res => { + if (res) { + this.chartData = res + if(this.flag) { + this.pillar.reRender() + this.curve.reRender() + } + } + }) + } + initData() { + this.service.getNetworkFreightForwarder().subscribe(res => { + this.interManlist = res + this.enterpriseInfoId = res[0].value + }) + } + + changeData() { + if (this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if (this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if (this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if (this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if (this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else { + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + exportFun() { + + } + changeCurve(){ + + } + changePie(){ + + } + changeDataNext() { + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + } + onChangeNext(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00'] + } + this.initPillarData(); + } + +} diff --git a/src/app/routes/datatable/components/financetable/pillar/pillar.component.html b/src/app/routes/datatable/components/financetable/pillar/pillar.component.html new file mode 100644 index 00000000..0640a4d4 --- /dev/null +++ b/src/app/routes/datatable/components/financetable/pillar/pillar.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/financetable/pillar/pillar.component.less b/src/app/routes/datatable/components/financetable/pillar/pillar.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/financetable/pillar/pillar.component.ts b/src/app/routes/datatable/components/financetable/pillar/pillar.component.ts new file mode 100644 index 00000000..9959782e --- /dev/null +++ b/src/app/routes/datatable/components/financetable/pillar/pillar.component.ts @@ -0,0 +1,75 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-financetable-pillar', + templateUrl: './pillar.component.html', + styleUrls: ['./pillar.component.less'] +}) +export class FinancetablePillarComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + console.log(this.chartData) + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + },1000) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + + this.chart.scale('number', { + nice: true, + }); + this.chart.tooltip({ + showMarkers: false, + shared: true, + }); + + this.chart + .interval() + .position('time*number') + .color('name') + .adjust([ + { + type: 'dodge', + marginRatio: 0, + }, + ]); + + this.chart.interaction('active-region'); + + this.chart.render(); + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/invoicetable/invoicetable.component.html b/src/app/routes/datatable/components/invoicetable/invoicetable.component.html new file mode 100644 index 00000000..e45122f6 --- /dev/null +++ b/src/app/routes/datatable/components/invoicetable/invoicetable.component.html @@ -0,0 +1,32 @@ + + + + + + {{item.totalInvoicedAmount | currency}} + + + {{item.invAmountMonth | currency}} + + + {{item.applyWaitInvAmount | currency}} + + + {{item.unInvoicedAmountHistory | currency}} + + + {{item.unInvoicedAmountCurMonth | currency}} + + + {{item.invoicedAmount | currency}} + + + diff --git a/src/app/routes/datatable/components/invoicetable/invoicetable.component.ts b/src/app/routes/datatable/components/invoicetable/invoicetable.component.ts new file mode 100644 index 00000000..40aac5d4 --- /dev/null +++ b/src/app/routes/datatable/components/invoicetable/invoicetable.component.ts @@ -0,0 +1,76 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { DataService } from '../../services/data.service'; + +@Component({ + selector: 'app-datatable-invoicetable', + templateUrl: './invoicetable.component.html', +}) +export class DatatableInvoicetableComponent implements OnInit { + @ViewChild('st', { static: false }) + st!: STComponent; + columns!: STColumn[]; + + data=[{name1:1111}] + constructor(private http: _HttpClient, private modal: ModalHelper,public service :DataService) { } + + /** + * 查询参数 + */ + get reqParams() { + return { }; + } + ngOnInit(): void { + this.initST(); + + } + initST() { + this.columns = [ + { + title: '运营主体', + index: 'operationName' + }, + { + title: '已开票总金额', + index: 'totalInvoicedAmount', + render: 'totalInvoicedAmount', + }, + { + title: '当月已开票金额', + index: 'invAmountMonth', + render: 'invAmountMonth', + }, + { + title: '当月已开票张数', + index: 'numInvAmountMonth', + }, + { + title: '已申请待开金额', + index: 'applyWaitInvAmount', + render: 'applyWaitInvAmount', + }, + { + title: '申请待开客户', + index: 'applyWaitCustomer', + }, + { + title: '已开票金额', + index: 'invoicedAmount', + render: 'invoicedAmount', + }, + { + title: '未申请开票金额(历史)', + index: 'unInvoicedAmountHistory', + render: 'unInvoicedAmountHistory', + }, + { + title: '未申请开票金额(当月)', + index: 'unInvoicedAmountCurMonth', + render: 'unInvoicedAmountCurMonth', + }, + ]; + } + +} diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.html b/src/app/routes/datatable/components/operationtable/curve/curve.component.html new file mode 100644 index 00000000..0640a4d4 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/curve/curve.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.less b/src/app/routes/datatable/components/operationtable/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.ts b/src/app/routes/datatable/components/operationtable/curve/curve.component.ts new file mode 100644 index 00000000..265190af --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/curve/curve.component.ts @@ -0,0 +1,83 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-operation-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class OperationCurveComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + },500) + console.log(this.chartData); + + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + this.chart.scale({ + time: { + range: [0, 1], + }, + number: { + nice: true, + }, + }); + + this.chart.tooltip({ + showCrosshairs: true, + shared: true, + }); + + this.chart.axis('number', { + label: { + formatter: (val: any) => { + return val; + }, + }, + }); + + this.chart + .line() + .position('time*number') + .color('name') + + + this.chart.render(); + + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.html b/src/app/routes/datatable/components/operationtable/operationtable.component.html new file mode 100644 index 00000000..bb830dfa --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.html @@ -0,0 +1,55 @@ + + + + +
    + +
    + + + + + + +
    + + +
    + +
    +
    + +
    + +
    + + +
    + + + +
    + + + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.less b/src/app/routes/datatable/components/operationtable/operationtable.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts b/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts new file mode 100644 index 00000000..3b100f2c --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOperationtableComponent } from './operationtable.component'; + +describe('DatatableOperationtableComponent', () => { + let component: DatatableOperationtableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOperationtableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOperationtableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.ts b/src/app/routes/datatable/components/operationtable/operationtable.component.ts new file mode 100644 index 00000000..891ee8e1 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.ts @@ -0,0 +1,155 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { DataService } from '../../services/data.service'; +import { differenceInCalendarDays } from 'date-fns'; +import { OperationCurveComponent } from './curve/curve.component'; +import { OperationPillarComponent } from './pillar/pillar.component'; + +@Component({ + selector: 'app-datatable-operationtable', + templateUrl: './operationtable.component.html', + styleUrls: ['./operationtable.component.less'], + providers: [DatePipe] + +}) +export class DatatableOperationtableComponent implements OnInit { + @ViewChild('curve') private readonly curve!: OperationCurveComponent; + @ViewChild('pillar') private readonly pillar!: OperationPillarComponent; + @ViewChild('st') private readonly st!: STComponent; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + time: any = ['2022-01-01 00:00:00'] + dateFormat = 'yyyy'; + dateNext: any = null; + modeNext = 'year'; + timeNext: any = ['2022-01-01 00:00:00'] + today = new Date(); + enterpriseInfoId = '' + + interManlist: any = [] + chartData: any = {} + columns: STColumn[] = [ + { title: '运营主体', index: 'networkTransporterName', className: 'text-center' }, + { title: '订单数', index: 'zsl', className: 'text-center' }, + { title: '应收金额', index: 'yingsje', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingsje }) } }, + { title: '承运数', index: 'cys', className: 'text-center' }, + { title: '应付运费', index: 'yingfyf', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingfyf }) } }, + { title: '运量(吨)', index: 'yl', className: 'text-center' }, + { title: '待接单数', index: 'djd', className: 'text-center' }, + { title: '在途数', index: 'ysz', className: 'text-center' }, + { title: '运输完成', index: 'yswc', className: 'text-center' }, + { title: '已收金额', index: 'yisje', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisje }) } }, + { title: '已付运费', index: 'yifyf', className: 'text-center', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yifyf }) } }, + ]; + /** + * 查询参数 + */ + get reqParams() { + if (this.mode === 'year') { + this.type = 1 + } else if (this.mode === 'month') { + this.type = 2 + } else if (this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type + }; + + delete params._$expand; + return { ...params }; + } + + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { + this.initData() + this.initPillarData() + } + initPillarData(flag?: boolean){ + let type = 1 + if(this.mode === 'year') { + type = 1 + } else if(this.mode === 'month') { + type = 2 + } + const params: any = { + time: this.timeNext, + type, + enterpriseInfoId: this.enterpriseInfoId + }; + this.service.request(this.service.$api_operationalReportHistogram, params).subscribe(res => { + if (res) { + this.chartData = res + if(flag) { // 除第一次加载外 + this.pillar.reRender() + this.curve.reRender() + } + } + }) + } + initData() { + + this.service.getNetworkFreightForwarder().subscribe(res => { + this.interManlist = res + this.enterpriseInfoId = res[0].value + }) + } + + changeData() { + if (this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if (this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if (this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if (this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if (this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else { + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + exportFun() { + + } + changeCurve(){ + + } + changePie(){ + + } + changeDataNext() { + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } + } + onChangeNext(result: any) { + if(result === null) { + return + } + if(this.mode === 'year') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00'] + } + this.initPillarData(true) + } +} diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.html b/src/app/routes/datatable/components/operationtable/pie/pie.component.html new file mode 100644 index 00000000..373a4b03 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.html @@ -0,0 +1,8 @@ + + + + +
    + +
    +
    \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.less b/src/app/routes/datatable/components/operationtable/pie/pie.component.less new file mode 100644 index 00000000..567be99f --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.less @@ -0,0 +1,5 @@ +.box{ + width: 50%; + margin:0 auto; + overflow: hidden; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.ts b/src/app/routes/datatable/components/operationtable/pie/pie.component.ts new file mode 100644 index 00000000..fa58fbd1 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.ts @@ -0,0 +1,188 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { Chart } from '@antv/g2'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-opeationtable-pie', + templateUrl: './pie.component.html', + styleUrls: ['./pie.component.less'] +}) +export class OperationtablePieComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: any = []; + el: any; + enterpriseInfoIdPie = '' + interManlist: any = [] + + constructor(private service: DataService, private ngZone: NgZone) { + } + + ngOnInit(): void { + this.initData() + this.initManData() + } + initData(){ + this.service.request(this.service.$api_operationalReportWaybillStatusDistribution, {id: this.enterpriseInfoIdPie}).subscribe(res => { + if (res) { + this.chartData = res + this.ngZone.runOutsideAngular(() => this.init(this.el)); + } + }) + } + initManData() { + this.service.getNetworkFreightForwarder().subscribe(res => { + this.interManlist = res + this.enterpriseInfoIdPie = res[0].value + }) + } + render(el: ElementRef): void { + this.el = el.nativeElement + } + private init(el: HTMLElement): void { + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(this.chartData); + + // chart.scale('percent', { + // formatter: val => { + // val = val * 100 + '%'; + // return val; + // }, + // }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: this.chartData.map((obj: any, index: any) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent+ '% ' + obj.count, + count: obj.count, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val}` // 格式化 itemValue 内容 + }, + }); + + const interval = chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(true); + // 默认选择 + interval.elements[0].setState('selected', true); + const ele = interval.elements[0].getData(); + + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + + + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/operationtable/pillar/pillar.component.html b/src/app/routes/datatable/components/operationtable/pillar/pillar.component.html new file mode 100644 index 00000000..0640a4d4 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pillar/pillar.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/pillar/pillar.component.less b/src/app/routes/datatable/components/operationtable/pillar/pillar.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/operationtable/pillar/pillar.component.ts b/src/app/routes/datatable/components/operationtable/pillar/pillar.component.ts new file mode 100644 index 00000000..b78f500f --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pillar/pillar.component.ts @@ -0,0 +1,74 @@ +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Chart } from '@antv/g2'; +import { DataService } from 'src/app/routes/datatable/services/data.service'; +@Component({ + selector: 'app-operation-pillar', + templateUrl: './pillar.component.html', + styleUrls: ['./pillar.component.less'] +}) +export class OperationPillarComponent implements OnInit, OnChanges { + el: any; + @Input() chartData: any; + chart: any; + constructor(private service: DataService, private ngZone: NgZone) { + + } + ngOnChanges(changes: SimpleChanges): void { + if (this.chartData) { + // setTimeout(()=>{ + // this.chart.render(true) + // }, 1000) + + } + } + + ngOnInit(): void { + + } + reRender() { + setTimeout(() => { + this.chart.data(this.chartData); + this.chart.render(); + }, 1000) + } + render(el: ElementRef): void { + this.el = el.nativeElement + setTimeout(() => { + this.ngZone.runOutsideAngular(() => this.init(this.el)); + }, 500) + } + + private init(el: HTMLElement): void { + this.chart = new Chart({ + container: el, + autoFit: true, + height: 500, + }); + + this.chart.data(this.chartData); + + this.chart.scale('number', { + nice: true, + }); + this.chart.tooltip({ + showMarkers: false, + shared: true, + }); + + this.chart + .interval() + .position('time*number') + .color('name') + .adjust([ + { + type: 'dodge', + marginRatio: 0, + }, + ]); + + this.chart.interaction('active-region'); + + this.chart.render(); + } + +} \ No newline at end of file diff --git a/src/app/routes/datatable/datatable-routing.module.ts b/src/app/routes/datatable/datatable-routing.module.ts new file mode 100644 index 00000000..8298fdf5 --- /dev/null +++ b/src/app/routes/datatable/datatable-routing.module.ts @@ -0,0 +1,48 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component'; +import { DatatableOwnerComponent } from './components/customtable/owner/owner.component'; +import { DatatableDriverComponent } from './components/customtable/driver/driver.component'; +import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component'; +import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component'; +import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; +import { DatatableComplianceIndexComponent } from './components/compliance/index/index.component'; +import { DatatableFinancetableComponent } from './components/financetable/financetable.component'; +import { DatatableInvoicetableComponent } from './components/invoicetable/invoicetable.component'; +import { DatatableComplianceSalesmanComponent } from './components/compliance/salesman/salesman.component'; +import { DatatableComplianceCustomerComponent } from './components/compliance/customer/customer.component'; +import { DatatableFundReportingComponent } from './reporting/components/fund-reporting/fund-reporting.component'; +import { DatatableMancustomtableComponent } from './components/customtable/mancustomtable/mancustomtable.component'; +import { DatatablePartnertableComponent } from './components/customtable/partnertable/partnertable.component'; +import { DatatableBusiindexComponent } from './components/busitable/busiindex/busiindex.component'; +import { DatatableMantableComponent } from './components/busitable/mantable/mantable.component'; +import { DatatableReportingFundInfoComponent } from './reporting/components/fund-info/fund-info.component'; +import { DatatableDatascreenComponent } from './components/datascreen/datascreen.component'; + +const routes: Routes = [ + { path: 'dataindex', component: DatatableDataindexComponent }, + { path: 'customtable/customindex', component: DatatableCustomindexComponent }, + { path: 'customtable/owner', component: DatatableOwnerComponent }, + { path: 'customtable/driver', component: DatatableDriverComponent }, + { path: 'customtable/mancustomtable', component: DatatableMancustomtableComponent }, + { path: 'customtable/partnertable', component: DatatablePartnertableComponent }, + { path: 'operationtable', component: DatatableOperationtableComponent }, + { path: 'reporting/order', component: DatatableOrderReportingComponent }, + { path: 'compliancetabel/index', component: DatatableComplianceIndexComponent }, + { path: 'compliancetabel/salesman', component: DatatableComplianceSalesmanComponent }, + { path: 'compliancetabel/customer', component: DatatableComplianceCustomerComponent }, + { path: 'financetable', component: DatatableFinancetableComponent }, + { path: 'invoicetable', component: DatatableInvoicetableComponent }, + { path: 'reporting/fund', component: DatatableFundReportingComponent }, + { path: 'busitable/busiindex', component: DatatableBusiindexComponent }, + { path: 'busitable/mantable', component: DatatableMantableComponent }, + { path: 'reporting/fund', component: DatatableFundReportingComponent }, + { path: 'fund-info', component: DatatableReportingFundInfoComponent }, + { path: 'datascreen', component: DatatableDatascreenComponent }]; + + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class DatatableRoutingModule { } diff --git a/src/app/routes/datatable/datatable.module.ts b/src/app/routes/datatable/datatable.module.ts new file mode 100644 index 00000000..7a1fe2be --- /dev/null +++ b/src/app/routes/datatable/datatable.module.ts @@ -0,0 +1,93 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-04-06 11:02:17 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 18:29:39 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\datatable.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule, Type } from '@angular/core'; +import { SharedModule, SHARED_G2_MODULES } from '@shared'; +import { DatatableRoutingModule } from './datatable-routing.module'; +import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component'; +import { DatatableOwnerComponent } from './components/customtable/owner/owner.component'; +import { DatatableDriverComponent } from './components/customtable/driver/driver.component'; +import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component'; +import { OperationtablePieComponent } from './components/operationtable/pie/pie.component'; +import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component'; +import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; +import { DatatableComplianceIndexComponent } from './components/compliance/index/index.component'; +import { DatatableFinancetableComponent } from './components/financetable/financetable.component'; +import { DatatableInvoicetableComponent } from './components/invoicetable/invoicetable.component'; +import { DatatableComplianceSalesmanComponent } from './components/compliance/salesman/salesman.component'; +import { DatatableComplianceCustomerComponent } from './components/compliance/customer/customer.component'; +import { DatatableReportingUploadSettingComponent } from './reporting/components/upload-setting/upload-setting.component'; +import { DatatableReportingVerifyResultComponent } from './reporting/components/verify-result/verify-result.component'; +import { DatatableFundReportingComponent } from './reporting/components/fund-reporting/fund-reporting.component'; +import { DatatableMancustomtableComponent } from './components/customtable/mancustomtable/mancustomtable.component'; +import { DatatablePartnertableComponent } from './components/customtable/partnertable/partnertable.component'; +import { DatatableBusiindexComponent } from './components/busitable/busiindex/busiindex.component'; +import { DatatableMantableComponent } from './components/busitable/mantable/mantable.component'; +import { BusitablePillarComponent } from './components/busitable/pillar/pillar.component'; +import { DatatableReportingFundInfoComponent } from './reporting/components/fund-info/fund-info.component'; +import { OperationPillarComponent } from './components/operationtable/pillar/pillar.component'; +import { OperationCurveComponent } from './components/operationtable/curve/curve.component'; +import { FinanceTableCurveComponent } from './components/financetable/curve/curve.component'; +import { DatatableDatascreenComponent } from './components/datascreen/datascreen.component'; +import { FinancetablePillarComponent } from './components/financetable/pillar/pillar.component'; +import { ComplianceCurveComponent } from './components/compliance/index/curve/curve.component'; +import { BusitableCurveComponent } from './components/busitable/busiindex/curve/curve.component'; +import { DatatableCustomindexCurveComponent } from './components/customtable/customindex/curve/curve.component'; +import { DatatableCustomindexMapComponent } from './components/datascreen/map/map.component'; +import { DatatableCustomindexCurveMinComponent } from './components/datascreen/curve/curve.component'; +import { DatatableReportingvViewTrackComponent } from './reporting/components/view-track/view-track.component'; + +const COMPONENTS: Type[] = [ + DatatableDataindexComponent, + DatatableCustomindexComponent, + DatatableOwnerComponent, + DatatableDriverComponent, + DatatableOperationtableComponent, + OperationtablePieComponent, + DatatableOrderReportingComponent, + DatatableComplianceIndexComponent, + DatatableFinancetableComponent, + DatatableInvoicetableComponent, + DatatableComplianceSalesmanComponent, + DatatableComplianceCustomerComponent, + DatatableReportingUploadSettingComponent, + DatatableReportingVerifyResultComponent, + DatatableFundReportingComponent, + DatatableMancustomtableComponent, + DatatablePartnertableComponent, + DatatableBusiindexComponent, + DatatableMantableComponent, + BusitablePillarComponent, + DatatableFundReportingComponent, + DatatableReportingFundInfoComponent, + OperationPillarComponent, + OperationCurveComponent, + DatatableReportingFundInfoComponent, + FinanceTableCurveComponent, + DatatableDatascreenComponent, + FinancetablePillarComponent, + ComplianceCurveComponent, + BusitableCurveComponent, + DatatableCustomindexCurveComponent, + DatatableCustomindexMapComponent, + DatatableCustomindexCurveMinComponent, + DatatableReportingvViewTrackComponent +] + + +@NgModule({ + imports: [ + SharedModule, + DatatableRoutingModule, + SHARED_G2_MODULES + ], + declarations: COMPONENTS, +}) +export class DatatableModule { } diff --git a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html new file mode 100644 index 00000000..b8bbd698 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html @@ -0,0 +1,14 @@ +
    + + + + {{filterCheckStatus(item?.checkStatus)}} + + +
    + + diff --git a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.spec.ts b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.spec.ts new file mode 100644 index 00000000..09d9ac30 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingFundInfoComponent } from './fund-info.component'; + +describe('DatatableReportingFundInfoComponent', () => { + let component: DatatableReportingFundInfoComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingFundInfoComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingFundInfoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts new file mode 100644 index 00000000..ed3f6b4e --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts @@ -0,0 +1,116 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; + +@Component({ + selector: 'app-datatable-fund-info', + templateUrl: './fund-info.component.html', +}) +export class DatatableReportingFundInfoComponent implements OnInit { + url = `/user`; + searchSchema!: SFSchema; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = []; + record: any = {} + + + get reqParams() { + return { capitalCode: this?.record?.serialNumberCode }; + } + + beforeReq(requestOptions: STRequestOptions) { + delete requestOptions?.body?.pageSize; + delete requestOptions?.body?.pageIndex; + return requestOptions; + } + constructor(public service: ReportingService, private modalRef: NzModalRef, public router: Router) { + + } + + ngOnInit(): void { + this.initST(); + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '序号', type: 'no', className: 'text-center', width: '10%', }, + { title: '监管平台字段', index: 'thirdPartyFieldName', className: 'text-center', width: '15%', }, + { title: '系统字段', index: 'checkFieldName', className: 'text-center', width: '15%', }, + { title: '归属模块', index: 'orderStatus', className: 'text-center', width: '15%', }, + { + title: '是否必填', + index: 'orderStatus', + className: 'text-center', + width: '10%', + type: 'enum', + enum: { + 0: '否', + 1: '是', + }, + }, + { title: '上传值', index: 'fieldValue', className: 'text-center', width: '15%', }, + { + title: '本地校验', + render: 'checkStatus', + className: 'text-center', + type: 'enum', + + enum: { + '0': '校验中', + '1': '通过', + '2': '不通过' + }, + width: '10%', + }, + { title: '错误内容', index: 'remark', className: 'text-center', width: '20%', }, + ] + } + + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + + selectTab(e: any) { + + } + + update() { + if (this.record?.billType === '1') { + window.open(location.origin + `/#/order-management/vehicle-detailChange/${this.record?.id}`) + + } else if (this.record.billType === '2') { + window.open(location.origin + `/#/order-management/bulk-detailChange/${this.record?.id}`); + } + + + } + close(): void { + this.modalRef.destroy(); + } + + filterCheckStatus(status: number) { + switch (status) { + case 0: + return '校验中'; + case 1: + return '通过'; + case 2: + return '不通过'; + default: + return ''; + + } + } + + +} diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html new file mode 100644 index 00000000..ca872918 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html @@ -0,0 +1,63 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + {{item?.uploadStatusLabel}} + + + {{item?.verifyStatusLabel}} + {{item?.verifyStatusLabel}} + + + {{item?.orderCode}} + + + {{item?.wayBillCode}} + + +
    {{item?.tolalAmount | currency }}
    +
    + +
    {{item?.payAmount | currency }}
    +
    +
    +
    + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + +
    +
    diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less new file mode 100644 index 00000000..6009fbbf --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.less @@ -0,0 +1,5 @@ +:host { + .text-black { + color: #000; + } +} diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts new file mode 100644 index 00000000..fb500388 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableFundReportingComponent } from './fund-reporting.component'; + +describe('DatatableFundReportingComponent', () => { + let component: DatatableFundReportingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableFundReportingComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableFundReportingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts new file mode 100644 index 00000000..fa7ecd77 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts @@ -0,0 +1,485 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; +import { DatatableReportingFundInfoComponent } from '../fund-info/fund-info.component'; +import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; + +@Component({ + selector: 'app-datatable-fund-reporting', + templateUrl: './fund-reporting.component.html', + styleUrls: ['./fund-reporting.component.less'] +}) +export class DatatableFundReportingComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType!: string; + tabs: any[] = [ + { name: '待上传', value: '1' }, + { name: '上传中', value: '2' }, + { name: '已上传', value: '3' }, + { name: '异常', value: '4' }, + { name: '全部', value: '' } + ]; + selectedIndex = '1'; //选择的项目 + serviceTel = ''; + selectedRows: any[] = []; + isLoading: boolean = false; + constructor( + public service: ReportingService, + private router: Router, + private ar: ActivatedRoute, + private modal: NzModalService, + public shipperSrv: ShipperBaseService + ) { + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + uploadStatus: this.selectedIndex + }); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + // get selectedRows() { + // return this.st?.list.filter((item: any) => item.checked) || []; + // } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + orderCode: { title: '订单号', type: 'string', ui: { placeholder: '请输入' } }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入', + }, + }, + serialNumberCode: { + type: 'string', + title: '流水单号', + ui: { + placeholder: '请输入', + }, + }, + carrier: { + title: '承运司机', + type: 'string', + ui: { + placeholder: '请输入司机姓名', visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + carNumber: { + title: '车牌号', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + payee: { + title: '车队长', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + uploadStatus: { + title: '上传状态', + type: 'string', + default: 0, + enum: [ + { label: '待上传', value: 0 }, + { label: '已上传', value: 1 }, + { label: '异常', value: 2 } + ], + ui: { + placeholder: '请选择', + widget: 'select', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + verifyStatus: { + title: '本地校验', + type: 'string', + enum: [ + { label: '校验中', value: 0 }, + { label: '通过', value: 1 }, + { label: '不通过', value: 2 } + ], + ui: { + placeholder: '请选择', + allowClear: true, + widget: 'select', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + ltdId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, false), + visibleIf: { + _$expand: (value: boolean) => value, + }, + allowClear: true + } + }, + transactionTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + uploadTime: { + title: '上传时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px', }, + { title: '上传状态', render: 'uploadStatus', className: 'text-center', width: '120px', }, + { title: '本地校验', render: 'verifyStatus', className: 'text-center', width: '120px', }, + { title: '流水单号', index: 'serialNumberCode', className: 'text-center', width: '190px', }, + { + title: '订单号', + render: 'orderCode', + className: 'text-center', + width: '180px', + }, + { title: '运单号', render: 'wayBillCode', className: 'text-center', width: '180px', }, + { + title: '网络货运人', + index: 'ltdName', + className: 'text-center', + width: '180px', + }, + { title: '实际承运人名称', index: 'carrier', className: 'text-center', width: '150px' }, + { title: '实际承运人证件号码', index: 'cardId', className: 'text-center', width: '200px' }, + { title: '车牌号', index: 'carNumber', className: 'text-center', width: '180px' }, + { title: '车牌颜色', index: 'carColor', className: 'text-center', width: '180px' }, + { title: '总金额', render: 'tolalAmount', className: 'text-center', width: '120px' }, + + { title: '付款方式', index: 'payType', className: 'text-center', width: '150px' }, + { title: '车队长', index: 'payee', className: 'text-center', width: '150px' }, + { title: '收款账户', index: 'collectionAccount', className: 'text-center', width: '180px' }, + + { title: '收款银行', index: 'bankTypeLabel', className: 'text-center', width: '150px' }, + + { title: '银行流水号', index: 'bankSerialNumber', className: 'text-center', width: '180px' }, + { title: '实际支付金额', render: 'payAmount', className: 'text-center', width: '150px' }, + { title: '交易时间', index: 'transactionTime', className: 'text-center', width: '180px' }, + { title: '上传次数', index: 'uploadFrequency', className: 'text-center', width: '120px' }, + { title: '上传时间', index: 'uploadTime', className: 'text-center', width: '180px' }, + ]; + } + + + + /** + *撤销 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要撤回的数据'); + return; + } + this.modal.confirm({ + nzTitle: '撤回提示', + nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_fund_reporting_recall, ids).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + + this.search(); + } + }) + } + }); + + + } + + selectChange(item: any) { + this.selectedIndex = item?.value || ''; + + setTimeout(() => { + this.selectedRows = []; + this.st.load(1); + }) + } + + /** + * 查看当行数据 + */ + view(record: STData) { + // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar }); + this.router.navigate(['../detail'], { + queryParams: { + id: record.id, + }, + relativeTo: this.ar + }); + } + + // appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzWidth: '40%', + // nzContent: CtcAppealComponent, + // nzComponentParams: { + // i: item, + // status: 'add' + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // if (res) { + // this.search({ representationsStatus: '' }); + // } + // }) + // } + + /** + * 上传 + */ + upload() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_fund_reporting_upload, ids).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('上传成功'); + this.search(); + } + }) + } + + + /** + * + * @param params 上传设置 + */ + uploadSetting() { + const modalRef = this.modal.create({ + nzTitle: '上传设置', + nzWidth: 600, + nzContent: DatatableReportingUploadSettingComponent, + nzComponentParams: {}, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 查看校验结果 + */ + viewResult(record: any) { + const modalRef = this.modal.create({ + nzTitle: '校验结果', + nzWidth: 1200, + + nzContent: DatatableReportingFundInfoComponent, + nzComponentParams: { + record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + + + /** + * 查看监管审核结果 + */ + viewAuditResult(record: any) { + if (record?.verifyStatus !== '2') { + return; + } + this.openWainingModal('监管审核结果', record?.uploadResult) + } + + /** + * 更新数据 + */ + updateData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_update_fund_data, ids).subscribe(res => { + if (res) { + this.selectedRows = []; + this.st.reload(); + + } + }) + } + + + search() { + this.selectedRows = []; + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + openWainingModal(content: string, title = '提示') { + this.modal.warning({ + nzMask: false, + nzTitle: title, + nzContent: content, + }) + } + + changeSt(e: STChange): void { + + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r: any) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + + +} diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html new file mode 100644 index 00000000..52d5bad7 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html @@ -0,0 +1,88 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + {{filterStatus(item?.orderCheckStatus)}} + {{filterStatus(item?.orderCheckStatus)}} + + + {{filterStatus(item?.driverCheckStatus)}} + {{filterStatus(item?.driverCheckStatus)}} + + + {{filterStatus(item?.carCheckStatus)}} + {{filterStatus(item?.carCheckStatus)}} + + + + {{filterCheckStatus(item?.checkStatus)}} + {{filterCheckStatus(item?.checkStatus)}} + + + + {{item?.billCode}} + + + {{item?.wayBillCode}} + + + +
    {{item?.freightAmount | currency :' '}}
    +
    + +
    + {{_item?.goodsTypeName}}/{{_item?.goodsName}}/{{_item?.weight}}吨/{{_item?.volume}}m³ +
    +
    + + + 查看轨迹 + + + 查看轨迹 + +
    +
    + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + + +
    +
    diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.less b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.less new file mode 100644 index 00000000..6009fbbf --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.less @@ -0,0 +1,5 @@ +:host { + .text-black { + color: #000; + } +} diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts new file mode 100644 index 00000000..2c07610f --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOrderReportingComponent } from './order-reporting.component'; + +describe('DatatableOrderReportingComponent', () => { + let component: DatatableOrderReportingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOrderReportingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOrderReportingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts new file mode 100644 index 00000000..e10847f0 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts @@ -0,0 +1,597 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; +import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; +import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component'; +import { DatatableReportingvViewTrackComponent } from '../view-track/view-track.component'; + +@Component({ + selector: 'app-datatable-order-reporting', + templateUrl: './order-reporting.component.html', + styleUrls: ['./order-reporting.component.less'] +}) +export class DatatableOrderReportingComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType!: string; + tabs: any[] = [ + { name: '待上传', value: '1' }, + { name: '上传中', value: '2' }, + { name: '已上传', value: '3' }, + { name: '异常', value: '4' }, + { name: '全部', value: '' } + ]; + selectedIndex = '1'; + isLoading: boolean = false; + selectedRows: any[] = []; + constructor( + public service: ReportingService, + private router: Router, + private ar: ActivatedRoute, + private modal: NzModalService, + public shipperSrv: ShipperBaseService + ) { + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + putStatus: this.selectedIndex, + }); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + // get selectedRows() { + // return this.st?.list.filter((item: any) => item.checked) || []; + // } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { title: '订单号', type: 'string', ui: { placeholder: '请输入' } }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入', + }, + }, + enterpriseInfoId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, false), + + allowClear: true + } + }, + shipperName: { + title: '货主', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + placeholder: '请输入司机姓名/手机号', visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + carNo: { + title: '车牌号', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + putStatus: { + title: '上传状态', + type: 'string', + default: 0, + enum: [ + { label: '待上传', value: 0 }, + { label: '已上传', value: 1 }, + { label: '异常', value: 2 } + ], + + ui: { + placeholder: '请选择', + widget: 'select', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + checkStatus: { + title: '本地校验', + type: 'string', + enum: [ + { label: '校验中', value: 0 }, + { label: '通过', value: 1 }, + { label: '不通过', value: 2 } + ], + ui: { + placeholder: '请选择', + widget: 'select', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + putTime: { + title: '上传时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + orderReceivingTime: { + title: '运单生成时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + dispatchedDate: { + title: '发货时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + receivingDate: { + title: '收货时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + + trajectoryDataAppStatus: { + title: '车辆轨迹', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '有', value: '1' }, + { label: '无', value: '0' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + trajectoryDataStatus: { + title: '司机轨迹', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '有', value: '1' }, + { label: '无', value: '0' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px', }, + { title: '订单状态', render: 'orderCheckStatus', className: 'text-center', width: '120px', }, + { title: '司机状态', render: 'driverCheckStatus', className: 'text-center', width: '120px', }, + + { title: '车辆状态', render: 'carCheckStatus', className: 'text-center', width: '120px', }, + + { title: '本地校验', render: 'checkStatus', className: 'text-center', width: '120px', }, + { + title: '订单号', + render: 'billCode', + className: 'text-center', + width: '180px', + }, + { title: '运单号', render: 'wayBillCode', className: 'text-center', width: '180px', }, + + { + title: '网络货运人', + index: 'enterpriseInfoName', + className: 'text-center', + width: '180px', + }, + { title: '统一社会信用代码', index: 'unifiedSocialCreditCode', className: 'text-center', width: '200px' }, + { title: '运单生成时间', index: 'wayBillCreateTime', className: 'text-center', width: '180px' }, + { title: '发货时间', index: 'dispatchedDate', className: 'text-center', width: '180px' }, + { title: '收货时间', index: 'receivingDate', className: 'text-center', width: '180px' }, + { title: '托运人名称', index: 'shipperName', className: 'text-center', width: '250px' }, + { title: '托运人统一社会信用代码', index: 'shipperCreditCode', className: 'text-center', width: '200px' }, + { title: '装货地址', index: 'loadingAddress', className: 'text-center', width: '200px' }, + { title: '收货方名称', index: 'receivingName', className: 'text-center', width: '150px' }, + { title: '收货地址', index: 'consigneeAddress', className: 'text-center', width: '150px' }, + { title: '运费金额', render: 'freightAmount', className: 'text-center', width: '250px' }, + { title: '车牌号', index: 'carNo', className: 'text-center', width: '150px' }, + { + title: '车牌颜色', + index: 'carNoColor', + className: 'text-center', + width: '250px', + type: 'enum', + enum: { + "4": "绿色", + "3": "黄绿色", + "2": "黄色", + "1": "蓝色" + } + + }, + { title: '司机姓名', index: 'driverName', className: 'text-center', width: '150px' }, + { title: '司机手机号码', index: 'driverPhone', className: 'text-center', width: '200px' }, + { title: '司机身份证号', index: 'driverIdentityNo', className: 'text-center', width: '150px' }, + { title: '货物信息', render: 'goodsInfoList', className: 'text-center', width: '180px' }, + { title: '实际承运人名称', index: 'carrierName', className: 'text-center', width: '150px' }, + { title: '实际承运人证件号码', index: 'carrierIdentityNo', className: 'text-center', width: '200px' }, + + { title: '实际承运人道路运输许可证号', render: 'payeeName', className: 'text-center', width: '150px' }, + + { title: '车辆轨迹', render: 'car', className: 'text-center', width: '250px' }, + { title: '司机轨迹', render: 'driver', className: 'text-center', width: '150px' }, + { title: '上传次数', index: 'putNumber', className: 'text-center', width: '150px' }, + { title: '上传时间', index: 'recentlyPutTime', className: 'text-center', width: '180px' }, + ]; + } + + + + /** + *撤销 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要撤回的数据'); + return; + } + this.modal.confirm({ + nzTitle: '撤回提示', + nzContent: '撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_recall_order_reporting, ids).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + this.search(); + } + }) + } + }); + + } + + changeSt(e: STChange): void { + + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r: any) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + selectChange(item: any) { + this.selectedIndex = item?.value || ''; + setTimeout(() => { + this.selectedRows = []; + this.st.load(1); + }) + } + + /** + * 查看当行数据 + */ + view(record: STData) { + // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar }); + this.router.navigate(['../detail'], { + queryParams: { + id: record.id, + }, + relativeTo: this.ar + }); + } + + // appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzWidth: '40%', + // nzContent: CtcAppealComponent, + // nzComponentParams: { + // i: item, + // status: 'add' + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // if (res) { + // this.search({ representationsStatus: '' }); + // } + // }) + // } + + /** + * 上传 + */ + upload() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_upload_order_reporting, ids).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('上传成功'); + this.search(); + } + }) + } + + + /** + * + * @param params 上传设置 + */ + uploadSetting() { + const modalRef = this.modal.create({ + nzTitle: '上传设置', + nzWidth: 600, + nzContent: DatatableReportingUploadSettingComponent, + nzComponentParams: {}, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 查看校验结果 + */ + viewResult(item: any) { + const modalRef = this.modal.create({ + nzTitle: '校验结果', + nzWidth: 1200, + nzContent: DatatableReportingVerifyResultComponent, + nzComponentParams: { + record: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 查看监管审核结果 + */ + viewAuditResult(record: any) { + if (record?.billStatus !== '2') { + return; + } + this.openWainingModal('监管审核结果', record?.result) + } + + + search() { + this.selectedRows = []; + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + openWainingModal(content: string, title = '提示') { + this.modal.warning({ + nzMask: false, + nzTitle: title, + nzContent: content, + }) + } + + /** + * 查看轨迹 + */ + viewTrack(_record: any, trajectory: string) { + const title = trajectory === 'car' ? '车辆' : '司机' + const modalRef = this.modal.create({ + nzTitle: `查看${title}轨迹`, + nzWidth: 1000, + nzContent: DatatableReportingvViewTrackComponent, + nzComponentParams: { + id: _record?.orderId, + trajectory + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + }) + } + + /** + * 更新数据 + */ + updateData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_update_order_data, ids).subscribe(res => { + if (res) { + this.selectedRows = []; + this.st.reload(); + + } + }) + } + + filterStatus(status: number) { + switch (status) { + case 0: + return '待上传'; + case 1: + return '已上传'; + case 2: + return '上传异常'; + default: + return ''; + + } + } + + filterCheckStatus(status: number) { + switch (status) { + case 0: + return '校验中'; + case 1: + return '通过'; + case 2: + return '不通过'; + default: + return ''; + + } + } + +} diff --git a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.html b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.html new file mode 100644 index 00000000..a4f5ae6e --- /dev/null +++ b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.html @@ -0,0 +1,8 @@ + + + + diff --git a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.spec.ts b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.spec.ts new file mode 100644 index 00000000..aeb5cf2c --- /dev/null +++ b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingUploadSettingComponent } from './upload-setting.component'; + +describe('DatatableReportingUploadSettingComponent', () => { + let component: DatatableReportingUploadSettingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingUploadSettingComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingUploadSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts new file mode 100644 index 00000000..0258f230 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; + +@Component({ + selector: 'app-datatable-upload-setting', + templateUrl: './upload-setting.component.html', +}) +export class DatatableReportingUploadSettingComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + + constructor( + private modal: NzModalRef, + public service: ReportingService + ) { } + + ngOnInit(): void { + this.initSF(); + this.loadData(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + orderPushType: { + type: 'string', + title: '订单数据', + enum: [ + { + label: '手动上传', + value: 1 + }, + { + label: '自动上传', + value: 2 + } + ], + description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', + ui: { + widget: 'radio', + + } + }, + capitalPushType: { + type: 'string', + title: '资金数据', + enum: [ + { + label: '手动上传', + value: 1 + }, + { + label: '自动上传', + value: 2 + } + ], + description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', + ui: { + widget: 'radio', + + } + }, + }, + required: ['orderPushType', 'capitalPushType'], + } + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 24 }, + }, + }; + } + + /** + * 获取设置数据 + */ + loadData() { + this.service.request(this.service.$api_get_upload_setting, {}).subscribe(res => { + if (res) { + this.i = res; + } + }) + } + + /** + * 修改 + * @param value + */ + save(value: any): void { + if (this.sf?.valid) + this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + }) + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.html b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.html new file mode 100644 index 00000000..7f0a72d2 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.html @@ -0,0 +1,21 @@ +
    +
    + + + +
    +
    + + + {{filterCheckStatus(item?.checkStatus)}} + + +
    +
    + diff --git a/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.spec.ts b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.spec.ts new file mode 100644 index 00000000..48b1e9e5 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingVerifyResultComponent } from './verify-result.component'; + +describe('DatatableReportingVerifyResultComponent', () => { + let component: DatatableReportingVerifyResultComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingVerifyResultComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingVerifyResultComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.ts b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.ts new file mode 100644 index 00000000..ac8b8350 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/verify-result/verify-result.component.ts @@ -0,0 +1,114 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ReportingService } from '../../services/reporting.service'; + +@Component({ + selector: 'app-datatable-verify-result', + templateUrl: './verify-result.component.html', +}) +export class DatatableReportingVerifyResultComponent implements OnInit { + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = []; + record: any = {}; + + tabs: any[] = [ + { name: '订单信息', value: 3 }, + { name: '司机信息', value: 2 }, + { name: '车辆信息', value: 4 }, + ]; + subjectType = 3; + subjectId = ''; + get reqParams() { + return { + subjectType: this.subjectType, + subjectId: this.record?.id + }; + } + constructor(public service: ReportingService, private modalRef: NzModalRef, public router: Router) { + + } + + ngOnInit(): void { + this.initST(); + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '序号', type: 'no', className: 'text-center', width: '60px', }, + { title: '监管平台字段', index: 'thirdPartyFieldName', className: 'text-center', width: '120px', }, + { title: '系统字段', index: 'checkFieldName', className: 'text-center', width: '100px', }, + { title: '归属模块', index: 'orderStatus', className: 'text-center', width: '120px', }, + { + title: '是否必填', + index: 'requiredStatus', + className: 'text-center', + width: '100px', + type: 'enum', + enum: { + 0: '否', + 1: '是' + } + }, + { title: '上传值', index: 'fieldValue', className: 'text-center', width: '150px', }, + { + title: '本地校验', index: 'checkStatus', className: 'text-center', width: '100px', + type: 'enum', + enum: { + 0: '校验中', + 1: '通过', + 2: '不通过' + } + }, + { title: '错误内容', index: 'remark', className: 'text-center', width: '150px', }, + ] + } + + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + + selectTab(e: any) { + setTimeout(() => { + this.subjectType = e?.value; + this.st.load(1); + }) + } + + update() { + if (this.record?.billType === '1') { + window.open(location.origin + `/#/order-management/vehicle-detailChange/${this.record?.id}`) + + } else if (this.record.billType === '2') { + window.open(location.origin + `/#/order-management/bulk-detailChange/${this.record?.id}`); + } + + + } + + + close(): void { + this.modalRef.destroy(); + } + filterCheckStatus(status: number) { + switch (status) { + case 0: + return '校验中'; + case 1: + return '通过'; + case 2: + return '不通过'; + default: + return ''; + + } + } + +} diff --git a/src/app/routes/datatable/reporting/components/view-track/view-track.component.html b/src/app/routes/datatable/reporting/components/view-track/view-track.component.html new file mode 100644 index 00000000..cc66c9c3 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/view-track/view-track.component.html @@ -0,0 +1,5 @@ +
    + + + +
    diff --git a/src/app/routes/datatable/reporting/components/view-track/view-track.component.spec.ts b/src/app/routes/datatable/reporting/components/view-track/view-track.component.spec.ts new file mode 100644 index 00000000..c32eb107 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/view-track/view-track.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingvViewTrackComponent } from './view-track.component'; + +describe('DatatableReportingvViewTrackComponent', () => { + let component: DatatableReportingvViewTrackComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingvViewTrackComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingvViewTrackComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/reporting/components/view-track/view-track.component.ts b/src/app/routes/datatable/reporting/components/view-track/view-track.component.ts new file mode 100644 index 00000000..1cb10886 --- /dev/null +++ b/src/app/routes/datatable/reporting/components/view-track/view-track.component.ts @@ -0,0 +1,92 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import format from 'date-fns/format'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from 'src/app/routes/order-management/services/order-management.service'; + + +@Component({ + selector: 'app-datatable-view-track', + templateUrl: './view-track.component.html', +}) +export class DatatableReportingvViewTrackComponent implements OnInit { + mapList: any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 + trajectory = "car"; + pois: any[] = []; + id = ''; + constructor(public service: OrderManagementService, private modalRef: NzModalRef, public router: Router) { + + } + + ngOnInit(): void { + if (this.trajectory === 'car') { + this.getTrajectory(); + } else if (this.trajectory === 'driver') { + this.getDriverTrajectory(); + } + } + + + + selectTab(e: any) { + + } + + close(): void { + this.modalRef.destroy(); + } + + // 车辆轨迹 + getTrajectory() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.cityArray]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + + + } + + // 获取司机轨迹 + getDriverTrajectory() { + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = item.vinOutTime ? this.getLocalTime(item.gtm) : ''; + item.cityName = item.appAdress; + }); + } + } + }); + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } + +} diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts new file mode 100644 index 00000000..f4216c85 --- /dev/null +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -0,0 +1,28 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class ReportingService extends BaseService { + + $api_get_order_reporting_page = `/api/sdc/regulation/list/queryPage`; // 订单上报-列表 + $api_upload_order_reporting = `/api/sdc/regulation/push`; // 上传订单上报 + $api_recall_order_reporting = `/api/sdc/regulation/withdraw`; // 撤回上传订单上报 + $api_async_export_order_reporting_list = ``; // 导出订单上报 + $api_get_upload_setting = `/api/sdc/regulation/getPushConfig`; // 获取上传设置 + $api_upload_setting_save = `/api/sdc/regulation/setPushConfig`; // 保存上传设置 + $api_get_order_valid_result = `/api/sdc/regulation/queryPage/checkRes`;//订单上报-校验结果 + $api_update_order_data = `/api/sdc/regulation/renewalOrderById`;//订单批量更新订单数据 + + $api_get_fund_reporting_page = `/api/fcc/fundUploadHead/list/page`; // 资金上报列表 + $api_fund_reporting_upload = `/api/fcc/fundUploadHead/uploadFundNumber`; // 资金批量上传 + $api_fund_reporting_recall = `/api/fcc/fundUploadHead/recallUploadFundNumber`; //资金批量撤回 + $api_get_fund_valid_result = `/api/fcc/capitalFieldCheck/getCapitalFieldCheckList`; // 查询资金校验表 + $api_update_fund_data = `/api/fcc/fundUploadHead/updateUploadFundNumber`;//资金批量更新数据 + + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/datatable/services/data.service.ts b/src/app/routes/datatable/services/data.service.ts new file mode 100644 index 00000000..e7443148 --- /dev/null +++ b/src/app/routes/datatable/services/data.service.ts @@ -0,0 +1,122 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 10:30:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 15:07:27 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\services\\data.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { map } from 'rxjs/operators'; +import { BaseService } from 'src/app/shared/services/core/base.service'; +import { EAFileUtil } from 'src/app/shared/utils/file.util'; + +@Injectable({ + providedIn: 'root', +}) +export class DataService extends BaseService { + + // 查询运营报表 + $api_listOperationalReportPage = `/api/sdc/report/listOperationalReportPage`; + // 查询业绩报表 + $api_listPerformanceReportPage = `/api/sdc/report/listPerformanceReportPage`; + // 运营报表运单状态分布 + $api_operationalReportWaybillStatusDistribution = `/api/sdc/report/operationalReportWaybillStatusDistribution`; + // 运营报表柱状图 + $api_operationalReportHistogram = `/api/sdc/report/operationalReportHistogram`; + // 获取网络货运人 + $api_get_network_freight_forwarder_list = `/api/mdc/cuc/networkTransporter/findAll`; + // 业绩报表柱状图 + $api_performanceReportHistogram = `/api/sdc/report/performanceReportHistogram`; + + // 查询开票数据报表 + $api_findInvoiceReport = `/api/fcc/invoiceReport/findInvoiceReport`; + // 查询开票数据报表 + $api_listFinancialReportPage = `/api/sdc/report/listFinancialReportPage`; + + + // 查询货主报表 + $api_listShipperReportPage = `/api/sdc/report/listShipperReportPage`; + // 司机报表 + $api_listDriverReportPage = `/api/sdc/report/listDriverReportPage`; + // 财务报表柱状图 + $api_financialReportHistogram = `/api/sdc/report/financialReportHistogram`; + // 合规监控报表-运费直付占比 + $api_getBillRateDirectPayment = `/api/sdc/reportComplianceMonitor/getBillRateDirectPayment`; + // 合规监控报表-货源单占比 + $api_getBillRateProportion = `/api/sdc/reportComplianceMonitor/getBillRateProportion`; + // 合规监控报表-订单合格率 + $api_getBillRateQualified = `/api/sdc/reportComplianceMonitor/getBillRateQualified`; + // 合规监控报表-付款及时率 + $api_getBillTimelyPayment = `/api/sdc/reportComplianceMonitor/getBillTimelyPayment`; + // 合规监控报表-监控报表(折线图) + $api_listMonitorSituation = `/api/sdc/reportComplianceMonitor/listMonitorSituation`; + + + // 客户报表-根据类型获取统计信息(card) + $api_statistics_total = `/api/mdc/cuc/statistics/total`; + // 客户报表-根据类型获取统计明细信息(table) + $api_statistics_totalDetail = `/api/mdc/cuc/statistics/totalDetail`; + // 客户报表-根据类型获取统计图表信息 + $api_statistics_totalAdd = `/api/mdc/cuc/statistics/totalAdd`; + + + // 数据大屏-本年全年交易情况 + $api_getAnnualTransactions = `/api/sdc/reportDataLargeScreen/getAnnualTransactions`; + // 数据大屏-客户统计(货主,合伙人,司机,车辆) + $api_getCustomerStatistics = `/api/sdc/reportDataLargeScreen/getCustomerStatistics`; + // 数据大屏-实时货源 + $api_getRealTimeSupply = `/api/sdc/reportDataLargeScreen/getRealTimeSupply`; + // 数据大屏-实时运单风控 + $api_getRealTimeWaybillRiskControl = `/api/sdc/reportDataLargeScreen/getRealTimeWaybillRiskControl`; + // 数据大屏-本月发货量排名 + $api_getShipmentRanking = `/api/sdc/reportDataLargeScreen/getShipmentRanking`; + // 数据大屏-今日交易情况 + $api_getTradingToday = `/api/sdc/reportDataLargeScreen/getTradingToday`; + // 数据大屏-本月交易趋势 + $api_getTradingTrend = `/api/sdc/reportDataLargeScreen/getTradingTrend`; + // 数据大屏-交易额(今日,本月,累计) + $api_getTransactionAmount = `/api/sdc/reportDataLargeScreen/getTransactionAmount`; + // 数据大屏-交易分布 + $api_getTransactionDistribution = `/api/sdc/reportDataLargeScreen/getTransactionDistribution`; + + + + constructor(public injector: Injector) { + super(injector); + } + + /** +* 获取网络货运人 +* @returns +*/ + getNetworkFreightForwarder(params = {}, containerAll = false) { + return this.request(this.$api_get_network_freight_forwarder_list, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const list = res.map((item: any) => { + return { + label: item.enterpriseName, + value: item.id + }; + }); + const obj = []; + if (containerAll) { + obj.push({ label: '全部', value: '' }); + } + return [...obj, ...list]; + }) + ); + } + + getPerformanceReportHistogram(params = {}) { + return this.request(this.$api_performanceReportHistogram, params) + } +} diff --git a/src/app/routes/demo/components/alian-demo/alian-demo.component.html b/src/app/routes/demo/components/alian-demo/alian-demo.component.html deleted file mode 100644 index e2acb3be..00000000 --- a/src/app/routes/demo/components/alian-demo/alian-demo.component.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -
    -
    - -
    -
    - - - - -
    -
    - - - - -
      -
    • 删除
    • -
    • 批量审批
    • -
    -
    -
    -
    - - - 已选择 - {{ selectedRows.length }} 项   服务调用总计 {{ - totalCallNo }} 万 - 清空 - - -
    - - -
    \ No newline at end of file diff --git a/src/app/routes/demo/components/alian-demo/alian-demo.component.ts b/src/app/routes/demo/components/alian-demo/alian-demo.component.ts deleted file mode 100644 index 0dbbe39c..00000000 --- a/src/app/routes/demo/components/alian-demo/alian-demo.component.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { STComponent, STColumn, STChange } from '@delon/abc/st'; -import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; -import { _HttpClient, ModalHelper } from '@delon/theme'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { DemoService } from '../../services/demo.service'; -import { DemoEditComponent } from '../zorro-demo/edit/edit.component'; - -@Component({ - selector: 'app-alian-demo', - templateUrl: './alian-demo.component.html', - styleUrls: ['./alian-demo.component.less'] -}) -export class AlianDemoComponent implements OnInit { - url = `/rule?_allow_anonymous=true`; - - status = [ - { index: 0, text: '关闭', value: false, type: 'default', checked: false }, - { - index: 1, - text: '运行中', - value: false, - type: 'processing', - checked: false - }, - { index: 2, text: '已上线', value: false, type: 'success', checked: false }, - { index: 3, text: '异常', value: false, type: 'error', checked: false } - ]; - @ViewChild('st', { static: true }) - st!: STComponent; - @ViewChild('sf', { static: false }) - sf!: SFComponent; - columns: STColumn[] = [ - { title: '', index: 'key', type: 'checkbox' }, - { title: '规则编号', index: 'no' }, - { title: '描述', index: 'description' }, - { - title: '服务调用次数', - index: 'callNo', - type: 'number', - format: item => `${item.callNo} 万`, - sort: { - compare: (a, b) => a.callNo - b.callNo - } - }, - { - title: '状态', - index: 'status', - render: 'status', - filter: { - menus: this.status, - fn: (filter, record) => record.status === filter.index - } - }, - { - title: '更新时间', - index: 'updatedAt', - type: 'date', - sort: { - compare: (a, b) => a.updatedAt - b.updatedAt - } - }, - { - title: '操作', - buttons: [ - { - text: '修改', - click: item => this.edit(item) - }, - { - text: '删除', - click: item => this.delete(item) - } - ] - } - ]; - searchSchema: SFSchema = { - properties: { - expand: { - type: 'boolean', - ui: { - hidden: true - } - }, - orderSn: { - type: 'string', - title: '订单号', - ui: { - autocomplete: 'off' - } - }, - receiveName: { - type: 'string', - title: '收件人' - }, - receiveMobile: { - type: 'string', - title: '收件人电话' - }, - tenantName: { - type: 'string', - title: '下单商家', - ui: { - visibleIf: { - expand: (value: boolean) => value - } - } - }, - createTime: { - title: '下单时间', - type: 'string', - ui: { - widget: 'date', - mode: 'range', - format: 'yyyy-MM-dd', - visibleIf: { - expand: (value: boolean) => value - } - } as SFDateWidgetSchema - } - } - }; - - ui: SFUISchema = { - '*': { - spanLabelFixed: 90, - grid: { span: 8, gutter: 4 } - }, - $orderSn: { - grid: { span: 8 } - }, - $receiveName: { - grid: { span: 8 } - }, - $createTime: { grid: { span: 8 } } - }; - _$expand = false; - - selectedRows: any[] = []; - totalCallNo = 0; - constructor(public service: DemoService, public msg: NzMessageService, private modal: ModalHelper) {} - - ngOnInit(): void {} - - stChange(e: STChange): void { - switch (e.type) { - case 'checkbox': - this.selectedRows = e.checkbox!; - this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.callNo, 0); - break; - case 'filter': - this.st.load(); - break; - } - } - - remove(): void { - this.service.request('/delete/rule?_allow_anonymous=true', { nos: this.selectedRows.map(i => i.no).join(',') }).subscribe(() => { - this.st.load(); - this.st.clearCheck(); - }); - } - - approval(): void { - this.msg.success(`审批了 ${this.selectedRows.length} 笔`); - } - - add(): void { - this.modal.createStatic(DemoEditComponent, { i: { id: 0 } }).subscribe(res => { - if (res) { - console.log(res); - } - }); - } - - edit(item: any) { - this.modal - .createStatic(DemoEditComponent, { i: { no: 1, owner: '22222', callNo: 111, status: 1, description: '222' } }) - .subscribe(res => { - if (res) { - this.st.setRow(item, res); - } - }); - } - - delete(item: any) { - this.st.removeRow(item); - } - - /** - * 重置表单 - */ - resetSF() { - this.sf.reset(); - this._$expand = false; - } - - /** - * 伸缩查询条件 - */ - expandToggle() { - this._$expand = !this._$expand; - this.sf?.setValue('/expand', this._$expand); - } -} diff --git a/src/app/routes/demo/components/zorro-demo/edit/edit.component.html b/src/app/routes/demo/components/zorro-demo/edit/edit.component.html deleted file mode 100644 index 97f50494..00000000 --- a/src/app/routes/demo/components/zorro-demo/edit/edit.component.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/src/app/routes/demo/components/zorro-demo/edit/edit.component.ts b/src/app/routes/demo/components/zorro-demo/edit/edit.component.ts deleted file mode 100644 index 989ed27f..00000000 --- a/src/app/routes/demo/components/zorro-demo/edit/edit.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { SFSchema, SFUISchema } from '@delon/form'; -import { _HttpClient } from '@delon/theme'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalRef } from 'ng-zorro-antd/modal'; - -@Component({ - selector: 'app-demo-edit', - templateUrl: './edit.component.html', -}) -export class DemoEditComponent implements OnInit { - record: any = {}; - i: any; - schema: SFSchema = { - properties: { - no: { type: 'string', title: '编号' }, - owner: { type: 'string', title: '姓名', maxLength: 15 }, - callNo: { type: 'number', title: '调用次数' }, - status: { type: 'number', title: '链接' }, - description: { type: 'string', title: '描述', maxLength: 140 }, - }, - required: ['owner', 'callNo', 'description'], - }; - ui: SFUISchema = { - '*': { - spanLabelFixed: 100, - grid: { span: 12 }, - }, - $no: { - widget: 'text' - }, - $href: { - widget: 'string', - }, - $description: { - widget: 'textarea', - grid: { span: 24 }, - }, - }; - - constructor( - private modal: NzModalRef, - private msgSrv: NzMessageService, - public http: _HttpClient, - ) {} - - ngOnInit(): void { - if (this.record.id > 0) - this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res)); - } - - save(value: any): void { - this.modal.close(value); - // this.http.post(`/user/${this.record.id}`, value).subscribe(res => { - // this.msgSrv.success('保存成功'); - // this.modal.close(true); - // }); - } - - close(): void { - this.modal.destroy(); - } -} diff --git a/src/app/routes/demo/components/zorro-demo/zorro-demo.component.html b/src/app/routes/demo/components/zorro-demo/zorro-demo.component.html deleted file mode 100644 index ec55f6ee..00000000 --- a/src/app/routes/demo/components/zorro-demo/zorro-demo.component.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -
    -
    -
    - - 规则编号 - - - - -
    -
    - - 使用状态 - - - - - - - -
    -
    - - 调用次数 - - - - -
    -
    - - 更新日期 - - - - -
    -
    - - 使用状态 - - - - - - - -
    -
    - - - - - {{ expandForm ? '收起' : '展开' }} - - -
    -
    -
    - - - - - -
      -
    • 删除
    • -
    • 批量审批
    • -
    -
    -
    -
    - - - 已选择 - {{ selectedRows.length }} 项   服务调用总计 {{ - totalCallNo }} 万 - 清空 - - -
    - - - - - - - No - Name - Description - Option - - - - - - - {{ data.no }} - {{ data.callNo }} - {{ data.description }} - - Edit - - Delete - - - - -
    - - - - - - 描述 - - - - - \ No newline at end of file diff --git a/src/app/routes/demo/components/zorro-demo/zorro-demo.component.ts b/src/app/routes/demo/components/zorro-demo/zorro-demo.component.ts deleted file mode 100644 index cef1b137..00000000 --- a/src/app/routes/demo/components/zorro-demo/zorro-demo.component.ts +++ /dev/null @@ -1,161 +0,0 @@ -import { ChangeDetectorRef, Component, OnInit, TemplateRef } from '@angular/core'; -import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { map, tap } from 'rxjs/operators'; -import { DemoService } from '../../services/demo.service'; - -@Component({ - selector: 'app-zorro-demo', - templateUrl: './zorro-demo.component.html', - styleUrls: ['./zorro-demo.component.less'] -}) -export class ZorroDemoComponent implements OnInit { - data: any[] = []; - loading = false; - expandForm = false; - - q: { - pi: number; - ps: number; - no: string; - sorter: string; - status: number | null; - statusList: NzSafeAny[]; - } = { - pi: 1, - ps: 10, - no: '', - sorter: '', - status: null, - statusList: [] - }; - - status = [ - { index: 0, text: '关闭', value: false, type: 'default', checked: false }, - { - index: 1, - text: '运行中', - value: false, - type: 'processing', - checked: false - }, - { index: 2, text: '已上线', value: false, type: 'success', checked: false }, - { index: 3, text: '异常', value: false, type: 'error', checked: false } - ]; - - selectedRows: any[] = []; - totalCallNo = 0; - description: string = ''; - checkedAll = false; - indeterminate = false; - constructor( - private service: DemoService, - public msg: NzMessageService, - private modalSrv: NzModalService, - private cdr: ChangeDetectorRef - ) {} - - ngOnInit(): void { - this.getData(); - } - - getData(): void { - this.loading = true; - this.q.statusList = this.status.filter(w => w.checked).map(item => item.index); - if (this.q.status !== null && this.q.status > -1) { - this.q.statusList.push(this.q.status); - } - this.service - .request('/rule?_allow_anonymous=true', this.q) - .pipe( - map((list: Array<{ status: number; statusText: string; statusType: string }>) => - list.map(i => { - const statusItem = this.status[i.status]; - i.statusText = statusItem.text; - i.statusType = statusItem.type; - return i; - }) - ), - tap(() => (this.loading = false)) - ) - .subscribe(res => { - this.data = res; - }); - } - - action(tpl: TemplateRef<{}>, data?: any): void { - if (data) { - this.description = data.description; - } - this.modalSrv.create({ - nzTitle: '新建规则', - nzContent: tpl, - nzOnOk: () => { - this.loading = true; - - // this.http.post('/rule', { description: this.description }).subscribe(() => this.getData()); - if (data) { - Object.assign(data, { description: this.description }); - } else { - this.data.push({ - checked: false, - key: this.data.length, - callNo: 111, - description: this.description - }); - this.data = [...this.data]; - } - setTimeout(() => { - this.loading = false; - }, 1000); - } - }); - } - - remove(): void { - this.service.request('/delete/rule?_allow_anonymous=true', { nos: this.selectedRows.map((i: any) => i.no).join(',') }).subscribe(() => { - this.getData(); - this.clearCheck(); - }); - } - - deleteAction(item: any) { - this.data = this.data.filter(({ no }) => no !== item.no); - } - - approval(): void { - this.msg.success(`审批了 ${this.selectedRows.length} 笔`); - } - - onAllChecked(checked: boolean): void { - this.data.filter(({ disabled }) => !disabled).forEach(item => (item.checked = checked)); - this.selectedRows = this.data.filter(({ checked }) => checked); - } - - onItemChecked(checked: boolean, item: any): void { - if (checked) { - this.selectedRows.push(item); - } else { - this.selectedRows = this.selectedRows.filter(({ no }) => no !== item.no); - } - this.refreshCheckedStatus(); - } - - refreshCheckedStatus(): void { - this.checkedAll = this.data.every(item => item.checked); - this.indeterminate = this.data.some(item => item.checked) && !this.checkedAll; - } - - clearCheck() { - this.data.forEach(item => (item.checked = false)); - this.selectedRows = []; - this.checkedAll = false; - this.indeterminate = false; - } - - reset(): void { - // wait form reset updated finished - setTimeout(() => this.getData()); - } -} diff --git a/src/app/routes/demo/demo-routing.module.ts b/src/app/routes/demo/demo-routing.module.ts deleted file mode 100644 index 2f6625d7..00000000 --- a/src/app/routes/demo/demo-routing.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { AlianDemoComponent } from './components/alian-demo/alian-demo.component'; -import { ZorroDemoComponent } from './components/zorro-demo/zorro-demo.component'; - -const routes: Routes = [ - { path: 'zorro', component: ZorroDemoComponent }, - { path: 'alain', component: AlianDemoComponent }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class DemoRoutingModule { } diff --git a/src/app/routes/demo/demo.module.ts b/src/app/routes/demo/demo.module.ts deleted file mode 100644 index b1828a1e..00000000 --- a/src/app/routes/demo/demo.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule, Type } from '@angular/core'; -import { SharedModule } from '@shared'; -import { AlianDemoComponent } from './components/alian-demo/alian-demo.component'; -import { DemoEditComponent } from './components/zorro-demo/edit/edit.component'; - -import { ZorroDemoComponent } from './components/zorro-demo/zorro-demo.component'; -import { DemoRoutingModule } from './demo-routing.module'; - -const COMPONENTS: Array> = [DemoEditComponent, ZorroDemoComponent, AlianDemoComponent]; - -@NgModule({ - imports: [SharedModule, DemoRoutingModule], - declarations: COMPONENTS -}) -export class DemoModule {} diff --git a/src/app/routes/download/components/list/list.component.html b/src/app/routes/download/components/list/list.component.html new file mode 100644 index 00000000..40d662a6 --- /dev/null +++ b/src/app/routes/download/components/list/list.component.html @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/download/components/list/list.component.ts b/src/app/routes/download/components/list/list.component.ts new file mode 100644 index 00000000..05f38c4c --- /dev/null +++ b/src/app/routes/download/components/list/list.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { DownloadService } from '../../services/download.service'; + +@Component({ + selector: 'app-download-center-components-list', + templateUrl: './list.component.html' +}) +export class DownloadComponentsListComponent implements OnInit { + ui: SFUISchema = {}; + schema: SFSchema = {}; + columns: STColumn[] = []; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor(public service: DownloadService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {} + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { ...params, createTime: params?.createTime?.start, applyEndTime: params?.createTime?.end }; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', + ui: { hidden: true } + }, + createTime: { + type: 'string', + title: '创建时间', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '文件名称', index: 'dataSourcesDetail', className: 'text-center' }, + { title: '文件来源', index: 'dataSources', className: 'text-center' }, + { title: '文件大小', index: 'dataSize', width: '120px', className: 'text-center' }, + { + title: '生成状态', + index: 'status', + width: '120px', + className: 'text-center', + type: 'enum', + enum: { + 0: '生成中', + 1: '已完成', + 2: '失败' + } + }, + { title: '下载次数', index: 'downloadCount', width: '120px', className: 'text-center' }, + { title: '创建时间', index: 'createTime', width: '120px', className: 'text-center' }, + { title: '生成时间', index: 'completeTime', width: '180px', className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '170px', + className: 'text-center', + buttons: [{ text: '下载', click: _record => this.download(_record) }] + } + ]; + } + + /** + * 删除单个实例 + * @param record 记录实例 + */ + delOne(record: STData) { + const headers = [{ key: 'Content-Type', value: 'application/json' }]; + this.modal.confirm({ + nzTitle: '删除确认', + nzContent: `即将删除 当前行数据,请仔细核对,避免误操作!
    是否删除?
    `, + nzOnOk: () => + this.service.request(this.service.encodeUrlHeader(this.service.$api_del_many, headers), { fileKey: record.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('数据删除成功!'); + this.st?.reload(); + } + }) + }); + } + download(record: STData) { + const headers = [{ key: 'Content-Type', value: 'application/json' }]; + this.service.downloadFile( + this.service.encodeUrlHeader(this.service.$api_download_file, headers), + {}, + { fileKey: record.fileUniqueKey }, + 'POST' + ); + } +} diff --git a/src/app/routes/download/download-routing.module.ts b/src/app/routes/download/download-routing.module.ts new file mode 100644 index 00000000..6cd311bb --- /dev/null +++ b/src/app/routes/download/download-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { DownloadComponentsListComponent } from './components/list/list.component'; + +const routes: Routes = [ + { path: '', redirectTo: 'list', pathMatch: 'full' }, + { path: 'list', component: DownloadComponentsListComponent, data: { reuse: true } }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class DownloadRoutingModule {} diff --git a/src/app/routes/download/download.module.ts b/src/app/routes/download/download.module.ts new file mode 100644 index 00000000..a6b86c99 --- /dev/null +++ b/src/app/routes/download/download.module.ts @@ -0,0 +1,12 @@ +import { NgModule, Type } from '@angular/core'; +import { SharedModule } from '@shared'; +import { DownloadComponentsListComponent } from './components/list/list.component'; +import { DownloadRoutingModule } from './download-routing.module'; + +const COMPONENTS: Type[] = [DownloadComponentsListComponent]; + +@NgModule({ + imports: [SharedModule, DownloadRoutingModule], + declarations: COMPONENTS, +}) +export class DownloadModule {} diff --git a/src/app/routes/download/services/download.service.ts b/src/app/routes/download/services/download.service.ts new file mode 100644 index 00000000..12fcb323 --- /dev/null +++ b/src/app/routes/download/services/download.service.ts @@ -0,0 +1,18 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class DownloadService extends BaseService { + // 删除多个实例接口地址 + $api_del_many = '/scm/cms/cms/deleteRecordInfo/file'; + // 获取实例分页数据接口地址 + $api_get_page = '/api/mdc/pbc/asynExportInfo/getAsynExportInfoListPage'; + // 下载文件 + $api_download_file = '/api/mdc/pbc/download/file'; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.html b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.html new file mode 100644 index 00000000..cdae9762 --- /dev/null +++ b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.html @@ -0,0 +1,35 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.less b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.less new file mode 100644 index 00000000..c5f2b1ea --- /dev/null +++ b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.less @@ -0,0 +1,37 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } +} + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + max-width: 400px; + position : absolute; + right : 0; + bottom : 25px; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.ts b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.ts new file mode 100644 index 00000000..f1195aa0 --- /dev/null +++ b/src/app/routes/financial-management/components/abnormal-gold/abnormal-gold.component.ts @@ -0,0 +1,192 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; +import { ClearingModalComponent } from './clearing-modal/clearing-modal.component'; + +@Component({ + selector: 'app-abnormal-gold', + templateUrl: './abnormal-gold.component.html', + styleUrls: ['./abnormal-gold.component.less'] +}) +export class AbnormalGoldComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + return requestOptions; + }; + + refund(item: any) { + this.nzModalService.warning({ + nzTitle: '确定要将该笔款项原路退回?', + nzOnOk: () => {} + }); + } + + clearingAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '清分', + nzContent: ClearingModalComponent, + nzOnOk: com => { + return false; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + paySerialNumber: { + type: 'string', + title: '银行流水号', + ui: { + placeholder: '请输入' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: '' }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + }, + default: '' + }, + transferBankAccount: { + type: 'string', + title: '付款账户', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + transferBankCardNumber: { + type: 'string', + title: '付款账号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + transferBankOpenName: { + type: 'string', + title: '付款银行', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + transferDate: { + title: '转账时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '银行流水号', index: 'paySerialNumber', width: 150 }, + { title: '网络货运人', index: 'ltdId', width: 120 }, + { title: '银行类型', index: 'callNo', width: 100, type: 'enum', enum: { 1: '平安银行', 2: '浦发银行' } }, + { title: '资金总账号', index: 'callNo', width: 120 }, + { title: '充值金额', index: 'rechargeAmount', width: 100 }, + { title: '付款账户', index: 'transferBankAccount', width: 100 }, + { title: '付款账号', index: 'transferBankCardNumber', width: 100 }, + { title: '付款银行', index: 'transferBankOpenName', width: 100 }, + { title: '转账时间', index: 'transferDate', type: 'date', width: 150 }, + { title: '转账备注', index: 'rechargeRemark', width: 100 }, + { title: '操作人', index: 'rechargeName', width: 90 }, + { title: '操作时间', index: 'callNo', type: 'date', width: 150 }, + { title: '状态', index: 'callNo', width: 90 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { + text: '清分', + click: item => this.clearingAction(item) + }, + { + text: '退款', + click: item => this.refund(item) + }, + { + text: '查看', + click: item => this.router.navigate(['/financial-management/withdrawals-record/detail/1']) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.html b/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.html new file mode 100644 index 00000000..fd8c045d --- /dev/null +++ b/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.less b/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.ts b/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.ts new file mode 100644 index 00000000..592e7bc4 --- /dev/null +++ b/src/app/routes/financial-management/components/abnormal-gold/clearing-modal/clearing-modal.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { SFComponent, SFSchema, SFTextWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +const IMAGECONFIG = { + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +}; + +@Component({ + selector: 'app-clearing-modal', + templateUrl: './clearing-modal.component.html', + styleUrls: ['./clearing-modal.component.less'] +}) +export class ClearingModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 18 } + } + }; + + constructor( + private modal: NzModalRef, + public service: FreightAccountService, + public shipperservice: ShipperBaseService, + ) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '入账金额', + type: 'string', + ui: { + widget: 'text' + } as SFTextWidgetSchema, + default: '10000.00' + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value, + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + }, + }, + name3: { + title: '银行类型', + type: 'string', + ui: { + widget: 'text' + } as SFTextWidgetSchema, + default: '平安银行' + }, + receiveName: { + type: 'string', + title: '分配对象', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + licensePhotoWatermark: { + type: 'string', + title: '上传凭证', + ui: { + ...IMAGECONFIG, + change: args => { + if (args.type === 'success') { + this.sf.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + } + }, + required: ['name', 'name2', 'name3', 'receiveName'] + }; + } +} diff --git a/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.html b/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.html new file mode 100644 index 00000000..f61ad33d --- /dev/null +++ b/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.html @@ -0,0 +1,86 @@ + + + + + + + +
    +
    + + 基本信息 + + {{ costInfo?.ltdName }} + + + {{ costInfo?.banktypeLabel }} + + + {{ costInfo?.artoname }} + + + {{ costInfo?.cnoName }} + + + {{ costInfo?.ltdaccountId }} + + + {{ costInfo?.brmmoney |currency }} + + + {{ costInfo?.brmtypeLabel }} + + +
    +
    +
    + + + + + + + + {{index+1}} + + + + + + + + {{index+1}} + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.ts b/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.ts new file mode 100644 index 00000000..0ddf08f4 --- /dev/null +++ b/src/app/routes/financial-management/components/advance-collection/advance-collection-detail/advance-collection-detail.component.ts @@ -0,0 +1,150 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-advance-collection-detail', + templateUrl: './advance-collection-detail.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/basic-board.less'] +}) +export class AdvanceCollectionDetailComponent implements OnInit { + @ViewChild('inputST', { static: true }) + inputST!: STComponent; + columns: { [key: string]: STColumn[] } = this.initST(); + @ViewChild('infoST', { static: true }) + infoST!: STComponent; + costInfo: any = {}; + id: any = null; + + @ViewChild('sf', { static: false }) + inputSF!: SFComponent; + @ViewChild('sf', { static: false }) + infoSF!: SFComponent; + inputSearchSchema: SFSchema = this.initInputSF(); + infoSearchSchema: SFSchema = this.initInfoSF(); + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + this.loadDetail(this.id); + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + id: this.id + }); + return requestOptions; + }; + + loadDetail(id: any) { + this.service.request(this.service.$api_get_advance_collection_header, { id }).subscribe(res => { + if (res) { + this.costInfo = res; + } + }); + } + + /** + * 重置表单 + */ + resetInputSF() { + this.inputSF.reset(); + } + /** + * 重置表单 + */ + resetInfoSF() { + this.infoSF.reset(); + } + + goBack() { + history.go(-1); + } + + private initInputSF(): SFSchema { + return { + properties: { + feedate: { + title: '到账日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + billHCode: { + type: 'string', + title: '收款单号', + ui: { + placeholder: '请输入' + } + } + } + }; + } + + private initInfoSF(): SFSchema { + return { + properties: { + feedate: { + title: '核销日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + billHCode: { + type: 'string', + title: '核销单号', + ui: { + placeholder: '请输入' + } + } + } + }; + } + + private initST(): { [key: string]: STColumn[] } { + return { + input: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '收款单号', index: 'brmHCode', className: 'text-left', width: 200 }, + // { title: '到账日期', index: 'billHId', className: 'text-center', width: 150 }, + { + title: '到账金额', + index: 'yskmoney', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) }, + width: 140 + }, + { + title: '转预收金额', + index: 'yskmoney', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) }, + width: 140 + }, + // { title: '预收备注', index: 'callNo', width: 200 } + ], + info: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '核销单号', index: 'ahxcode', className: 'text-left', width: 200 }, + { title: '核销日期', index: 'ahxdate', className: 'text-center', width: 150 }, + { + title: '核销金额', + index: 'ahxmoney', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ahxmoney }) }, + width: 200 + }, + { title: '核销备注', index: 'remarks', className: 'text-left', width: 200 } + ] + }; + } +} diff --git a/src/app/routes/financial-management/components/advance-collection/advance-collection.component.html b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.html new file mode 100644 index 00000000..065f29b2 --- /dev/null +++ b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.html @@ -0,0 +1,28 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts new file mode 100644 index 00000000..57a658a1 --- /dev/null +++ b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts @@ -0,0 +1,164 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; + +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-advance-collection', + templateUrl: './advance-collection.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class AdvanceCollectionComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + _$expand = false; + + constructor(public service: FreightAccountService, private router: Router, private modal: NzModalService) {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount() + } + }, + arto: { + type: 'string', + title: '付款人', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }) + } + }, + brmtype: { + type: 'string', + title: '收款类型', + enum: [{ label: '全部', value: null }], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: null + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: null + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '网络货运人', width: 160, index: 'ltdName' }, + { title: '银行类型', width: 120, index: 'banktypeLabel' }, + { title: '收款账户', width: 150, index: 'ltdaccountId' }, + { title: '收款类型', width: 120, index: 'brmtypeLabel' }, + { + title: '预收余额', + index: 'yskmoney', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) } + }, + { title: '付款人', index: 'artoName', width: 180 }, + { title: '结算客户', index: 'cnoName', width: 150 }, + { + title: '操作', + width: 120, + className: 'text-center', + fixed: 'right', + buttons: [ + { + text: '浏览', + click: item => this.router.navigate([`/financial-management/advance-collection/detail/${item.id}`]) + } + // { + // text: '核销' + // }, + // { + // text: '退款' + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html new file mode 100644 index 00000000..976d3b4a --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html @@ -0,0 +1,150 @@ + + + + + + + +
    +
    + + 基本信息(应收费用) + + {{ costInfo?.ltdName }} + + + {{ costInfo?.feetypeLabel }} + + + {{ costInfo?.arremarks }} + + + {{ costInfo?.artoname }} + + + {{ costInfo?.arvattypeLabel }} + + + {{ costInfo?.armoeny | currency }} + + + {{ costInfo?.armoeny | currency }} + + + {{ costInfo?.armoeny | currency }} + + + + 基本信息(应付费用) + + {{ costInfo?.ltdName }} + + + {{ costInfo?.feetypeLabel }} + + {{ costInfo?.hrmoney | currency}} + + {{ costInfo?.hrremarks }} + + + {{ costInfo?.hrtoname }} + + + {{ costInfo?.hrvattypeLabel }} + + + {{ costInfo?.hrmoney | currency}} + + + {{ (costInfo?.hrvatmoney || 0) | currency }} + + + {{ costInfo?.hrmoney | currency}} + + +
    +
    +
    + + + + + + + {{ index + 1 }} + + + {{ costInfo?.artocode}}/{{ costInfo?.artonames}} + + + {{ item.armoney | currency}} + {{ item.hrmoney | currency}} + + + + {{ item.armoney | currency}} + {{ item.hrmoney | currency}} + + + {{ item.arkpmoney | currency}} + + + + {{costInfo.billTime}} + + + {{costInfo.cnoName}} + + + + + + + {{ item.armoney | currency}} + + + {{ item.vatmoney | currency}} + + + {{ index + 1 }} + + + + + + + {{ item.ahxmoney | currency}} + + + {{ item.ahxmoney | currency}} + + + {{ index + 1 }} + + 已核销 + + + + + + + + + {{ index + 1 }} + + + {{ item.phxmoney | currency}} + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.less b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.less new file mode 100644 index 00000000..aa2721f6 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.less @@ -0,0 +1,24 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + + .text-truncate { + white-space: normal; + } + + .ant-form-item { + margin-bottom: 0; + } + + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts new file mode 100644 index 00000000..981f1776 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn } from '@delon/abc/st'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-cost-management-detail', + templateUrl: './cost-management-detail.component.html', + styleUrls: ['./cost-management-detail.component.less'] +}) +export class CostManagementDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + columns: { [key: string]: STColumn[] } = this.initST(); + data = []; + textStatus: boolean = false; + costInfo: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + const id = route.snapshot.params.id; + this.loadDetail(id); + } + + ngOnInit(): void { + if (this.route.snapshot?.queryParams?.status === '应收') { + this.textStatus = false; + } else { + this.textStatus = true; + } + } + + loadDetail(id: any) { + this.service.request(this.service.$api_get_cost_detail, { id }).subscribe(res => { + if (res) { + this.costInfo = res; + } + }); + } + + goBack() { + history.go(-1); + } + + private initST(): { [key: string]: STColumn[] } { + return { + cost: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '费用明细号', index: 'feeHId', className: 'text-left', width: 200 }, + { title: '订单号', index: 'billHCode', className: 'text-left', width: 200 }, + { title: '订单日期', render: 'billTime', className: 'text-left', width: 200 }, + { title: '运单号', index: 'waybillHCode', className: 'text-left', width: 200 }, + { title: '运单日期', index: 'waybillDate', className: 'text-left', width: 200, format: _ => this.costInfo.billTime }, + { title: '结算客户', render: 'cnoName', className: 'text-left', width: 200 }, + { title: '订单费用类型', index: 'billLTypeLabel', className: 'text-left', width: 200 }, + { title: '费用科目', index: 'feeSubName', className: 'text-left', width: 200 }, + { + title: '税率', + index: 'arvatrate', + className: 'text-right', + width: 200, + format: item => `${item.arvatrate ? ((item.arvatrate as number) * 100).toFixed(2) : 0}%` + }, + { title: '费用金额', render: 'hrvatmoney', className: 'text-right', width: 200 }, + { title: '收/付款金额', render: 'armoney', className: 'text-right', width: 200 }, + { title: '开/收票金额', render: 'arkpmoney', className: 'text-right', width: 200 } + ], + requested: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '费用明细号', index: 'feeLId', className: 'text-left', width: 200 }, + { title: '发票申请', index: 'vatinvcode', className: 'text-left', width: 200 }, + { title: '发票类型', index: 'invoicetypeLabel', className: 'text-left', width: 200 }, + { title: '发票号', index: 'invoiceno', className: 'text-left', width: 200 }, + { title: '发票日期', index: 'invoicedate', className: 'text-left', width: 200 }, + { title: '发票状态', index: 'stsLabel', className: 'text-left', width: 200 }, + { title: '应收金额', render: 'armoney', className: 'text-left', width: 200 }, + { title: '开票金额', render: 'vatmoney', className: 'text-left', width: 200 } + ], + collection: [ + { title: '序号', render: 'no', width: 70 }, + { title: '费用明细号', index: 'feeLId', className: 'text-left', width: 200 }, + { title: '收款单号', index: 'ahxHId', className: 'text-left', width: 200 }, + { title: '收款日期', index: 'feedate', className: 'text-left', width: 200 }, + { title: '收款状态', render: 'status', className: 'text-left', width: 150 }, + { title: '应收金额', render: 'ahxmoney', className: 'text-left', width: 120 }, + { title: '收款金额', render: 'ahxmoney', className: 'text-left', width: 120 } + ], + ticket: [ + { title: '序号', render: 'no', width: 70 }, + { title: '费用明细号', index: 'callNo' }, + { title: '进项发票号', index: 'callNo' }, + { title: '发票类型', index: 'callNo' }, + { title: '发票日期', index: 'callNo' }, + { title: '认证日期', index: 'callNo' }, + { title: '发票状态', index: 'callNo' }, + { title: '应付金额', index: 'callNo' }, + { title: '收票金额', index: 'callNo' } + ], + payment: [ + { title: '序号', render: 'no', width: 70 }, + { title: '费用明细号', index: 'feeHCode' }, + { title: '付款单号', index: 'phxHId' }, + { title: '要求日期', index: 'billTime' }, + { title: '确认日期', index: 'feedate' }, + // { title: '付款状态', index: 'callNo' }, + { title: '应付金额', render: 'phxmoney' }, + { title: '付款金额', render: 'phxmoney' } + ] + }; + } +} diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.html b/src/app/routes/financial-management/components/cost-management/cost-management.component.html new file mode 100644 index 00000000..c9d36bdd --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.html @@ -0,0 +1,70 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    +
    + +
    +
    + + + {{ item.armoeny | currency }} + + + {{ item.hrmoney | currency }} + + {{ item.cnoCode }}/{{ item.cnoName }} + + {{ item.hrpaymoney | currency }} + + + {{ item.hrvatmoney | currency }} + + +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts new file mode 100644 index 00000000..33bacf25 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts @@ -0,0 +1,321 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-cost-management', + templateUrl: './cost-management.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class CostManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + searchSchema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + + selectedRows: any[] = []; + + _$expand = false; + + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + feedate: { + start: this.sf.value.feedate?.[0] || '', + end: this.sf.value.feedate?.[1] || '' + }, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + auditAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + modal.destroy(); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + routeTo(url: string, params?: any, status?: any) { + this.router.navigate([url], { queryParams: params }); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + feecode: { + type: 'string', + title: '费用单号', + ui: { placeholder: '请输入' } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { placeholder: '请输入' } + }, + waybillHCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入' + } + }, + feedate: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + feetype: { + type: 'string', + title: '费用类型', + enum: [ + { label: '全部', value: '' }, + { label: '应收', value: 1 }, + { label: '应付', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + feeSubId: { + type: 'string', + title: '费用科目', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + hrto: { + type: 'string', + title: '应付对象', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + visibleIf: { + expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + arto: { + type: 'string', + title: '应收对象', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + visibleIf: { + expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + ishrhx: { + type: 'string', + title: '应付核销', + enum: [ + { label: '全部', value: '' }, + { label: '否', value: 0 }, + { label: '是', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '费用单号', fixed: 'left', index: 'feecode', width: 200, className: 'text-left' }, + { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-left' }, + { title: '订单号', index: 'billHCode', width: 200, className: 'text-left' }, + { title: '运单号', index: 'waybillHCode', width: 200, className: 'text-left' }, + { title: '费用日期', index: 'feedate', width: 200, className: 'text-left' }, + { title: '费用类型', index: 'feetypeLabel', width: 150, className: 'text-center' }, + { title: '应付核销', index: 'ishrhx', width: 200, type: 'enum', enum: { 0: '否', 1: '是' }, className: 'text-left' }, + { title: '结算客户', render: 'artocode', width: 200, className: 'text-left' }, + { title: '应收对象', index: 'artoname', width: 200, className: 'text-left' }, + { title: '应付对象', index: 'hrtoname', width: 200, className: 'text-left' }, + { title: '应收金额', render: 'armoeny', width: 150, className: 'text-right' }, + { title: '应付金额', render: 'hrmoney', width: 150, className: 'text-right' }, + { title: '收/付款金额', render: 'hrpaymoney', width: 150, className: 'text-right' }, + { title: '开/收票金额', render: 'hrvatmoney', width: 150, className: 'text-right' }, + { title: '创建时间', index: 'createTime', type: 'date', width: 200, className: 'text-center' }, + { title: '状态', index: 'stsLabel', width: 120, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: '110px', + buttons: [ + { + text: '浏览', + click: item => this.routeTo('/financial-management/cost-management/detail/' + item.id, { status: item?.feetypeLabel }), + acl: { ability: ['FINANCIAL-COST-view'] } + }, + { + text: '审核', + click: item => this.auditAction(item), + iif: item => item.sts === 2, + acl: { ability: ['FINANCIAL-COST-audit'] } + } + // { + // text: '修改', + // click: item => this.router.navigate(['/financial-management/cost-management/expenses-receivable/1'], { queryParams: { id: 1 } }) + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html new file mode 100644 index 00000000..dcfc2646 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.html @@ -0,0 +1,56 @@ + + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less new file mode 100644 index 00000000..23d2c4ba --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts new file mode 100644 index 00000000..7706a93f --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-payable/expenses-payable.component.ts @@ -0,0 +1,152 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-expenses-payable', + templateUrl: './expenses-payable.component.html', + styleUrls: ['./expenses-payable.component.less'] +}) +export class ExpensesPayableComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema!: SFSchema; + columns: STColumn[] = this.initST(); + + id = null; + data: any[] = [ + { + id: 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + } + ]; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.queryParams.id; + if (this.id) { + this.schema = this.initSF({ page2: '天津怡亚通物流科技有限公司', pag2e21: '茅台集团' }); + } else { + this.schema = this.initSF(); + } + } + + ngOnInit(): void {} + + addRow() { + this.data.push({ + id: this.data.length + 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + }); + this.st.reload(); + } + + goBack() { + history.go(-1); + } + + private initSF(data?: any): SFSchema { + return { + properties: { + page2: { + type: 'string', + title: '网络货运人', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.page2 || '' + }, + pag2e21: { + title: '应付对象', + type: 'string', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.pag2e21 || '' + }, + dee: { + title: '', + type: 'string', + ui: { + widget: 'text' + }, + default: ' ' + }, + createTi2me: { + title: '费用日期', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema, + default: data?.createTi2me || '' + }, + pa2ge2: { + type: 'string', + title: '收票方式', + enum: [], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: data?.pa2ge2 || '' + }, + page: { + type: 'string', + title: '应付备注', + ui: { + placeholder: '请输入' + }, + default: data?.page || '' + } + }, + required: ['page2', 'pag2e21', 'createTi2me', 'pa2ge2'] + }; + } + + private initST(): STColumn[] { + return [ + { title: '结算客户', render: 'description1', width: 150 }, + { title: '费用科目', render: 'description2', width: 120 }, + { + title: '税率', + render: 'description3', + width: 120, + format: item => `${item.description3 ? ((item.description3 as number) * 100).toFixed(2) : 0}%` + }, + { title: '应付金额', render: 'num', width: 120 }, + { title: '备注', render: 'description5', width: 150 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 90, + buttons: [ + { + text: '删除', + click: item => { + this.st.removeRow(item); + this.data = this.data.filter(i => i.id !== item.id); + } + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html new file mode 100644 index 00000000..1fbc355f --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less new file mode 100644 index 00000000..23d2c4ba --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts new file mode 100644 index 00000000..b049fed3 --- /dev/null +++ b/src/app/routes/financial-management/components/cost-management/expenses-receivable/expenses-receivable.component.ts @@ -0,0 +1,152 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-expenses-receivable', + templateUrl: './expenses-receivable.component.html', + styleUrls: ['./expenses-receivable.component.less'] +}) +export class ExpensesReceivableComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema!: SFSchema; + columns: STColumn[] = this.initST(); + + id = null; + data: any[] = [ + { + id: 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + } + ]; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.queryParams.id; + if (this.id) { + this.schema = this.initSF({ page2: '天津怡亚通物流科技有限公司', pag2e21: '茅台集团' }); + } else { + this.schema = this.initSF(); + } + } + + ngOnInit(): void {} + + addRow() { + this.data.push({ + id: this.data.length + 1, + description1: '', + description2: '', + description3: '', + num: null, + description5: '' + }); + this.st.reload(); + } + + goBack() { + history.go(-1); + } + + private initSF(data?: any): SFSchema { + return { + properties: { + page2: { + type: 'string', + title: '网络货运人', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.page2 || '' + }, + pag2e21: { + title: '应收对象', + type: 'string', + enum: [], + ui: { + widget: data ? 'text' : 'select', + placeholder: '请选择' + }, + default: data?.pag2e21 || '' + }, + dee: { + title: '', + type: 'string', + ui: { + widget: 'text' + }, + default: ' ' + }, + createTi2me: { + title: '费用日期', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema, + default: data?.createTi2me || '' + }, + pa2ge2: { + type: 'string', + title: '开票方式', + enum: [], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: data?.pa2ge2 || '' + }, + page: { + type: 'string', + title: '应收备注', + ui: { + placeholder: '请输入' + }, + default: data?.page || '' + } + }, + required: ['page2', 'pag2e21', 'createTi2me', 'pa2ge2'] + }; + } + + private initST(): STColumn[] { + return [ + { title: '结算客户', render: 'description1', width: 150 }, + { title: '费用科目', render: 'description2', width: 120 }, + { + title: '税率', + render: 'description3', + width: 120, + format: item => `${item.description3 ? ((item.description3 as number) * 100).toFixed(2) : 0}%` + }, + { title: '应收金额', render: 'num', width: 120 }, + { title: '备注', render: 'description5', width: 150 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 90, + buttons: [ + { + text: '删除', + click: item => { + this.st.removeRow(item); + this.data = this.data.filter(i => i.id !== item.id); + } + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html new file mode 100644 index 00000000..3bef51eb --- /dev/null +++ b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts new file mode 100644 index 00000000..7b27f0bc --- /dev/null +++ b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts @@ -0,0 +1,195 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-driver-account-detail', + templateUrl: './driver-account-detail.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class DriverAccountDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + info: any = {}; + params: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.params = route.snapshot.queryParams; + } + + ngOnInit(): void { + this.loadInfo(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + ltdId: this.params.ltdId, + projectId: this.params.projectId, + enterpriseId: this.params.enterpriseId, + roleId: this.params.roleId, + bankType: this.params.bankType, + }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value?.createTime?.[0] || '', + end: this.sf.value?.createTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + loadInfo() { + this.service + .request(this.service.$api_get_driver_account_balance_detail, { + ...this.sf?.value, + ltdId: this.params.ltdId, + projectId: this.params.projectId, + enterpriseId: this.params.enterpriseId, + roleId: this.params.roleId, + pageIndex: this.st.pi, + pageSize: this.st.ps, + bankType: this.params.bankType, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }) + .subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + stChange(e: STChange): void {} + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + createTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + transactionNumber: { + type: 'string', + title: '流水号', + ui: { + placeholder: '请输入' + } + }, + businessNumber: { + type: 'string', + title: '关联单号', + ui: { + placeholder: '请输入' + } + }, + tradeType: { + type: 'string', + title: '交易类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'trade:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + incomeType: { + type: 'string', + title: '收支类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'income:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '交易时间', index: 'createTime', type: 'date', width: 150 }, + { title: '流水号', index: 'channelPaySn', width: 170 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 150 }, + { title: '交易单号', index: 'businessNumber' , width: 190}, + { title: '订单号', index: 'orderSn' , width: 190}, + { title: '运单号', index: 'transportSn', width: 190 }, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 150 }, + { + title: '交易金额', + index: 'amount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '账户余额', + index: 'accountBalance', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } + }, + { title: '付款方', index: 'payName', width: 150}, + { title: '收款方', index: 'incomeName', width: 150 }, + { title: '备注', index: 'tradeContent' , width: 150}, + ]; + } +} diff --git a/src/app/routes/financial-management/components/driver-account/driver-account.component.html b/src/app/routes/financial-management/components/driver-account/driver-account.component.html new file mode 100644 index 00000000..9fe32a52 --- /dev/null +++ b/src/app/routes/financial-management/components/driver-account/driver-account.component.html @@ -0,0 +1,32 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + {{ (parseFloat(item.availableBalance) + + parseFloat(item.freezeBalance)).toFixed(2) | currency}} + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/driver-account/driver-account.component.ts b/src/app/routes/financial-management/components/driver-account/driver-account.component.ts new file mode 100644 index 00000000..9d0545cc --- /dev/null +++ b/src/app/routes/financial-management/components/driver-account/driver-account.component.ts @@ -0,0 +1,228 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-driver-account', + templateUrl: './driver-account.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class DriverAccountComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + _$expand = false; + + constructor(public service: FreightAccountService, private router: Router, private modal: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { accountType: 2 }); + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + } + return requestOptions; + }; + + showAccountDetail(item: any) { + this.modal.create({ + nzTitle: '账户明细', + nzContent: AccountDetailComponent, + nzNoAnimation: true, + nzWidth: 600, + nzComponentParams: { + params: { accountType: 2, roleId: item.roleId }, + url: '/api/fcc/accountBalance/getDriverAccountBalanceDetailByOperator' + }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + this.service.asyncExport({ ...this.sf.value, pageSize: -1 }, this.service.$api_export_driver_account_page); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + userName: { + type: 'string', + title: '司机姓名', + ui: { placeholder: '请输入' } + }, + certificateNumber: { + type: 'string', + title: '证件号码', + ui: { placeholder: '请输入' } + }, + phone: { + type: 'string', + title: '手机号', + ui: { + placeholder: '请输入' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: null + }, + virtualAccount: { + type: 'string', + title: '虚拟账户', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '司机姓名', width: 140, index: 'name' }, + { title: '证件号码', width: 140, index: 'idNo' }, + { title: '手机号', width: 140, index: 'phone' }, + { title: '网络货运人', width: 180, index: 'ltdName' }, + { title: '银行类型', width: 120, index: 'bankTypeLabel' }, + { title: '虚拟账户', width: 140, index: 'virtualAccount' }, + { + title: '可用余额', + index: 'availableBalance', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.availableBalance }) } + }, + { + title: '冻结余额', + index: 'freezeBalance', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.freezeBalance }) } + }, + { + title: '本月累计提现金额', + index: 'withdrawBalance', + width: 160, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.withdrawBalance }) } + }, + { title: '账户总余额', render: 'availableBalance', className: 'text-right', width: 180 }, + { title: '创建时间', index: 'createTime', type: 'date', width: 150 }, + { title: '状态', index: 'stateDeletedLabel', width: 120 }, + { + title: '操作', + width: 120, + className: 'text-center', + fixed: 'right', + buttons: [ + { + text: '查看明细', + click: item => + this.router.navigate(['/financial-management/driver-account/detail/' + item.id], { + queryParams: { + name: item.name, + phone: item.phone, + ltdName: item.ltdName, + bankType: item.bankType, + projectId: item.projectId, + availableBalance: item.availableBalance, + enterpriseId: item.enterpriseId, + roleId: item.roleId, + ltdId: item.ltdId + } + }) + } + ] + } + ]; + } + + parseFloat(num: any) { + return parseFloat(num); + } +} diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html new file mode 100644 index 00000000..af8a0b5b --- /dev/null +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts new file mode 100644 index 00000000..410c7fac --- /dev/null +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts @@ -0,0 +1,228 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-freight-account-detail', + templateUrl: './freight-account-detail.component.html', + styleUrls: ['../../../../commom/less/box.less'] +}) +export class FreightAccountDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + info: any = {}; + params: any = {}; + static: any = {}; + _$expand = false; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private route: ActivatedRoute) { + this.params = route.snapshot.queryParams; + } + + ngOnInit(): void { + this.loadInfo(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + ltdId: this.params.ltdId, + projectId: this.params.projectId, + enterpriseId: this.params.enterpriseId, + roleId: this.params.roleId + }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf?.value.createTime?.[0] || '', + end: this.sf?.value.createTime?.[1] || '' + } + }); + } + this.loadStatistics(requestOptions.body); + return requestOptions; + }; + + loadInfo() { + this.service + .request(this.service.$api_get_shipper_account_balance_detail, { + ...this.sf?.value, + ltdId: this.params.ltdId, + projectId: this.params.projectId, + enterpriseId: this.params.enterpriseId, + roleId: this.params.roleId, + pageIndex: this.st.pi, + pageSize: this.st.ps, + createTime: { + start: this.sf?.value.createTime?.[0] || '', + end: this.sf?.value.createTime?.[1] || '' + } + }) + .subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + loadStatistics(params: any) { + this.service.request(this.service.$api_get_shipper_account_balance_detail, params).subscribe(res => { + if (res) { + this.static = res; + } + }); + } + + stChange(e: STChange): void {} + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + createTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + transactionNumber: { + type: 'string', + title: '流水号', + ui: { + placeholder: '请输入' + } + }, + businessNumber: { + type: 'string', + title: '交易单号', + ui: { + placeholder: '请输入' + } + }, + tradeType: { + type: 'string', + title: '交易类型', + enum: [ + { label: '全部', value: '' }, + { label: '整车订单退款', value: '1' }, + { label: '整车订单支付', value: '2' }, + { label: '提现失败退回', value: '3' }, + { label: '提现', value: '4' }, + { label: '充值', value: '5' }, + { label: '运货订单结算F', value: '5' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + incomeType: { + type: 'string', + title: '收支类型', + enum: [ + { label: '全部', value: '' }, + { label: '收入', value: '1' }, + { label: '支出', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + projectId: { + title: '所属项目', + type: 'string', + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getEnterpriseProject() + } as SFSelectWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '交易时间', index: 'createTime', type: 'date', width: 170 }, + { title: '流水号', index: 'transactionNumber', width: 170 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 140 }, + { title: '交易单号', index: 'businessNumber', width: 170 }, + { title: '订单号', index: 'orderSn', width: 170 }, + { title: '运单号', index: 'transportSn', width: 170 }, + { title: '货主', index: 'enterpriseName' , width: 170}, + { title: '所属项目', index: 'projectName' , width: 170}, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 140 }, + { + title: '交易金额', + index: 'amount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '账户余额', + index: 'accountBalance', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } + }, + { title: '付款方', index: 'payName' , width: 170}, + { title: '收款方', index: 'incomeName', width: 170 }, + { title: '备注', index: 'tradeContent', width: 170 } + ]; + } +} diff --git a/src/app/routes/financial-management/components/freight-account/freight-account.component.html b/src/app/routes/financial-management/components/freight-account/freight-account.component.html new file mode 100644 index 00000000..5dba1c89 --- /dev/null +++ b/src/app/routes/financial-management/components/freight-account/freight-account.component.html @@ -0,0 +1,32 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + {{ (parseFloat(item.availableBalance) + + parseFloat(item.freezeBalance)).toFixed(2) | currency}} + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/freight-account/freight-account.component.ts b/src/app/routes/financial-management/components/freight-account/freight-account.component.ts new file mode 100644 index 00000000..610f1efe --- /dev/null +++ b/src/app/routes/financial-management/components/freight-account/freight-account.component.ts @@ -0,0 +1,234 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { CurrencyService } from '@delon/util'; +import { CurrencyCNYPipe } from '@delon/util/pipes/currency/cny.pipe'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { parse } from 'path'; +import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-freight-account', + templateUrl: './freight-account.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class FreightAccountComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + searchSchema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + + selectedRows: any[] = []; + + _$expand = false; + + constructor(public service: FreightAccountService, private router: Router, private modal: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { accountType: 1 }); + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + } + return requestOptions; + }; + + showAccountDetail(item: any) { + this.modal.create({ + nzTitle: '账户明细', + nzContent: AccountDetailComponent, + nzNoAnimation: true, + nzWidth: 600, + nzComponentParams: { + params: { accountType: 1, roleId: item.roleId }, + url: '/api/fcc/accountBalance/getShipperAccountBalanceDetailByOperator' + }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + this.service.asyncExport({ ...this.sf.value, pageSize: -1 }, this.service.$api_export_shipper); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + tenantName: { + type: 'string', + title: '企业名称', + ui: { placeholder: '请输入' } + }, + userName: { + type: 'string', + title: '联系人', + ui: { placeholder: '请输入' } + }, + phone: { + type: 'string', + title: '联系人电话', + ui: { + placeholder: '请输入' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: null + }, + virtualAccount: { + type: 'string', + title: '虚拟账户', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '企业名称', width: 170, index: 'tenantName' }, + { title: '联系人', width: 120, index: 'name' }, + { title: '联系人电话', width: 140, index: 'phone' }, + { title: '网络货运人', width: 170, index: 'ltdName' }, + { title: '银行类型', width: 120, index: 'bankTypeLabel' }, + { title: '虚拟账户', width: 140, index: 'virtualAccount' }, + { + title: '可用余额', + index: 'availableBalance', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.availableBalance }) } + }, + { + title: '冻结余额', + index: 'freezeBalance', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.freezeBalance }) } + }, + { + title: '账户总余额', + render: 'description', + width: 140, + className: 'text-right' + }, + { title: '创建时间', index: 'createTime', type: 'date', width: 150 }, + { + title: '状态', + index: 'stateDeletedLabel', + width: 80 + }, + { + title: '操作', + width: 120, + className: 'text-center', + fixed: 'right', + buttons: [ + { + text: '查看明细', + click: item => + this.router.navigate(['/financial-management/freight-account/detail/' + item.id], { + queryParams: { + tenantName: item.tenantName, + ltdName: item.ltdName, + bankType: item.bankType, + availableBalance: item.availableBalance, + projectId: item.projectId, + enterpriseId: item.enterpriseId, + roleId: item.roleId, + ltdId: item.ltdId + } + }) + } + ] + } + ]; + } + + parseFloat(num: any) { + return parseFloat(num); + } +} diff --git a/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.html b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.html new file mode 100644 index 00000000..05929852 --- /dev/null +++ b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.html @@ -0,0 +1,95 @@ + + + + + + + + +
    +
    + + {{headerInfo?.ltdId}} + + + {{headerInfo?.cnoName}} + + + {{headerInfo?.shipperaccount}} + + + {{headerInfo?.phxmoney | currency}} + +
    +
    + + {{headerInfo?.phxdate}} + + + {{headerInfo?.driver2IdName}} + + + {{headerInfo?.ltdaccountId}} + + + {{headerInfo?.prmoney | currency}} + +
    +
    + + {{headerInfo?.banktype==='1'?'平安':'浦发'}} + + + {{headerInfo?.brmtypeLabel}} + + + {{headerInfo?.bankreceipt}} + + + {{headerInfo?.remarks}} + +
    +
    +
    + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + {{index+1}} + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.less b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.less new file mode 100644 index 00000000..aebf12ee --- /dev/null +++ b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.ts b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.ts new file mode 100644 index 00000000..939ea639 --- /dev/null +++ b/src/app/routes/financial-management/components/payable-order/payable-order-detail/payable-order-detail.component.ts @@ -0,0 +1,179 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-payable-order-detail', + templateUrl: './payable-order-detail.component.html', + styleUrls: ['./payable-order-detail.component.less', '../../../../commom/less/expend-but.less', '../../../../commom/less/box.less'], + providers: [CurrencyPipe] +}) +export class PayableOrderDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + id = null; + billHId = null; + headerInfo: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute, private currencyPipe: CurrencyPipe) { + this.id = route.snapshot.params.id; + this.billHId = route.snapshot.queryParams.billHId; + this.loadHeadInfo(); + } + + ngOnInit(): void {} + + loadHeadInfo() { + this.service.request(this.service.$api_get_fico_ph_header, { id: this.id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { phxHId: this.billHId }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + billTime: { + start: this.sf.value.billTime?.[0] || null, + end: this.sf.value.billTime?.[1] || null + }, + feedate: { + start: this.sf.value.feedate?.[0] || null, + end: this.sf.value.feedate?.[1] || null + } + }); + if (this.sf.value.billTime) { + Object.assign(requestOptions.body, { + billTime: { + start: this.sf.value.billTime?.[0] || null, + end: this.sf.value.billTime?.[1] || null + } + }); + } + if (this.sf.value.feedate) { + Object.assign(requestOptions.body, { + feedate: { + start: this.sf.value.feedate?.[0] || null, + end: this.sf.value.feedate?.[1] || null + } + }); + } + } + return requestOptions; + }; + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + feeHCode: { + type: 'string', + title: '费用单', + ui: { + placeholder: '请输入' + } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + feedate: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + billTime: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '序号', render: 'no', width: 80 }, + { title: '费用号', index: 'feeHCode', width: 140 }, + { title: '费用日期', index: 'feedate', type: 'date', width: 150 }, + { title: '订单号', index: 'billHCode', width: 140 }, + { title: '订单日期', index: 'billTime', width: 150 }, + { title: '费用类型', index: 'feetype', width: 90 }, + { title: '订单费用科目', index: 'billLTypeLabel', width: 100 }, + { title: '费用科目', index: 'feeSubIdName', width: 140 }, + { title: '结算客户', index: 'cnoName', width: 140 }, + { + title: '已收金额', + index: 'phxmoney', + width: 100, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.armoney || 0)}` + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/payable-order/payable-order.component.html b/src/app/routes/financial-management/components/payable-order/payable-order.component.html new file mode 100644 index 00000000..bc0c5c7b --- /dev/null +++ b/src/app/routes/financial-management/components/payable-order/payable-order.component.html @@ -0,0 +1,39 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payable-order/payable-order.component.ts b/src/app/routes/financial-management/components/payable-order/payable-order.component.ts new file mode 100644 index 00000000..65872e27 --- /dev/null +++ b/src/app/routes/financial-management/components/payable-order/payable-order.component.ts @@ -0,0 +1,272 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-payable-order', + templateUrl: './payable-order.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'], + providers: [CurrencyPipe] +}) +export class PayableOrderComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor( + public service: FreightAccountService, + private nzModalService: NzModalService, + private router: Router, + private currencyPipe: CurrencyPipe + ) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value?.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || null, + end: this.sf.value.createTime?.[1] || null + } + }); + } + if (this.sf.value?.ahxdate) { + Object.assign(requestOptions.body, { + ahxdate: { + start: this.sf.value.ahxdate?.[0] || null, + end: this.sf.value.ahxdate?.[1] || null + } + }); + } + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + phxcode: { + type: 'string', + title: '核销单号', + ui: { + placeholder: '请输入' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + bankreceipt: { + type: 'string', + title: '银行水单', + ui: { + placeholder: '请输入' + } + }, + brmtype: { + type: 'string', + title: '付款类型', + enum: [{ value: '1', label: '费用款项' }], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + driver2IdName: { + type: 'string', + title: '收款人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + type: 'string', + title: '核销状态', + enum: [ + { value: 1, label: '已核销' }, + { value: 0, label: '待核销' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + phxdate: { + title: '核销日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + feeHCode: { + type: 'string', + title: '费用号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + remarks: { + type: 'string', + title: '付款备注', + ui: { + autocomplete: 'off', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '核销单号', index: 'phxcode', type: 'link', width: 140 }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '核销日期', index: 'phxdate', type: 'date', width: 160 }, + { title: '付款账户', index: 'shipperaccount', width: 170 }, + { title: '收款账户', index: 'ltdaccountId', width: 170 }, + { + title: '核销金额', + index: 'phxmoney', + width: 120, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.phxmoney || 0)}` + }, + { + title: '应付金额', + index: 'prmoney', + width: 120, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.prmoney || 0)}` + }, + { title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 }, + { title: '付款类型', index: 'brmtype', type: 'enum', enum: { '1': '费用款项' }, width: 120 }, + { title: '收款人', index: 'driver2IdName', width: 120 }, + { title: '结算客户', index: 'cno', width: 120 }, + { title: '银行水单', index: 'bankreceipt', width: 120 }, + { title: '创建时间', index: 'createTime', width: 160 }, + // { title: '创建人', index: 'createUserIdLabel', width: 120 }, + { title: '核销状态', index: 'sts', type: 'enum', enum: { 0: '待核销', 1: '已核销' }, width: 120 }, + { title: '核销备注', index: 'remarks', width: 120 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { + text: '浏览', + click: item => + this.router.navigate(['/financial-management/payable-order/detail/' + item.id], { queryParams: { billHId: item.id } }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html new file mode 100644 index 00000000..3c575c32 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html @@ -0,0 +1,92 @@ + + + + + + + + +
    +
    + + {{headerInfo?.ltdName}} + + + {{headerInfo?.hrToLabel}} + + + {{headerInfo?.ltdAccountId}} + + + {{headerInfo?.ishrhxLabel}} + +
    +
    + + {{headerInfo?.payDate}} + + + {{headerInfo?.hrBankName}} - {{headerInfo?.hrBankNo}} + + + {{headerInfo?.payDate}} + + + {{headerInfo?.payRemarks}} + +
    +
    + + {{headerInfo?.payModeLabel}} + + + {{headerInfo?.payTypeLabel}} + + + {{headerInfo?.payMoney |currency}} + +
    +
    +
    + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.less b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.ts b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.ts new file mode 100644 index 00000000..c78211b7 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.ts @@ -0,0 +1,174 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-payment-order-detail', + templateUrl: './payment-order-detail.component.html', + styleUrls: ['./payment-order-detail.component.less'] +}) +export class PaymentOrderDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + id = null; + headerInfo: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + this.loadHeadInfo(); + } + + ngOnInit(): void {} + + loadHeadInfo() { + this.service.request(this.service.$api_get_payment_header, { id: this.id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + payHId: this.id, + billTime: { + start: this.sf.value.billTime?.[0] || null, + end: this.sf.value.billTime?.[1] || null + }, + feedate: { + start: this.sf.value.feedate?.[0] || null, + end: this.sf.value.feedate?.[1] || null + } + }); + } else { + Object.assign(requestOptions.body, { + payHId: this.id, + }); + } + return requestOptions; + }; + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + // feeHCode: { + // type: 'string', + // title: '费用单号', + // ui: { + // placeholder: '请输入' + // } + // }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + waybillHCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入' + } + }, + // feedate: { + // title: '费用日期', + // type: 'string', + // ui: { + // widget: 'sl-from-to-search', + // format: 'yyyy-MM-dd', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } as SFDateWidgetSchema + // }, + billTime: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + } as SFDateWidgetSchema + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '序号', render: 'billHCode', width: 80 }, + // { title: '费用号', index: 'feeHCode', width: 100 }, + // { title: '费用日期', index: 'feedate', type: 'date', width: 150 }, + { title: '订单号', index: 'billHCode', width: 100 }, + { title: '订单日期', index: 'billTime', width: 150 }, + { title: '结算客户', index: 'cnoName', width: 90 }, + { title: '费用科目', index: 'feeSubId', width: 100 }, + { + title: '收票金额', + index: 'paymoney', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) } + }, + { + title: '收票税额', + index: 'invtax', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invtax }) } + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/payment-order/payment-order.component.html b/src/app/routes/financial-management/components/payment-order/payment-order.component.html new file mode 100644 index 00000000..aec490c7 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-order/payment-order.component.html @@ -0,0 +1,39 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + +
    + +
    + 已选择 + {{ selectedRows.length }} 张单 + 清空 +
    +
    + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payment-order/payment-order.component.ts b/src/app/routes/financial-management/components/payment-order/payment-order.component.ts new file mode 100644 index 00000000..93bb090b --- /dev/null +++ b/src/app/routes/financial-management/components/payment-order/payment-order.component.ts @@ -0,0 +1,275 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; +import { TicketService } from 'src/app/routes/ticket-management/services/ticket.service'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-payment-order', + templateUrl: './payment-order.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class PaymentOrderComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) { } + + ngOnInit(): void { } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + let params = { ...this.sf.value }; + if (params.payDate) { + const payDate = { start: this.sf?.value?.payDate?.[0], end: this.sf?.value?.payDate?.[1] } + params.payDate = payDate; + } + if (params.payDate2) { + const payDate2 = { start: this.sf?.value?.payDate2?.[0], end: this.sf?.value?.payDate2?.[1] } + params.payDate2 = payDate2; + } + if (params.createTime) { + const createTime = { start: this.sf?.value?.createTime?.[0], end: this.sf?.value?.createTime?.[1] } + params.createTime = createTime; + } + Object.assign(requestOptions.body, params); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addInvoice() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择付款单'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '付款单', + nzContent: AddCollectionInvoiceModalComponent, + nzComponentParams: { i: { userId: 0 } }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + paycode: { + type: 'string', + title: '付款单号', + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: null + }, + // orderS2n: { + // type: 'string', + // title: '付款状态', + // ui: { + // widget: 'dict-select', + // containsAllLable: true, + // params: { dictKey: 'refund:apply:status' }, + // placeholder: '请选择' + // } + // }, + paytype: { + type: 'string', + title: '付款类型', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:type' }, + placeholder: '请选择', + } + }, + paymode: { + type: 'string', + title: '付款方式', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + arto: { + type: 'string', + title: '收款人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + payDate: { + title: '要求付款日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + payDate2: { + title: '确认日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + waybillCode: { + type: 'string', + title: '运单号', + ui: { + visibleIf: { + expand: (value: boolean) => value + } + } + }, + // feeCode: { + // type: 'string', + // title: '费用号', + // ui: { + // visibleIf: { + // expand: (value: boolean) => value + // } + // } + // }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + payRemarks: { + type: 'string', + title: '付款备注', + ui: { + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', fixed: 'left', className: 'text-center' }, + { title: '付款单号', index: 'payCode', type: 'link', width: 180 }, + { title: '网络货运人', index: 'ltdName', width: 180 }, + { title: '运单号', index: 'waybillCode', width: 180 }, + // { title: '费用号', index: 'feeCode', width: 180 }, + { title: '要求付款日期', index: 'payDate', type: 'date', className: 'text-center', width: 150 }, + { + title: '付款金额', + index: 'payMoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payMoney }) } + }, + { title: '付款类型', index: 'payTypeLabel', width: 130 }, + { title: '付款方式', index: 'payModeLabel', width: 130 }, + { title: '结算客户', index: 'cnoName', width: 160 }, + { title: '收款人', index: 'hrToLabel', width: 150 }, + { title: '应付已核销', index: 'ishrhxLabel', width: 150 }, + { title: '确认日期', index: 'payDate2', type: 'date', className: 'text-center', width: 150 }, + { title: '创建时间', index: 'payDate', type: 'date', className: 'text-center', width: 150 }, + { title: '创建人', index: 'createUserIdLabel', width: 160 }, + { title: '付款备注', index: 'payRemarks', width: 200 }, + { + title: '操作', + className: 'text-center', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '浏览', + click: item => this.router.navigate(['/financial-management/payment-order/detail/' + item.id]) + }, + // { + // text: '修改', + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.html b/src/app/routes/financial-management/components/payment-record/payment-record.component.html new file mode 100644 index 00000000..e5a74213 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.html @@ -0,0 +1,66 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + + {{ item?.orderPaymentCode }}
    {{ item?.paymentStatusLabel }} +
    + + + {{detail.costName}}:{{ detail.price | currency }}
    +
    +
    + + {{ item?.billCode }}
    {{item?.billStatusLabel }} +
    + + {{ item?.wayBillCode }}
    {{item?.wayBillStatusLabel }} +
    + + {{ item?.driverName }}
    {{ item?.driverTelephone }} {{ item?.driverLicencePlate }} +
    + + {{ item?.captainName }}
    {{ item?.captainTelephone }} +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.less b/src/app/routes/financial-management/components/payment-record/payment-record.component.less new file mode 100644 index 00000000..cd8c3436 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.less @@ -0,0 +1,41 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } + + .text-truncate { + white-space: normal; + } +} + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + max-width: 400px; + position : absolute; + right : 0; + bottom : 25px; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.ts b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts new file mode 100644 index 00000000..a41bc6e4 --- /dev/null +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts @@ -0,0 +1,302 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; +import { ClearingModalComponent } from '../abnormal-gold/clearing-modal/clearing-modal.component'; + +@Component({ + selector: 'app-payment-record', + templateUrl: './payment-record.component.html', + styleUrls: ['./payment-record.component.less'] +}) +export class PaymentRecordComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + paymentStatus: any = ''; + + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + applyDate: { + start: this.sf.value.applyDate?.[0] || '', + end: this.sf.value.applyDate?.[1] || '' + }, + handlerDate: { + start: this.sf.value.handlerDate?.[0] || '', + end: this.sf.value.handlerDate?.[1] || '' + }, + paymentStatus: this.paymentStatus || null + }); + } + return requestOptions; + }; + + changePaymentStatus(status?: string) { + this.paymentStatus = status || null; + this.st.load(1); + } + + refund(item: any) { + this.nzModalService.warning({ + nzTitle: '确定要关闭所选支付记录?', + nzOnOk: () => {} + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + orderPaymentCode: { + type: 'string', + title: '支付编号', + ui: { + placeholder: '请输入' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + resourceCode: { + type: 'string', + title: '货源编号', + ui: { + placeholder: '请输入' + } + }, + serviceType: { + type: 'string', + title: '服务类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + driver: { + type: 'string', + title: '承运司机', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + driverLicensePlate: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + captain: { + type: 'string', + title: '收款人', + ui: { + placeholder: '请输入收款人姓名/手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + isCaptain: { + type: 'string', + title: '车队长收款', + enum: [ + { label: '全部', value: '' }, + { label: '否', value: 0 }, + { label: '是', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + payType: { + type: 'string', + title: '支付类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'paybill:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + applyDate: { + title: '申请时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + handlerDate: { + title: '处理时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: '' }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '支付编号', render: 'orderPaymentCode', width: 200 }, + { + title: '支付金额', + render: 'payAmount', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payAmount }) } + }, + { + title: '运费明细', + render: 'amountDetails', + width: 160 + // format: item => { + // (item.amountDetails as Array).forEach(detail => { + // detail.surcharge = detail.price + (detail.surcharge || 0); + // }); + // console.log(item.amountDetails); + + // return ''; + // } + }, + { + title: '支付类型', + index: 'payTypeLabel', + width: 140 + }, + { title: '货主', index: 'enterpriseInfoName', width: 180 }, + { title: '订单号', render: 'billCode', width: 170 }, + { title: '运单号', render: 'wayBillCode', width: 170 }, + { title: '货源编号', index: 'resourceCode', width: 160 }, + { + title: '服务类型', + index: 'serviceTypeLabel', + width: 150 + }, + { title: '承运司机', render: 'driverId', width: 140 }, + { title: '收款人', render: 'captainName', width: 140 }, + { title: '银行类型', index: 'bankType', width: 150, type: 'enum', enum: { 1: '平安银行', 2: '浦发银行' } }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '申请时间', index: 'applyTime', width: 160 }, + { title: '申请人', index: 'applyUserName', width: 90 }, + { title: '处理时间', index: 'handlerTime', width: 180 }, + { title: '处理人', index: 'handlerUserName', width: 90 }, + { title: '退款状态', index: 'refundStatusLabel', width: 220 }, + { title: '备注', index: 'failCause', width: 250 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { + text: '关闭', + iif: item => item.paymentStatus === '4', + click: item => this.refund(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.html b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.html new file mode 100644 index 00000000..3fb082ed --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.html @@ -0,0 +1,68 @@ + + + + + + + +

    {{params?.ltdName}}

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts new file mode 100644 index 00000000..ed00c9f4 --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts @@ -0,0 +1,228 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; + +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-platform-account-detail', + templateUrl: './platform-account-detail.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class PlatformAccountDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + info: any = {}; + params: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.params = route.snapshot.queryParams; + } + + ngOnInit(): void { + this.loadInfo(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { ...this.params }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value?.createTime?.[0] || '', + end: this.sf.value?.createTime?.[1] || '' + } + }); + } + } + return requestOptions; + }; + + loadInfo() { + this.service + .request(this.service.$api_get_platform_account_header, { + ...this.sf?.value, + ...this.params, + pageIndex: this.st.pi, + pageSize: this.st.ps + }) + .subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + stChange(e: STChange): void {} + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + createTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + businessNumber: { + type: 'string', + title: '流水号', + ui: { + placeholder: '请输入' + } + }, + transactionNumber: { + type: 'string', + title: '交易单号', + ui: { + placeholder: '请输入' + } + }, + tradeType: { + type: 'string', + title: '交易类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'trade:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + channelSource: { + type: 'string', + title: '账户类型', + enum: [ + { value: '', label: '全部' }, + { value: '1', label: '货主账户' }, + { value: '2', label: '司机账户' }, + { value: '3', label: '运营商账户' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + incomeType: { + type: 'string', + title: '收支类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'income:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + enterpriseName: { + type: 'string', + title: '货主', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + projectName: { + type: 'string', + title: '所属项目', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '交易时间', index: 'createTime', type: 'date', width: 150 }, + { title: '流水号', index: 'channelPaySn', width: 170 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 130 }, + { title: '交易单号', index: 'transactionNumber', width: 190 }, + { title: '订单号', index: 'orderSn', width: 170 }, + { title: '运单号', index: 'businessNumber', width: 190 }, + { title: '账户类型', index: 'accountTypeLabel', className: 'text-center', width: 130 }, + { title: '账户名称', index: 'payName', className: 'text-center', width: 150 }, + { title: '所属项目', index: 'projectName', className: 'text-center', width: 150 }, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 130 }, + { + title: '交易金额', + index: 'amount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '账户余额', + index: 'accountBalance', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } + }, + { title: '付款方', index: 'payName', className: 'text-center', width: 150 }, + { title: '收款方', index: 'incomeName', className: 'text-center', width: 150 }, + { title: '备注', index: 'tradeContent', className: 'text-center', width: 150 } + ]; + } +} diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.html b/src/app/routes/financial-management/components/platform-account/platform-account.component.html new file mode 100644 index 00000000..0cda0ad8 --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.ts b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts new file mode 100644 index 00000000..87b42163 --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts @@ -0,0 +1,197 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-platform-account', + templateUrl: './platform-account.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class PlatformAccountComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + searchSchema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + + info: any = {}; + + static: any = {}; + constructor(public service: FreightAccountService, private router: Router, private nzModalService: NzModalService) {} + + ngOnInit(): void { + this.loadInfo(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + this.loadStatistics(requestOptions.body); + return requestOptions; + }; + + loadInfo() { + const params = {}; + if (this.sf) { + Object.assign(params, { ...this.sf.value }); + } + this.service.request(this.service.$api_get_platform_account_header, params).subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + loadStatistics(params: any) { + this.service.request(this.service.$api_get_platform_account_statistics, params).subscribe(res => { + if (res) { + this.static = res; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private initSF(): SFSchema { + return { + properties: { + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: null + }, + virtualAccount: { + type: 'string', + title: '虚拟账户', + ui: { + placeholder: '请输入' + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '网络货运人', index: 'ltdName', width: 180 }, + { title: '银行类型', index: 'bankTypeLabel', width: 120 }, + { title: '虚拟账户', index: 'virtualAccount', width: 160 }, + { + title: '平台账户可用余额', + index: 'availableBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.availableBalance }) } + }, + { + title: '平台账户冻结余额', + index: 'freezeBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.freezeBalance }) } + }, + { + title: '货主账户可用余额', + index: 'shipperAvailableBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.shipperAvailableBalance }) } + }, + { + title: '货主账户冻结余额', + index: 'shipperFreezeBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.shipperFreezeBalance }) } + }, + { + title: '司机账户可用余额', + index: 'driverAvailableBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.driverAvailableBalance }) } + }, + { + title: '司机账户冻结余额', + index: 'driverFreezeBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.driverFreezeBalance }) } + }, + { + title: '累计充值金额', + index: 'rechargeBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.rechargeBalance }) } + }, + { + title: '货主累计提现金额', + index: 'shipperWithdrawBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.shipperWithdrawBalance }) } + }, + { + title: '司机累计提现金额', + index: 'driverWithdrawBalance', + width: 180, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.driverWithdrawBalance }) } + }, + { + title: '操作', + width: 100, + className: 'text-center', + fixed: 'right', + buttons: [ + { + text: '查看明细', + click: item => + this.router.navigate(['/financial-management/platform-account/detail/' + item.id], { + queryParams: { ltdId: item.ltdId, bankType: item.bankType, ltdName: `${item.ltdName}(${item.bankTypeLabel})` } + }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.html b/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.html new file mode 100644 index 00000000..10785fb6 --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.html @@ -0,0 +1,11 @@ + +
    + + +
    + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.less b/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.ts b/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.ts new file mode 100644 index 00000000..27193906 --- /dev/null +++ b/src/app/routes/financial-management/components/platform-account/setting-financial/setting-financial.component.ts @@ -0,0 +1,112 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; + +@Component({ + selector: 'app-setting-financial', + templateUrl: './setting-financial.component.html', + styleUrls: ['./setting-financial.component.less'] +}) +export class SettingFinancialComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + roleList = []; + roleNames: any = []; + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: SystemService) {} + + ngOnInit(): void { + if (this.i?.id !== 0) { + this.i.roleIds = this.i.roleId !== '' ? this.i.roleId.split(',') : []; + } + + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '公司名称', + type: 'string', + ui: { widget: 'string', placeholder: '请输入公司名称' }, + default: staff.name + }, + phone: { + title: '纳税人识别号', + type: 'string', + ui: { widget: 'string', placeholder: '请输入纳税人识别号' }, + default: staff.phone + }, + phone2: { + title: '税收分类编码', + type: 'string', + ui: { widget: 'string', placeholder: '请输入税收分类编码' }, + default: staff.phone + }, + phone3: { + title: '发票税率', + type: 'string', + ui: { widget: 'string', placeholder: '请输入发票税率' }, + default: staff.phone + }, + phone4: { + title: '附加费比例', + type: 'string', + ui: { widget: 'string', placeholder: '请输入附加费比例' }, + default: staff.phone + } + }, + required: ['name', 'phone', 'phone2', 'phone3', 'phone4'] + }; + } + + sure() { + if (!this.sf.value.roleIds || this.sf.value.roleIds.length === 0) { + this.service.msgSrv.error('员工角色不能为空!'); + return; + } + this.roleNames = []; + this.roleList.forEach((item: { id: any; roleName: string }) => { + this.sf.value.roleIds.forEach((ele: any) => { + if (ele === item.id) { + this.roleNames.push(item.roleName); + } + }); + }); + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleIds, + roleNames: this.roleNames.join(','), + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleIds, + telephone: this.i.telephone + }; + // this.service.request(this.service.$api_editorStaff, params).subscribe((res) => { + // this.service.msgSrv.success('编辑成功!'); + // this.modal.close(true); + // }); + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.html b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.html new file mode 100644 index 00000000..ab154074 --- /dev/null +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.html @@ -0,0 +1,95 @@ + + + + + + + +
    +
    + + 基本信息 + + {{ costInfo?.ltdName }} + + + {{ costInfo?.brmdate }} + + + {{ costInfo?.brmModeLabel }} + + + {{ costInfo?.banktypeLabel }} + + + {{ costInfo?.artoname }} + + + {{ costInfo?.brmtypeLabel }} + + + {{ costInfo?.ltdaccountId }} + + + {{ costInfo?.recnopay |currency }} + + + {{ 0 |currency }} + + + {{ costInfo?.brmmoney |currency }} + + + {{ costInfo?.brmmoney |currency }} + + + {{ costInfo?.bankreceipt }} + + + {{ costInfo?.brmmoney |currency }} + + + {{ costInfo?.remarks }} + + +
    +
    +
    + + + + + + + + {{ item.vatnotax | currency}} + + + {{ item.vatmoney | currency}} + + + {{ index + 1 }} + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.less b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.less new file mode 100644 index 00000000..aa2721f6 --- /dev/null +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.less @@ -0,0 +1,24 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + + .text-truncate { + white-space: normal; + } + + .ant-form-item { + margin-bottom: 0; + } + + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts new file mode 100644 index 00000000..17dd85b2 --- /dev/null +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order-detail/receipt-order-detail.component.ts @@ -0,0 +1,89 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-20 10:00:39 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-25 15:40:10 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\components\\receipt-order\\receipt-order-detail\\receipt-order-detail.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-receipt-order-detail', + templateUrl: './receipt-order-detail.component.html', + styleUrls: ['./receipt-order-detail.component.less'], +}) +export class ReceiptOrderDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + columns: { [key: string]: STColumn[] } = this.initST(); + costInfo: any = {}; + id: any = null; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + this.loadDetail(this.id); + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + id: this.id + }); + return requestOptions; + }; + + loadDetail(id: any) { + this.service.request(this.service.$api_get_receipt_header, { id }).subscribe(res => { + if (res) { + this.costInfo = res; + } + }); + } + + goBack() { + history.go(-1); + } + + private initST(): { [key: string]: STColumn[] } { + return { + cost: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '费用号', index: 'feeHId', className: 'text-left', width: 200 }, + { title: '费用日期', index: 'billHId', className: 'text-center', width: 150 }, + { title: '订单号', index: 'callNo', className: 'text-left', width: 200 }, + { title: '订单日期', index: 'waybillHId', className: 'text-center', width: 150 }, + { title: '订单费用类型', index: 'waybillDate', className: 'text-center', width: 160 }, + { title: '费用类型', index: 'callNo', className: 'text-center', width: 160 }, + { title: '费用科目', index: 'billLType', className: 'text-left', width: 160 }, + { title: '结算客户', index: 'feeSubId', className: 'text-left', width: 150 }, + { + title: '已收金额', + index: 'hrvatrate', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) }, + width: 140 + } + ], + requested: [ + { title: '序号', render: 'no', width: 70, className: 'text-left' }, + { title: '结算客户', index: 'cnoName', className: 'text-left', width: 200 }, + { + title: '预收金额', + index: 'yskmoney', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) }, + width: 200 + }, + { title: '预收备注', index: 'vatapptype', className: 'text-left', width: 200 } + ] + }; + } +} diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.html b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.html new file mode 100644 index 00000000..58f7732c --- /dev/null +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.html @@ -0,0 +1,46 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    + +
    + 已选择 + {{ selectedRows.length }} 张单 + 清空 +
    +
    + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts new file mode 100644 index 00000000..820d90b9 --- /dev/null +++ b/src/app/routes/financial-management/components/receipt-order/receipt-order.component.ts @@ -0,0 +1,291 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-receipt-order', + templateUrl: './receipt-order.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class ReceiptOrderComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.brmdate) { + Object.assign(requestOptions.body, { + brmdate: { + start: this.sf.value.brmdate?.[0] || '', + end: this.sf.value.brmdate?.[1] || '' + } + }); + } + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addInvoice() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择收款单'); + return; + } + // const modal = this.nzModalService.create({ + // nzTitle: '收款单', + // nzContent: AddCollectionInvoiceModalComponent, + // nzComponentParams: { i: { userId: 0 } }, + // nzFooter: null + // }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + brmcode: { + type: 'string', + title: '收款单号', + ui: { + placeholder: '请输入' + } + }, + ltdid: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: null + }, + bankreceipt: { + type: 'string', + title: '银行水单', + ui: { + placeholder: '请输入' + } + }, + brmtype: { + type: 'string', + title: '收款类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'driverrecord:receive:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + brmmode: { + type: 'string', + title: '收款方式', + ui: { + widget: 'dict-select', + params: { dictKey: 'receive:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + arto: { + type: 'string', + title: '付款人', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + type: 'string', + title: '收款状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'write:off:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + brmdate: { + title: '到账日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + // billHCode: { + // type: 'string', + // title: '订单号', + // ui: { + // placeholder: '请输入', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } + // }, + // feeHCodes: { + // type: 'string', + // title: '费用号', + // ui: { + // placeholder: '请输入', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } + // }, + remarks: { + type: 'string', + title: '付款备注', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60, fixed: 'left', className: 'text-center' }, + { title: '收款单号', index: 'brmcode', type: 'link', width: 180, className: 'text-left' }, + // { title: '订单号', index: 'billHCode', width: 180, className: 'text-left' }, + // { title: '费用号', index: 'feeCode', width: 180, className: 'text-left' }, + { title: '网络货运人', index: 'ltdName', width: 200, className: 'text-left' }, + { title: '到账日期', index: 'brmdate', type: 'date', width: 200, className: 'text-left' }, + { title: '收款账户', index: 'ltdaccountId', width: 200, className: 'text-left' }, + { + title: '到账金额', + index: 'brmmoney', + width: 200, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.brmmoney }) } + }, + { + title: '核销金额', + index: 'brmmoney', + width: 200, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.brmmoney }) } + }, + { + title: '预收金额', + index: 'yskmoney', + width: 200, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yskmoney }) } + }, + { title: '银行类型', index: 'banktypeLabel', width: 200, className: 'text-left' }, + { title: '收款类型', index: 'brmtypeLabel', width: 150, className: 'text-left' }, + { title: '收款方式', index: 'brmModeLabel', width: 150, className: 'text-left' }, + { title: '付款人', index: 'artoname', width: 200, className: 'text-left' }, + { title: '银行水单', index: 'bankreceipt', width: 200, className: 'text-left' }, + { title: '创建时间', index: 'createTime', type: 'date', width: 200, className: 'text-left' }, + // { title: '创建人', index: 'createUserName', width: 150, className: 'text-left' }, + { title: '收款状态', index: 'stsLabel', width: 200, className: 'text-left' }, + { title: '收款备注', index: 'remarks', width: 200, className: 'text-left' }, + { + title: '操作', + width: '110px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '浏览', + click: item => this.router.navigate(['/financial-management/receipt-order/detail/' + item.id]) + } + // { + // text: '核销' + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.html b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.html new file mode 100644 index 00000000..0c48f68d --- /dev/null +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.html @@ -0,0 +1,85 @@ + + + + + + + +
    +
    + + {{headerInfo?.ltdName}} + + + {{headerInfo?.cnoName}} + + + {{headerInfo?.ltdaccountId}} + + + {{headerInfo?.ahxmoney | currency}} + +
    +
    + + {{headerInfo?.ahxdate}} + + + {{headerInfo?.artoname}} + + + + {{headerInfo?.armoney | currency}} + +
    +
    + + {{headerInfo?.banktypeLabel}} + + + {{headerInfo?.brmtypeLabel}} + + + {{headerInfo?.bankreceipt}} + + + {{headerInfo?.remarks}} + +
    +
    +
    + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + {{index+1}} + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.less b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.less new file mode 100644 index 00000000..aebf12ee --- /dev/null +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts new file mode 100644 index 00000000..d630043c --- /dev/null +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts @@ -0,0 +1,161 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { TicketService } from 'src/app/routes/ticket-management/services/ticket.service'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-receivable-order-detail', + templateUrl: './receivable-order-detail.component.html', + styleUrls: ['./receivable-order-detail.component.less', '../../../../commom/less/expend-but.less', '../../../../commom/less/box.less'], + providers: [CurrencyPipe] +}) +export class ReceivableOrderDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + id = null; + billHId = null; + headerInfo: any = {}; + constructor(public service: FreightAccountService, private route: ActivatedRoute, private currencyPipe: CurrencyPipe) { + this.id = route.snapshot.params.id; + this.billHId = route.snapshot.queryParams.billHId; + this.loadHeadInfo(); + } + + ngOnInit(): void {} + + loadHeadInfo() { + this.service.request(this.service.$api_get_fico_header, { id: this.id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { ahxHId: this.id }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.feedate?.[0]) { + Object.assign(requestOptions.body, { + feedate: { + start: this.sf.value.feedate?.[0] || '', + end: this.sf.value.feedate?.[1] || '' + } + }); + } + } + return requestOptions; + }; + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + feeHCode: { + type: 'string', + title: '费用单', + ui: { + placeholder: '请输入' + } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount() + }, + default: '' + }, + feedate: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + // billTime: { + // title: '订单日期', + // type: 'string', + // ui: { + // widget: 'sl-from-to-search', + // format: 'yyyy-MM-dd', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } as SFDateWidgetSchema + // } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '序号', render: 'no', width: 80 }, + { title: '费用号', index: 'feeLId', width: 100 }, + { title: '费用日期', index: 'feedate', type: 'date', width: 150 }, + { title: '订单号', index: 'billHCode', width: 100 }, + // { title: '订单日期', index: 'billTime', width: 150 }, + // { title: '费用类型', index: 'cnoName', width: 90 }, + { title: '订单费用科目', index: 'billLTypeLabel', width: 100 }, + { title: '费用科目', index: 'feeSubName', width: 140 }, + { title: '结算客户', index: 'cnoName', width: 100 }, + { + title: '已收金额', + index: 'ahxmoney', + width: 100, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.ahxmoney)}` + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html new file mode 100644 index 00000000..63041216 --- /dev/null +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html @@ -0,0 +1,37 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts new file mode 100644 index 00000000..a8e78022 --- /dev/null +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts @@ -0,0 +1,312 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from 'src/app/routes/ticket-management/services/ticket.service'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-receivable-order', + templateUrl: './receivable-order.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'], + providers: [CurrencyPipe] +}) +export class ReceivableOrderComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor( + public service: FreightAccountService, + private nzModalService: NzModalService, + private router: Router, + private currencyPipe: CurrencyPipe + ) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value?.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || null, + end: this.sf.value.createTime?.[1] || null + } + }); + } + if (this.sf.value?.ahxdate) { + Object.assign(requestOptions.body, { + ahxdate: { + start: this.sf.value.ahxdate?.[0] || null, + end: this.sf.value.ahxdate?.[1] || null + } + }); + } + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + ahxcode: { + type: 'string', + title: '核销单号', + ui: { + placeholder: '请输入' + } + }, + ltdid: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + bankreceipt: { + type: 'string', + title: '银行水单', + ui: { + placeholder: '请输入' + } + }, + brmtype: { + type: 'string', + title: '收款类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'driverrecord:receive:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + arvattype: { + type: 'string', + title: '付款类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'pay:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + arto: { + type: 'string', + title: '付款人', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + type: 'string', + title: '核销状态', + enum: [ + { value: 1, label: '已核销' }, + { value: 0, label: '待核销' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + banktype: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: '' }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + ahxdate: { + title: '核销日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + // orderS3: { + // type: 'string', + // title: '费用号', + // ui: { + // placeholder: '请输入', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } + // }, + remarks: { + type: 'string', + title: '核销备注', + ui: { + autocomplete: 'off', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '核销单号', index: 'ahxcode', type: 'link', width: 140 }, + { title: '订单号', index: 'billHCode', type: 'link', width: 140 }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '核销日期', index: 'ahxdate', type: 'date', width: 160 }, + { title: '收款账户', index: 'ltdaccountId', width: 160 }, + { title: '核销类型', index: 'ahxType', type: 'enum', enum: { '1': '预收款' }, width: 120 }, + { + title: '核销金额', + index: 'ahxmoney', + width: 120, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.ahxmoney)}` + }, + { + title: '应收金额', + index: 'armoney', + width: 120, + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.armoney)}` + }, + { title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 }, + { title: '收款类型', index: 'arvattype', type: 'enum', enum: { '1': '费用款项' }, width: 120 }, + { title: '付款人', index: 'artoname', width: 200 }, + { title: '付款账户', index: 'shipperaccount', width: 170 }, + { title: '结算客户', index: 'cnoName', width: 120 }, + { title: '银行水单', index: 'bankreceipt', width: 200 }, + { title: '创建时间', index: 'createTime', width: 180 }, + // { title: '收款人', index: 'driver2IdName', width: 120 }, + // { title: '创建人', index: 'createUserIdLabel', width: 120 }, + { title: '核销状态', index: 'sts', type: 'enum', enum: { 0: '待核销', 1: '已核销' }, width: 120 }, + { title: '核销备注', index: 'remarks', width: 120 }, + { + title: '操作', + fixed: 'right', + width: 120, + className: 'text-center', + buttons: [ + { + text: '浏览', + click: item => + this.router.navigate(['/financial-management/receivable-order/detail/' + item.id], { queryParams: { billHId: item.billHId } }) + } + // { + // text: '核销' + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/recharge-record/recharge-record.component.html b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.html new file mode 100644 index 00000000..8c7c5d10 --- /dev/null +++ b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.html @@ -0,0 +1,56 @@ + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + {{ item.transferBankOpenName }}
    {{ item.transferBankCardNumber }} +
    +
    +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts new file mode 100644 index 00000000..e45f63bb --- /dev/null +++ b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts @@ -0,0 +1,236 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-recharge-record', + templateUrl: './recharge-record.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class RechargeRecordComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + @ViewChild('remarkodal', { static: true }) + remarkodal!: any; + rechargeRemark = ''; + + _$expand = false; + constructor(public service: FreightAccountService, private modal: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + return requestOptions; + }; + + addRemark(item: any) { + this.rechargeRemark = item.remark; + const modal = this.modal.create({ + nzTitle: this.rechargeRemark ? '修改备注' : '添加备注', + nzContent: this.remarkodal, + nzFooter: [ + { + type: 'primary', + label: '确认', + loading: () => this.service.http.loading, + onClick: () => { + this.service.request(this.service.$api_edit_remark, { id: item.id, remark: this.rechargeRemark }).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + modal.destroy(); + } + }); + return false; + } + } + ] + }); + } + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 }); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + rechargeNo: { + type: 'string', + title: '充值单号', + ui: { + placeholder: '请输入' + } + }, + rechargeStatus: { + type: 'string', + title: '充值状态', + enum: [ + { label: '全部', value: '' }, + { label: '充值中', value: '1' }, + { label: '充值失败', value: '2' }, + { label: '充值成功', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + createTime: { + title: '充值时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + roleName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + autocomplete: 'off', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + accountType: { + type: 'string', + title: '账户类型', + enum: [ + { label: '全部', value: '' }, + { label: '货主账户', value: '1' }, + { label: '司机账户', value: '2' }, + { label: '营商商账户', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + } + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: '' }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '充值时间', index: 'createTime', type: 'date', width: 180 }, + { title: '充值单号', index: 'rechargeNo', width: 140 }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '银行类型', index: 'bankTypeLabel', width: 100 }, + { title: '账户类型', index: 'accountTypeLabel', width: 100 }, + { title: '账户名称', index: 'roleName', width: 160 }, + { title: '虚拟账户', index: 'virtualAccount', width: 100 }, + { + title: '充值金额', + index: 'rechargeAmount', + width: 160, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.rechargeAmount }) } + }, + { title: '充值银行账户', render: 'transferBankAccount', width: 200 }, + { title: '充值方式', index: 'payChannelLabel', width: 100 }, + { title: '充值状态', index: 'rechargeStatusLabel', width: 100 }, + { title: '银行流水号', index: 'paySerialNumber', width: 120 }, + { + title: '操作', + width: 120, + fixed: 'right', + className: 'text-center', + buttons: [ + { type: 'divider' }, + { + text: '查看回单
    ', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.roleId, + snglFlgCd: item.paySerialNumber2, + bussType: '06', + ltdId: item.ltdId, + accountType: item.accountType + }) + }, + { + text: '添加备注', + click: item => this.addRemark(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/refund-record/refund-record.component.html b/src/app/routes/financial-management/components/refund-record/refund-record.component.html new file mode 100644 index 00000000..34a9cad4 --- /dev/null +++ b/src/app/routes/financial-management/components/refund-record/refund-record.component.html @@ -0,0 +1,66 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + + {{ item.orderRefundCode }}
    {{ item.refundStatusLabel }} +
    + + + {{cost.costName}}:{{ cost.refundAmount |currency }}
    +
    +
    + + + {{ bill.paymentApplicationCode }}
    +
    +
    + + {{ item.driverName }}
    {{ item.driverTelephone }}
    {{ item.driverLicencePlate }} +
    + + {{ item.captainName }}
    {{ item.captainTelephone }} +
    +
    +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/refund-record/refund-record.component.ts b/src/app/routes/financial-management/components/refund-record/refund-record.component.ts new file mode 100644 index 00000000..32dcf8ab --- /dev/null +++ b/src/app/routes/financial-management/components/refund-record/refund-record.component.ts @@ -0,0 +1,290 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-refund-record', + templateUrl: './refund-record.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class RefundRecordComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + refundStatus: any = ''; + + msg = ''; + + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void { + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { refundStatus: this.refundStatus || null }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + refundExecuteTime: { + start: this.sf.value.refundExecuteTime?.[0] || '', + end: this.sf.value.refundExecuteTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any) { + this.msg = ''; + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + if (!this.msg) { + this.service.msgSrv.warning('请填写原因'); + return false; + } + this.service + .request(this.service.$api_disagree_refund_record, { + applicationId: item.id, + remark: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功'); + modal.destroy(true); + this.st.load(1); + } + }); + return false; + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.service + .request(this.service.$api_agree_refund_record, { + applicationId: item.id, + remark: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功'); + modal.destroy(true); + this.st.load(1); + } + }); + return false; + } + } + ] + }); + } + + reApply(item: any) { + const modal = this.nzModalService.warning({ + nzTitle: '确定要重新发起退款?', + nzOnOk: () => { + this.service + .request(this.service.$api_rebulid_refund_record, { + applicationId: item.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('发起成功'); + modal.destroy(true); + this.st.load(1); + } + }); + return false; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + orderRefundCode: { + type: 'string', + title: '退款单号', + ui: { + placeholder: '请输入' + } + }, + refundType: { + type: 'string', + title: '退款类型', + enum: [ + { value: '1', label: '平台退款货主' }, + { value: '2', label: '司机退款平台' }, + { value: '3', label: '车队长退款司机' }, + { value: '4', label: '车队长退款平台' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + enterpriseInfoName: { + type: 'string', + title: '货主', + ui: { + placeholder: '请输入' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + visibleIf: { + expand: (value: boolean) => value + }, + placeholder: '请输入' + } + }, + enterpriseProjectName: { + type: 'string', + title: '所属项目', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + resourceCode: { + type: 'string', + title: '货源号', + ui: { + visibleIf: { + expand: (value: boolean) => value + }, + placeholder: '请输入' + } + }, + refundExecuteTime: { + title: '退款时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + }, + nzShowTime: true + } as SFDateWidgetSchema + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + bankType: { + type: 'string', + title: '银行类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bankname:type' }, + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '退款单号', render: 'orderRefundCode', width: 190 }, + { title: '退款类型', index: 'refundTypeLabel', width: 140 }, + { title: '退款金额', render: 'refundAmount', className: 'text-right', width: 180 }, + { title: '退款时间', index: 'refundExecuteTime', width: 170 }, + { title: '货主', index: 'enterpriseInfoName', width: 150 }, + { title: '所属项目', index: 'enterpriseProjectName', width: 140 }, + { title: '支付单', render: 'billRefundPaymentVOS', width: 150 }, + { title: '订单号', index: 'billCode', width: 150 }, + { title: '货源号', index: 'resourceCode', width: 150 }, + { title: '司机', render: 'driver', width: 150 }, + { title: '收款人', render: 'captain', width: 150 }, + { title: '网络货运人', index: 'ltdName', width: 180 }, + { title: '银行类型', index: 'bankTypeLabel', width: 120 }, + { title: '退款原因', index: 'reason', width: 170 }, + { title: '失败原因', index: 'failCause', width: 170 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: '150px', + buttons: [ + { + text: '审核', + iif: item => item.refundStatus === '1', + click: item => this.auditAction(item) + }, + { + text: '重新发起', + iif: item => item.refundStatus === '5', + click: item => this.reApply(item) + } + // { + // text: '关闭', + // click: item => this.router.navigate(['/financial-management/withdrawals-record/detail/' + item.id]) + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.html b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.html new file mode 100644 index 00000000..77fc9628 --- /dev/null +++ b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.html @@ -0,0 +1,30 @@ + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.less b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.less new file mode 100644 index 00000000..cd8c3436 --- /dev/null +++ b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.less @@ -0,0 +1,41 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } + + .text-truncate { + white-space: normal; + } +} + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + max-width: 400px; + position : absolute; + right : 0; + bottom : 25px; + } + +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.ts b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.ts new file mode 100644 index 00000000..3222c24f --- /dev/null +++ b/src/app/routes/financial-management/components/transaction-flow/transaction-flow.component.ts @@ -0,0 +1,264 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; + +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-transaction-flow', + templateUrl: './transaction-flow.component.html', + styleUrls: ['./transaction-flow.component.less'], + providers: [CurrencyPipe] +}) +export class TransactionFlowComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + constructor( + public service: FreightAccountService, + private nzModalService: NzModalService, + private router: Router, + private currencyPipe: CurrencyPipe + ) {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + createTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择' + } as SFDateWidgetSchema + }, + transactionNumber: { + type: 'string', + title: '流水号', + ui: { + placeholder: '请输入' + } + }, + businessNumber: { + type: 'string', + title: '关联单号', + ui: { + placeholder: '请输入' + } + }, + tradeType: { + type: 'string', + title: '交易类型', + enum: [ + { label: '全部', value: '' }, + { label: '运费支付', value: 1 }, + { label: '附加费支付', value: 2 }, + { label: '运费退款', value: 3 }, + { label: '附加费退款', value: 4 }, + { label: '保费支付', value: 5 }, + { label: '保费退款', value: 6 }, + { label: '余额充值', value: 7 }, + { label: '余额提现', value: 8 }, + { label: '资金分配', value: 9 }, + { label: '资金回收', value: 10 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + incomeType: { + type: 'string', + title: '收支类型', + enum: [ + { label: '全部', value: '' }, + { label: '收入', value: 2 }, + { label: '支出', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + channelSource: { + type: 'string', + title: '账户类型', + enum: [ + { label: '全部', value: '' }, + { label: '货主账户', value: '1' }, + { label: '司机账户', value: '2' }, + { label: '运营商账户', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + enterpriseName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + projectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getEnterpriseProject() + }, + default: '' + }, + bankType: { + type: 'string', + title: '银行类型', + enum: [ + { label: '全部', value: '' }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '交易时间', index: 'createTime', width: 180 }, + { title: '流水号', index: 'transactionNumber', width: 180 }, + { title: '交易类型', index: 'tradeTypeLabel', width: 120 }, + { title: '关联单号', index: 'businessNumber', width: 150 }, + { title: '账户类型', index: 'accountTypeLabel', width: 130 }, + { title: '账户名称', index: 'roleName', width: 180 }, + { title: '所属项目', index: 'projectName', width: 140 }, + { title: '收支类型', index: 'incomeTypeLabel', width: 100, className: 'text-center' }, + { + title: '交易金额', + index: 'amount', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '账户余额', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } + }, + { title: '网络货运人', index: 'ltdName', width: 180 }, + { title: '银行类型', index: 'bankTypeLabel', width: 100 }, + { title: '银行流水号', index: 'channelPaySn', width: 170 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { + text: '查看回单', + iif: item => item.tradeType !== '9' && item.tradeType !== '10', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.roleId, + snglFlgCd: item.channelPaySn, + bussType: item.tradeType === '7' ? '05' : item.tradeType === '8' ? '06' : '07', + ltdId: item.ltdId, + accountType: item.accountType + }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html new file mode 100644 index 00000000..bdf26c72 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html @@ -0,0 +1,66 @@ + + + + + + + + +
    + 记账凭证 + + + + {{info?.vcltdcode}} - {{info?.vcltdname}} + + + {{info?.vctype}} + + + {{info?.vctime}} + +
    + + + + +
    +
    合计:
    +
    {{info?.drmoney | currency}}
    +
    {{info?.crmoney | currency}}
    +
    +
    +
    + + + + {{ auxVO.auxLabel }}: {{ auxVO.auxValue }}
    +
    +
    +
    + + + + {{info?.remarks}} + + + {{info?.id}} + + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.ts b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.ts new file mode 100644 index 00000000..1c4f072c --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.ts @@ -0,0 +1,57 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STData, STColumn, STRequestOptions } from '@delon/abc/st'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-voucher-detail', + templateUrl: './voucher-detail.component.html' +}) +export class VoucherDetailComponent implements OnInit { + columns: STColumn[] = [ + { title: '摘要', index: 'remarks' }, + { title: '会计科目', index: 'subname' }, + { title: '辅助核算', render: 'auxVOList' }, + { title: '币种', index: 'currency', className: 'text-center' }, + { + title: '借方金额', + index: 'drlocalmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drlocalmoney }) } + }, + { + title: '贷方金额', + index: 'crlocalmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crlocalmoney }) } + } + ]; + id!: string; + + info: any = { faShowVOList: [] }; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + } + + ngOnInit(): void { + this.loadDetail(this.id); + } + + loadDetail(id: string) { + this.service.request(this.service.$api_get_fico_vch__detail, { id }).subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + goBack() { + history.go(-1); + } +} diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-management.component.html b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.html new file mode 100644 index 00000000..30ea85a7 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.html @@ -0,0 +1,39 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + +
    + +
    + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts new file mode 100644 index 00000000..4509f291 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts @@ -0,0 +1,362 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-18 15:57:44 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-20 17:18:16 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\components\\voucher-management\\voucher-management.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-voucher-management', + templateUrl: './voucher-management.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class VoucherManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || null, + end: this.sf.value.createTime?.[1] || null + } + }); + } + if (this.sf.value.vctime) { + Object.assign(requestOptions.body, { + vctime: { + start: this.sf.value.vctime?.[0] || null, + end: this.sf.value.vctime?.[1] || null + } + }); + } + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + vccode: { + type: 'string', + title: '凭证号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + vctime: { + title: '凭证时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + sourceCode: { + type: 'string', + title: '原始单号', + ui: { + autocomplete: 'off', + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sourceType: { + type: 'string', + title: '原始单类型', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '收款' }, + { value: 2, label: '收款(退款)' }, + { value: 3, label: '应收费用' }, + { value: 4, label: '应收费用(负数)' }, + { value: 5, label: '应收核销' }, + { value: 6, label: '应收核销(负数)' }, + { value: 7, label: '应付费用' }, + { value: 8, label: '应付费用(负数)' }, + { value: 9, label: '应付核销' }, + { value: 10, label: '应付核销(负数)' }, + { value: 11, label: '分票开票' }, + { value: 12, label: '删除分票' }, + { value: 13, label: '付款' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + inpinvcosde: { + type: 'string', + title: '凭证摘要', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vctype: { + type: 'string', + title: '凭证类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'credential:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + subid: { + type: 'string', + title: '科目', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + drmoney: { + type: 'string', + title: '借方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + crmoney: { + type: 'string', + title: '贷方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vcltdid: { + type: 'string', + title: '帐套', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + type: 'string', + title: '凭证状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'credential:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + importncnotes: { + type: 'string', + title: 'NC凭证', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vc2code: { + type: 'string', + title: '汇总凭证号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + importnc: { + type: 'string', + title: '导入NC', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + isvc2: { + type: 'string', + title: '是否汇总', + enum: [ + { value: null, label: '全部' }, + { value: 0, label: '否' }, + { value: 1, label: '是' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' }, + { title: '凭证号', index: 'vccode', type: 'link', width: 200 }, + { title: '帐套', index: 'ltdId', width: 200, format: item => `${item.vcltdcode}-${item.vcltdname}` }, + { title: '凭证时间', index: 'vctime', type: 'date', width: 200 }, + { title: '凭证类型', index: 'vctype', width: 200 }, + // { title: '序号', index: 'invmoney', width: 200, format: _ => '1' }, + { title: '摘要', index: 'remarks', width: 300 }, + { title: '币种', index: 'currency', width: 100 }, + { + title: '借方金额', + index: 'drmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drmoney }) } + }, + { + title: '贷方金额', + index: 'crmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crmoney }) } + }, + { title: 'NC凭证', index: 'importncnotes', width: 150 }, + { title: '汇总凭证号', index: 'vc2code', width: 150 }, + { title: '凭证状态', index: 'stsLabel', width: 120 }, + { title: '创建时间', index: 'createTime', width: 140 }, + // { title: '创建人', index: 'createUserId', width: 150 }, + { + title: '操作', + width: '130px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '浏览', + click: (item: any) => this.router.navigate(['/financial-management/voucher-management/detail/' + item.id]), + acl: { ability: ['FINANCIAL-VOUCHER-view'] } + } + // { + // text: '修改' + // }, + // { + // text: '删除' + // }, + // { + // text: '提交' + // } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.html b/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.html new file mode 100644 index 00000000..49cf138c --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.html @@ -0,0 +1,53 @@ + + + + + + + +
    + 记账凭证 + + + + {{info?.vcltdcode}} + + + {{info?.vctype}} + + + {{info?.vctime}} + +
    + + + + +
    +
    合计:
    +
    {{info?.drmoney | currency}}
    +
    {{info?.crmoney | currency}}
    +
    +
    +
    + + + + {{ auxVO.auxLabel }}: {{ auxVO.auxValue }}
    +
    +
    +
    + + + + {{info?.remarks}} + + + {{info?.createUserId}} + + + +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.ts b/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.ts new file mode 100644 index 00000000..0f931738 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/summary-detail/summary-detail.component.ts @@ -0,0 +1,60 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STData, STColumn, STRequestOptions } from '@delon/abc/st'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-summary-detail', + templateUrl: './summary-detail.component.html' +}) +export class SummaryDetailComponent implements OnInit { + columns: STColumn[] = [ + { title: '摘要', index: 'remarks' }, + { title: '会计科目', index: 'subname' }, + { title: '辅助核算', render: 'auxVOList' }, + { title: '币种', index: 'currency', className: 'text-center' }, + { + title: '借方金额', + index: 'drlocalmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drlocalmoney }) } + }, + { + title: '贷方金额', + index: 'crlocalmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crlocalmoney }) } + } + ]; + id!: string; + + info: any = { faShowVOList: [] }; + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + } + + ngOnInit(): void { + this.loadDetail(this.id); + } + + loadDetail(id: string) { + this.service.request(this.service.$api_get_fico_vch__detail, { id }).subscribe(res => { + if (res) { + this.info = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + return requestOptions; + }; + + goBack() { + history.go(-1); + } +} diff --git a/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.html b/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.html new file mode 100644 index 00000000..27bd4068 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.html @@ -0,0 +1,31 @@ + + + + +
    +
    + +
    +
    + + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.ts b/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.ts new file mode 100644 index 00000000..a8422946 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/voucher-list/voucher-list.component.ts @@ -0,0 +1,226 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-voucher-list', + templateUrl: './voucher-list.component.html', + styleUrls: ['../../../../commom/less/box.less'] +}) +export class VoucherListComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + vc2code = null; + constructor(public service: FreightAccountService, private route: ActivatedRoute, private router: Router) { + this.vc2code = route.snapshot.params.id; + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { vc2code: this.vc2code }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || null, + end: this.sf.value.createTime?.[1] || null + } + }); + } + if (this.sf.value.vctime) { + Object.assign(requestOptions.body, { + vctime: { + start: this.sf.value.vctime?.[0] || null, + end: this.sf.value.vctime?.[1] || null + } + }); + } + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + vccode: { + type: 'string', + title: '凭证号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + vctime: { + title: '凭证时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + sourceCode: { + type: 'string', + title: '原始单号', + ui: { + autocomplete: 'off', + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sourceType: { + type: 'string', + title: '原始单类型', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + drmoney: { + type: 'string', + title: '借方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + inpinvcosde: { + type: 'string', + title: '凭证摘要', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + subid: { + type: 'string', + title: '科目', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + crmoney: { + type: 'string', + title: '贷方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '凭证号', index: 'id', type: 'link', width: 150 }, + { title: '帐套', index: 'vcltdid', width: 150 }, + { title: '凭证时间', index: 'vctime', type: 'date', width: 150 }, + { title: '凭证类型', index: 'vctype', width: 150 }, + { title: '序号', index: 'invmoney', width: 150, format: _ => '1' }, + { title: '摘要', index: 'remarks', width: 300 }, + { title: '币种', index: 'currency', width: 100 }, + { + title: '借方金额', + index: 'drmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drmoney }) } + }, + { + title: '贷方金额', + index: 'crmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crmoney }) } + }, + { title: '凭证状态', index: 'stsLabel', width: 120 }, + { title: '创建时间', index: 'createTime', width: 140 }, + { title: '创建人', index: 'createUserId', width: 150 }, + { + title: '操作', + width: '130px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '浏览', + click: (item: any) => this.router.navigate(['/voucher-summary/list/detail/' + item.id]) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.html b/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.html new file mode 100644 index 00000000..bd2dffe4 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.html @@ -0,0 +1,39 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.ts b/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.ts new file mode 100644 index 00000000..88a03a72 --- /dev/null +++ b/src/app/routes/financial-management/components/voucher-summary/voucher-summary.component.ts @@ -0,0 +1,345 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { DateHelperByDatePipe } from 'ng-zorro-antd/i18n'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-voucher-summary', + templateUrl: './voucher-summary.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class VoucherSummaryComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor( + public service: FreightAccountService, + private nzModalService: NzModalService, + private router: Router, + private dateHelperByDatePipe: DateHelperByDatePipe + ) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { isvc2: 1 }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createtime: { + start: this.sf.value.createtime?.[0] || null, + end: this.sf.value.createtime?.[1] || null + }, + vctime: { + start: this.sf.value.vctime?.[0] || null, + end: this.sf.value.vctime?.[1] || null + } + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addInvoice() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择申请记录'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '收票信息', + nzContent: AddCollectionInvoiceModalComponent, + nzComponentParams: { i: { userId: 0 } }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + vc2code: { + type: 'string', + title: '汇总凭证号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + vctime: { + title: '凭证时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + sourceCode: { + type: 'string', + title: '原始单号', + ui: { + autocomplete: 'off', + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sourceType: { + type: 'string', + title: '原始单类型', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + remarks: { + type: 'string', + title: '凭证摘要', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vctype: { + type: 'string', + title: '凭证类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'credential:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + s2ts: { + type: 'string', + title: '科目', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + drmoney: { + type: 'string', + title: '借方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + crmoney: { + type: 'string', + title: '贷方金额', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vcltdid: { + type: 'string', + title: '帐套', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + type: 'string', + title: '凭证状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'credential:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + feecode: { + type: 'string', + title: 'NC凭证', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + vccode: { + type: 'string', + title: '凭证号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + s22t2ss: { + type: 'string', + title: '导入NC', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createt1im2e: { + title: '统计时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' }, + { title: '汇总凭证号', index: 'vc2code', type: 'link', width: 140 }, + { title: '帐套', index: 'vcltdcode', width: 120 }, + { title: '凭证时间', index: 'vctime', type: 'date', width: 150 }, + { + title: '统计区间', + index: 'invdate', + type: 'date', + width: 200, + format: item => + `${this.dateHelperByDatePipe.format(item.vctime2start, 'yyyy-MM-dd')} | ${this.dateHelperByDatePipe.format( + item.vctime2end, + 'yyyy-MM-dd' + )}` + }, + { title: '凭证类型', index: 'vctype', width: 120 }, + { title: '序号', index: 'invmoney', width: 100, format: _ => '1' }, + { title: '摘要', index: 'remarks', width: 120 }, + { title: '币种', index: 'currency', width: 100 }, + { + title: '借方金额', + index: 'drmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drmoney }) } + }, + { + title: '贷方金额', + index: 'crmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crmoney }) } + }, + { title: 'NC凭证', index: 'importncnotes', width: 120 }, + { title: '凭证状态', index: 'stsLabel', width: 120 }, + { title: '创建时间', index: 'createTime', width: 180 }, + { title: '创建人', index: 'createUserName', width: 120 }, + { + title: '操作', + width: '130px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '浏览', + click: (item: any) => this.router.navigate(['/financial-management/voucher-summary/detail/' + item.id]) + }, + { + text: '列表', + click: (item: any) => this.router.navigate(['/financial-management/voucher-summary/list/' + item.vc2code]) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html new file mode 100644 index 00000000..f561427f --- /dev/null +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html @@ -0,0 +1,109 @@ + + + + + + + + + +
    + + {{formData?.ltdName}} + + + {{formData?.bankType==='1'?'平安银行':'浦发银行'}} + + + {{formData?.refundApplyCode}} + + + {{formData?.bankAccountName}} + + + {{formData?.createTime}} + + + {{formData?.virtualAccount}} + + + {{formData?.refundStatusLabel}} + + + {{formData?.amount | currency}} + + + {{formData?.bankSerialNumber}} + + + {{formData?.bankCardNumber}} + + + {{formData?.refundStatus==='3'?'下载回单':'暂无回单'}} + +
    + + + +
    +
    + +
    +
    + + + + +
    +
    + + + + {{detail.costName}}:{{detail.price |currency}} + + + + {{item.billCode}}
    + {{item.billStatus}}
    +
    + + {{item.wayBillCode}}
    + {{item.wayBillStatus}}
    +
    + + {{item.driverName}}
    + {{item.driverTelephone}}
    + {{item.driverLicencePlate}}
    +
    + + {{item.captainName}}
    + {{item.captainTelephone}}
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less new file mode 100644 index 00000000..627355a5 --- /dev/null +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less @@ -0,0 +1,23 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color : rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size : 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } + + nz-tabs-nav { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + padding-left : 18px; + } +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts new file mode 100644 index 00000000..85144954 --- /dev/null +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts @@ -0,0 +1,241 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { FreightAccountService } from '../../../services/freight-account.service'; + +@Component({ + selector: 'app-withdrawals-detail', + templateUrl: './withdrawals-detail.component.html', + styleUrls: ['./withdrawals-detail.component.less'] +}) +export class WithdrawalsDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: Component; + @ViewChild('sf', { static: false }) + inputSF!: SFComponent; + columns: STColumn[] = this.initST(); + inputSearchSchema: SFSchema = this.initInputSF(); + _$expand = false; + + formData: any = {}; + + timeLineData: any = []; + + accountType = '1'; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + const id = route.snapshot.params.id; + this.accountType = route.snapshot.queryParams.type; + this.loadRefundDetail(id); + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.inputSF?.value) { + Object.assign(requestOptions.body, { + ...this.inputSF.value + }); + } + Object.assign(requestOptions.body, { refundApplicationId: this.route.snapshot.params.id }); + return requestOptions; + }; + + loadRefundDetail(id: string) { + this.service.request(this.service.$api_get_refund_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + let isEnd = false; + if (res.successTime) { + isEnd = true; + if (res.refundStatus === '3') { + this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + } else { + this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + } + } + if (res.agreeTime && res.refundStatus !== '4') { + this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + } + if (res.agreeTime) { + if (res.refundStatus === '4') { + isEnd = true; + this.timeLineData.push({ + time: res.agreeTime, + value: `拒绝提现
    操作人员:${res.handlerUserIdLabel}`, + color: 'red' + }); + } else { + this.timeLineData.push({ + time: res.agreeTime, + value: `审核通过
    操作人员:${res.handlerUserIdLabel}`, + color: 'gray' + }); + } + } + if (res.createTime) { + this.timeLineData.push({ + time: res.createTime, + value: `提交提现申请
    提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
    操作人员:${res.userIdLabel}`, + color: 'gray' + }); + } + if (this.timeLineData?.length > 0 && !isEnd) { + this.timeLineData[0].color = 'green'; + } + } + }); + } + + downBack() { + if (this.formData?.refundStatus !== '3') { + return; + } + this.service.getReceiptUrl(this.formData.receiptUrl, { + bankType: this.formData.bankType, + rmYll: this.formData.userId, + snglFlgCd: this.formData.coreSerNo, + bussType: '06', + ltdId: this.formData.ltdId, + accountType: this.formData.accountType + }); + } + + /** + * 重置表单 + */ + resetInputSF() { + this.inputSF.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.inputSF?.setValue('/expand', this._$expand); + } + + goBack() { + history.go(-1); + } + + private initInputSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + billHCode: { + type: 'string', + title: '支付编号', + ui: { + placeholder: '请输入' + } + }, + billHCod1e: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + billHCo1de: { + type: 'string', + title: '货源编号', + ui: { + placeholder: '请输入' + } + }, + billHC1ode: { + type: 'string', + title: '服务类型', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billHCo11de: { + type: 'string', + title: '承运司机', + ui: { + placeholder: '请输入司机姓名/手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billHCo111de: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billHC1o11de: { + type: 'string', + title: '收款人', + ui: { + placeholder: '请输入收款人姓名/手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billHC1o111de: { + type: 'string', + title: '车队长收款', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '支付编号', index: 'orderPaymentCode', className: 'text-left', width: 200 }, + { + title: '支付金额', + index: 'payAmount', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payAmount }) }, + width: 140 + }, + { title: '运费明细', render: 'amountDetails', className: 'text-center', width: 150 }, + { title: '货主', index: 'ltdName', className: 'text-center', width: 200 }, + { title: '订单号', render: 'billId', className: 'text-center', width: 150 }, + { title: '运单号', render: 'wayBillId', className: 'text-center', width: 150 }, + { title: '货源编号', index: 'resourceCode', className: 'text-center', width: 150 }, + { + title: '服务类型', + index: 'serviceType', + className: 'text-center', + width: 150, + type: 'enum', + enum: { '1': '抢单', '2': '指派', '3': '二维码', '4': '手工单' } + }, + { title: '承运司机', render: 'driverId', className: 'text-center', width: 150 }, + { title: '收款人', render: 'captainName', className: 'text-center', width: 150 }, + { title: '银行类型', index: 'bankType', className: 'text-center', width: 150 } + ]; + } +} diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.html b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.html new file mode 100644 index 00000000..603a6634 --- /dev/null +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.html @@ -0,0 +1,85 @@ + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据   累计提现 {{ + totalCallNo }} + 清空 +
    + +
    +
    + + + + {{ item.bankName }}
    {{ item.bankCardNumber }} +
    +
    +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts new file mode 100644 index 00000000..907c9ad5 --- /dev/null +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-record.component.ts @@ -0,0 +1,308 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; + +import { FreightAccountService } from '../../services/freight-account.service'; + +@Component({ + selector: 'app-withdrawals-record', + templateUrl: './withdrawals-record.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class WithdrawalsRecordComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + delete requestOptions?.body?.expand; + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + data = data.map(node => ({ ...node, disabled: node.refundStatus !== '1' })); + return data; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.amount, 0).toFixed(2); + break; + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any) { + this.msg = ''; + let params: string[] = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + disabled: () => this.service.http.loading, + type: 'default', + onClick: () => { + if (!this.msg || this.msg.trim().length === 0) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return false; + } + this.service + .request(this.service.$api_disagree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功'); + modal.destroy(); + this.st.load(1); + } + }); + return false; + } + }, + { + label: '通过', + disabled: () => this.service.http.loading, + type: 'primary', + onClick: () => { + this.service + .request(this.service.$api_agree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功'); + modal.destroy(); + this.st.load(1); + } + }); + return false; + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + refundApplyCode: { + type: 'string', + title: '提现单号', + ui: { + placeholder: '请输入' + } + }, + refundStatus: { + type: 'string', + title: '提现状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + }, + createTime: { + title: '提现时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + bankAccountName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + accountType: { + type: 'string', + title: '账户类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bank:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + bankType: { + type: 'string', + title: '银行类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bankname:type' }, + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '提现时间', index: 'createTime', width: 180 }, + { title: '提现单号', index: 'refundApplyCode', width: 120 }, + { title: '网络货运人', index: 'ltdName', width: 140 }, + { title: '银行类型', index: 'bankTypeLabel', width: 100 }, + { title: '账户类型', index: 'accountTypeLabel', width: 100 }, + { title: '账户名称', index: 'bankAccountName', width: 140 }, + { title: '虚拟账户', index: 'virtualAccount', width: 100 }, + { + title: '提现金额', + index: 'amount', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { title: '提现银行账户', render: 'bankCardNumber', width: 180 }, + { title: '提现状态', index: 'refundStatusLabel', width: 100 }, + { title: '银行流水号', index: 'bankSerialNumber', width: 120 }, + { title: '核心交易流水', index: 'coreSerNo', width: 130 }, + { title: '备注', index: 'rejectionCause', width: 150, format: item => item.failCause || item.rejectionCause }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '审核', + iif: item => item.refundStatus === '1', + click: item => this.auditAction(item) + }, + { + text: '详情
    ', + click: item => + this.router.navigate([`/financial-management/withdrawals-record/detail/${item.id}`], { + queryParams: { type: item.accountType } + }) + }, + { + text: '查看回单', + iif: item => item.refundStatus === '3', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.userId, + snglFlgCd: item.coreSerNo, + bussType: '06', + ltdId: item.ltdId, + accountType: item.accountType + }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/financial-management/financial-managemen-routing.module.ts b/src/app/routes/financial-management/financial-managemen-routing.module.ts new file mode 100644 index 00000000..e1a67109 --- /dev/null +++ b/src/app/routes/financial-management/financial-managemen-routing.module.ts @@ -0,0 +1,76 @@ +import { FreightAccountComponent } from './components/freight-account/freight-account.component'; +import { DriverAccountComponent } from './components/driver-account/driver-account.component'; +import { RechargeRecordComponent } from './components/recharge-record/recharge-record.component'; +import { WithdrawalsRecordComponent } from './components/withdrawals-record/withdrawals-record.component'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { FreightAccountDetailComponent } from './components/freight-account/freight-account-detail/freight-account-detail.component'; +import { DriverAccountDetailComponent } from './components/driver-account/driver-account-detail/driver-account-detail.component'; +import { WithdrawalsDetailComponent } from './components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { CostManagementComponent } from './components/cost-management/cost-management.component'; +import { AbnormalGoldComponent } from './components/abnormal-gold/abnormal-gold.component'; +import { PaymentRecordComponent } from './components/payment-record/payment-record.component'; +import { TransactionFlowComponent } from './components/transaction-flow/transaction-flow.component'; +import { CostManagementDetailComponent } from './components/cost-management/cost-management-detail/cost-management-detail.component'; +import { ExpensesReceivableComponent } from './components/cost-management/expenses-receivable/expenses-receivable.component'; +import { ExpensesPayableComponent } from './components/cost-management/expenses-payable/expenses-payable.component'; +import { PaymentOrderComponent } from './components/payment-order/payment-order.component'; +import { ReceiptOrderComponent } from './components/receipt-order/receipt-order.component'; +import { VoucherManagementComponent } from './components/voucher-management/voucher-management.component'; +import { VoucherSummaryComponent } from './components/voucher-summary/voucher-summary.component'; +import { ReceivableOrderComponent } from './components/receivable-order/receivable-order.component'; +import { PayableOrderComponent } from './components/payable-order/payable-order.component'; +import { ReceivableOrderDetailComponent } from './components/receivable-order/receivable-order-detail/receivable-order-detail.component'; +import { PayableOrderDetailComponent } from './components/payable-order/payable-order-detail/payable-order-detail.component'; +import { VoucherDetailComponent } from './components/voucher-management/voucher-detail/voucher-detail.component'; +import { SummaryDetailComponent } from './components/voucher-summary/summary-detail/summary-detail.component'; +import { VoucherListComponent } from './components/voucher-summary/voucher-list/voucher-list.component'; +import { ReceiptOrderDetailComponent } from './components/receipt-order/receipt-order-detail/receipt-order-detail.component'; +import { PaymentOrderDetailComponent } from './components/payment-order/payment-order-detail/payment-order-detail.component'; +import { PlatformAccountComponent } from './components/platform-account/platform-account.component'; +import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component'; +import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component'; +import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component'; +import { RefundRecordComponent } from './components/refund-record/refund-record.component'; + +const routes: Routes = [ + { path: 'freight-account', component: FreightAccountComponent, data: { guard: { ability: ['FINANCIAL-FREIGHT-ACOUNT-list'] } } }, + { path: 'freight-account/detail/:id', component: FreightAccountDetailComponent }, + { path: 'driver-account', component: DriverAccountComponent }, + { path: 'driver-account/detail/:id', component: DriverAccountDetailComponent }, + { path: 'platform-account', component: PlatformAccountComponent }, + { path: 'platform-account/detail/:id', component: PlatformAccountDetailComponent }, + { path: 'recharge-record', component: RechargeRecordComponent }, + { path: 'withdrawals-record', component: WithdrawalsRecordComponent }, + { path: 'withdrawals-record/detail/:id', component: WithdrawalsDetailComponent }, + { path: 'refund-record', component: RefundRecordComponent }, + { path: 'voucher-management', component: VoucherManagementComponent }, + { path: 'voucher-management/detail/:id', component: VoucherDetailComponent }, + { path: 'voucher-summary', component: VoucherSummaryComponent }, + { path: 'voucher-summary/detail/:id', component: SummaryDetailComponent }, + { path: 'voucher-summary/list/:id', component: VoucherListComponent }, + { path: 'voucher-summary/list/detail/:id', component: VoucherDetailComponent }, + { path: 'cost-management', component: CostManagementComponent }, + { path: 'cost-management/detail/:id', component: CostManagementDetailComponent }, + { path: 'cost-management/expenses-receivable/:id', component: ExpensesReceivableComponent }, + { path: 'cost-management/expenses-payable/:id', component: ExpensesPayableComponent }, + { path: 'abnormal-gold', component: AbnormalGoldComponent }, + { path: 'payment-record', component: PaymentRecordComponent }, + { path: 'transaction-flow', component: TransactionFlowComponent }, + { path: 'payment-order', component: PaymentOrderComponent }, + { path: 'payment-order/detail/:id', component: PaymentOrderDetailComponent }, + { path: 'receipt-order', component: ReceiptOrderComponent }, + { path: 'receipt-order/detail/:id', component: ReceiptOrderDetailComponent }, + { path: 'advance-collection', component: AdvanceCollectionComponent }, + { path: 'advance-collection/detail/:id', component: AdvanceCollectionDetailComponent }, + { path: 'receivable-order', component: ReceivableOrderComponent }, + { path: 'receivable-order/detail/:id', component: ReceivableOrderDetailComponent }, + { path: 'payable-order', component: PayableOrderComponent }, + { path: 'payable-order/detail/:id', component: PayableOrderDetailComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class FinancialManagementRoutingModule {} diff --git a/src/app/routes/financial-management/financial-management.module.ts b/src/app/routes/financial-management/financial-management.module.ts new file mode 100644 index 00000000..5844f4a2 --- /dev/null +++ b/src/app/routes/financial-management/financial-management.module.ts @@ -0,0 +1,78 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FreightAccountComponent } from './components/freight-account/freight-account.component'; +import { DriverAccountComponent } from './components/driver-account/driver-account.component'; +import { RechargeRecordComponent } from './components/recharge-record/recharge-record.component'; +import { WithdrawalsRecordComponent } from './components/withdrawals-record/withdrawals-record.component'; +import { SharedModule } from '@shared'; +import { FinancialManagementRoutingModule } from './financial-managemen-routing.module'; +import { FreightAccountDetailComponent } from './components/freight-account/freight-account-detail/freight-account-detail.component'; +import { DriverAccountDetailComponent } from './components/driver-account/driver-account-detail/driver-account-detail.component'; +import { WithdrawalsDetailComponent } from './components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { CostManagementComponent } from './components/cost-management/cost-management.component'; +import { AbnormalGoldComponent } from './components/abnormal-gold/abnormal-gold.component'; +import { PaymentRecordComponent } from './components/payment-record/payment-record.component'; +import { TransactionFlowComponent } from './components/transaction-flow/transaction-flow.component'; +import { ClearingModalComponent } from './components/abnormal-gold/clearing-modal/clearing-modal.component'; +import { CostManagementDetailComponent } from './components/cost-management/cost-management-detail/cost-management-detail.component'; +import { ExpensesReceivableComponent } from './components/cost-management/expenses-receivable/expenses-receivable.component'; +import { ExpensesPayableComponent } from './components/cost-management/expenses-payable/expenses-payable.component'; +import { PaymentOrderComponent } from './components/payment-order/payment-order.component'; +import { ReceiptOrderComponent } from './components/receipt-order/receipt-order.component'; +import { VoucherManagementComponent } from './components/voucher-management/voucher-management.component'; +import { VoucherSummaryComponent } from './components/voucher-summary/voucher-summary.component'; +import { ReceivableOrderComponent } from './components/receivable-order/receivable-order.component'; +import { PayableOrderComponent } from './components/payable-order/payable-order.component'; +import { ReceivableOrderDetailComponent } from './components/receivable-order/receivable-order-detail/receivable-order-detail.component'; +import { PayableOrderDetailComponent } from './components/payable-order/payable-order-detail/payable-order-detail.component'; +import { VoucherDetailComponent } from './components/voucher-management/voucher-detail/voucher-detail.component'; +import { SummaryDetailComponent } from './components/voucher-summary/summary-detail/summary-detail.component'; +import { PaymentOrderDetailComponent } from './components/payment-order/payment-order-detail/payment-order-detail.component'; +import { VoucherListComponent } from './components/voucher-summary/voucher-list/voucher-list.component'; +import { ReceiptOrderDetailComponent } from './components/receipt-order/receipt-order-detail/receipt-order-detail.component'; +import { PlatformAccountComponent } from './components/platform-account/platform-account.component'; +import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component'; +import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component'; +import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component'; +import { RefundRecordComponent } from './components/refund-record/refund-record.component'; + +const ROUTESCOMPONENTS = [ + FreightAccountComponent, + DriverAccountComponent, + RechargeRecordComponent, + WithdrawalsRecordComponent, + WithdrawalsDetailComponent, + AbnormalGoldComponent, + PaymentRecordComponent, + TransactionFlowComponent, + CostManagementComponent, + CostManagementDetailComponent, + ExpensesReceivableComponent, + ExpensesPayableComponent, + PaymentOrderComponent, + ReceiptOrderComponent, + VoucherManagementComponent, + VoucherDetailComponent, + VoucherSummaryComponent, + SummaryDetailComponent, + ReceivableOrderComponent, + PayableOrderComponent, + ReceivableOrderDetailComponent, + PayableOrderDetailComponent, + PlatformAccountComponent, + PlatformAccountDetailComponent, + PaymentOrderDetailComponent, + VoucherListComponent, + ReceiptOrderDetailComponent, + AdvanceCollectionComponent, + AdvanceCollectionDetailComponent, + RefundRecordComponent +]; + +const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent, ClearingModalComponent]; + +@NgModule({ + declarations: [...ROUTESCOMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, FinancialManagementRoutingModule, SharedModule] +}) +export class FinancialManagementModule {} diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts new file mode 100644 index 00000000..60242ceb --- /dev/null +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -0,0 +1,193 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-18 15:57:44 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-26 16:53:11 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\services\\freight-account.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService, EACacheService, ShipperBaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class FreightAccountService extends ShipperBaseService { + $mock_url = '/rule?_allow_anonymous=true'; + + // 运营端获取货主账户信息 + $api_get_shipper_account_page = '/api/fcc/accountBalance/getShipperAccountBalanceByOperator'; + // 运营端获取司机账户信息 + $api_get_driver_account_page = '/api/fcc/accountBalance/getDriverAccountBalanceByOperator'; + + // 运营端获取平台余额 + $api_get_platform_account_header = '/api/fcc/accountBalance/getPlatformBalanceByOperator'; + // 运营端获取平台余额 + $api_get_platform_account_statistics = '/api/fcc/accountBalanceDetail/getAccountBalancePlatformIncomeDetailByOperator'; + // 运营端获取平台余额 + $api_get_platform_account_page = '/api/fcc/accountBalance/getPlatformAccountBalanceByOperator'; + // 运营端获取账户余额交易明细 + $api_get_platform_account_detail_page = '/api/fcc/accountBalanceDetail/getAccountBalanceByPage'; + + // 运营端获取货主账户明细信息 + $api_get_shipper_account_detail = '/api/fcc/accountBalanceDetail/getAccountBalanceShipperByOperatorPage'; + // 运营端获取司机账户明细信息 + $api_get_driver_account_detail = '/api/fcc/accountBalanceDetail/getAccountBalanceDriverByOperatorPage'; + // 运营端端获取货主交易收入与支出金额 + $api_get_shipper_account_balance_detail = '/api/fcc/accountBalanceDetail/getAccountBalanceShipperIncomeDetailByOperator'; + // 运营端端获取司机交易收入与支出金额 + $api_get_driver_account_balance_detail = '/api/fcc/accountBalanceDetail/getAccountBalanceDriverIncomeDetailByOperator'; + // 运营端导出司机账户明细信息 + $api_export_driver_account_page = '/api/fcc/accountBalance/exportDriverAccountBalanceByOperator'; + + // 货主端获取账户余额交易明细 + $api_get_balance_by_shipper = '/api/fcc/accountBalanceDetail/getAccountBalanceByShipperPage'; + // 运营端导出货主账户明细信息 + $api_export_shipper = '/api/fcc/accountBalance/reportShipperAccountBalanceByOperator'; + + // 查询订单支付申请表 + $api_get_order_payment_page = '/api/fcc/billPaymentApplicationOBC/list/page'; + + // 查询提现申请表 + $api_get_refund_page = '/api/fcc/refundApplicationOBC/list/page'; + // 获取提现申请表详情 + $api_get_refund_detail = '/api/fcc/refundApplicationOBC/get'; + // 获取提现支付详情 + $api_get_refund_detail_page = '/api/fcc/refundApplicationOBC/get/payList'; + // 同意提现 + $api_agree_refund = '/api/fcc/refundApplicationOBC/agreeRefund'; + // 拒绝提现 + $api_disagree_refund = '/api/fcc/refundApplicationOBC/disagreeRefund'; + + // 查询订单退款申请表 + $api_get_refund_record_page = '/api/fcc/billRefundApplication/list/page'; + // 同意退款 + $api_agree_refund_record = '/api/fcc/billRefundApplication/agreeRefund'; + // 不同意退款 + $api_disagree_refund_record = '/api/fcc/billRefundApplication/disagreeRefund'; + // 重新发起 + $api_rebulid_refund_record = '/api/fcc/billRefundApplication/rebulid'; + + // 查询充值信息表 + $api_get_recharge_page = '/api/fcc/rechargeInfo/list/getPageByOperator'; + // 查询异常入金 + $api_get_abnormal_gold_page = '/api/fcc/rechargeInfo/list/page'; + // 运营端获取账户余额交易明细 + $api_get_account_blance = '/api/fcc/accountBalanceDetail/getAccountBalanceByPage'; + // 添加备注 + $api_edit_remark = '/api/fcc/rechargeInfo/addRemark'; + + // 查询费用单抬头 + $api_get_cost_page = '/api/fcc/ficoFeeH/list/page'; + // 根据费用头ID查询费用单及开票明细 + $api_get_cost_detail = '/api/fcc/ficoFeeL/detail'; + // 费用关联的应收核销明细 + $api_get_cost_ahxl_detail = '/api/fcc/ficoAhxL/getListByFeeLId'; + + // 查询应收核销抬头 + $api_get_fico_page = '/api/fcc/ficoAhxH/list/page'; + // 获取应收核销抬头 + $api_get_fico_header = '/api/fcc/ficoAhxH/get'; + // 查询应收核销明细 + $api_get_fico_detail_header = '/api/fcc/ficoAhxL/list/page'; + + // 查询应付核销抬头 + $api_get_fico_ph_page = '/api/fcc/ficoPhxH/list/page'; + // 获取应付核销抬头 + $api_get_fico_ph_header = '/api/fcc/ficoPhxH/get'; + // 查询应付核销明细 + $api_get_fico_ph_detail_header = '/api/fcc/ficoPhxL/list/page'; + + // 查询总账凭证表 + $api_get_fico_vch_page = '/api/fcc/ficoVcH/list/page'; + // 获取总账凭证表详情信息 + $api_get_fico_vch__detail = '/api/fcc/ficoVcH/getDetail'; + + // 查询付款单抬头 + $api_get_payment_page = '/api/fcc/ficoPayH/listFicoPayHPage'; + // 查询付款单明细 + $api_get_payment_detail = '/api/fcc/ficoPayL/list/page'; + // 付款单抬头信息 + $api_get_payment_header = '/api/fcc/ficoPayH/getFicoPayHById'; + + // 查询收款单抬头 + $api_get_receipt_page = '/api/fcc/ficoBrmH/list/page'; + // 收款单抬头信息 + $api_get_receipt_header = '/api/fcc/ficoBrmH/get'; + // 获取收款单抬头 + $api_get_receipt_detail = '/api/fcc/ficoBrmYsk/getListByBrmHid'; + + // 收款单浏览抬头 + $api_get_ficoInpinvL_page = '/api/fcc/ficoBrmH/get'; + // 收款单浏览表格明细 + $api_get_ficoInpinvL_getListByBrmHid = '/api/fcc/ficoBrmYsk/getListByBrmHid'; + + // 下载银行回单请求 + $api_download_receipt_apply = '/api/fcc/spd/callback/receiptApply'; + $api_download_receipt_apply_byte = '/api/fcc/spd/callback/receiptApplyByte'; + + // 查询预收款余额 + $api_get_advance_collection_page = '/api/fcc/ficoYskBla/list/page'; + // 根据预收款ID获取收款单抬头 + $api_get_advance_collection_header = '/api/fcc/ficoBrmH/getByYskblaId'; + // 根据预收款ID获取收款单明细 + $api_get_advance_collection_detail = '/api/fcc/ficoBrmYsk/getBrmYskByYskblaId'; + // 根据预收款ID获取核销信息明细 + $api_get_advance_collection_hrxiao = '/api/fcc/ficoAhxH/getAhxHByYskblaId'; + + constructor(public injector: Injector) { + super(injector); + } + + getReceiptUrl(url: string, params: any) { + const { bankType, snglFlgCd } = params; + if (url) { + if (params?.bankType === '1') { + window.open(params?.receiptUrl); + } else if (params?.bankType === '2') { + this.exportFile({ bankType, receiptUrl: url, bankSerialNumber: snglFlgCd }, this.$api_download_receipt_apply_byte); + } + } else { + this.request(this.$api_download_receipt_apply, { ...params }).subscribe(res => { + if (res?.receiptUrl) { + if (bankType === '1') { + window.open(res?.receiptUrl); + } else if (bankType === '2') { + this.downloadFile(this.$api_download_receipt_apply_byte, { + bankType, + receiptUrl: res.receiptUrl, + bankSerialNumber: snglFlgCd + }); + } + } else { + this.msgSrv.warning(res.statusMsg || '获取回单失败'); + } + }); + } + } + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + reviewPDF(url: string) { + if (!url) { + return; + } + const uA = window.navigator.userAgent; // 判断浏览器内核 + const isIE = + /msie\s|trident\/|edge\//i.test(uA) && + !!('uniqueID' in document || 'documentMode' in document || 'ActiveXObject' in window || 'MSInputMethodContext' in window); + const objectUrl = url; + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = objectUrl; + a.download = `回单.pdf`; + if (isIE) { + // 兼容IE11无法触发下载的问题 + (navigator as any).msSaveBlob(url, a.download); + } else { + a.click(); + } + a.remove(); + } +} diff --git a/src/app/routes/insurance-management/components/list/list.component.html b/src/app/routes/insurance-management/components/list/list.component.html new file mode 100644 index 00000000..d74b9efa --- /dev/null +++ b/src/app/routes/insurance-management/components/list/list.component.html @@ -0,0 +1,133 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + +
    + + + {{ item.resourceCode | currency }} + + + {{ item.practicalPremium | currency }} + + + {{ item.insureAmount | currency }} + + + {{ item.premium | currency }} + + + {{ item.processResult == '2' ? item.processMessage : '' }} + + +
    {{ item?.driverName }}/{{ item?.driverTelephone }}/{{ item?.carNo }}
    +
    + +
    + {{ item?.distance ? ((item?.distance)/1000).toFixed(4) + '公里' : '' }} +
    +
    + +
    + {{ item?.billCode }} +
    +
    + +
    + {{ item?.resourceCode }} +
    +
    + {{ item?.resourceStatusLabel }} +
    +
    + +
    {{ item.insureCode }}
    +
    + {{ item?.insureStatusLabel }} +
    +
    + +
    {{ item?.goodsInfoName }}
    +
    + {{ item?.weight ? item?.weight + '吨/' : '' }} + {{ item?.volume ? item?.volume + '方' : '' }} + {{ item?.number ? item?.number + '件' : '' }} +
    +
    + +
    +

    + {{ data.expenseName }}:{{ data.price | currency }} + {{ data.paymentStatusLabel }} +

    +
    +
    +
    +
    +
    + + +
    + +
    +
    diff --git a/src/app/routes/insurance-management/components/list/list.component.less b/src/app/routes/insurance-management/components/list/list.component.less new file mode 100644 index 00000000..149a0bc9 --- /dev/null +++ b/src/app/routes/insurance-management/components/list/list.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/insurance-management/components/list/list.component.spec.ts b/src/app/routes/insurance-management/components/list/list.component.spec.ts new file mode 100644 index 00000000..1cb2cef1 --- /dev/null +++ b/src/app/routes/insurance-management/components/list/list.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:03:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-25 17:22:11 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { insuranceManagementListComponent } from './list.component'; + +describe('insuranceManagementListComponent', () => { + let component: insuranceManagementListComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ insuranceManagementListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(insuranceManagementListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/insurance-management/components/list/list.component.ts b/src/app/routes/insurance-management/components/list/list.component.ts new file mode 100644 index 00000000..c6fbcbb1 --- /dev/null +++ b/src/app/routes/insurance-management/components/list/list.component.ts @@ -0,0 +1,564 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { Router } from '@angular/router'; +import { InsuranceManagementService } from '../../services/insurance-management.service'; +import { VehicleImgViewComponent } from 'src/app/routes/vehicle/components/list/img-view/img-view.component'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; + +@Component({ + selector: 'app-insurance-management-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.less'] +}) +export class insuranceManagementListComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('stFloat') private readonly stFloat!: STComponent; + @ViewChild('stFloatView') private readonly stFloatView!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + columns: STColumn[] = []; + columnsFloat: STColumn[] = []; + columnsFloatView: STColumn[] = []; + demoValue: any; + resourceStatus: any; + datass: any = [ + { + one: '1', + two: '1', + three: '1', + id: 1 + }, + { + one: '2', + two: '2', + three: '2', + id: 2 + } + ]; + tabs = { + totalCount: 0, + receivedQuantity: 0, + stayQuantity: 0, + GoingQuantity: 0, + cancelQuantity: 0 + }; + constructor( + public service: InsuranceManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router, + private modale: ModalHelper, + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.insureStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + }, + recordTime: { + start: this.sf?.value?.recordTime?.[0] || '', + end: this.sf?.value?.recordTime?.[1] || '' + }, + insureTime: { + start: this.sf?.value?.insureTime?.[0] || '', + end: this.sf?.value?.insureTime?.[1] || '' + }, + }; + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + getGoodsSourceStatistical() { + this.tabs = { + totalCount: 0, + receivedQuantity: 0, + stayQuantity: 0, + GoingQuantity: 0, + cancelQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.insureStatus; + this.service.request(this.service.$api_listStatisticalStatus, params).subscribe((res: any) => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.insureStatusLabel === '待投保') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.insureStatusLabel === '已投保') { + this.tabs.stayQuantity = element.quantity; + } else if (element.insureStatusLabel === '投保失败') { + this.tabs.GoingQuantity = element.quantity; + } else if (element.insureStatusLabel === '已取消') { + this.tabs.cancelQuantity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + ngOnInit(): void { + this.getGoodsSourceStatistical(); + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + insureCode: { + type: 'string', + title: '投保编号' + }, + billCode: { + type: 'string', + title: '订单号' + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + policyNo: { + type: 'string', + title: '保单号', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, + insureType: { + title: '类型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'insure:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + startAddress: { + type: 'string', + title: '始发地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + endAddress: { + type: 'string', + title: '目的地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema + }, + + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + insureStatus: { + title: '投保状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'insure:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + insureRefundStatus: { + title: '退款状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'insure:refund:status' }, + containsAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + insureTime: { + title: '投保时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + recordTime: { + title: '录单时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '投保编号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'insureCode' + }, + { + title: '保单号', + width: '250px', + className: 'text-right', + index: 'policyNo' + }, + { title: '类型', index: 'insureTypeLabel', width: '220px', className: 'text-left' }, + { title: '始发地', index: 'startAddress', width: '220px', className: 'text-left' }, + { title: '目的地', index: 'endAddress', width: '220px', className: 'text-left' }, + { title: '距离', render: 'distance', width: '180px', className: 'text-left' }, + { title: '保额(元)', render: 'insureAmount', width: '180px', className: 'text-right' }, + { title: '保费(元)', render: 'premium', width: '180px', className: 'text-right' }, + // { + // title: '实际保费(元)', + // className: 'text-right', + // width: '180px', + // render: 'practicalPremium' + // }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsName' + }, + { + title: '承运司机', + className: 'text-right', + width: '250px', + render: 'driverName' + }, + { + title: '关联订单号', + className: 'text-right', + render: 'goodsNumber', + width: '180px' + }, + { + title: '货源编号', + className: 'text-right', + render: 'resourceCode', + width: '150px' + }, + { + title: '网络货运人', + className: 'text-left', + width: '250px', + index: 'enterpriseInfoName' + }, + { + title: '货主', + className: 'text-left', + width: '250px', + index: 'shipperAppUserName' + }, + { + title: '所属项目', + width: '250px', + className: 'text-left', + index: 'enterpriseProjectName' + }, + { + title: '投保时间', + width: '180px', + className: 'text-left', + index: 'insureTime' + }, + { + title: '生效时间', + width: '180px', + className: 'text-left', + index: 'effectTime' + }, + { + title: '录单时间', + width: '180px', + className: 'text-left', + index: 'recordTime' + }, + { + title: '创建时间', + width: '180px', + className: 'text-left', + index: 'createTime' + }, + { + title: '失败原因', + width: '180px', + className: 'text-left', + render: 'processMessage', + // processResult=2 + }, + { + title: '退款状态', + width: '180px', + className: 'text-left', + index: 'insureRefundStatusLabel', + // processResult=2 + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '查看保单', + click: _record => this.showImg(_record), + iif: item => item.insureStatus == '2' + // acl: { ability: ['VEHICLE-LIST-view'] }, + // iif: item => + // item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1' + }, + { + text: '退保费', + click: _record => this.retreatPrice(_record), + iif: item => item.insureStatus == '2' + // acl: { ability: ['VEHICLE-LIST-view'] }, + } + ] + } + ]; + } + showImg(_record: any) { + window.location.href = `${_record.policyUrl}`; + // const params = { + // imgList: [_record.policyUrl], + // index: 0 + // }; + // this.modal.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + // 退保费 + retreatPrice(value: any) { + this.modal.warning({ + nzTitle: '确认退还保费吗?', + nzClosable: true, + nzContent: '退还后不可撤销,请谨慎操作!', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_get_addINPBillRefundApplication, {id: value.id}).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除菜单成功'); + } + }); + } + }); + } + // 再次投保 + retreatNext(value: any) { + this.modal.warning({ + nzTitle: '确认再次投保吗?', + nzClosable: true, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_del_many, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除菜单成功'); + } + }); + } + }); + } + // 保险配置 + changeOrder() { + this.router.navigate(['/insurance-management/list-set', 1]); + } +} diff --git a/src/app/routes/insurance-management/components/set/set.component.html b/src/app/routes/insurance-management/components/set/set.component.html new file mode 100644 index 00000000..e803c987 --- /dev/null +++ b/src/app/routes/insurance-management/components/set/set.component.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/src/app/routes/insurance-management/components/set/set.component.less b/src/app/routes/insurance-management/components/set/set.component.less new file mode 100644 index 00000000..1d17aeb7 --- /dev/null +++ b/src/app/routes/insurance-management/components/set/set.component.less @@ -0,0 +1,94 @@ +:host { + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .source-info { + p { + margin-bottom: .5em; + } + } + + .freight-info-box { + width: 95%; + } + + .freigth-label { + display : inline-block; + width : 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width : 70%; + margin: 0 auto; + } + } + + // .ant-tabs-top>.ant-tabs-nav, + // .ant-tabs-bottom>.ant-tabs-nav, + // .ant-tabs-top>div>.ant-tabs-nav, + // .ant-tabs-bottom>div>.ant-tabs-nav { + // margin: 0; + // } + + // .ant-anchor-ink::before { + // width: 0; + // } + + // .ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab { + // margin-left: 40px + // } + } + + .leftPadding { + padding-right: 100px; + } + .handling-info { + min-height: 100px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/insurance-management/components/set/set.component.spec.ts b/src/app/routes/insurance-management/components/set/set.component.spec.ts new file mode 100644 index 00000000..42437440 --- /dev/null +++ b/src/app/routes/insurance-management/components/set/set.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { insuranceManagementSetComponent } from './set.component'; + +describe('insuranceManagementSetComponent', () => { + let component: insuranceManagementSetComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ insuranceManagementSetComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(insuranceManagementSetComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/insurance-management/components/set/set.component.ts b/src/app/routes/insurance-management/components/set/set.component.ts new file mode 100644 index 00000000..7e1055a0 --- /dev/null +++ b/src/app/routes/insurance-management/components/set/set.component.ts @@ -0,0 +1,45 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:20:26 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-25 20:43:37 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\set\\set.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Router } from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { InsuranceManagementService } from '../../services/insurance-management.service'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +@Component({ + selector: 'app-insurance-management-set', + templateUrl: './set.component.html', + styleUrls: ['./set.component.less'] +}) +export class insuranceManagementSetComponent implements OnInit { + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: InsuranceManagementService, + ) { + + } + + ngOnInit(): void { + this.initData() + } + initData() { + + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/insurance-management/insurance-management-routing.module.ts b/src/app/routes/insurance-management/insurance-management-routing.module.ts new file mode 100644 index 00000000..845a621d --- /dev/null +++ b/src/app/routes/insurance-management/insurance-management-routing.module.ts @@ -0,0 +1,25 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-06 09:24:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-25 17:21:54 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\insurance-management-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { insuranceManagementListComponent } from './components/list/list.component'; +import { insuranceManagementSetComponent } from './components/set/set.component'; + + +const routes: Routes = [ + { path: 'list', component: insuranceManagementListComponent }, + { path: 'list-set/:id', component: insuranceManagementSetComponent }, +] +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class InsuranceManagementRoutingModule { } diff --git a/src/app/routes/insurance-management/insurance-management.module.ts b/src/app/routes/insurance-management/insurance-management.module.ts new file mode 100644 index 00000000..00103336 --- /dev/null +++ b/src/app/routes/insurance-management/insurance-management.module.ts @@ -0,0 +1,23 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-06 09:24:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-25 20:45:45 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\insurance-management.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule, Type } from '@angular/core'; +import { InsuranceTableModule, SharedModule } from '@shared'; +import { insuranceManagementListComponent } from './components/list/list.component'; +import { insuranceManagementSetComponent } from './components/set/set.component'; +import { InsuranceManagementRoutingModule } from './insurance-management-routing.module'; +const COMPONENTS: Type[] = [insuranceManagementListComponent, insuranceManagementSetComponent]; + +@NgModule({ + imports: [SharedModule, InsuranceManagementRoutingModule, InsuranceTableModule], + declarations: COMPONENTS +}) +export class InsuranceManagementModule {} diff --git a/src/app/routes/insurance-management/services/insurance-management.service.ts b/src/app/routes/insurance-management/services/insurance-management.service.ts new file mode 100644 index 00000000..ee65b8e3 --- /dev/null +++ b/src/app/routes/insurance-management/services/insurance-management.service.ts @@ -0,0 +1,36 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 15:31:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-28 17:11:54 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\services\\insurance-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { EACacheService, ShipperBaseService } from '@shared'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class InsuranceManagementService extends ShipperBaseService { + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + // 查询保险费信息表 + public $api_premiumInfo_list = '/api/sdc/premiumInfo/list/page'; + // 统计保险单状态数量 + public $api_listStatisticalStatus = '/api/sdc/premiumInfo/listStatisticalStatus'; + + + // 保险费公司认证 + $api_get_submitAuthInfo = `/api/sdc/premiumInfo/submitAuthInfo`; + // 退保费 + $api_get_addINPBillRefundApplication = `/billRefundApplication/addINPBillRefundApplication`; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/logs/components/system-logs/system-logs.component.html b/src/app/routes/logs/components/system-logs/system-logs.component.html new file mode 100644 index 00000000..ebbf215b --- /dev/null +++ b/src/app/routes/logs/components/system-logs/system-logs.component.html @@ -0,0 +1,30 @@ + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + diff --git a/src/app/routes/logs/components/system-logs/system-logs.component.ts b/src/app/routes/logs/components/system-logs/system-logs.component.ts new file mode 100644 index 00000000..90caac95 --- /dev/null +++ b/src/app/routes/logs/components/system-logs/system-logs.component.ts @@ -0,0 +1,112 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { LogsService } from '../../services/logs.service'; + +@Component({ + selector: 'app-system-logs', + templateUrl: './system-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class SystemLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + operator: { + type: 'string', + title: '操作人', + ui: { placeholder: '请输入' } + }, + telephone: { + type: 'string', + title: '手机号码', + ui: { placeholder: '请输入' } + }, + operatePage: { + type: 'string', + title: '操作页面', + ui: { + placeholder: '请输入' + } + }, + operationContent: { + type: 'string', + title: '操作内容', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + time: { + title: '操作时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '操作时间', index: 'operatorTimestamp' }, + { title: '操作人', index: 'operator' }, + { title: '操作人手机号码', index: 'telephone' }, + { title: '操作页面', index: 'operatePage' }, + { title: '操作内容', index: 'operationContent' } + ]; + + _$expand = false; + + constructor(public service: LogsService) {} + + ngOnInit(): void { + } + + beforeReq = (requestOptions: STRequestOptions) => { + requestOptions.body.operateType = '1'; + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + operateType: '1', + endTime: this.sf.value.time?.[1] || null, + startTime: this.sf.value.time?.[0] || null + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.html b/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.html new file mode 100644 index 00000000..a1b61545 --- /dev/null +++ b/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.html @@ -0,0 +1,31 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.ts b/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.ts new file mode 100644 index 00000000..53edd71b --- /dev/null +++ b/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.ts @@ -0,0 +1,91 @@ +/* + * @Author: your name + * @Date: 2022-01-04 14:42:30 + * @LastEditTime: 2022-01-04 16:04:46 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\sys-setting\components\system-supply-logs\system-supply-logs.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { LogsService } from '../../services/logs.service'; + +@Component({ + selector: 'app-system-logs', + templateUrl: './system-supply-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class SystemSupplyLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + operateObject: { + type: 'string', + title: '货源编码', + ui: { + placeholder: '请输入', + } + }, + time: { + title: '操作时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + + { title: 'ID', index: 'id' }, + { title: '货源编码', index: 'operateObject' }, + { title: '说明', index: 'operationContent' }, + { title: '操作人', index: 'operator' }, + { title: '操作时间', index: 'operatorTimestamp', type: 'date' }, + ]; + + _$expand = false; + + constructor(public service: LogsService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + requestOptions.body.operateType = '4' + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + operateType: '4', + endTime: this.sf.value.time?.[1] || null, + startTime: this.sf.value.time?.[0] || null + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.html b/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.html new file mode 100644 index 00000000..c51c7fa9 --- /dev/null +++ b/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.html @@ -0,0 +1,34 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + + diff --git a/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.ts b/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.ts new file mode 100644 index 00000000..f394883f --- /dev/null +++ b/src/app/routes/logs/components/system-waybill-logs/system-waybill-logs.component.ts @@ -0,0 +1,90 @@ +/* + * @Author: your name + * @Date: 2022-01-04 14:44:59 + * @LastEditTime: 2022-01-04 16:05:27 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\sys-setting\components\system-waybill-logs\system-waybill-logs.component.ts + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { LogsService } from '../../services/logs.service'; + +@Component({ + selector: 'app-system-logs', + templateUrl: './system-waybill-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class SystemWaybillLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + operateObject: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入', + } + }, + time: { + title: '登录时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: 'ID', index: 'id' }, + { title: '订单号', index: 'operateObject' }, + { title: '说明', index: 'operationContent' }, + { title: '操作人', index: 'operator' }, + { title: '操作时间', index: 'operatorTimestamp', type: 'date' }, + ]; + + _$expand = false; + + constructor(public service: LogsService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + requestOptions.body.operateType = '3' + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + operateType: '3', + endTime: this.sf.value.time?.[1] || null, + startTime: this.sf.value.time?.[0] || null + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/logs/components/user-logs/user-logs.component.html b/src/app/routes/logs/components/user-logs/user-logs.component.html new file mode 100644 index 00000000..ea2aff40 --- /dev/null +++ b/src/app/routes/logs/components/user-logs/user-logs.component.html @@ -0,0 +1,27 @@ + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/app/routes/logs/components/user-logs/user-logs.component.ts b/src/app/routes/logs/components/user-logs/user-logs.component.ts new file mode 100644 index 00000000..70bf123f --- /dev/null +++ b/src/app/routes/logs/components/user-logs/user-logs.component.ts @@ -0,0 +1,123 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { LogsService } from '../../services/logs.service'; + +@Component({ + selector: 'app-user-logs', + templateUrl: './user-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class UserLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + roleName: { + type: 'string', + title: '登录端口', + ui: { placeholder: '请输入' } + }, + loginType: { + type: 'string', + title: '登录方式', + enum: [ + { label: '全部', value: null }, + { label: 'PC', value: '1' }, + { label: 'APP', value: '2' }, + { label: '小程序', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: null + }, + address: { + type: 'string', + title: '位置', + ui: { + placeholder: '请输入' + } + }, + terminalIp: { + type: 'string', + title: 'ip', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + time: { + title: '登录时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '登录时间', index: 'createTime', type: 'date' }, + { title: '登录端口', index: 'roleName' }, + { title: '姓名', index: 'userName' }, + { title: '登录方式', index: 'loginType', enum: { '1': 'PC', '2': 'APP', '3': '小程序' }, type: 'enum' }, + { title: '位置', index: 'address' }, + { title: 'ip', index: 'terminalIp' } + ]; + + _$expand = false; + + constructor(public service: LogsService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + time: { + start: this.sf.value.time?.[0] || null, + end: this.sf.value.time?.[1] || null + } + }); + } + return requestOptions; + }; + + roleAction(item?: any) {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/logs/components/version-logs/version-logs.component.html b/src/app/routes/logs/components/version-logs/version-logs.component.html new file mode 100644 index 00000000..3eff1b25 --- /dev/null +++ b/src/app/routes/logs/components/version-logs/version-logs.component.html @@ -0,0 +1,40 @@ + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + diff --git a/src/app/routes/logs/components/version-logs/version-logs.component.ts b/src/app/routes/logs/components/version-logs/version-logs.component.ts new file mode 100644 index 00000000..d53bad68 --- /dev/null +++ b/src/app/routes/logs/components/version-logs/version-logs.component.ts @@ -0,0 +1,124 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { LogsService } from '../../services/logs.service'; + +@Component({ + selector: 'app-version-logs', + templateUrl: './version-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class VersionLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + publishPort: { + type: 'string', + title: '端口', + enum: [ + { label: '全部', value: null }, + { label: '司机', value: '1' }, + { label: '货主', value: '2' }, + { label: '运营平台', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: null + }, + publishType: { + type: 'string', + title: '端口方式', + enum: [ + { label: '全部', value: null }, + { label: 'PC ', value: '1' }, + { label: 'APP', value: '2' }, + { label: '小程序', value: '3' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: null + }, + publishVersion: { + type: 'string', + title: '版本号', + ui: { + placeholder: '请输入' + } + }, + time: { + title: '发布时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '端口', index: 'publishPort', type: 'enum', enum: { 1: '司机', 2: '货主', 3: '运营平台' } }, + { title: '端口方式', index: 'publishType', type: 'enum', enum: { 1: 'PC', 2: 'APP', 3: '小程序' } }, + { title: '版本号', index: 'publishVersion' }, + { + title: '发布时间', + index: 'createTime', + type: 'date' + }, + { title: '更新内容', index: 'publicshContext' } + ]; + + _$expand = false; + + constructor(public service: LogsService, private nzModalService: NzModalService) {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + publishTime: { + start: this.sf.value.time?.[0] || null, + end: this.sf.value.time?.[1] || null + } + }); + } + return requestOptions; + }; + + ngOnInit(): void {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/logs/logs-routing.module.ts b/src/app/routes/logs/logs-routing.module.ts new file mode 100644 index 00000000..40e2ccb5 --- /dev/null +++ b/src/app/routes/logs/logs-routing.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { SystemLogsComponent } from './components/system-logs/system-logs.component'; +import { SystemSupplyLogsComponent } from './components/system-supply-logs/system-supply-logs.component'; +import { SystemWaybillLogsComponent } from './components/system-waybill-logs/system-waybill-logs.component'; +import { UserLogsComponent } from './components/user-logs/user-logs.component'; +import { VersionLogsComponent } from './components/version-logs/version-logs.component'; + +const routes: Routes = [ + { path: 'system-logs', component: SystemLogsComponent }, + { path: 'user-logs', component: UserLogsComponent }, + { path: 'version-logs', component: VersionLogsComponent }, + { path: 'system-supply-logs', component: SystemSupplyLogsComponent }, + { path: 'system-waybill-logs', component: SystemWaybillLogsComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class LogsRoutingModule {} diff --git a/src/app/routes/logs/logs.module.ts b/src/app/routes/logs/logs.module.ts new file mode 100644 index 00000000..6454841b --- /dev/null +++ b/src/app/routes/logs/logs.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '@shared'; +import { LogsRoutingModule } from './logs-routing.module'; +import { SystemLogsComponent } from './components/system-logs/system-logs.component'; +import { SystemSupplyLogsComponent } from './components/system-supply-logs/system-supply-logs.component'; +import { SystemWaybillLogsComponent } from './components/system-waybill-logs/system-waybill-logs.component'; +import { UserLogsComponent } from './components/user-logs/user-logs.component'; +import { VersionLogsComponent } from './components/version-logs/version-logs.component'; + +const COMPONENTS = [SystemLogsComponent, UserLogsComponent, VersionLogsComponent, SystemSupplyLogsComponent, SystemWaybillLogsComponent]; +@NgModule({ + declarations: [...COMPONENTS], + imports: [CommonModule, LogsRoutingModule, SharedModule] +}) +export class LogsModule {} diff --git a/src/app/routes/logs/services/logs.service.ts b/src/app/routes/logs/services/logs.service.ts new file mode 100644 index 00000000..1c0a9489 --- /dev/null +++ b/src/app/routes/logs/services/logs.service.ts @@ -0,0 +1,19 @@ +import { Injectable, Injector } from '@angular/core'; +import { Menu } from '@delon/theme'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class LogsService extends BaseService { + // 查询用户登录记录表 + public $api_user_login_logs = '/api/mdc/userLoginLog/list/page'; + // 获取操作日志列表 + public $api_get_systemt_logs = '/api/mdc/pbc/operationLogRecords/getOperationLogRecordsList'; + // 查询版本发布表 + public $api_get_version_logs = '/api/mdc/versionPublish/list/page'; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/menu-manager/components/api-auth/api-auth.component.html b/src/app/routes/menu-manager/components/api-auth/api-auth.component.html new file mode 100644 index 00000000..f1d7c7f0 --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/api-auth.component.html @@ -0,0 +1,75 @@ + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + + + + + + + + + + 菜单名称 + 菜单编号 + 路由地址 + 菜单图标 + 菜单排序 + 操作 + + + + + + + + + {{ item.text }} + + {{ item.keyCode }} + {{ item.link }} + + + + {{ item.sorted }} + + 权限配置 + + + + + + + \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/api-auth/api-auth.component.less b/src/app/routes/menu-manager/components/api-auth/api-auth.component.less new file mode 100644 index 00000000..b83ce9ee --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/api-auth.component.less @@ -0,0 +1,17 @@ +:host { + ::ng-deep { + .pane-content-left { + padding-right: 12px; + + nz-select { + width: 100%; + margin-bottom: 1rem; + border-bottom: 2px solid #15408e; + } + } + .pane-content-right { + padding-left: 12px; + } + } + } + \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/api-auth/api-auth.component.ts b/src/app/routes/menu-manager/components/api-auth/api-auth.component.ts new file mode 100644 index 00000000..c61cab04 --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/api-auth.component.ts @@ -0,0 +1,80 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema } from '@delon/form'; +import { EAEnvironmentService } from '@shared'; +import { NzDrawerService } from 'ng-zorro-antd/drawer'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { MenuManagerService } from '../../services/menu-manager.service'; +import { MenuModalComponent } from '../index/menu-modal/menu-modal.component'; +import { AuthDrawerComponent } from './auth-drawer/auth-drawer.component'; + +@Component({ + selector: 'app-api-auth', + templateUrl: './api-auth.component.html', + styleUrls: ['./api-auth.component.less', '../../../commom/less/box.less'] +}) +export class ApiAuthComponent implements OnInit { + selectedPlatform!: { name: string; appId: string; enName: string }; + platforms: Array = [ + { name: '货主PC', appId: 'A48F72F0A304427F921794BAD86B3522', enName: 'tms-smc-web' }, + { name: '运营后台', appId: this.envSrv.env.appId, enName: 'tms-obc-web' } + ]; + + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + roleName: { + type: 'string', + title: '菜单名称', + ui: { placeholder: '请输入' } + } + } + }; + + mapOfExpandedData: { [key: string]: any[] } = {}; + listOfMapData: any[] = []; + constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private drawer: NzDrawerService) { + this.initData(); + } + + ngOnInit(): void {} + + initData(): void { + this.selectedPlatform = this.platforms[0]; + this.loadMemu(this.selectedPlatform.appId); + } + + loadMemu(appId: string) { + this.service.request(this.service.$api_get_all, { appId }, 'POST', false).subscribe(res => { + if (res) { + this.listOfMapData = res; + this.listOfMapData.forEach(item => { + this.mapOfExpandedData[item.key] = this.service.convertTreeToList(item); + }); + // console.log(this.listOfMapData, this.mapOfExpandedData); + } + }); + } + + changeMemu(key: number) { + this.selectedPlatform = this.platforms[key]; + this.loadMemu(this.selectedPlatform.appId); + } + + openDrawer(item: any) { + this.drawer.create({ + nzTitle: `接口权限配置(${item.text})`, + nzContent: AuthDrawerComponent, + nzWidth: 900, + nzContentParams: { id: item.id, appId: this.selectedPlatform.appId, code: item.keyCode } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.html b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.html new file mode 100644 index 00000000..935bee97 --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.html @@ -0,0 +1,38 @@ +
    +
    + +
    +
    + + +
    +
    + +
    + +
    + + + +

    + {{code}}-{{item.permissionsCode}}

    +
    +
    + + + +
    + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.less b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.less new file mode 100644 index 00000000..40e50505 --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.less @@ -0,0 +1,6 @@ +:host:ng-deep { + st-td { + word-break: break-all; + word-wrap : break-word; + } +} \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.ts b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.ts new file mode 100644 index 00000000..e9668879 --- /dev/null +++ b/src/app/routes/menu-manager/components/api-auth/auth-drawer/auth-drawer.component.ts @@ -0,0 +1,154 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { MenuManagerService } from '../../../services/menu-manager.service'; + +@Component({ + selector: 'app-auth-drawer', + templateUrl: './auth-drawer.component.html', + styleUrls: ['./auth-drawer.component.less'] +}) +export class AuthDrawerComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('configTypeItemModal', { static: false }) + configTypeItemModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + id = null; + appId = ''; + code = ''; + + functionInfo: any = {}; + functions: any[] = []; + isDisabled = false; + + constructor(public service: MenuManagerService, private modal: NzModalService) {} + + ngOnInit(): void { + this.loadFunctions(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { id: this.id }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + loadFunctions() { + this.service.request(this.service.$api_get_functions, { appId: this.appId }, 'POST', false).subscribe(res => { + if (res) { + this.functions = res; + } + }); + } + + functionAction(item?: any, isDisabled = false) { + if (item) { + this.functionInfo = { ...item, id: item.functionButtonId }; + } else { + this.functionInfo = {}; + } + this.isDisabled = isDisabled; + const modal = this.modal.create({ + nzTitle: item ? '编辑' : '新增', + nzContent: this.configTypeItemModal, + nzWidth: 800, + nzCancelText: '取消', + nzOkText: '保存', + nzOnOk: () => { + this.service.request(this.service.$api_save_menu_function, { ...this.functionInfo, functionId: this.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success(item ? '编辑成功' : '新增成功'); + this.st.load(1); + modal.destroy(); + } + }); + return false; + } + }); + } + + deleteAuth(item: any) { + const modal = this.modal.warning({ + nzTitle: '是否确定删除该权限', + nzOnOk: () => { + this.service.request(this.service.$api_delete_menu_function, [item.functionButtonId]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.load(1); + modal.destroy(); + } else { + this.service.msgSrv.error('删除失败'); + } + }); + return false; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private initSF(): SFSchema { + return { + properties: { + vc2code: { + type: 'string', + title: '权限名称', + ui: { + autocomplete: 'off', + placeholder: '请输入权限名称' + } + }, + vc2c2ode: { + type: 'string', + title: '权限编号', + ui: { + autocomplete: 'off', + placeholder: '请输入权限编号' + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '权限名称', index: 'permissionsName', width: 120 }, + { title: '权限编码', render: 'permissionsCode' }, + { title: '权限路径', index: 'permissionsUrl', className: 'break-word-all', width: 200 }, + { + title: '操作', + width: '150px', + className: 'text-center', + buttons: [ + { + text: '查看', + click: item => this.functionAction(item, true) + }, + { + text: '编辑', + click: item => this.functionAction(item) + }, + { + text: '删除', + click: item => this.deleteAuth(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/menu-manager/components/index/index.component.html b/src/app/routes/menu-manager/components/index/index.component.html new file mode 100644 index 00000000..8b1acd73 --- /dev/null +++ b/src/app/routes/menu-manager/components/index/index.component.html @@ -0,0 +1,101 @@ + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + + + + +
    +
    + + + +
    +
    +
    + + + + + + + 菜单名称 + 菜单编号 + 路由地址 + 菜单图标 + 菜单排序 + 操作 + + + + + + + + + {{ item.title }} + + {{ item.keyCode }} + {{ item.link }} + + + + + + + {{ item.sorted }} + + 查看 + + 编辑 + + 删除 + + + 新增子项 + + + + + + + +
    \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/index/index.component.less b/src/app/routes/menu-manager/components/index/index.component.less new file mode 100644 index 00000000..c801e37d --- /dev/null +++ b/src/app/routes/menu-manager/components/index/index.component.less @@ -0,0 +1,16 @@ +:host { + ::ng-deep { + .pane-content-left { + padding-right: 12px; + + nz-select { + width: 100%; + margin-bottom: 1rem; + border-bottom: 2px solid #15408e; + } + } + .pane-content-right { + padding-left: 12px; + } + } +} diff --git a/src/app/routes/menu-manager/components/index/index.component.ts b/src/app/routes/menu-manager/components/index/index.component.ts new file mode 100644 index 00000000..2f9b1306 --- /dev/null +++ b/src/app/routes/menu-manager/components/index/index.component.ts @@ -0,0 +1,140 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { Menu, ModalHelper } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SettingRoleEditComponent } from 'src/app/routes/sys-setting/components/role-management/edit/edit.component'; +import { MenuManagerMenusortComponent } from '../menusort/menusort.component'; +import { MenuManagerService } from './../../services/menu-manager.service'; +import { MenuModalComponent } from './menu-modal/menu-modal.component'; + +@Component({ + selector: 'app-menu-manager-components-index', + templateUrl: './index.component.html', + styleUrls: ['./index.component.less', '../../../commom/less/box.less'] +}) +export class MenuManagerComponentsIndexComponent implements OnInit { + selectedPlatform!: { name: string; appId: string; enName: string }; + platforms: Array = [ + { name: '货主PC', appId: 'A48F72F0A304427F921794BAD86B3522', enName: 'tms-smc-web' }, + { name: '运营后台', appId: this.envSrv.env.appId, enName: 'tms-obc-web' } + ]; + + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + roleName: { + type: 'string', + title: '菜单名称', + ui: { placeholder: '请输入' } + } + } + }; + + mapOfExpandedData: { [key: string]: any[] } = {}; + listOfMapData: any[] = []; + constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private modal: NzModalService, private modalHelper: ModalHelper,) { + this.initData(); + } + + ngOnInit(): void {} + + initData(): void { + this.selectedPlatform = this.platforms[0]; + this.loadMemu(this.selectedPlatform.appId); + } + + loadMemu(appId: string) { + this.service.request(this.service.$api_get_all, { appId }, 'POST', false).subscribe(res => { + if (res) { + this.listOfMapData = res; + this.listOfMapData.forEach(item => { + this.mapOfExpandedData[item.key] = this.service.convertTreeToList(item); + }); + // console.log(this.listOfMapData, this.mapOfExpandedData); + } + }); + } + + changeMemu(key: number) { + this.selectedPlatform = this.platforms[key]; + this.loadMemu(this.selectedPlatform.appId); + } + + menuAction(nzTitle: string, item?: any, parentId?: string, isDisabled = false) { + const modal = this.modal.create({ + nzTitle, + nzContent: MenuModalComponent, + nzWidth: 900, + nzComponentParams: item + ? { formData: { ...item }, isDisabled, params: { parentId, appId: this.selectedPlatform.appId } } + : { formData: { id: null }, params: { parentId, appId: this.selectedPlatform.appId } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.loadMemu(this.selectedPlatform.appId); + } + }); + } + + deleteAction(item: any) { + this.modal.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_del_many, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除菜单成功'); + this.loadMemu(this.selectedPlatform.appId); + } + }); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + menuImport(index: number) { + if (this.listOfMapData?.length > 0) { + this.service.msgSrv.warning('请先清空菜单'); + return; + } + if (!this.selectedPlatform) { + return; + } + + this.service.menuImport(this.selectedPlatform.enName, this.selectedPlatform.appId); + } + + delMenu(type: number) { + this.modal.confirm({ + nzTitle: '删除确认', + nzContent: `是否确认删除?`, + nzOnOk: () => { + this.service.getMenuByAppID(type === 0 ? 'A48F72F0A304427F921794BAD86B3522' : this.envSrv.env.appId); + } + }); + } + menuSort(){ + const dialogData = { + appId: this.selectedPlatform.appId + }; + this.modalHelper.create(MenuManagerMenusortComponent, { i: dialogData }, { size: 900 }).subscribe((res:any) => { + if(res) { + console.log('a') + this.loadMemu(this.selectedPlatform.appId); + } + }); + } +} diff --git a/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.html b/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.html new file mode 100644 index 00000000..31848fe4 --- /dev/null +++ b/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.html @@ -0,0 +1,8 @@ +
    + +
    + + \ No newline at end of file diff --git a/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.less b/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.ts b/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.ts new file mode 100644 index 00000000..b55bde12 --- /dev/null +++ b/src/app/routes/menu-manager/components/index/menu-modal/menu-modal.component.ts @@ -0,0 +1,151 @@ +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { SettingMenuComponent } from 'src/app/routes/sys-setting/components/role-management/menu/menu.component'; +import { MenuManagerService } from '../../../services/menu-manager.service'; + +@Component({ + selector: 'app-menu-modal', + templateUrl: './menu-modal.component.html', + styleUrls: ['./menu-modal.component.less'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class MenuModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + formData: any; + schema!: SFSchema; + ui!: SFUISchema; + isDisabled = false; + + params = {}; + + constructor(public service: MenuManagerService, private modal: NzModalRef, private cdr: ChangeDetectorRef) {} + + ngOnInit(): void { + if (this.formData.id) { + this.loadMenu(); + } else { + this.initSF(); + } + } + + initSF(data?: any) { + this.schema = { + properties: { + title: { + title: '菜单名称', + type: 'string', + default: this.formData.text, + maxLength: 20, + ui: { + widget: this.isDisabled ? 'text' : 'string', + placeholder: '请输入菜单名称' + } + }, + keyCode: { + title: '菜单编码', + type: 'string', + default: this.formData.keyCode, + ui: { + widget: this.isDisabled ? 'text' : 'string', + placeholder: '请输入菜单编码' + } + }, + isLeaf: { + title: '是否叶子节点', + type: 'boolean', + default: this.formData.isLeaf || true, + enum: [true, false], + readOnly: this.isDisabled, + ui: { + widget: 'radio' + } + }, + hide: { + title: '是否隐藏', + type: 'boolean', + default: this.formData.hide || false, + enum: [true, false], + readOnly: this.isDisabled, + ui: { + widget: 'radio' + } + }, + link: { + title: '菜单路由', + type: 'string', + default: this.formData.link, + ui: { + widget: this.isDisabled ? 'text' : 'string', + placeholder: '请输入菜单路由' + } + }, + icon: { + title: '菜单图标', + type: 'string', + default: this.formData.icon, + ui: { + widget: this.isDisabled ? 'text' : 'string', + placeholder: '请输入菜单图标' + } + }, + sortId: { + title: '排序', + type: 'number', + default: this.formData.sortId, + ui: { + widget: this.isDisabled ? 'text' : 'number' + } + } + }, + required: ['title'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 12 } + } + }; + this.cdr.detectChanges(); + } + + loadMenu() { + this.service.request(this.service.$api_get_menu_by_id, { id: this.formData.id }).subscribe(res => { + if (res) { + this.formData = res; + this.initSF(this.formData); + } + }); + } + + close() { + this.modal.destroy(); + } + + sure() { + if (!this.sf.valid) { + this.service.msgSrv.warning('表单验证错误'); + return; + } + const params = { + ...this.sf.value, + ...this.params, + i18n: null, + // i18n: this.sf.value.keyCode, + menuType: 0, + reuse: 0, + shortcut: 0, + hideInBreadcrumb: 0, + functionType: 0, + sortId: this.sf.value.sortId?.toString() || null, + text: this.sf.value.title + }; + this.service.request(this.service.$api_add_one, params).subscribe(res => { + if (res) { + this.service.msgSrv.success(this.formData.id ? '修改菜单成功' : '新增菜单成功'); + this.modal.destroy(true); + } + }); + } +} diff --git a/src/app/routes/menu-manager/components/menusort/menusort.component.html b/src/app/routes/menu-manager/components/menusort/menusort.component.html new file mode 100644 index 00000000..35e4f397 --- /dev/null +++ b/src/app/routes/menu-manager/components/menusort/menusort.component.html @@ -0,0 +1,18 @@ + +
    + + +
    + diff --git a/src/app/routes/menu-manager/components/menusort/menusort.component.spec.ts b/src/app/routes/menu-manager/components/menusort/menusort.component.spec.ts new file mode 100644 index 00000000..dd867bb3 --- /dev/null +++ b/src/app/routes/menu-manager/components/menusort/menusort.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MenuManagerMenusortComponent } from './menusort.component'; + +describe('MenuManagerMenusortComponent', () => { + let component: MenuManagerMenusortComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ MenuManagerMenusortComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MenuManagerMenusortComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/menu-manager/components/menusort/menusort.component.ts b/src/app/routes/menu-manager/components/menusort/menusort.component.ts new file mode 100644 index 00000000..9e4dd21b --- /dev/null +++ b/src/app/routes/menu-manager/components/menusort/menusort.component.ts @@ -0,0 +1,77 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzTreeComponent } from 'ng-zorro-antd/tree'; +import { MenuManagerService } from '../../services/menu-manager.service'; + +@Component({ + selector: 'app-menu-manager-menusort', + templateUrl: './menusort.component.html', +}) +export class MenuManagerMenusortComponent implements OnInit { + @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; + record: any = {}; + i: any; + functionList: any[] = []; + menuList: any[] = []; + + constructor( + private modal: NzModalRef, + public service: MenuManagerService, + ) { } + + ngOnInit(): void { + this.getAllFunction() + } + getAllFunction() { + this.service.request(this.service.$api_get_all, { appId: this.i.appId }, 'POST', false).subscribe(res => { + this.functionList = res; + this.menuList = res[0].children; + }); + } + nzEvent(event: any): void { + console.log(event) + } + dragEnd(event: any){ + const functionId = event.node.key + let sortNumber = 0 + const newMenuList = this.nzTreeComponent.getTreeNodes() + newMenuList.forEach((item, index) => { + if(event.node.level === 0 && item.children) { + + if(functionId === item.key) { + sortNumber = index + } + } else if(event.node.level === 1 && item.children) { + item.children.forEach((subItem: any, subIndex: number) => { + if(functionId === subItem.key) { + sortNumber = subIndex + } + }) + } else if(event.node.level === 2 && item.children) { + item.children.forEach((thirdItem: any, thirdIndex: number) => { + if(functionId === thirdItem.key) { + sortNumber = thirdIndex + } + }) + } + }) + const params: any = { + parentId: event.node.level === 0 ? this.functionList[0].id : event.node.parentNode.key, + functionId, + sortNumber + } + this.service.request(this.service.$api_alterFunctionsParent, params).subscribe(res => { + if (res) { + } + }) + + } + sure(){ + this.modal.close(true) + } + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/menu-manager/menu-manager-routing.module.ts b/src/app/routes/menu-manager/menu-manager-routing.module.ts new file mode 100644 index 00000000..d46c398f --- /dev/null +++ b/src/app/routes/menu-manager/menu-manager-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { ApiAuthComponent } from './components/api-auth/api-auth.component'; +import { MenuManagerComponentsIndexComponent } from './components/index/index.component'; + +const routes: Routes = [ + { path: '', redirectTo: 'index', pathMatch: 'full' }, + { path: 'index', component: MenuManagerComponentsIndexComponent }, + { path: 'auth', component: ApiAuthComponent }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class MenuManagerRoutingModule {} diff --git a/src/app/routes/menu-manager/menu-manager.module.ts b/src/app/routes/menu-manager/menu-manager.module.ts new file mode 100644 index 00000000..7d243d84 --- /dev/null +++ b/src/app/routes/menu-manager/menu-manager.module.ts @@ -0,0 +1,16 @@ +import { NgModule, Type } from '@angular/core'; +import { SharedModule } from '@shared'; +import { MenuManagerComponentsIndexComponent } from './components/index/index.component'; +import { MenuManagerRoutingModule } from './menu-manager-routing.module'; +import { MenuModalComponent } from './components/index/menu-modal/menu-modal.component'; +import { ApiAuthComponent } from './components/api-auth/api-auth.component'; +import { AuthDrawerComponent } from './components/api-auth/auth-drawer/auth-drawer.component'; +import { MenuManagerMenusortComponent } from './components/menusort/menusort.component'; + +const COMPONENTS: Type[] = [MenuManagerComponentsIndexComponent, ApiAuthComponent]; +const COMPONENTS_NOROUNT: Type[] = [MenuModalComponent, AuthDrawerComponent, MenuManagerMenusortComponent]; +@NgModule({ + imports: [SharedModule, MenuManagerRoutingModule], + declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT] +}) +export class MenuManagerModule {} diff --git a/src/app/routes/menu-manager/services/menu-manager.service.ts b/src/app/routes/menu-manager/services/menu-manager.service.ts new file mode 100644 index 00000000..b8a7c259 --- /dev/null +++ b/src/app/routes/menu-manager/services/menu-manager.service.ts @@ -0,0 +1,157 @@ +import { Injectable, Injector } from '@angular/core'; +import { Menu } from '@delon/theme'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class MenuManagerService extends BaseService { + // 新增/更新菜单 + $api_add_one = `/api/mdc/cuc/functionInfo/saveFunctionInfo`; + // 根据应用ID获取所有菜单 + $api_get_all = `/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId`; + // 获取菜单详情 + $api_get_menu_by_id = `/api/mdc/cuc/functionInfo/getFunctionInfo`; + // 根据应用ID获取菜单 + $api_get_one = `/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId?_allow_badcode=true`; + // 删除多个菜单 + $api_del_many = `/api/mdc/cuc/functionInfo/deletebatchFunctionInfo`; + + // 获取菜单下按钮权限列表 + $api_get_functions_by_id = `/api/mdc/cuc/functionButton/getFunctionButtonByFunctionId`; + // 获取所有按钮信息 + $api_get_functions = `/api/mdc/cuc/buttonInfo/getButtonInfoList`; + // 保存菜单按钮关联 + $api_save_menu_function = `/api/mdc/cuc/functionButton/saveFunctionButton`; + // 删除菜单按钮关联表 + $api_delete_menu_function = `/api/mdc/cuc/functionButton/deletebatch`; + // 排序菜单 + $api_alterFunctionsParent = `/api/mdc/cuc/functionInfo/alterFunctionsParent`; + + constructor(public injector: Injector) { + super(injector); + } + + getMenuByAppID(appId: string) { + this.request(this.$api_get_one, { appId }, 'POST', false).subscribe(res => { + if (res) { + const menus = res.data; + if (res.data?.length > 0) { + this.deleteMenuByAppID(res.data); + } else { + this.msgSrv.success('菜单已清空'); + } + } + }); + } + + deleteMenuByAppID(arr: Array) { + let ids: any[] = arr?.map(item => item.id) || []; + arr.forEach(item => { + if (item.children?.length > 0) { + this.deleteMenuByAppID(item.children); + } + }); + this.request(this.$api_del_many, ids).subscribe(res => {}); + } + + menuImport(enName: string, appId: string) { + this.http.request('GET', `assets/mocks/platform/${enName}.json`).subscribe((res: any) => { + this.addMenu(res.menu, appId); + }); + } + + addMenu(menus: Array, appId: string, parentId: string = '') { + menus.forEach(r => { + if (parentId !== '') { + r.parentId = parentId; + } + this.request(this.$api_get_one, { appId }, 'POST', false).subscribe(res => { + // 如果res.data存在,则更新菜单 + if (res.data) { + r.id = res.data.id; + } + this.addOne({ appId, ...r, isLeaf: !(r.children && r.children.length > 0) }).subscribe(result => { + if (result) { + if (r.children && r.children.length > 0) { + this.addMenu(r.children, appId, result.id); + } + } + }); + }); + }); + + // this.loadMenus(this.selectedPlatform.appId); + } + + collapse(array: TreeNodeInterface[], data: TreeNodeInterface, $event: boolean): void { + if (!$event) { + if (data.children) { + data.children.forEach(d => { + const target = array.find(a => a.key === d.key)!; + target.expand = false; + this.collapse(array, target, false); + }); + } else { + return; + } + } + } + + convertTreeToList(root: TreeNodeInterface): TreeNodeInterface[] { + const stack: TreeNodeInterface[] = []; + const array: TreeNodeInterface[] = []; + const hashMap = {}; + stack.push({ ...root, level: 0, expand: true }); + + while (stack.length !== 0) { + const node = stack.pop()!; + this.visitNode(node, hashMap, array); + if (node.children) { + for (let i = node.children.length - 1; i >= 0; i--) { + stack.push({ + ...node.children[i], + level: node.level! + 1, + expand: false, + parent: node, + ...this.formatIcon(node.children[i].icon) + }); + } + } + } + + return array; + } + + visitNode(node: TreeNodeInterface, hashMap: { [key: string]: boolean }, array: TreeNodeInterface[]): void { + if (!hashMap[node.key]) { + hashMap[node.key] = true; + array.push(node); + } + } + + private formatIcon(icon: any): { iconType: string; value: string } { + let value = icon; + let type = 'icon'; + // compatible `anticon anticon-user` + if (~icon.indexOf(`anticon-`)) { + value = value.split('-').slice(1).join('-'); + } + if (~icon.indexOf(`iconfont`)) { + type = 'iconfont'; + } + return { iconType: type, value }; + } +} + +export interface TreeNodeInterface { + key: string; + name: string; + age?: number; + level?: number; + expand?: boolean; + address?: string; + children?: TreeNodeInterface[]; + parent?: TreeNodeInterface; + [key: string]: any; +} diff --git a/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.html b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.html new file mode 100644 index 00000000..89c12502 --- /dev/null +++ b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.html @@ -0,0 +1,94 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    + + + + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + item?.carNo : '' }}
    +
    + +
    {{ item?.longitude }} + {{ item?.latitude ? "," + item?.latitude : '' }}
    +
    + + +
    + {{ item?.billStatusLabel }} +
    +
    + {{item?.billTypeLabel}}{{item?.serviceTypeLabel === item?.billTypeLabel ? '':item?.serviceTypeLabel}} +
    +
    +
    +
    +
    + + diff --git a/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.less b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.less new file mode 100644 index 00000000..149a0bc9 --- /dev/null +++ b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.spec.ts b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.spec.ts new file mode 100644 index 00000000..c2659773 --- /dev/null +++ b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:03:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 09:43:16 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\abnormal-warning\\abnormal-warning.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementAbnormalWarningComponent } from './abnormal-warning.component'; + +describe('OrderManagementAbnormalWarningComponent', () => { + let component: OrderManagementAbnormalWarningComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementAbnormalWarningComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementAbnormalWarningComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.ts b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.ts new file mode 100644 index 00000000..68867622 --- /dev/null +++ b/src/app/routes/order-management/components/abnormal-warning/abnormal-warning.component.ts @@ -0,0 +1,288 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; +import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component'; +import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { Router } from '@angular/router'; +import { OneCarOrderAppealComponent } from '../../modal/audit/appeal/appeal.component'; + +@Component({ + selector: 'app-order-management-abnormal-warning', + templateUrl: './abnormal-warning.component.html', + styleUrls: ['./abnormal-warning.component.less'] +}) +export class OrderManagementAbnormalWarningComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 + changeViewId: any; // 查看运费变更记录id - 用于查看 + auditId: any; + auditIdR: any; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + isVisibleRE = false; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + @ViewChild('stFloat') private readonly stFloat!: STComponent; + @ViewChild('stFloatView') private readonly stFloatView!: STComponent; + columns: STColumn[] = []; + columnsFloat: STColumn[] = []; + columnsFloatView: STColumn[] = []; + ViewCause: any; // 变更运费查看数据 + constructor( + public service: OrderManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + warningTime: { + start: this.sf?.value?.warningTime?.[0] || '', + end: this.sf?.value?.warningTime?.[1] || '' + } + }; + } + get changeParams() { + return { + id: this.changeId + }; + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + get changeViewParams() { + return { + id: this.changeViewId + }; + } + search() { + this.st?.load(1); + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + } + }, + wayCode: { + type: 'string', + title: '运单号', + ui: { + } + }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + } as SFSelectWidgetSchema + }, + resourceType: { + title: '货源类型', + type: 'string', + default: '', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + widget: 'dict-select', + params: { dictKey: 'goodresource:type' }, + containsAllLabel: true, + } as SFSelectWidgetSchema + }, + shipperId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNos: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + warningTime: { + title: '预警时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '运单号', + width: '180px', + fixed: 'left', + className: 'text-left', + index: 'wayCode' + }, + { + title: '订单号', + width: '180px', + fixed: 'left', + className: 'text-left', + index: 'billCode' + }, + { title: '服务类型', index: 'serviceTypeLabel', width: '220px', className: 'text-left' }, + { title: '货主', index: 'shipperName', width: '220px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '220px', className: 'text-left' }, + { title: '卸货地', index: 'unloadingAddressArr', width: '220px', className: 'text-left' }, + { title: '司机', render: 'driverName', width: '180px', className: 'text-left' }, + { title: '车牌号', index: 'carNo', width: '180px', className: 'text-left' }, + { title: '预警类型', index: 'warningTypeLabel', width: '180px', className: 'text-left' }, + { + title: '预警时间', + className: 'text-left', + width: '180px', + index: 'warningTime' + }, + { + title: '位置描述', + className: 'text-left', + width: '250px', + render: 'longitude' + }, + { + title: '提醒内容', + className: 'text-left', + width: '250px', + index: 'warningContent', + }, + + ]; + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_get_asyncExportSpotCheckList); + } +} diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html new file mode 100644 index 00000000..38b54fcb --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -0,0 +1,372 @@ + + + + + + + + +
    + +

    订单号: {{ i?.billCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.goodsResource?.enterpriseInfoName }} + {{ i?.goodsResource?.shipperAppUserName }} + {{i?.goodsResource?.enterpriseProjectName}} + {{i?.goodsResource?.serviceTypeLabel}} + {{i?.createUserName}} {{ i?.createUserPhone ? "/" + i?.createUserPhone : ''}} + {{i?.goodsResource?.dispatchName}}{{ i?.goodsResource?.dispatchPhone ? "/" + i?.goodsResource?.dispatchPhone : ''}} +
    + + + + + + + + + + + + +
    +
    +
    + +
    +
    +   +   +   +   +
    +
    +
    + + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    + +
    +
    +
    +
    + + 装货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    + + +
    +
    + + + + + {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件 + + + + + + + + + + + + + + + {{ i?.carModel }}{{ i?.carLength ? "/" + i?.carLength : ''}} + + + {{i?.driverName}}{{ i?.driverPhone ? "/" + i?.driverPhone : ''}}{{ i?.carNo ? "/" + i?.carNo : ''}} + + + {{ i?.driverCarModelLabel }},{{ i?.driverCarLengthLabel }}米,{{ i?.driverCarWeight }}吨 + + + + + + + + + + + + + +

    {{i?.goodsInfoList?.[0]?.freightPrice}}{{i?.goodsInfoList?.[0]?.freightTypeLabel}}({{ i?.goodsInfoList?.[0]?.settlementBasisLabel ? i?.goodsInfoList?.[0]?.settlementBasisLabel + ',' :' ' }}{{i?.goodsInfoList?.[0]?.ruleLabel}})

    + + 到付 + + {{ item.price | currency }} + + + {{ item.price + item.surcharge | currency }} + + + {{ item.surcharge | currency }} + + +
    +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2)}}%) +
    +
    +
    车队长:{{ i?.payeeName }}{{ i?.payeePhone ? "/" + i?.payeePhone : ''}}
    +
    + + + + + + 查看附件      + 补充协议 + + + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + {{ i?.supplementaryInformationVO?.receiptUserName }} / {{ i?.supplementaryInformationVO?.phon }} + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + + + + +
    + +
    请上传图片
    +
    +
    + +
    + + {{i?.goodsResource?.remarks}} + +
    +
    + + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + +
    暂无附件信息
    +
    +
    + + + + +
    \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.less b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.less new file mode 100644 index 00000000..a59b9526 --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.less @@ -0,0 +1,33 @@ +:host { + + .tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; + } + + .card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; + } + + .align-center { + display: flex; + align-items: center; + justify-content: center; + } + .align-center2 { + display: flex; + align-items: center; + } + #container { + width: 300px; + height: 180px; + } + :host { + ::ng-deep { + nz-input-number{width: 100%;} + } + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.spec.ts b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.spec.ts new file mode 100644 index 00000000..94efd41a --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementBulkDetailChangeComponent } from './bulk-detail-change.component'; + +describe('OrderManagementBulkDetailChangeComponent', () => { + let component: OrderManagementBulkDetailChangeComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementBulkDetailChangeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementBulkDetailChangeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts new file mode 100644 index 00000000..2e5fb6b9 --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts @@ -0,0 +1,1012 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-24 16:58:02 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-23 14:44:37 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { ViewChild } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFNumberWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { AmapPoiPickerComponent, AmapService, EAEnvironmentService, ShipperBaseService } from '@shared'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer } from 'rxjs'; +import { apiConf } from '@conf/api.conf'; +import { OrderManagementService } from '../../services/order-management.service'; +import format from 'date-fns/format'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { map } from 'rxjs/operators'; +function getBase64(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} +@Component({ + selector: 'app-supply-management-bulk-detail-change', + templateUrl: './bulk-detail-change.component.html', + styleUrls: ['./bulk-detail-change.component.less'] +}) +export class OrderManagementBulkDetailChangeComponent implements OnInit { + validateForm1: FormGroup; + id = this.route.snapshot.params.id; + @ViewChild('distannce3', { static: false }) + i: any = { unLoadingPlaceList: [] }; + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + startInfo: any = []; // 装货信息 + endInfo: any = []; // 卸货信息 + unloadTime: any; // 货源单设置回显 + loadTime: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + dirverPhone: any; // 货源单设置回显 + dirverBankCard: any; // 货源单设置回显 + listImagUrls: any[] = []; // 货源单设置回显 + dirvingMessage = []; + modalcontent: any; + modalTitle:string = ''; + imges: any; + totalObj: any; + attObj: any; + previewImage1 = ''; + previewVisible1 = false; + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + @ViewChild('st') st!: STComponent; + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + isVisible = false; + billExpenses: any[] = []; //运费信息表格信息 + ui4!: SFUISchema; + formData: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' } + ]; + logColumns: STColumn[] = [ + { title: '款项', index: 'expenseCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatus', + type: 'badge', + width: '120px', + badge: { + '1': { text: '待申请', color: 'warning' }, + '2': { text: '已支付', color: 'success' }, + '3': { text: '已拒绝', color: 'warning' }, + '4': { text: '申请中', color: 'warning' } + } + } + ]; + trajectory = 'car'; + mapList: any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 + constructor( + private route: ActivatedRoute, + private router: Router, + private msgSrv: NzMessageService, + public service: OrderManagementService, + private modalService: NzModalService, + private amapService: AmapService, + public shipperservice: ShipperBaseService, + fb: FormBuilder, + private envSrv: EAEnvironmentService, + private ar: ActivatedRoute + ) { + this.validateForm1 = fb.group({ + loadTime: [null, []], + unloadTime: [null, []] + }); + } + + ngOnInit(): void { + this.initData(); + this.initSF3(); + this.initSF4(); + this.getTrajectory(); + } + initSF() { + this.schema = { + properties: { + loadingLadingBillFilePath: { + type: 'string', + title: '装货凭证', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + loadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no7: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + }, + unloadingLadingBillFilePath: { + type: 'string', + title: '卸货凭证', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + unloadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no5: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + }, + no6: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + } + }, + required: ['loadingLadingBillFilePath', 'unloadingLadingBillFilePath'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $unloadingLadingBillFilePath: { grid: { span: 12 } }, + $unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, + $loadingLadingBillFilePath: { grid: { span: 12 } }, + $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, + $no5: { grid: { span: 24 } } + }; + } + initData() { + this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + if (res) { + this.i = res; + this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TRA'); + this.initSF(); + // 对装货凭证进行初始化 + let arr: any = []; + res?.receiptFilePath.forEach((element: any, index: any) => { + arr.push({ + url: element, + status: 'done', + uid: index + }); + }); + this.sf4data; + this.listImagUrls = arr; + // this.sf4data = res?.goodsInfoList?.[0] + this.sf4data = { + ...res, + ...res?.goodsInfoList?.[0] + }; + this.sf3data = { + goodsTypeId: res?.goodsInfoList[0]?.goodsTypeId || '', + goodsTypeName: res?.goodsInfoList[0]?.goodsTypeName || '', + goodsNameId: res?.goodsInfoList[0]?.goodsNameId || '', + goodsName: res?.goodsInfoList[0]?.goodsName || '' + }; + if (this.sf3data.goodsTypeName === '其它') { + this.sf3data.goodsName1 = res?.goodsInfoList[0]?.goodsName || ''; + } + this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId }); + // 对装卸货信息进行初始化 + res?.unLoadingPlaceList.forEach((element: any) => { + if (element.type === 1 || element.type === '1') { + const controlId = this.startInfo.length; + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); + } else if (element.type === 2 || element.type === '2') { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } + }); + // 对装货凭证进行初始化 + this.formData = { + loadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.loadingLadingBillFilePath, + response: { + url: res?.loadingLadingBillFilePath + } + } + ], + loadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.loadingPeopleVehiclesGoodsFilePath, + response: { + url: res?.loadingPeopleVehiclesGoodsFilePath + } + } + ], + unloadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.unloadingLadingBillFilePath, + response: { + url: res?.unloadingLadingBillFilePath + } + } + ], + unloadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.unloadingPeopleVehiclesGoodsFilePath, + response: { + url: res?.unloadingPeopleVehiclesGoodsFilePath + } + } + ] + }; + // 发车时间到车时间初始化 + this.loadTime = res?.loadTime; + this.unloadTime = res?.unloadTime; + this.dirvingMessage = res?.billExpenseDetails; + // 计算里程,时间 + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + // 取消修改 + cancelChange() { + window.history.go(-1); + } + // 保存修改 + save() { + Object.keys(this.validateForm1.controls).forEach(key => { + this.validateForm1.controls[key].markAsDirty(); + this.validateForm1.controls[key].updateValueAndValidity(); + }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid) { + this.service.msgSrv.warning('请完善必填项!'); + return; + } + if ( + this.sf4.value?.acceptWeight > this.i?.goodsInfoList?.[0]?.weight || + this.sf4.value?.settlementWeight.settlementWeight > this.i?.goodsInfoList?.[0]?.weight + ) { + this.service.msgSrv.warning('装货重量/卸货重量不能大于货物重量!'); + return; + } + let imgList: any = []; + if (this.listImagUrls.length > 0) { + this.listImagUrls?.forEach((res: any) => { + if (res?.url) { + imgList.push(res?.url); + } + }); + } + if (typeof this.unloadTime !== 'string') { + var c = new Date(this.unloadTime); + this.unloadTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + } + if (typeof this.loadTime !== 'string') { + var c = new Date(this.loadTime); + this.loadTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + } + const params = { + id: this.id, + unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo], + receiptFilePath: imgList, + goodsInfoDTOList: [ + { + id: this.i?.goodsInfoList?.[0].id, + goodsName: this.sf3.value?.goodsName, + ...this.sf4.value + } + ], + // 运费信息 + // 车队长 + payeeId: this.dirverPhone, + dirverBankCard: this.dirverBankCard, // 银行卡 + // 发车时间 + loadTime: this.loadTime, + // 到车时间 + unloadTime: this.unloadTime, + acceptWeight: this.sf4.value?.acceptWeight, + acceptVolume: this.sf4.value?.acceptVolume, + settlementWeight: this.sf4.value?.settlementWeight, + settlementVolume: this.sf4.value?.settlementVolume, + loadingLadingBillFilePath: this.sf.value?.loadingLadingBillFilePath?.data + ? this.sf.value?.loadingLadingBillFilePath.data.fullFilePath + : this.sf.value?.loadingLadingBillFilePath?.url, + + loadingPeopleVehiclesGoodsFilePath: this.sf.value?.loadingPeopleVehiclesGoodsFilePath?.data + ? this.sf.value?.loadingPeopleVehiclesGoodsFilePath.data.fullFilePath + : this.sf.value?.loadingPeopleVehiclesGoodsFilePath?.url, + + unloadingLadingBillFilePath: this.sf.value?.unloadingLadingBillFilePath?.data + ? this.sf.value?.unloadingLadingBillFilePath.data.fullFilePath + : this.sf.value?.unloadingLadingBillFilePath?.url, + + unloadingPeopleVehiclesGoodsFilePath: this.sf.value?.unloadingPeopleVehiclesGoodsFilePath?.data + ? this.sf.value?.unloadingPeopleVehiclesGoodsFilePath.data.fullFilePath + : this.sf.value?.unloadingPeopleVehiclesGoodsFilePath?.url + }; + this.service.request(this.service.$api_set_modifyBulkOrder, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('修改成功!'); + this.router.navigate(['/order-management/bulk/bulk-detail/', this.id]); + } else { + this.service.msgSrv.error(res?.msg); + } + }); + } + addPreZero(num: any) { + if (num < 10) { + return '0' + num; + } else { + return num; + } + } + // -------------------装卸货信息处理 + // 打开地图 + // 打开地图 + // 打开地图 + openMap(type: string, index: number, address: string) { + console.log(type); + console.log(index); + + const modalRef = this.modalService.create({ + nzTitle: '', + nzComponentParams: { selectedAddress: address }, + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.pois; + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.formattedAddress; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + this.startInfo[index].address = poi.formattedAddress; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.formattedAddress; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + this.endInfo[index].address = poi.formattedAddress; + break; + default: + break; + } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + }); + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物类型' }, + asyncData: () => + this.service.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (_value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 110, + grid: { span: 12 } + } + }; + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget?.reset(res); + if (this.sf3data.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); + } + } + }); + } + initSF4() { + this.schema4 = { + properties: { + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '必填项' } + } + }, + carmand: { + type: 'string', + title: '用车需求', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + drivers: { + type: 'string', + title: '承运司机', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + weightModel: { + type: 'string', + title: '车型车长承重', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + loadTime: { + type: 'string', + title: '发车时间', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + unloadTime: { + type: 'string', + title: '到车时间', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + acceptWeight: { + type: 'number', + title: '装货重量', + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + acceptVolume: { + type: 'number', + title: '装货体积', + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + settlementWeight: { + type: 'number', + title: '卸货重量', + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + }, + settlementVolume: { + type: 'number', + title: '卸货体积', + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true + } as SFNumberWidgetSchema + } + }, + required: ['loadTime', 'unloadTime'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 110, + grid: { span: 24 } + }, + $weight: { + grid: { span: 24 } + }, + $carmand: { + grid: { span: 24 } + }, + $weightModel: { + spanLabelFixed: 120, + grid: { span: 12 } + }, + $drivers: { + grid: { span: 12 } + }, + $loadTime: { + grid: { span: 12 } + }, + $unloadTime: { + grid: { span: 12 } + } + }; + } + // 处理上传图片 + handlePreview1 = async (file: NzUploadFile) => { + if (!file.url && !file.preview) { + file.preview = await getBase64(file.originFileObj!); + } + this.previewImage1 = file.url || file.preview; + this.previewVisible1 = true; + }; + + handleChange1(info: NzUploadChangeParam): void { + switch (info.file.status) { + case 'uploading': + break; + case 'done': + let fileList = [...info.fileList]; + // 2. Read from response and show file link + fileList = fileList.map((file: any) => { + if (file.response) { + file.url = file.response.data.fullFilePath; + } + return file; + }); + break; + case 'error': + this.service.msgSrv.error('网络错误'); + break; + } + } + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + return new Observable((observer: Observer) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; + if (!isJpgOrPng) { + this.service.msgSrv.warning('只能上传图片!'); + observer.complete(); + return; + } + // tslint:disable-next-line: no-non-null-assertion + const isLt2M = file.size! / 1024 / 1024 < 3; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过3兆!'); + observer.complete(); + return; + } + observer.next(isJpgOrPng && isLt2M); + observer.complete(); + }); + }; + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false; + } + handleOK() { + this.isVisible = false; + } + goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + } + } + // 装卸货地址互换 + swapAddress() { + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any) => { + element.type = '1'; + }); + this.endInfo.forEach((element: any) => { + element.type = '2'; + }); + + // 计算里程,时间 + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + + // 获取车辆轨迹 + getTrajectory() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res?.trackArray; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res?.cityArray; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory() { + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res?.tracks; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res?.enclosureDataAppTrack]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event: any) { + if (event === 'car') { + this.getTrajectory(); + } else if (event === 'driver') { + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html new file mode 100644 index 00000000..3380fdbe --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -0,0 +1,258 @@ + + + + + + +
    + +

    订单号: {{ i?.billCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.goodsResource?.enterpriseInfoName }} + {{ i?.goodsResource?.shipperAppUserName }} + {{ i?.goodsResource?.enterpriseProjectName }} + {{ i?.goodsResource?.serviceTypeLabel }} + {{ i?.createUserName }} {{ i?.createUserPhone ? "/" + i?.createUserPhone : ''}} + {{ i?.goodsResource?.dispatchName }}{{ i?.goodsResource?.dispatchPhone ? "/" + i?.goodsResource?.dispatchPhone : ''}} + {{ i?.goodsResource?.resourceCode }} + {{ i?.wayBill?.wayBillCode }} + {{ i?.goodsResource?.paymentDays }} +
    + + + + + + + +
    +
    +
    + +
    +
    +   + + + +
    +
    +
    + + + + + {{i?.goodsInfoList?.[0]?.goodsName}} + + + + {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件 + {{ i?.carModel }}{{ i?.carLength ? "/" + i?.carLength : ''}} + {{ i?.driverName }}{{i?.driverPhone ? "/" + i?.driverPhone : ''}}{{ i?.carNo ? "/" + i?.carNo : ''}} + {{ i?.driverCarModelLabel }},{{ i?.driverCarLengthLabel }}米,{{ i?.driverCarWeight }}吨 + + {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方 + {{ i?.loadWeight }}吨,{{ i?.loadVolume }}方 + {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方 + +
    +

    装货卸货信息 + ( + + + + ) +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{ item?.province }}{{ item.city }}{{ item.area }}{{ item.detailedAddress }}

    +

    联系人:{{ item.appUserName }}{{ item.contractTelephone ? "/" + item.contractTelephone : '' }}

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{ item?.province }}{{ item.city }}{{ item.area }}{{ item.detailedAddress }}

    +

    联系人:{{ item.appUserName }}{{ item.contractTelephone ? "/" + item.contractTelephone : ''}}

    +
    +
    +
    +
    +
    +
    +
    +
    + +

    {{i?.freightPrice}}{{i?.freightTypeLabel}}({{ i?.settlementBasisLabel ? i?.settlementBasisLabel + ',' :' ' }}{{i?.ruleLabel}})

    + + 到付 + + {{ item.price + item.surcharge | currency }} + + + {{ item.price | currency }} + + + {{ item.surcharge | currency }} + + +
    +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2)}}%) +
    +
    +
    车队长:{{ i?.payeeName }}{{ i?.payeePhone ? "/" + i?.payeePhone : ''}}
    +
    + + + + + 查看附件      + 补充协议 + + + + + + + + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + {{ i?.supplementaryInformationVO?.receiptUserName }} / {{ i?.supplementaryInformationVO?.phon }} + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + + + + + + {{ i?.goodsResource?.remarks }} + + + + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + +
    + 您的订单可能存在交易风险,请及时提交申诉材料,提交成功后,平台将及时完成审核并通知您! +
    +
    如果您的运单没有问题,可以提出申诉,并提供相关资料,我们将24小时内审核反馈
    +
      +
    • 系统识别:{{item?.complianceTypeName}}
    • +
    • {{item?.determineDetails}},您可在企业端提交申诉材料或联系客服。
    • +
    • 2021-11-07 03:20:15
    • +
    +
    + + + + + + + + +
    +
    + + + +
    暂无附件信息
    +
    +
    + + + + +
    diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.less b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.less new file mode 100644 index 00000000..1d17aeb7 --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.less @@ -0,0 +1,94 @@ +:host { + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .source-info { + p { + margin-bottom: .5em; + } + } + + .freight-info-box { + width: 95%; + } + + .freigth-label { + display : inline-block; + width : 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width : 70%; + margin: 0 auto; + } + } + + // .ant-tabs-top>.ant-tabs-nav, + // .ant-tabs-bottom>.ant-tabs-nav, + // .ant-tabs-top>div>.ant-tabs-nav, + // .ant-tabs-bottom>div>.ant-tabs-nav { + // margin: 0; + // } + + // .ant-anchor-ink::before { + // width: 0; + // } + + // .ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab, + // .ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab { + // margin-left: 40px + // } + } + + .leftPadding { + padding-right: 100px; + } + .handling-info { + min-height: 100px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.spec.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.spec.ts new file mode 100644 index 00000000..8556cf2d --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementBulkeDetailComponent } from './bulk-detail.component'; + +describe('OrderManagementBulkeDetailComponent', () => { + let component: OrderManagementBulkeDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementBulkeDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementBulkeDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts new file mode 100644 index 00000000..816be5a7 --- /dev/null +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts @@ -0,0 +1,221 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:20:26 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-29 14:30:11 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Router } from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../services/order-management.service'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import format from 'date-fns/format'; + +@Component({ + selector: 'app-supply-management-bulk-detail', + templateUrl: './bulk-detail.component.html', + styleUrls: ['./bulk-detail.component.less'] +}) +export class OrderManagementBulkeDetailComponent implements OnInit { + MapList: any[]=[]; + id = this.route.snapshot.params.id; + billExpenses: any[] = []; //运费信息表格信息 + pois: any[] = []; + abnormalList: any[] = []; + i: any; + imges: any; + totalObj: any; + attObj: any; + modalcontent: any; + modalTitle:string = ''; + isVisible = false; + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' }, + ]; + logColumns: STColumn[] = [ + { title: '款项', index: 'expenseCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatus', + type: 'badge', + width: '120px', + badge: { + '1': { text: '待申请', color: 'warning' }, + '2': { text: '已支付', color: 'success' }, + '3': { text: '已拒绝', color: 'warning' }, + '4': { text: '申请中', color: 'warning' } + } + } + ]; + trajectory = 'car'; + mapList:any[] = []; //地图点位数据组 + addressItems:any[] = []; //打点地址数据组 + constructor( + public route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: OrderManagementService, + private router: Router, + private modal: NzModalService + ) { + } + + ngOnInit(): void { + console.log(this.route?.snapshot?.queryParams?.sts); + + this.initData(); + this.getTrajectory(); + } + + initData() { + this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + if (res) { + this.i = res; + this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TRA'); + this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE"); + this.pois = [ + { + markerLabel: '起', + color: 'blue', + position: [res.startingPoint.longitude, res.startingPoint.latitude], + title: res.startingPoint.detailedAddress + }, + { + markerLabel: '卸', + color: 'red', + position: [res.endPoint.longitude, res.endPoint.latitude], + title: res.endPoint.detailedAddress + } + ]; + } + }); + this.service.request(this.service.$api_listBillComplianceAbnormalByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('风险详情') + console.log(res) + this.abnormalList = res + } + }); + this.service.request(this.service.$api_getAbnormalWarningByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('异常预警') + console.log(res) + } + }); + } + + goBack() { + window.history.go(-1); + } + // 修改订单 + changeOrder() { + this.router.navigate(['order-management/bulk-detailChange', this.id]); + } + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false; + } + handleOK() { + this.isVisible = false; + } + goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + } + } + // 取消订单 + cancellation() { + // api_get_cancelAnOrder + this.modal.confirm({ + nzTitle: '确定取消该订单吗?', + nzContent: `取消后无法恢复,请确认`, + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.initData(); + } + }) + }); + } + + // 获取车辆轨迹 + getTrajectory(){ + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res.cityArray; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory(){ + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event:any){ + if(event ==='car'){ + this.getTrajectory() + }else if(event ==='driver'){ + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/order-management/components/bulk/bulk.component.html b/src/app/routes/order-management/components/bulk/bulk.component.html new file mode 100644 index 00000000..482bb68c --- /dev/null +++ b/src/app/routes/order-management/components/bulk/bulk.component.html @@ -0,0 +1,261 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + +
    + + + {{ item.freightPrice | currency }} + + +
    装 | {{ item?.loadTime }}
    +
    卸 | {{ item?.unloadTime }}
    +
    + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + item?.carNo : ''}}
    +
    + +
    {{ item?.payeeName }}{{ item?.payeePhone ? "/" + item?.payeePhone : '' }}
    +
    + +
    {{ item?.createUserName }}{{ item?.createUserPhone ? "/" + item?.createUserPhone : '' }}
    +
    + + {{ item.billCode }} +
    + {{ item?.billTypeLabel }}{{ item?.serviceTypeLabel }} +
    +
    + {{ item?.billStatusLabel }} +
    +
    + +
    {{ item?.goodsName }}
    +
    + {{ item?.weight ? item?.weight + '吨/' : '' }} + {{ item?.volume ? item?.volume + '方/' : '' }} + {{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }} +
    +
    + +
    +

    + {{ data.expenseName }}:{{ data.price | currency }} + {{ data.expenseName }}:{{ (data.price * 100).toFixed(2) + '%' }} + {{ data.paymentStatusLabel }} +

    +
    +
    +
    +
    +
    + + + + + + {{ index + 1 }} + + +
    + 待确认 + 已确认 + 已撤销 + 拒绝 +
    +
    +
    +
    + + + + +
    + + + + + +
    + +
    元/吨
    +
    +
    +
    + + + {{ item.amountBeforeChange | currency }} + + ¥{{ item.amountchangeValue | number: '0.2-2' }} + + {{ item.amountAfterChange | currency }} + + +
    变更原因:{{ ViewCause?.changeCause }}
    +
    拒绝原因:{{ ViewCause?.refuseCause }}
    +
    注:附加费依据调整后的运输费用重新计算
    +
    + + + + +
    + + + + + + + + + + +
    暂无评价内容
    +
    + + + + + + +
    暂无评价内容
    +
    +
    +
    + + + + +
    + +
    + +
    已选择{{ selectedRows?.length || 0 }}条订单,确认批量签收吗? +
    +
    签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。
    +
    +
    + +
    + +
    +
    diff --git a/src/app/routes/order-management/components/bulk/bulk.component.less b/src/app/routes/order-management/components/bulk/bulk.component.less new file mode 100644 index 00000000..149a0bc9 --- /dev/null +++ b/src/app/routes/order-management/components/bulk/bulk.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/order-management/components/bulk/bulk.component.spec.ts b/src/app/routes/order-management/components/bulk/bulk.component.spec.ts new file mode 100644 index 00000000..e78deb02 --- /dev/null +++ b/src/app/routes/order-management/components/bulk/bulk.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:03:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:18:06 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk\\bulk.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementBulkComponent } from './bulk.component'; + +describe('OrderManagementBulkComponent', () => { + let component: OrderManagementBulkComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementBulkComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementBulkComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts new file mode 100644 index 00000000..00a306fb --- /dev/null +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -0,0 +1,856 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; +import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component'; +import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { Router, ActivatedRoute } from '@angular/router'; +import { OneCarOrderCancelConfirmComponent } from '../../modal/vehicle/cancel-confirm/cancel-confirm.component'; + +@Component({ + selector: 'app-supply-management-bulk', + templateUrl: './bulk.component.html', + styleUrls: ['./bulk.component.less'] +}) +export class OrderManagementBulkComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + _$expand = false; + loading: boolean = true; + changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 + changeViewId: any; // 查看运费变更记录id - 用于查看 + ViewCause: any; // 变更运费查看数据 + sfViewFormData: any; // 变更运费查看的sf 数据 + shipList: any; // 货主评价 数据 + diverList: any; // 司机评价 数据 + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('stFloat') private readonly stFloat!: STComponent; + @ViewChild('stFloatView') private readonly stFloatView!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + columns: STColumn[] = []; + columnsFloat: STColumn[] = []; + columnsFloatView: STColumn[] = []; + demoValue: any; + resourceStatus: any; + tabs = { + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + signQuantity: 0, + compolatelQuantity: 0, + GoingQuantity: 0, + totalCount: 0 + }; + constructor( + public service: OrderManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router, + private ar: ActivatedRoute, + ) {} + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.billStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const a: any = {}; + if (this.resourceStatus) { + a.billStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + console.log(params); + + if (this.sf) { + Object.assign(requestOptions.body, { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }); + } + this.loading = true; + return requestOptions; + }; + afterRes = (data: any[], rawData?: any) => { + console.log(data) + this.loading = false + return data.map(item => ({ + ...item, + disabled: item.billStatus !== '4' + })); + }; + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + get changeParams() { + return { + id: this.changeId + }; + } + search() { + this.st?.load(); + this.getGoodsSourceStatistical(); + } + getGoodsSourceStatistical() { + this.tabs = { + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + signQuantity: 0, + compolatelQuantity: 0, + GoingQuantity: 0, + totalCount: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.billStatus; + this.service.request(this.service.$api_getBulkStatistical, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.billStatusLabel === '待发车') { + this.tabs.stayQuantity = element.quantity; + } else if (element.billStatusLabel === '待接单') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.billStatusLabel === '待签收') { + this.tabs.signQuantity = element.quantity; + } else if (element.billStatusLabel === '已完成') { + this.tabs.compolatelQuantity = element.quantity; + } else if (element.billStatusLabel === '已取消') { + this.tabs.cancelQuantity = element.quantity; + } else if (element.billStatusLabel === '运输中') { + this.tabs.GoingQuantity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + ngOnInit(): void { + this.getGoodsSourceStatistical(); + this.initSF(); + this.initST(); + this.initSTFloat(); + this.initSTFloatView(); + this.initSFView(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '最多100个单号,空号隔开', + } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '最多100个单号,空号隔开', + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + paymentStatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + riskStatus: { + type: 'string', + title: '是否风险单', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: '3' }, + { label: '否', value: '1' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + settlementBasis: { + title: '结算依据', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'goodresource:settlement:type' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + /** + * 初始化查询表单 + */ + initSFView() { + this.schemaView = { + properties: { + freightPrice: { + type: 'string', + title: '运费单价' + }, + rule: { + title: '', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:rounding:rules' }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + settlementBasis: { + type: 'string', + title: '结算重量', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:settlement:type' }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + } + } + }; + this.uiView = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } }; + } + // 获取所属项目 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '订单号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'billCode' + }, + { + title: '运费明细', + width: '250px', + className: 'text-right', + render: 'mybidDetailInfo' + }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, + { title: '所属项目', index: 'enterpriseProjectName', width: '250px', className: 'text-left' }, + { title: '关联运单号', index: 'wayBillCode', width: '180px', className: 'text-left' }, + { title: '货源编号', index: 'resourceCode', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '180px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '180px', + index: 'unloadingAddressArr' + }, + // { + // title: '货物信息', + // className: 'text-left', + // width: '250px', + // render: 'goodsName' + // }, + { + title: '货物信息', + index: 'goodsName', + width: '180px', + className: 'text-left', + format: (item: any) => + `${item?.goodsName}/ + ${item?.weight || '0'}吨/ + ${item?.volume || '0'}方/ + ${item?.goodsNumber || '0'}件` + }, + { + title: '运费单价', + className: 'text-right', + width: '180px', + render: 'freightPrice' + }, + { + title: '接单数量', + render: 'receveOrderCountInfo', + width: '170px', + className: 'text-left', + format: (item: any) => + `${item.loadWeight || '0'}吨/ + ${item.loadVolume || '0'}方` + }, + { + title: '结算数量', + index: '结算数量', + width: '170px', + className: 'text-left', + format: (item: any) => + `${item.settlementWeight || '0'}吨/ + ${item.settlementVolume || '0'}方` + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + index: 'driverName', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '180px', + index: 'payeeName', + render: 'payeeName' + }, + { + title: '装卸货时间', + width: '200px', + className: 'text-left', + render: 'loadingTime' + }, + { + title: '创建时间', + width: '180px', + className: 'text-left', + index: 'createTime' + }, + { + title: '操作', + fixed: 'right', + width: '130px', + className: 'text-left block-td', + buttons: [ + { + text: '运费变更记录', + click: _record => this.OpenPrice(_record), + iif: item => + item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '6', + acl: { ability: ['ORDER-BULK-listChangeApply'] }, + }, + { + text: '查看评价', + click: _record => this.viewEvaluate(_record), + iif: item => item.billStatus == '5', + acl: { ability: ['ORDER-BULK-evaluation'] }, + }, + { + text: '查看详情', + click: (item: any) => { + this.router.navigate(['./bulk-detail', item.id], { relativeTo: this.ar }); + }, + acl: { ability: ['USERCENTER-FREIGHT-USER-view'] }, + }, + { + text: '变更运费', + click: _record => this.updateFreight(_record), + iif: item => item.billStatus !== '1' && item.billStatus !== '6' && item.overallPaymentStatus != '2', + acl: { ability: ['ORDER-BULK-FreightChangeBulkDetail'] }, + }, + { + text: '确认签收', + click: _record => this.confirmReceipt(_record), + iif: item => item.billStatus == '4', + acl: { ability: ['VEHICLE-LIST-view'] }, + }, + { + text: '取消订单', + click: _record => this.cancellation(_record), + iif: item => + item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1', + acl: { ability: ['ORDER-BULK-signBulkOrder'] }, + }, + { + text: '申请退款', + click: (_record) => this.applyRefund(_record), + iif: item => item.isApplyForRefund, + acl: { ability: ['ORDER-VEHICLE-modificationOrder'] }, + }, + { + text: '修改订单', + click: _record => this.changeOrder(_record), + iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3', + acl: { ability: ['ORDER-BULK-BulkBillDetail'] }, + } + ] + } + ]; + } + initSTFloat() { + this.columnsFloat = [ + { + title: '序号', + className: 'text-center', + render: 'order' + }, + { + title: '操作时间', + className: 'text-center', + index: 'applyTime' + }, + { + title: '操作人', + className: 'text-center', + index: 'applyUserName' + }, + { title: '状态', index: 'handleStatusLabel', className: 'text-center' }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '查看', + click: _record => this.FloatView(_record) + }, + // { + // text: '查看协议', + // click: (_record, _modal, _instance) => this.view(_record) + // }, + { + text: '撤销', + click: _record => this.revoke(_record), + iif: item => item.handleStatus === '1' || item.handleStatus === 1 + } + ] + } + ]; + } + initSTFloatView() { + this.columnsFloatView = [ + { + title: '费用名称', + width: '100px', + className: 'text-center', + index: 'costName' + }, + { + title: '变更前', + width: '100px', + className: 'text-center', + index: 'amountAfterChange', + render: 'amountAfterChange' + }, + { title: '变更值', index: 'amountchangeValue', width: '120px', className: 'text-center', render: 'amountchangeValue' }, + { title: '变更后', index: 'amountBeforeChange', render: 'amountBeforeChange', width: '120px', className: 'text-center' } + ]; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + get changeViewParams() { + return { + id: this.changeViewId + }; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + /** + * 导入货源 + */ + importGoodsSource() { } + audit(item: any) { } + + /* + * 审核关闭弹窗 + view: 1 + 浮动费用: 0 + 查看评价: 3 + */ + handleCancel(type: string) { + if (type === '0') { + this.isVisible = false; + } else if (type === '1') { + console.log(type); + this.isVisibleView = false; + } else if (type === '2') { + this.isVisibleEvaluate = false; + } + } + /** + * 审核通过按钮 + */ + handleOK() { } + OpenPrice(item: any) { + this.changeId = item.id; + this.isVisible = true; + } + /** + * 浮动费用查看 + */ + FloatView(item: any) { + this.changeViewId = item.id; + this.service.request(this.service.$api_getChangeRecordBulkDetail, { id: this.changeViewId }).subscribe(res => { + this.ViewCause = res; + }); + this.isVisibleView = true; + } + /** + *查看评价 + */ + viewEvaluate(item: any) { + console.log(item); + this.isVisibleEvaluate = true; + const params = { + businessCode: item.billCode, + evaluateUserId: item.shipperAppUserId + }; + const params2 = { + businessCode: item.billCode, + evaluateUserId: item.shipperAppUserId + }; + this.service.request(this.service.$api_getBillEvaluateByShipper, params).subscribe(res => { + console.log(res); + console.log(res.evaluateInfos); + this.shipList = res.evaluateInfos; + }); + this.service.request(this.service.$api_getBillEvaluateDriverByShipper, params2).subscribe(res => { + console.log(res); + this.diverList = res.evaluateInfos; + }); + } + /** + *变更运费 + */ + updateFreight(item: any) { + this.service.request(this.service.$api_getFreightChangeBulkDetail, { id: item.id }).subscribe(data => { + if (data) { + const modal = this.modal.create({ + nzTitle: '变更运费', + nzWidth: 580, + nzContent: UpdateFreightComponent, + nzComponentParams: { data: { ...data, billId: item.id } }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + this.st.reload(1); + this.getGoodsSourceStatistical(); + } + }); + } + }); + } + + // *确认签收 + + confirmReceipt(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认签收', + nzWidth: '50%', + nzContent: ConfirReceiptComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical(); + }); + } + userAction() { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('请选择订单!'); + return; + } + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + this.service.request(this.service.$api_get_batchSignBulkOrder, params).subscribe(res => { + if (res) { + this.st.load(1); + this.getGoodsSourceStatistical(); + } + }); + } + // 取消订单 + cancellation(item: any) { + // api_get_cancelAnOrder + this.modal.confirm({ + nzTitle: '确定取消该订单吗?', + nzContent: `取消后无法恢复,请确认`, + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: item.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.st?.reload(1); + this.getGoodsSourceStatistical(); + this.initST(); + } + this.st?.reload(1); + this.getGoodsSourceStatistical(); + }) + }); + } + revoke(item: any) { + this.modal.confirm({ + nzTitle: '是否确定立即撤销费用变更!', + nzOnOk: () => + this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('撤销成功!'); + this.stFloat.reload(); + this.st?.reload(1); + this.getGoodsSourceStatistical(); + } + }) + }); + } + // 修改订单 + changeOrder(value: any) { + this.router.navigate(['order-management/bulk-detailChange', value.id]); + } + /** +*申请退款 +*/ + applyRefund(item: any) { + const modalRef = this.modal.create({ + nzTitle: '申请退款', + nzContent: OneCarOrderCancelConfirmComponent, + nzComponentParams: { + i: item, + sts: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: boolean) => { + if (res) { + this.resetSF; + this.st.load(); + } + }); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams,this.service.$api_get_asyncExportBulkList); + } +} diff --git a/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.html b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.html new file mode 100644 index 00000000..ecc0d4a2 --- /dev/null +++ b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + +

    投诉单号:{{datailList?.complaintCode}}

    + + + + + +
    + + + + + +
    {{i?.nodeNameLabel}}
    +

    + {{i?.timeLabel}}:{{i?.time}} +

    +

    + {{i?.resultLabel}}:{{i?.result}} +

    +
    +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.less b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.less new file mode 100644 index 00000000..0df0abc9 --- /dev/null +++ b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.less @@ -0,0 +1,10 @@ +.info{ + color: #666; +} +:host{ + ::ng-deep{ + .dealBox .ant-card-body{ + width: 500px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.spec.ts b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.spec.ts new file mode 100644 index 00000000..8939201f --- /dev/null +++ b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-04 17:29:18 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:19:01 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint-detail\\complaint-detail.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementComplaintDetailComponent } from './complaint-detail.component'; + +describe('OrderManagementComplaintDetailComponent', () => { + let component: OrderManagementComplaintDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementComplaintDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementComplaintDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.ts b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.ts new file mode 100644 index 00000000..f40d2d70 --- /dev/null +++ b/src/app/routes/order-management/components/complaint-detail/complaint-detail.component.ts @@ -0,0 +1,246 @@ +import { Component, OnInit, ViewChild, ɵɵsetComponentScope } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../services/order-management.service'; +// import { RiskOrderService } from '../../services/risk-order.service'; +// import { CtcAppealComponent } from '../appeal/appeal.component'; + +@Component({ + selector: 'app-oder-management-component-risk-detail', + templateUrl: './complaint-detail.component.html', + styleUrls: ['./complaint-detail.component.less'] +}) +export class OrderManagementComplaintDetailComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + isVisibleRE = false; + channelId: any; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + i: any; + datailList: any = { + complainantName: '', + complainantPartyLabel: '' + }; + complaint: any; + complaintStatus = false + id: string = ''; + constructor(private modal: NzModalService, public service: OrderManagementService, public ar: ActivatedRoute) { + this.id = this.ar.snapshot.params.id; + } + + ngOnInit(): void { + if (this.id) + { + this.getDetail(this.id); + this.initSF(); + this.initSTAudit() + } + + } + initSTAudit() { + this.schemaView = { + properties: { + handleResult: { + title: '处理结果', + type: 'string', + maxLength: 50, + ui: { + placeholder: '最多不超过50字', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + }, + }, + }, + required: ['handleResult'] + }; + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + initSF() { + this.schema = { + properties: { + drvComplaintCauseLabel: { + title: '投诉原因', + type: 'string', + maxLength: 30, + ui: { + widget: 'text', + change: (value, orgData) => console.log(value, orgData), + } as SFSelectWidgetSchema, + }, + complainantName: { + title: '托运方', + type: 'string', + maxLength: 30, + ui: { + widget: 'text', + change: (value, orgData) => console.log(value, orgData), + } as SFSelectWidgetSchema, + }, + handlerIdLabel: { + title: '司机', + type: 'string', + maxLength: 30, + ui: { + widget: 'text', + change: (value, orgData) => console.log(value, orgData), + } as SFSelectWidgetSchema, + }, + complaintDetails: { + title: '投诉详情', + type: 'string', + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { + minRows: 4, + maxRows: 4 + } + }, + readOnly: true + } as SFTextareaWidgetSchema, + imgUrls: { + type: 'string', + title: '上传凭证', + ui: { + widget: 'custom' + } + }, + }, + }; + + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $title1: { + spanLabelFixed: 0, + }, + $title2: { + spanLabelFixed: 0, + }, + $title3: { + spanLabelFixed: 0, + }, + $unit: { + spanLabelFixed: 20, + grid: { span: 3 }, + }, + }; + } + getDetail(id: string) { + this.service.request(this.service.$api_get_getComplaintDriverDetails, { id }).subscribe(res => { + if (res) { + this.datailList = res; + this.complaint = JSON.parse(this.ar.snapshot.queryParams.detail) + this.datailList.complainantName = this.complaint?.shipperAppUserName + this.datailList.complainantPartyLabel = this.complaint?.driverIdLabel + } + }) + } + + edit(item: any): void { + const modalRef = this.modal.create({ + nzTitle: '申诉', + nzWidth: '40%', + // nzContent: CtcAppealComponent, + nzComponentParams: { + i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + if (res) { + + } + }) + } + goBack() { + window.history.go(-1) + } + /* + * 审核关闭弹窗 + view: 1 + 浮动费用: 0 + 查看评价: 3 + */ + handleCancel(type: string) { + if(!this.sfView.valid) { + this.service.msgSrv.error('请填写处理结果!') + return + } + const paramsa = { + ...this.sfView.value, + handleStatus: 0, + id: this.channelId + } + this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已拒绝!') + this.isVisibleRE = false + this.getDetail(this.id); + this.complaintStatus = true; + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + this.isVisibleRE = false + } + Cancel() { + this.isVisibleRE = false + } + handleCancel2() { + if(!this.sfView.valid) { + this.service.msgSrv.error('请填写处理结果!') + return + } + const paramsa = { + id: this.channelId + } + this.service.request(this.service.$api_get_canelComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已拒绝!') + this.isVisibleRE = false + this.getDetail(this.id); + this.complaintStatus = true; + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + this.isVisibleRE = false + } + /** + * 审核通过按钮 + */ + handleOK() { + if(!this.sfView.valid) { + this.service.msgSrv.error('请填写处理结果!') + return + } + const paramsa = { + ...this.sfView.value, + handleStatus: 1, + id: this.channelId + } + this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已通过!') + this.isVisibleRE = false + this.complaintStatus = true; + this.getDetail(this.id); + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + } + viewEvaluate() { + this.isVisibleRE = true + this.channelId = this.id; + } +} diff --git a/src/app/routes/order-management/components/complaint/complaint.component.html b/src/app/routes/order-management/components/complaint/complaint.component.html new file mode 100644 index 00000000..460d650e --- /dev/null +++ b/src/app/routes/order-management/components/complaint/complaint.component.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + +
    + +
    + +
    +
    + + + +
    +
    +
    + + + + + + +
    + + + {{item.complaintCode}} + + +
    {{item?.drvComplaintCauseLabel}}
    +
    {{item?.complaintCauseLabel}}
    +
    +
    +
    +
    + + + + + + + + + + + + + + diff --git a/src/app/routes/order-management/components/complaint/complaint.component.less b/src/app/routes/order-management/components/complaint/complaint.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/order-management/components/complaint/complaint.component.spec.ts b/src/app/routes/order-management/components/complaint/complaint.component.spec.ts new file mode 100644 index 00000000..361a453a --- /dev/null +++ b/src/app/routes/order-management/components/complaint/complaint.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-07 14:46:19 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:18:47 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint\\complaint.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementComplaintComponent } from './complaint.component'; + +describe('OrderManagementComplaintComponent', () => { + let component: OrderManagementComplaintComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementComplaintComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementComplaintComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/complaint/complaint.component.ts b/src/app/routes/order-management/components/complaint/complaint.component.ts new file mode 100644 index 00000000..23c7cae1 --- /dev/null +++ b/src/app/routes/order-management/components/complaint/complaint.component.ts @@ -0,0 +1,363 @@ +import { Router } from '@angular/router'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; + + +@Component({ + selector: 'app-supply-management-complaint', + templateUrl: './complaint.component.html', + styleUrls: ['./complaint.component.less'] +}) +export class OrderManagementComplaintComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + isVisibleRE = false; + _$expand = false; + channelId: any; + resourceStatus: any; + selectedMainTabStatus = '2'; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + columns: STColumn[] = []; + selectedIndex: number = 0; + isLoading: boolean = false; + mainTabs = [ + { name: '司机投诉', status: '2' }, + { name: '货主投诉', status: '1' }, + ] + tabs = [ { + name: '全部', + type: 0, + }, + { + name: '待处理', + type: 1, + }, + { + name: '已处理', + type: 2, + }, + { + name: '已撤销', + type: 3, + } + ]; + constructor( + public service: OrderManagementService, + private modal: NzModalService, + private router: Router + ) { + // console.log(this.selectedIndex); + // if (this.selectedIndex === 0) { + // this.selectedMainTabStatus = '2'; + // } else if (this.selectedIndex === 1) { + // this.selectedMainTabStatus = '1'; + // } + } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if(this.resourceStatus) { + a.complaintStatus = this.resourceStatus + } + if(this.selectedMainTabStatus) { + a.complainantParty = this.selectedMainTabStatus + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + }; + } + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.initSTAudit(); + } + + + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + complaintCode: { + type: 'string', + title: '投诉单号', + }, + complaintCause: { + title: '投诉原因', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'drvcomplaint:cause' }, + containsAllLabel: true, + } as SFSelectWidgetSchema + }, + complainantTime: { + type: 'string', + + title: '投诉时间', + ui: { + widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema, + }, + }, + }; + this.ui = + { + '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 8 } }, + + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '投诉单号', + width: '200px', + fixed: 'left', + className: 'text-center', + render: 'complaintCode' + }, + { + title: '运单号', + width: '200px', + className: 'text-center', + index: 'wayBillCode' + }, + { + title: '投诉时间', + width: '170px', + index: 'complainantTime', + className: 'text-center', + }, + { title: '托运方', index: 'shipperAppUserName', width: '200px', className: 'text-center' }, + { title: '司机', index: 'driverName', width: '120px', className: 'text-center' }, + { + title: '投诉原因', + className: 'text-center', + width: '170px', + render: 'complaintCauseLabel' + }, + { + title: '投诉状态', + className: 'text-center', + width: '120px', + index: 'complaintStatusLabel' + }, + { + title: '处理人', + className: 'text-center', + width: '200px', + index:'handlePartyLabel' + }, + { + title: '处理时间', + className: 'text-center', + width: '200px', + index:'handleTime' + }, + { + title: '处理结果', + className: 'text-center', + width: '170px', + index:'handleResult' + }, + { + title: '投诉方', + className: 'text-center', + width: '120px', + index: 'complainantPartyLabel' + }, + { + title: '投诉人', + className: 'text-center', + width: '120px', + index: 'complainantName' + }, + { + title: '操作', + fixed: 'right', + width: '100px', + className: 'text-center', + buttons: [ + // { + // text: '处理', + // click: (_record) => this.viewEvaluate(_record), + // iif: (item) => item.complaintStatus == 1 + // }, + { + text: '查看', + click: (_record) => this.view(_record), + acl: { ability: ['ORDER-COMPLAINT-view'] }, + }, + ], + }, + ]; + } + initSTAudit() { + this.schemaView = { + properties: { + handleResult: { + title: '处理结果', + type: 'string', + maxLength: 50, + ui: { + placeholder: '最多不超过50字', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + }, + }, + }, + required: ['handleResult'] + }; + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this.isLoading = true + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + /** + * 切换投诉与被投诉tab + */ + selectMainTab(e: any) { + console.log(e); + console.log(this.selectedIndex); + this.selectedMainTabStatus = e?.status; + this.initST(); + this.initSF(); + setTimeout(() => { + this.st.load(1); + }) + } + + /** + * 导入货源 + */ + importGoodsSource() { + + } + audit(item: any) { + } + + /* + * 审核关闭弹窗 + view: 1 + 浮动费用: 0 + 查看评价: 3 + */ + handleCancel(type: string) { + const paramsa = { + ...this.sfView.value, + handleStatus: 0, + id: this.channelId + } + this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已拒绝!') + this.isVisibleRE = false + this.st.reload(1) + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + this.isVisibleRE = false + } + Cancel() { + this.isVisibleRE = false + } + handleCancel2() { + const paramsa = { + id: this.channelId + } + this.service.request(this.service.$api_get_canelComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已拒绝!') + this.isVisibleRE = false + this.st.reload(1) + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + this.isVisibleRE = false + } + /** + * 审核通过按钮 + */ + handleOK() { + const paramsa = { + ...this.sfView.value, + handleStatus: 1, + id: this.channelId + } + this.service.request(this.service.$api_get_dealWithComplaint, paramsa).subscribe((res: any) =>{ + if(res) { + this.service.msgSrv.success('已通过!') + this.isVisibleRE = false + this.st.reload(1) + } else{ + this.service.msgSrv.error(res?.msg) + } + }) + } + /** + *查看评价 + */ + viewEvaluate(item: any) { + this.isVisibleRE = true + this.channelId = item.id; + } + view(value: any) { + this.router.navigate(['/order-management/complaint-detail/' + value.id], { + queryParams: { + detail: JSON.stringify(value) + } + }) + } +} diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html new file mode 100644 index 00000000..0803df06 --- /dev/null +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html @@ -0,0 +1,197 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + +
    + + + {{ item.freightPrice | currency }} + + +
    装 | {{ item?.loadingTime }}
    +
    卸 | {{ item?.unloadingTime }}
    +
    + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + item?.carNo : '' }}
    +
    + +
    {{ item?.payeeName }}{{ item?.payeePhone ? "/" + item?.payeePhone : '' }}
    +
    + + {{ item.billCode }} + {{ item.billCode }} + {{ item.billCode }} +
    + {{ item?.billStatusLabel }} +
    +
    + {{item?.billTypeLabel}}{{item?.serviceTypeLabel === item?.billTypeLabel ? '':item?.serviceTypeLabel}} +
    +
    + +
    {{ item?.goodsName }}
    +
    + {{ item?.weight ? item?.weight + '吨/' : '' }} + {{ item?.volume ? item?.volume + '方/' : '' }} + {{ item?.goodsNumber ? item?.goodsNumber + '吨' : '' }} +
    +
    + +
    +

    + {{ data.expenseName }}:{{ data.price | currency }} + {{ data.paymentStatusLabel }} +

    +
    +
    +
    +
    +
    + + +
    + +
    +
    + + + + + + + + + + + + + + + + {{ index + 1 }} + + + + + + + + + + + + + + {{ item.amountBeforeChange | currency }} + + ¥{{ item.amountchangeValue | number: '0.2-2' }} + + {{ item.amountAfterChange | currency }} + + +
    变更原因:{{ ViewCause?.changeCause }}
    +
    拒绝原因:{{ ViewCause?.refuseCause }}
    +
    注:附加费依据调整后的运输费用重新计算
    +
    + + + + +
    diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.less b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.less new file mode 100644 index 00000000..149a0bc9 --- /dev/null +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.spec.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.spec.ts new file mode 100644 index 00000000..2baa9abc --- /dev/null +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:03:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-19 16:47:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\receipts-audit\\receipts-audit.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementReceiptsAuditComponent } from './compliance-audit.component'; + +describe('OrderManagementReceiptsAuditComponent', () => { + let component: OrderManagementReceiptsAuditComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementReceiptsAuditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementReceiptsAuditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts new file mode 100644 index 00000000..5ae60cc3 --- /dev/null +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -0,0 +1,701 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; +import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component'; +import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { Router } from '@angular/router'; +import { OneCarOrderAppealComponent } from '../../modal/audit/appeal/appeal.component'; + +@Component({ + selector: 'app-order-management-compliance-audit', + templateUrl: './compliance-audit.component.html', + styleUrls: ['./compliance-audit.component.less'] +}) +export class OrderManagementComplianceAuditComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 + changeViewId: any; // 查看运费变更记录id - 用于查看 + auditId: any; + auditIdR: any; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + isVisibleRE = false; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + @ViewChild('stFloat') private readonly stFloat!: STComponent; + @ViewChild('stFloatView') private readonly stFloatView!: STComponent; + columns: STColumn[] = []; + columnsFloat: STColumn[] = []; + columnsFloatView: STColumn[] = []; + ViewCause: any; // 变更运费查看数据 + resourceStatus: any; + tabs = { + totalCount: 0, + qualifiedtity: 0, + spotQuantity: 0, + unstayQuantity: 0 + }; + constructor( + public service: OrderManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus >= 0) { + a.complianceStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }; + } + get changeParams() { + return { + id: this.changeId + }; + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + get changeViewParams() { + return { + id: this.changeViewId + }; + } + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + getGoodsSourceStatistical() { + this.tabs = { + totalCount: 0, + qualifiedtity: 0, + spotQuantity: 0, + unstayQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.complianceStatus + this.service.request(this.service.$api_get_getComplianceStatisticalStatus, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.complianceStatusLabel === '待抽查') { + this.tabs.spotQuantity = element.quantity; + } else if (element.complianceStatusLabel === '合格') { + this.tabs.qualifiedtity = element.quantity; + } else if (element.complianceStatusLabel === '不合格') { + this.tabs.qualifiedtity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); + } + selectChange(e: number) { + this.resourceStatus = e - 1; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + ngOnInit(): void { + this.getGoodsSourceStatistical(); + this.initSF(); + this.initST(); + this.initSTFloat(); + this.initSTFloatView(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + paymentStatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '订单号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'billCode' + }, + { + title: '费用明细', + width: '250px', + className: 'text-right', + render: 'mybidDetailInfo' + }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '220px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '220px', className: 'text-left' }, + { title: '所属项目', index: 'enterpriseProjectName', width: '220px', className: 'text-left' }, + { title: '关联运单号', index: 'wayBillCode', width: '220px', className: 'text-left' }, + { title: '货源编号', index: 'resourceCode', width: '180px', className: 'text-left' }, + { title: '服务类型', index: 'serviceTypeLabel', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '180px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '180px', + index: 'unloadingAddressArr' + }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsName' + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + index: 'driverName', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '180px', + index: 'payeeName', + render: 'payeeName' + }, + { + title: '装卸货时间', + width: '200px', + className: 'text-left', + render: 'loadingTime' + }, + { + title: '创建时间', + width: '180px', + className: 'text-left', + index: 'createTime' + }, + { + title: '审核人', + width: '180px', + className: 'text-left', + index: 'complianceName' + }, + { + title: '审核时间', + width: '180px', + className: 'text-left', + index: 'complianceTime' + }, + { + title: '状态', + width: '180px', + className: 'text-left', + index: 'complianceStatusLabel' + }, + { + title: '操作', + fixed: 'right', + width: '140px', + className: 'text-center block-td', + buttons: [ + { + text: '查看申诉记录', + click: _record => this.appeal(_record), + // iif: item => item.billStatus == '5' + }, + { + text: '运费变更记录', + click: _record => this.OpenPrice(_record), + // iif: item => item.billStatus == '4', + acl: { ability: ['ORDER-COMPLIANCE-AUDIT-listChangeApply'] }, + }, + { + text: '合规抽查', + click: _record => this.audit(_record), + iif: item => item.complianceStatus == '0', + acl: { ability: ['ORDER-COMPLIANCE-AUDIT-updateBillByCompliance'] }, + }, + ] + } + ]; + } + initSTFloat() { + this.columnsFloat = [ + { + title: '序号', + className: 'text-center', + render: 'order' + }, + { + title: '操作时间', + className: 'text-center', + index: 'applyTime' + }, + { + title: '操作人', + className: 'text-center', + index: 'applyUserName' + }, + { title: '状态', index: 'handleStatusLabel', className: 'text-center' }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '查看', + click: (_record) => this.FloatView(_record), + }, + { + text: '撤销', + click: (_record) => this.revoke(_record), + iif: item => item.handleStatus === '1' || item.handleStatus === 1, + }, + ], + }, + ]; + } + initSTFloatView() { + this.columnsFloatView = [ + { + title: '费用名称', + width: '100px', + className: 'text-center', + index: 'costName' + }, + { + title: '变更前', + width: '100px', + className: 'text-center', + index: 'amountAfterChange', + render: 'amountAfterChange' + }, + { + title: '变更值', + index: 'amountchangeValue', + render: 'amountchangeValue', + width: '120px', + className: 'text-center' + }, + { + title: '变更后', + index: 'amountBeforeChange', + render: 'amountBeforeChange', + width: '120px', + className: 'text-center' + } + ]; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + // 申诉记录 + appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzContent: OneCarOrderAppealComponent, + // nzComponentParams: { + // i: item + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe((res) => { + // if(res){ + // this.resetSF; + // this.st.load(); + // } + // }); + this.router.navigate(['/order-management/risk-detail', item.id]); + } + /** +* 浮动费用查看 +*/ + FloatView(item: any) { + console.log(item) + this.changeViewId = item.id; + this.service.request(this.service.$api_getChangeRecordWholeDetail, { id: this.changeViewId }).subscribe((res) => { + this.ViewCause = res; + }) + this.isVisibleView = true + } + revoke(item: any) { + this.modal.confirm({ + nzTitle: '是否确定立即撤销费用变更!', + nzOnOk: () => + this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id }).subscribe((res) => { + console.log(res) + if (res) { + this.service.msgSrv.success('撤销成功!') + this.stFloat.reload() + } + }) + }); + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + /** + * 导入货源 + */ + importGoodsSource() { } + OpenPrice(item: any) { + this.changeId = item.id; + this.isVisible = true; + } + + initSTAudit(value: number) { + if (value == 1) { + this.schemaView = { + properties: { + billCode: { + title: '订单号', + type: 'string', + default: this.auditId, + ui: { + widget: 'text' + } + }, + complianceRemark: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '合格可以不用填写原因 ,不合格必须说明原因', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } + } + } + }; + } else { + this.schemaView = { + properties: { + billCode: { + title: '', + type: 'string', + default: `已选${this.selectedRows?.length}条订单`, + ui: { + widget: 'text' + } + }, + complianceRemark: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '合格可以不用填写原因 ,不合格必须说明原因', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } + } + } + }; + } + + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /* + * 审核关闭弹窗 + */ + handleCancel(value?: string) { + if (value === '0') { + this.isVisible = false; + } else if (value === '1') { + this.isVisibleRE = false; + } else if (value === '2') { + this.isVisibleView = false; + } + } + /** +* 审核通过按钮 +*/ + handleOK() { + let idList: any[] = []; + if (this.selectedRows.length > 0) { + this.selectedRows.forEach(item => { + idList.push(item.id); + }); + } else { + idList.push(this?.auditIdR) + } + const parms = { + ids: idList, + complianceRemark: this.sfView.value.complianceRemark, + complianceStatus: 1, + }; + this.service.request(this.service.$api_get_updateBillByCompliance, parms).subscribe(res => { + if (res) { + this.service.msgSrv.success('提交成功!'); + this.isVisibleRE = false; + this.st?.load(1); + this.getGoodsSourceStatistical() + } + }); + } + /** + * 审核拒绝按钮 + */ + reject() { + if (!this.sfView.value.complianceRemark) { + this.service.msgSrv.error('备注不能为空!'); + return; + } + let idList: any[] = []; + if (this.selectedRows.length > 0) { + this.selectedRows.forEach(item => { + idList.push(item.id); + }); + } else { + idList.push(this.sfView.value.billCode) + } + const parms = { + ids: idList, + complianceRemark: this.sfView.value.complianceRemark, + complianceStatus: 2, + }; + this.service.request(this.service.$api_get_updateBillByCompliance, parms).subscribe(res => { + if (res) { + this.service.msgSrv.success('提交成功!'); + this.isVisibleRE = false; + this.st?.load(1); + this.getGoodsSourceStatistical() + } + }); + } + /** +*合规抽查 +*/ + audit(item?: any) { + if (item) { + this.isVisibleRE = true; + this.auditId = item.billCode; + this.auditIdR = item.id; + this.initSTAudit(1); + } else { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('请选择订单!') + return; + } else { + this.isVisibleRE = true; + this.initSTAudit(2); + } + } + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_get_asyncExportSpotCheckList); + } +} diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html new file mode 100644 index 00000000..cb49f728 --- /dev/null +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html @@ -0,0 +1,137 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + +
    + + + {{ item.freightPrice | currency }} + + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    装 | {{ item?.loadingTime }}
    +
    卸 | {{ item?.unloadingTime }}
    +
    + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : ''}}{{ item?.carNo ? "/" + item?.carNo : '' }}
    +
    + +
    {{ item?.payeeName }}{{item?.payeePhone ? "/" + item?.payeePhone : '' }}
    +
    + + + {{ item.billCode }} + {{ item.billCode }} + {{ item.billCode }} +
    + {{item?.billStatusLabel}} +
    +
    + {{item?.resourceTypeLabel}}{{item?.serviceTypeLabel === item?.resourceTypeLabel ? '':item?.serviceTypeLabel}} +
    +
    + +
    {{ item?.goodsName }}
    +
    + {{ item?.weight ? item?.weight + '吨/' : '' }} + {{ item?.volume ? item?.volume + '方/' : '' }} + {{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }} +
    +
    + +
    +

    + {{ data.expenseName }}:{{ data.price | currency }} + {{ data.paymentStatusLabel }} +

    +
    +
    +
    +
    +
    + + +
    + + +
    +
    diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.less b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.less new file mode 100644 index 00000000..3b21fa16 --- /dev/null +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.less @@ -0,0 +1,22 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + ::ng-deep { + .imgBox { + display: flex; + img { + width: 60px !important; + } + } + } + } + \ No newline at end of file diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.spec.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.spec.ts new file mode 100644 index 00000000..9c92d180 --- /dev/null +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.spec.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 20:03:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-19 16:47:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\receipts-audit\\receipts-audit.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementReceiptsAuditComponent } from './receipts-audit.component'; + +describe('OrderManagementReceiptsAuditComponent', () => { + let component: OrderManagementReceiptsAuditComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementReceiptsAuditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementReceiptsAuditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts new file mode 100644 index 00000000..a8b7fe1f --- /dev/null +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -0,0 +1,583 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; +import { UpdateFreightComponent } from '../../modal/bulk/update-freight/update-freight.component'; +import { ConfirReceiptComponent } from '../../modal/bulk/confir-receipt/confir-receipt.component'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { Router } from '@angular/router'; +import { orderManagementVoucherViewComponent } from '../../modal/audit/voucher-view/voucher-view.component'; + +@Component({ + selector: 'app-order-management-receipts-audit', + templateUrl: './receipts-audit.component.html', + styleUrls: ['./receipts-audit.component.less'] +}) +export class OrderManagementReceiptsAuditComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + loading: boolean = true; + resourceStatus: any; + tabs = { + receivedQuantity: 0, + stayQuantity: 0, + totalCount: 0 + }; + constructor( + public service: OrderManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + private router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.auditStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const a: any = {}; + if (this.resourceStatus) { + a.auditStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (this.sf) { + Object.assign(requestOptions.body, { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }); + } + this.loading = true; + return requestOptions; + }; + afterRes = (data: any[], rawData?: any) => { + console.log(data) + this.loading = false + return data.map(item => ({ + ...item, + // disabled: item.billStatus !== '4' + })); + }; + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + getGoodsSourceStatistical() { + this.tabs = { + receivedQuantity: 0, + stayQuantity: 0, + totalCount: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.auditStatus + this.service.request(this.service.$api_get_getAuditStatistical, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.auditStatus == '1') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.auditStatus == '2') { + this.tabs.stayQuantity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + this.getGoodsSourceStatistical(); + }, 500); + } + ngOnInit(): void { + this.getGoodsSourceStatistical(); + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入' + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + paymentStatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + billStatus: { + title: '运输状态', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'bill:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + loadingDocuments: { + type: 'string', + title: '装卸货凭证', + enum:[ + {label: '全部',value: ''}, + {label: '无装卸货凭证',value: '1'}, + {label: '装卸货凭证齐全',value: '2'}, + {label: '只有装货凭证',value: '3'}, + {label: '只有卸货凭证',value: '4'}, + ], + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '订单号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'billCode' + }, + { + title: '运费明细', + width: '250px', + className: 'text-right', + render: 'mybidDetailInfo' + }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, + { title: '所属项目', index: 'enterpriseProjectName', width: '250px', className: 'text-left' }, + { title: '货源编号', index: 'resourceCode', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '180px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '180px', + index: 'unloadingAddressArr' + }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsName' + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + index: 'driverName', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '180px', + index: 'payeeName', + render: 'payeeName' + }, + { + title: '装卸货时间', + width: '200px', + className: 'text-left', + render: 'loadingTime' + }, + { + title: '装货凭证', + width: '180px', + className: 'text-left', + render: 'loadingLadingBillFilePath' + }, + { + title: '卸货凭证', + width: '180px', + className: 'text-left', + render: 'unloadingLadingBillFilePath' + }, + { + title: '操作', + fixed: 'right', + width: '136px', + className: 'text-center block-td', + buttons: [ + { + text: '生成电子单据', + click: _record => this.generate(_record, 2), + iif: item => !item?.loadingElectronicsLadingBillFilePath, + acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] }, + }, + { + text: '通过', + click: _record => this.sign(_record), + iif: item => !item?.loadingElectronicsLadingBillFilePath, + acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] }, + }, + { + text: '修改', + click: _record => this.modification(_record), + iif: item => !item?.loadingElectronicsLadingBillFilePath, + acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] }, + }, + { + text: '查看凭证', + click: _record => this.generate(_record, 3), + iif: item => item?.loadingElectronicsLadingBillFilePath, + acl: { ability: ['ORDER-RECEIPTS-view'] }, + }, + ] + } + ]; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + /** + * 导入货源 + */ + importGoodsSource() { } + audit(item: any) { } + + /** + * 审核通过按钮 + */ + handleOK() { } + OpenPrice(item: any) { + this.isVisible = true; + } + // 修改 + modification(item: any) { + const modalRef = this.modal.create({ + nzTitle: '修改', + nzWidth: '50%', + nzContent: orderManagementVoucherViewComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical() + }); + } + // 生成电子单据 + generate(item: any, sts?: number) { + let text = '查看凭证'; + if (sts == 2) { + text = '生成电子单据'; + } + const modalRef = this.modal.create({ + nzTitle: text, + nzWidth: '50%', + nzContent: orderManagementVoucherViewComponent, + nzComponentParams: { + i: item, + Status: sts + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + if(result) { + this.st.load(); + this.getGoodsSourceStatistical() + } + }); + } + // 通过 + sign(item?: any) { + let params: any = [] + let text = ''; + if (item === '1') { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('请选择订单!') + return + } + this.selectedRows.forEach(ite => { + params.push(ite.id); + }); + text = `已选择${this.selectedRows.length}条订单,确认批量通过审核吗?` + } else { + text = `确认通过审核吗?` + params.push(item.id); + } + console.log(this.selectedRows) + console.log(params) + this.modal.confirm({ + nzTitle: text, + nzContent: `通过后不可修改,可以再生成电子单据。`, + nzOnOk: () => + this.service.request(this.service.$api_get_billAuditPass, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.st?.reload(1); + this.getGoodsSourceStatistical(); + this.initST(); + } + this.st?.reload(1); + this.getGoodsSourceStatistical(); + }) + }); + } + // 批量生成电子单据 + sign1(item?: any) { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.error('请选择订单!') + return + } + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item?.id); + }); + this.modal.confirm({ + nzTitle: `已选择${this.selectedRows.length}条订单,确认批量生成电子单据吗?`, + nzContent: `确认后单据不可修改,请谨慎操作。`, + nzOnOk: () => + { + this.service.downloadFile(this.service.$api_createBillTakeGoods,params) + this.service.downloadFile(this.service.$api_createBillDischargeGoods,params) + this.service.msgSrv.success('生成成功!'); + this.st?.reload() + // this.getGoodsSourceStatistical(); + } + }) + } + // 获取所属项目 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_get_asyncExportExamineBillList); + } +} diff --git a/src/app/routes/order-management/components/risk-detail/risk-detail.component.html b/src/app/routes/order-management/components/risk-detail/risk-detail.component.html new file mode 100644 index 00000000..bfceb298 --- /dev/null +++ b/src/app/routes/order-management/components/risk-detail/risk-detail.component.html @@ -0,0 +1,63 @@ + + + + + + + + + {{i?.billCode}} + + {{i?.representationsStatusLabel}} + + {{i?.driverName ? i?.driverName + '/': ''}} {{i?.driverPhone ?i?.driverPhone + '/': '' }} {{i?.carNo}} + {{i?.carCaptainName ? i?.carCaptainName+ '/' : ''}}{{i?.carCaptainPhone}} + {{i?.loadTime}} + {{i?.unloadTime}} + {{i?.loadingPlace}} + {{i?.dischargePlace}} + +
    +
    +
    {{items.complianceName}}
    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    {{item?.operationContent}}
    +
    操作人:{{item?.operator}}
    +
    +
    +
    diff --git a/src/app/routes/order-management/components/risk-detail/risk-detail.component.less b/src/app/routes/order-management/components/risk-detail/risk-detail.component.less new file mode 100644 index 00000000..0df0abc9 --- /dev/null +++ b/src/app/routes/order-management/components/risk-detail/risk-detail.component.less @@ -0,0 +1,10 @@ +.info{ + color: #666; +} +:host{ + ::ng-deep{ + .dealBox .ant-card-body{ + width: 500px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/risk-detail/risk-detail.component.spec.ts b/src/app/routes/order-management/components/risk-detail/risk-detail.component.spec.ts new file mode 100644 index 00000000..02ad6800 --- /dev/null +++ b/src/app/routes/order-management/components/risk-detail/risk-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementRiskDetailComponent } from './risk-detail.component'; + +describe('OrderManagementRiskDetailComponent', () => { + let component: OrderManagementRiskDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementRiskDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementRiskDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/risk-detail/risk-detail.component.ts b/src/app/routes/order-management/components/risk-detail/risk-detail.component.ts new file mode 100644 index 00000000..d982d8f4 --- /dev/null +++ b/src/app/routes/order-management/components/risk-detail/risk-detail.component.ts @@ -0,0 +1,160 @@ +import { Component, OnInit, ViewChild, ɵɵsetComponentScope } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../services/order-management.service'; +// import { RiskOrderService } from '../../services/risk-order.service'; +// import { CtcAppealComponent } from '../appeal/appeal.component'; + +@Component({ + selector: 'app-oder-management-component-risk-detail', + templateUrl: './risk-detail.component.html', + styleUrls: ['./risk-detail.component.less'] +}) +export class OrderManagementRiskDetailComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + ui: SFUISchema = {}; + schema: SFSchema = {}; + // abnormalReason = [ + // '司机装货轨迹异常', + // '司机卸货轨迹异常', + // '车辆装货轨迹异常', + // '司机位置未移动,或运输途中未打开APP', + // '运单轨迹严重异常' + // ] + i: any; + logList: any = []; + id: string = ''; + constructor(private modal: NzModalService, public service: OrderManagementService, public ar: ActivatedRoute) { + this.id = this.ar.snapshot.params.id; + } + + ngOnInit(): void { + if (this.id) + { + this.getDetail(this.id); + this.initSF(); + } + + } + initSF() { + this.schema = { + properties: { + representationsCauseLabel: { + title: '申诉原因', + type: 'string', + maxLength: 30, + ui: { + widget: 'text', + change: (value, orgData) => console.log(value, orgData), + } as SFSelectWidgetSchema, + }, + representationsDescribe: { + title: '申诉描述', + type: 'string', + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { + minRows: 4, + maxRows: 4 + } + }, + + readOnly: true + + } as SFTextareaWidgetSchema, + uploadVanchor: { + type: 'string', + title: '上传凭证', + ui: { + widget: 'custom' + } + }, + }, + }; + + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $title1: { + spanLabelFixed: 0, + }, + $title2: { + spanLabelFixed: 0, + }, + $title3: { + spanLabelFixed: 0, + }, + $unit: { + spanLabelFixed: 20, + grid: { span: 3 }, + }, + }; + } + /** + * 获取详情 + * @param id + */ + getDetail(id: string) { + this.service.request(this.service.$api_get_getRiskDetail, { id }).subscribe(res => { + if (res) { + this.i = Object.assign({}, res); + console.log(this.i); + let list: any = []; + this.i.fileArr.map((item: any, index: number) => { + const obj = { + uid: index, + name: '文件' + (index + 1), + status: 'done', + url: item, + }; + list.push(obj); + }); + this.i.uploadVanchor = list; + this.initSF(); + this.getLog(this.i?.billCode); + } + }) + } + // getDetail(id: string) { + + // this.service.request(this.service.$api_get_getRiskDetail, { id }).subscribe(res => { + // if (res) { + // this.i = res; + // } + // }) + // } + + edit(item: any): void { + const modalRef = this.modal.create({ + nzTitle: '申诉', + nzWidth: '40%', + // nzContent: CtcAppealComponent, + nzComponentParams: { + i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + if (res) { + + } + }) + } + goBack() { + window.history.go(-1) + } + /** + * 获取操作日志 + */ + getLog(operateObject: any) { + this.service.request(this.service.$api_get_risk_order_log, { operateObject, operateType: '8', size: 100 }).subscribe(res => { + this.logList = res?.records; + }) + } +} diff --git a/src/app/routes/order-management/components/risk/risk.component.html b/src/app/routes/order-management/components/risk/risk.component.html new file mode 100644 index 00000000..9f81f0fe --- /dev/null +++ b/src/app/routes/order-management/components/risk/risk.component.html @@ -0,0 +1,133 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + +
    + + + {{ item.billCode }} +
    + {{ item?.representationsStatusLabel }} +
    +
    + {{item?.billTypeLabel}}{{item?.billTypeLabel === item?.serviceTypeLabel ? '' : item?.serviceTypeLabel}} +
    +
    + +

    创建时间:{{ item?.createTime }}

    +

    装货时间:{{ item?.loadTime }}

    +

    卸货时间:{{ item?.unloadTime }}

    +
    + +
    +
    {{items.complianceName}}
    +
    +
    + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}{{ item?.carNo ? "/" + item?.carNo : ''}}
    +
    + +
    +
    {{item.payeeName}}
    +
    {{item.payeePhone}}
    +
    +
    -
    +
    + +
    +

    {{ data.expenseName }}:{{ data.price | currency }}

    +
    +
    + +
    +

    货物名称:{{ i?.goodsName }}

    +

    重量/体积:{{ i?.weight ? i?.weight + '吨' : '' }}{{ i?.volume ? "/" + i?.volume + '方' : ''}}

    +

    车型/车长:{{ i?.carModelLabel }} {{ i?.carLengthLabel ? "/" + i?.carLengthLabel : ''}}

    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    + +
    +
    diff --git a/src/app/routes/order-management/components/risk/risk.component.less b/src/app/routes/order-management/components/risk/risk.component.less new file mode 100644 index 00000000..987664d0 --- /dev/null +++ b/src/app/routes/order-management/components/risk/risk.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/order-management/components/risk/risk.component.spec.ts b/src/app/routes/order-management/components/risk/risk.component.spec.ts new file mode 100644 index 00000000..7885a90c --- /dev/null +++ b/src/app/routes/order-management/components/risk/risk.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-07 14:27:59 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:19:18 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\risk\\risk.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementRiskComponent } from './risk.component'; + +describe('OrderManagementRiskComponent', () => { + let component: OrderManagementRiskComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementRiskComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementRiskComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/risk/risk.component.ts b/src/app/routes/order-management/components/risk/risk.component.ts new file mode 100644 index 00000000..14e690d7 --- /dev/null +++ b/src/app/routes/order-management/components/risk/risk.component.ts @@ -0,0 +1,539 @@ +import { registerLocaleData } from '@angular/common'; +import { Router } from '@angular/router'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { OrderManagementService } from '../../services/order-management.service'; + +@Component({ + selector: 'app-supply-management-risk', + templateUrl: './risk.component.html', + styleUrls: ['./risk.component.less'] +}) +export class OrderManagementRiskComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + auditMany = false; + loading: boolean = true; + auditId: any; + auditIdR: any; + isVisibleRE = false; + resourceStatus: any; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfView', { static: false }) sfView!: SFComponent; + columns: STColumn[] = []; + tabs = { + underwayQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + constructor( + public service: OrderManagementService, + public shipperservice: ShipperBaseService, + private modal: NzModalService, + public router: Router + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.representationsStatus = this.resourceStatus + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '', + }, + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const a: any = {}; + if (this.resourceStatus) { + a.representationsStatus = this.resourceStatus + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (this.sf) { + Object.assign(requestOptions.body, { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '', + }, + }); + } + this.loading = true; + return requestOptions; + }; + afterRes = (data: any[], rawData?: any) => { + console.log(data) + this.loading = false + return data.map(item => ({ + ...item, + disabled: item.auditStatus !== '1' + })); + }; + search() { + this.st?.load(1); + this.getGoodsSourceStatistical() + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + ngOnInit(): void { + this.getGoodsSourceStatistical() + this.initSF(); + this.initST(); + } + getGoodsSourceStatistical() { + this.service.request(this.service.$api_get_listStatisticalStatus, this.reqParams).subscribe(res => { + if (res) { + res.forEach((element: any) => { + console.log(element.representationsStatus); + if(element.representationsStatus === '1') { + this.tabs.stayQuantity = element.quantity + } else if (element.representationsStatus == '4') { + this.tabs.cancelQuantity = element.quantity + } else if (element.representationsStatus == '3') { + this.tabs.receivedQuantity = element.quantity + }else if (element.representationsStatus == '2') { + this.tabs.underwayQuantity = element.quantity + } + }); + console.log(this.tabs) + } + }) + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入订单号' + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + externalResourceCode: { + type: 'string', + title: '外部订单号' + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + payeeName: { + type: 'string', + title: '车队长', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + wayBillType: { + title: '运单类型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'freight:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + shipperId: { + title: '托运人', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'BulkFreightUnitPriceType' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + }, + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', width: '50px', className: 'text-center' }, + { + title: '订单号', + width: '200px', + className: 'text-left', + render: 'billCode' + }, + { + title: '申诉状态', + width: '180px', + className: 'text-left', + index: 'representationsStatusLabel' + }, + { + title: '货源编号', + width: '200px', + className: 'text-left', + index: 'resourceCode' + }, + { + title: '异常信息', + width: '200px', + className: 'text-left', + render: 'billComplianceVOS' + }, + { title: '托运人', index: 'shipperName', width: '200px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, + { + title: '运费明细', + className: 'text-right', + width: '200px', + render: 'freightDetails' + }, + { + title: '服务类型', + className: 'text-left', + width: '100px', + index: 'serviceTypeLabel' + }, + { + title: '装货地', + className: 'text-left', + width: '250px', + index: 'loadingPlace' + }, + { + title: '卸货地', + className: 'text-left', + width: '250px', + index: 'dischargePlace' + }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsInfoVOList' + }, + { + title: '承运司机', + className: 'text-left', + width: '200px', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '200px', + render: 'payeeName' + }, + { + title: '运输信息', + className: 'text-left', + width: '280px', + render: 'timeer' + }, + { + title: '操作', + fixed: 'right', + width: '90px', + className: 'text-center block-td', + buttons: [ + { + text: '审核', + click: _record => this.audit(_record), + iif: item => item.representationsStatus == '2' , + acl: { ability: ['ORDER-RISK-audit'] }, + }, + { + text: '详情', + click: _record => this.viewEvaluate(_record), + iif: item => item.representationsStatus !== '1' , + acl: { ability: ['ORDER-RISK-riskDetail'] }, + } + ] + } + ]; + } + initSTAudit(value: number) { + if (value == 1) { + this.schemaView = { + properties: { + billCode: { + title: '订单号', + type: 'string', + default: this.auditId, + ui: { + widget: 'text' + } + }, + id: { + title: '', + type: 'string', + default: this.auditIdR, + ui: { + hidden: true + } + }, + representationsCause: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '通过可以不用填写原因 ,拒绝必须说明原因', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } + } + } + }; + } else { + this.schemaView = { + properties: { + billCode: { + title: '', + type: 'string', + default: `已选${this.selectedRows?.length}条订单`, + ui: { + widget: 'text' + } + }, + representationsCause: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '通过可以不用填写原因 ,拒绝必须说明原因', + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } + } + } + }; + } + + this.uiView = { '*': { spanLabelFixed: 110, grid: { span: 24 } } }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + console.log(item); + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + /** + * 导入货源 + */ + importGoodsSource() { } + + /* + * 审核关闭弹窗 + */ + handleCancel() { + this.isVisibleRE = false; + } + /** + * 审核通过按钮 + */ + handleOK() { + let idList: any[] = []; + if (this.selectedRows.length > 0) { + this.selectedRows.forEach(item => { + idList.push(item.id); + }); + } else { + idList.push(this.sfView.value.id) + } + const parms = { + ids: idList, + auditRemark: this.sfView.value.representationsCause, + representationsStatus: 3, + auditStatus: 2, + }; + this.service.request(this.service.$api_get_listRisk_audit, parms).subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功!'); + this.isVisibleRE = false; + this.st?.load(1); + this.getGoodsSourceStatistical() + } + }); + } + /** + * 审核拒绝按钮 + */ + reject() { + let idList: any[] = []; + if (this.selectedRows.length > 0) { + this.selectedRows.forEach(item => { + idList.push(item.id); + }); + } else { + idList.push(this.sfView.value.id) + } + if (!this.sfView.value.representationsCause) { + this.service.msgSrv.error('拒绝原因为空!'); + return; + } + const parms = { + ids: idList, + auditRemark: this.sfView.value.representationsCause, + representationsStatus: 4, + auditStatus: 3, + }; + this.service.request(this.service.$api_get_listRisk_audit, parms).subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功!'); + this.isVisibleRE = false; + this.st?.load(1); + this.getGoodsSourceStatistical() + } + }); + } + /** + *审核 + */ + audit(item?: any) { + if (item) { + this.auditId = item.billCode; + this.auditIdR = item.id; + this.initSTAudit(1); + this.isVisibleRE = true; + } else { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('请选择订单!') + return; + } else { + this.initSTAudit(2); + this.isVisibleRE = true; + } + } + } + /** + *查看详情 + */ + viewEvaluate(item: any) { + this.router.navigate(['/order-management/risk-detail', item.id]); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_get_asyncExportRiskBillList); + } +} diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html new file mode 100644 index 00000000..33d7ebdc --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html @@ -0,0 +1,347 @@ + + + + + + + +
    + +

    订单号: {{ i?.billCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.goodsResource?.enterpriseInfoName }} + {{ i?.goodsResource?.shipperAppUserName }} + {{ i?.goodsResource?.enterpriseProjectName }} + {{ i?.goodsResource?.serviceTypeLabel }} + {{ i?.createUserName }} {{ i?.createUserPhone ? '/' + i?.createUserPhone : '' }} + {{ i?.goodsResource?.dispatchName }}{{ i?.goodsResource?.dispatchPhone ? '/' + i?.goodsResource?.dispatchPhone : '' }} + + {{ i?.externalBillCode }} + {{ i?.goodsResource?.resourceCode }} + {{ i?.wayBillId }} + {{ i?.goodsResource?.paymentDays }} +
    + + + + + + + + +
    +
    +
    + +
    +
    +   +   +   +   +
    +
    +
    + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    +
    +
    +
    +
    + + 装货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + {{ i?.carModel }}{{ i?.carLength ? '/' + i?.carLength : '' }} + + + {{ i?.driverName }}{{i?.driverPhone ? "/" + i?.driverPhone : ''}}{{ i?.carNo ? "/" + i?.carNo : ''}} + + + + {{ i?.driverCarModelLabel }},{{ i?.driverCarLengthLabel }}米,{{ i?.driverCarWeight }}吨 + + + + + + + + + + + + + + + {{ item.price | currency }} + + + {{ item.price + item.surcharge | currency }} + + + {{ item.surcharge | currency }} + + +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2)}}% ) +
    +
    车队长:{{ i?.payeeName }}{{ i?.payeePhone ? "/" + i?.payeePhone : ''}}
    +
    + + + + + 查看附件      + 补充协议 + + + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + {{ i?.supplementaryInformationVO?.receiptUserName }} / {{ i?.supplementaryInformationVO?.phon }} + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + + + + +
    + +
    请上传图片
    +
    +
    + +
    + + {{ i?.goodsResource?.remarks }} + +
    +
    + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + +
    暂无附件信息
    +
    +
    + + + + +
    diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.less b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.less new file mode 100644 index 00000000..a59b9526 --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.less @@ -0,0 +1,33 @@ +:host { + + .tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; + } + + .card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; + } + + .align-center { + display: flex; + align-items: center; + justify-content: center; + } + .align-center2 { + display: flex; + align-items: center; + } + #container { + width: 300px; + height: 180px; + } + :host { + ::ng-deep { + nz-input-number{width: 100%;} + } + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.spec.ts b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.spec.ts new file mode 100644 index 00000000..e9236973 --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementVehicleDetailChangeComponent } from './vehicle-detail-change.component'; + +describe('OrderManagementVehicleDetailChangeComponent', () => { + let component: OrderManagementVehicleDetailChangeComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementVehicleDetailChangeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementVehicleDetailChangeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts new file mode 100644 index 00000000..2132950a --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts @@ -0,0 +1,967 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-23 13:39:58 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-06 15:12:24 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { AmapPoiPickerComponent, AmapService, EACacheService, EAEnvironmentService, ShipperBaseService } from '@shared'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer } from 'rxjs'; +import { map } from 'rxjs/operators'; +import format from 'date-fns/format'; +import { OrderManagementService } from '../../services/order-management.service'; +function getBase64(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} +@Component({ + selector: 'app-supply-management-vehicle-detail-change', + templateUrl: './vehicle-detail-change.component.html', + styleUrls: ['./vehicle-detail-change.component.less'] +}) +export class OrderManagementVehicleDetailChangeComponent implements OnInit { + validateForm1: FormGroup; + id = this.route.snapshot.params.id; + @ViewChild('distannce3', { static: false }) + i: any = { unLoadingPlaceList: [] }; + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + startInfo: any = []; // 装货信息 + endInfo: any = []; // 卸货信息 + unloadTime: any; // 货源单设置回显 + loadTime: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + dirverPhone: any; // 货源单设置回显 + dirverBankCard: any; // 货源单设置回显 + listImagUrls: any[] = []; // 货源单设置回显 + billExpenses: any[] = []; //运费信息表格信息 + dirvingMessage = []; + modalcontent: any; + modalTitle:string = ''; + attObj: any; + totalObj: any; + approvalLsit: any; + imges: any; + previewImage1 = ''; + previewVisible1 = false; + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + @ViewChild('st') st!: STComponent; + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + isVisible = false; + ui4!: SFUISchema; + formData: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + logColumns: STColumn[] = [ + { title: '款项', index: 'expenseCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatusLabel', + } + ]; + trajectory = 'car'; + mapList: any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' } + ]; + constructor( + private route: ActivatedRoute, + private router: Router, + private msgSrv: NzMessageService, + public service: OrderManagementService, + private modalService: NzModalService, + private amapService: AmapService, + public shipperservice: ShipperBaseService, + private ar: ActivatedRoute, + fb: FormBuilder, + private envSrv: EAEnvironmentService + ) { + this.validateForm1 = fb.group({ + loadTime: [null, []], + unloadTime: [null, []] + }); + } + + ngOnInit(): void { + this.initData(); + this.initSF3(); + this.initSF4(); + this.initSF(); + } + initSF() { + this.schema = { + properties: { + loadingLadingBillFilePath: { + type: 'string', + title: '装货凭证', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + loadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no7: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + }, + unloadingLadingBillFilePath: { + type: 'string', + title: '卸货凭证', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + unloadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + // readOnly: this.i.billStatus !== '4' || this.i.billStatus !== '3', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no5: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + }, + no6: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '' + } + }, + required: ['loadingLadingBillFilePath', 'unloadingLadingBillFilePath'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $unloadingLadingBillFilePath: { grid: { span: 12 } }, + $unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, + $loadingLadingBillFilePath: { grid: { span: 12 } }, + $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, + $no4: { grid: { span: 24 } } + }; + } + initData() { + this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => { + console.log(res); + console.log(JSON.stringify(res)); + if (res) { + this.i = res; + // this.initSF(); + this.approvalLsit = res?.scheduleVOList; + this.billExpenses = this.i?.billExpenseDetails?.filter( + (data: any) => data.expenseCode === 'PRE' || data.expenseCode === 'RECE' || data.expenseCode === 'BACK' + ); + this.approvalLsit.map((item: any, key: any) => { + if (item.displayStatus === 'HIDE') { + delete this?.approvalLsit?.[key]; + } + }); + // 对装货凭证进行初始化 + let arr: any = []; + res?.receiptFilePath.forEach((element: any, index: any) => { + arr.push({ + url: element, + status: 'done', + uid: index + }); + }); + this.listImagUrls = arr; + this.sf4data = res?.goodsInfoList?.[0]; + this.sf3data = { + goodsTypeId: res?.goodsInfoList[0]?.goodsTypeId || '', + goodsTypeName: res?.goodsInfoList[0]?.goodsTypeName || '', + goodsNameId: res?.goodsInfoList[0]?.goodsNameId || '', + goodsName: res?.goodsInfoList[0]?.goodsName || '' + }; + if (this.sf3data.goodsTypeName === '其它') { + this.sf3data.goodsName1 = res?.goodsInfoList[0]?.goodsName || ''; + } + this.changeGoodsType(this.sf3data?.goodsTypeId, { label: this.sf3data?.goodsTypeName, value: this.sf3data?.goodsTypeId }); + // 对装卸货信息进行初始化 + res?.unLoadingPlaceList.forEach((element: any) => { + if (element.type === 1 || element.type === '1') { + const controlId = this.startInfo.length; + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); + } else if (element.type === 2 || element.type === '2') { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } + }); + // 对装货凭证进行初始化 + this.formData = { + loadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.loadingLadingBillFilePath, + response: { + url: res?.loadingLadingBillFilePath + } + } + ], + loadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.loadingPeopleVehiclesGoodsFilePath, + response: { + url: res?.loadingPeopleVehiclesGoodsFilePath, + } + } + ], + unloadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.unloadingLadingBillFilePath, + response: { + url: res?.unloadingLadingBillFilePath + } + } + ], + unloadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res?.unloadingPeopleVehiclesGoodsFilePath, + response: { + url: res?.unloadingPeopleVehiclesGoodsFilePath + } + } + ] + }; + // 发车时间到车时间初始化 + this.loadTime = res?.loadTime; + this.unloadTime = res?.unloadTime; + this.dirvingMessage = res?.billExpenseDetails; + // 计算里程,时间 + if (this.startInfo?.[0]?.area && this.endInfo?.[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + // 取消修改 + cancelChange() { + window.history.go(-1); + } + // 保存修改 + save() { + let imgList: any = []; + if (this.listImagUrls.length > 0) { + this.listImagUrls?.forEach((res: any) => { + if (res?.url) { + imgList.push(res?.url); + } + }); + } + if (typeof this.unloadTime !== 'string') { + var c = new Date(this.unloadTime); + this.unloadTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + } + if (typeof this.loadTime !== 'string') { + var c = new Date(this.loadTime); + this.loadTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + } + const params = { + id: this.id, + unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo], + receiptFilePath: imgList, + goodsInfoDTOList: [ + { + id: this.i?.goodsInfoList?.[0].id, + goodsName: this.sf3.value?.goodsName, + ...this.sf4.value + } + ], + // 运费信息 + billExpenseDetailDTOList: this.st._data, + // 车队长 + payeeId: this.dirverPhone, + dirverBankCard: this.dirverBankCard, // 银行卡 + // 发车时间 + loadTime: this.loadTime, + // 到车时间 + unloadTime: this.unloadTime, + loadingLadingBillFilePath: this.sf.value?.loadingLadingBillFilePath?.data + ? this.sf.value?.loadingLadingBillFilePath.data.fullFilePath + : this.sf.value?.loadingLadingBillFilePath?.url, + + loadingPeopleVehiclesGoodsFilePath: this.sf.value?.loadingPeopleVehiclesGoodsFilePath?.data + ? this.sf.value?.loadingPeopleVehiclesGoodsFilePath.data.fullFilePath + : this.sf.value?.loadingPeopleVehiclesGoodsFilePath?.url, + + unloadingLadingBillFilePath: this.sf.value?.unloadingLadingBillFilePath?.data + ? this.sf.value?.unloadingLadingBillFilePath.data.fullFilePath + : this.sf.value?.unloadingLadingBillFilePath?.url, + + unloadingPeopleVehiclesGoodsFilePath: this.sf.value?.unloadingPeopleVehiclesGoodsFilePath?.data + ? this.sf.value?.unloadingPeopleVehiclesGoodsFilePath.data.fullFilePath + : this.sf.value?.unloadingPeopleVehiclesGoodsFilePath?.url + }; + this.service.request(this.service.$api_set_modifyWholeOrder, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('修改成功!'); + this.router.navigate(['/order-management/vehicle/vehicle-detail/', this.id], { relativeTo: this.ar }); + } else { + this.service.msgSrv.error(res?.msg); + } + }); + } + addPreZero(num: any) { + if (num < 10) { + return '0' + num; + } else { + return num; + } + } + // -------------------装卸货信息处理 + // 打开地图 + openMap(type: string, index: number, address: string) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzComponentParams: { selectedAddress: address }, + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.pois; + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.formattedAddress; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + this.startInfo[index].address = poi.formattedAddress; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.formattedAddress; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + this.endInfo[index].address = poi.formattedAddress; + break; + default: + break; + } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + }); + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物类型' }, + asyncData: () => + this.shipperservice.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value: any, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (_value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 110, + grid: { span: 12 } + } + }; + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget?.reset(res); + if (this.sf3data.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); + } + } + }); + } + initSF4() { + this.schema4 = { + properties: { + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '必填项' } + } + }, + volume: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + number: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + carmand: { + type: 'string', + title: '用车需求', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + drivers: { + type: 'string', + title: '承运司机', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + weightModel: { + type: 'string', + title: '车型车长承重', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + loadTime: { + type: 'string', + title: '发车时间', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + unloadTime: { + type: 'string', + title: '到车时间', + ui: { + widget: 'custom', + placeholder: '请输入' + } + } + }, + required: ['weight', 'loadPlanTime', 'unloadPlanTime'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 110, + grid: { span: 24 } + }, + $weight: { + grid: { span: 8 } + }, + $volume: { + grid: { span: 8 } + }, + $number: { + grid: { span: 8 } + }, + $carmand: { + grid: { span: 24 } + }, + $weightModel: { + spanLabelFixed: 120, + grid: { span: 12 } + }, + $drivers: { + grid: { span: 12 } + }, + $loadPlanTime: { + grid: { span: 12 } + }, + $unloadPlanTime: { + grid: { span: 12 } + } + }; + } + // 处理上传图片 + handlePreview1 = async (file: NzUploadFile) => { + if (!file.url && !file.preview) { + file.preview = await getBase64(file.originFileObj!); + } + console.log('888888888'); + + this.previewImage1 = file.url || file.preview; + this.previewVisible1 = true; + }; + + handleChange1(info: NzUploadChangeParam): void { + switch (info.file.status) { + case 'uploading': + break; + case 'done': + let fileList = [...info.fileList]; + // 2. Read from response and show file link + fileList = fileList.map((file: any) => { + if (file.response) { + file.url = file.response.data.fullFilePath; + } + return file; + }); + break; + case 'error': + this.service.msgSrv.error('网络错误'); + break; + } + } + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + return new Observable((observer: Observer) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; + if (!isJpgOrPng) { + this.service.msgSrv.warning('只能上传图片!'); + observer.complete(); + return; + } + // tslint:disable-next-line: no-non-null-assertion + const isLt2M = file.size! / 1024 / 1024 < 3; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过3兆!'); + observer.complete(); + return; + } + observer.next(isJpgOrPng && isLt2M); + observer.complete(); + }); + }; + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false; + } + handleOK() { + this.isVisible = false; + } + goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + // elf['elementRef'].nativeElement.className = 'target-fix' + } + } + // 装卸货地址互换 + swapAddress() { + this.startInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + }); + this.endInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + }); + + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any, index: any) => { + element.type = '1'; + this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + this.endInfo.forEach((element: any, index: any) => { + element.type = '2'; + this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + // 计算里程,时间 + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res?.distance; + this.totalTime = res?.time; + }); + } + } + // 获取车辆轨迹 + getTrajectory() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res?.trackArray; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res?.cityArray; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory() { + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res?.tracks; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res?.enclosureDataAppTrack]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event: any) { + if (event === 'car') { + this.getTrajectory(); + } else if (event === 'driver') { + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html new file mode 100644 index 00000000..f9519e6c --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html @@ -0,0 +1,284 @@ + + + + + + +
    + +

    订单号: {{ i?.billCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.goodsResource?.enterpriseInfoName }} + {{ i?.goodsResource?.shipperAppUserName }} + {{ i?.goodsResource?.enterpriseProjectName }} + {{ i?.goodsResource?.serviceTypeLabel }} + {{ i?.createUserName }} {{ i?.createUserPhone ? '/' + i?.createUserPhone : '' }} + {{ i?.goodsResource?.dispatchName }}{{ i?.goodsResource?.dispatchPhone ? '/' + i?.goodsResource?.dispatchPhone : '' }} + + {{ i?.externalBillCode }} + {{ i?.goodsResource?.resourceCode }} + {{ i?.wayBill?.wayBillCode }} + {{ i?.goodsResource?.paymentDays }} +
    + + + + + + + + +
    +
    +
    + +
    +
    +   + + + +
    +
    +
    + + + + 货物信息 + + {{ i?.goodsResource?.enterpriseInfoName }} + + + {{i?.goodsInfoList?.[0]?.goodsName}} + + + + {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件 + {{ i?.carModel }}{{ i?.carLength ? '/' + i?.carLength : '' }} + {{ i?.driverName }}{{ i?.driverPhone ? '/' + i?.driverPhone : '' }}{{ i?.carNo ? '/' + i?.carNo : '' }} + {{ i?.driverCarModelLabel }},{{ i?.driverCarLengthLabel }}米,{{ i?.driverCarWeight }}吨 + +
    +

    装货卸货信息 + ( + + + ) + +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{ item?.province }}{{ item.city }}{{ item.area }}{{ item.detailedAddress }}

    +

    联系人:{{ item.appUserName }}{{ item.contractTelephone ? '/' + item.contractTelephone : '' }}

    +
    +
    +
    +

    计划装货时间:{{ i?.goodsResource?.loadingTime }}

    +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{ item?.province }}{{ item.city }}{{ item.area }}{{ item.detailedAddress }}

    +

    联系人:{{ item.appUserName }}{{ item.contractTelephone ? '/' + item.contractTelephone : '' }}

    +
    +
    +
    +

    计划卸货时间:{{ i?.goodsResource?.unloadingTime }}

    +
    +
    +
    +
    +
    + + + + {{ i?.goodsResource?.insuranceTypeLabel }} + + + {{ i?.goodsResource?.goodsValue !== null ? (i?.goodsResource?.goodsValue | currency) + '元' : '-' }} + + + {{ i?.goodsResource?.insurancePremium !== null ? (i?.goodsResource?.insurancePremium | currency) + '元' : '-' }} + + + + + + + + {{ item.price | currency }} + + + {{ item.price + item.surcharge | currency }} + + + {{ item.surcharge | currency }} + + +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2) }}% ) +
    +
    车队长:{{ i?.payeeName }}{{ i?.payeePhone ? '/' + i?.payeePhone : '' }}
    +
    + + + + + 查看附件      + 补充协议 + + + + + + + + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + + {{ i?.supplementaryInformationVO?.receiptUserName }} / {{ i?.supplementaryInformationVO?.phon }} + + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + + + + + + {{ i?.goodsResource?.remarks }} + + + + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + +
    您的订单可能存在交易风险,请及时提交申诉材料,提交成功后,平台将及时完成审核并通知您!
    +
    如果您的运单没有问题,可以提出申诉,并提供相关资料,我们将24小时内审核反馈
    +
      +
    • 系统识别:{{ item?.complianceTypeName }}
    • +
    • {{ item?.determineDetails }},您可在企业端提交申诉材料或联系客服。
    • +
    • 2021-11-07 03:20:15
    • +
    +
    + + + + + + +
    +
    + + +
    暂无附件信息
    +
    +
    + + + + +
    diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.less b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.less new file mode 100644 index 00000000..64f5143e --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.less @@ -0,0 +1,84 @@ +:host { + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .source-info { + p { + margin-bottom: .5em; + } + } + + .freight-info-box { + width: 95%; + } + + .freigth-label { + display : inline-block; + width : 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width : 70%; + margin: 0 auto; + } + } + + } + + .leftPadding { + padding-right: 100px; + } + .hide{ + display: none; + } + .handling-info { + min-height: 100px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } + .target-fix { + display: block; + margin-top: 290px; + } +} \ No newline at end of file diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.spec.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.spec.ts new file mode 100644 index 00000000..3e4df0bf --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 15:31:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-10 09:53:00 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementVehicleDetailComponent } from './vehicle-detail.component'; + +describe('OrderManagementVehicleDetailComponent', () => { + let component: OrderManagementVehicleDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementVehicleDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementVehicleDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts new file mode 100644 index 00000000..099775a6 --- /dev/null +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -0,0 +1,215 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-28 14:42:03 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-06 15:12:10 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; +import { OrderManagementService } from '../../services/order-management.service'; +@Component({ + selector: 'app-supply-management-vehicle-detail', + templateUrl: './vehicle-detail.component.html', + styleUrls: ['./vehicle-detail.component.less'] +}) +export class OrderManagementVehicleDetailComponent implements OnInit { + id = this.route.snapshot.params.id; + modalcontent: any; + modalTitle:string = ''; + trajectory = 'car'; + mapList: any[] = []; //地图点位数据组 + pois: any[] = []; + addressItems: any[] = []; //打点地址数据组 + abnormalList: any[] = []; + i: any = { + unLoadingPlaceList: [], + billExpenseDetails: [], + goodsInfoList: [], + goodsResource: [] + }; + billExpenses: any[] = []; //运费信息表格信息 + imges: any; + attObj: any; + totalObj: any; + approvalLsit: any; + isVisible = false; + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' } + ]; + logColumns: STColumn[] = [ + { title: '款项', index: 'expenseCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatusLabel', + } + ]; + constructor( + public route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: OrderManagementService, + private router: Router, + private modal: NzModalService + ) {} + + ngOnInit(): void { + this.initData(); + this.getTrajectory(); + } + + initData() { + this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => { + if (res) { + this.i = res; + this.pois = [ + { + markerLabel: '起', + color: 'blue', + position: [res.startingPoint.longitude, res.startingPoint.latitude], + title: res.startingPoint.detailedAddress + }, + { + markerLabel: '卸', + color: 'red', + position: [res.endPoint.longitude, res.endPoint.latitude], + title: res.endPoint.detailedAddress + } + ]; + this.billExpenses = this.i?.billExpenseDetails?.filter( + (data: any) => data.expenseCode === 'PRE' || data.expenseCode === 'RECE' || data.expenseCode === 'BACK' + ); + this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE'); + } + }); + this.service.request(this.service.$api_listBillComplianceAbnormalByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('风险详情') + console.log(res) + this.abnormalList = res + } + }); + this.service.request(this.service.$api_getAbnormalWarningByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('异常预警') + console.log(res) + } + }); + } + // 取消订单 + cancellation() { + // api_get_cancelAnOrder + this.modal.confirm({ + nzTitle: '确定取消该订单吗?', + nzContent: `取消后无法恢复,请确认`, + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.initData(); + } + }) + }); + } + goBack() { + window.history.go(-1); + } + // 修改订单 + changeOrder() { + this.router.navigate(['order-management/vehicle-detailChange', this.id]); + } + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false; + } + handleOK() { + this.isVisible = false; + } + + goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + // elf['elementRef'].nativeElement.className = 'target-fix' + } + } + // 获取车辆轨迹 + getTrajectory() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: `${item.spd}km/h`, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm + }); + }); + this.mapList = list; + this.addressItems = res.cityArray; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory() { + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event: any) { + if (event === 'car') { + this.getTrajectory(); + } else if (event === 'driver') { + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.html b/src/app/routes/order-management/components/vehicle/vehicle.component.html new file mode 100644 index 00000000..35c07449 --- /dev/null +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.html @@ -0,0 +1,219 @@ + + + + + + +
    + + + + + + + + + + +
    + +
    + + + {{ item.billCode }} +
    + {{ item?.billTypeLabel }}{{ item?.serviceTypeLabel }} +
    +
    + {{ item?.billStatusLabel }} +
    +
    + +
    {{ item?.goodsName }}
    +
    + {{ item?.weight ? item?.weight + '吨/' : '' }} + {{ item?.volume ? item?.volume + '方/' : '' }} + {{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }} +
    +
    + +
    {{ item?.createUserName }}{{ item?.createUserPhone ? "/" + item?.createUserPhone : '' }}
    +
    + + +
    +

    + {{ data.expenseName }}:{{ data.price | currency }} + {{ data.expenseName }}:{{ (data.price * 100).toFixed(2) + '%' }} + {{ data.paymentStatusLabel }} +

    +
    +
    + +
    + {{ i?.costName }}:{{ i?.price }} +
    +
    + +
    {{ item?.driverName }}{{ item?.driverPhone ? '/' + item?.driverPhone : '' }}{{ item?.carNo ? '/' + item?.carNo : '' }}

    +
    {{ item?.payeeName ? item?.payeeName + '/' : ''}}{{ item?.payeePhone }}
    +
    + + +
    装 | {{ item?.loadingTime }}
    +
    卸 | {{ item?.unloadingTime }}
    +
    +
    +
    +
    + + + + + + {{ index + 1 }} + + + + + + + + + + + + + + {{ item.amountBeforeChange | currency }} + + ¥{{ item.amountchangeValue | number: '0.2-2' + }} + + {{ item.amountAfterChange | currency }} + + +
    变更原因:{{ ViewCause?.changeCause }}
    +
    拒绝原因:{{ ViewCause?.refuseCause }}
    +
    注:附加费依据调整后的运输费用重新计算
    +
    + + + + +
    + + + + + + + + + + +
    暂无评价内容
    +
    + + + + + + +
    暂无评价内容
    +
    +
    +
    + + + + +
    + + +
    + +
    + +
    + + + +
    +
    +
    + + +
    + + + + + + +
    +
    + +
    + +
    已选择{{ + selectedRows?.length || 0 }}条订单,确认批量签收吗? +
    +
    签收后不可再修改运费,请确保运费等信息准确无误后,再进行签收。
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.less b/src/app/routes/order-management/components/vehicle/vehicle.component.less new file mode 100644 index 00000000..149a0bc9 --- /dev/null +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.less @@ -0,0 +1,13 @@ + + :host { + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts new file mode 100644 index 00000000..58b2f93d --- /dev/null +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -0,0 +1,871 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { fromEvent, of } from 'rxjs'; +import { debounceTime, map } from 'rxjs/operators'; +import { BasicTableComponent } from 'src/app/routes/commom/components/basic-table/basic-table.component'; +import { OneCarOrderCancelConfirmComponent } from '../../modal/vehicle/cancel-confirm/cancel-confirm.component'; +import { VehicleConfirReceiptComponent } from '../../modal/vehicle/confir-receipt/confir-receipt.component'; +import { VehicleFreightPeopleComponent } from '../../modal/vehicle/freight-people/freight-people.component'; +import { VehicleModifyCaptainComponent } from '../../modal/vehicle/modify-captain/modify-captain.component'; +import { VehicleModifyRateComponent } from '../../modal/vehicle/modify-rate/modify-rate.component'; +import { VehicleUpdateFreightComponent } from '../../modal/vehicle/update-freight/update-freight.component'; +import { OneCarOrderViewtrackComponent } from '../../modal/vehicle/view-track/view-track.component'; +import { OrderManagementService } from '../../services/order-management.service'; + +@Component({ + selector: 'app-supply-management-vehicle', + templateUrl: './vehicle.component.html', + styleUrls: ['../../../commom/less/commom-table.less','./vehicle.component.less'] +}) +export class OrderManagementVehicleComponent extends BasicTableComponent implements OnInit { + ui: SFUISchema = {}; + schema: SFSchema = {}; + auditMany = false; + isVisibleView = false; + isVisibleEvaluate = false; + isVisible = false; + loading: boolean = true; + paramsList: any; + changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 + changeViewId: any; // 查看运费变更记录id - 用于查看 + ViewCause: any; // 变更运费查看数据 + shipList: any; // 货主评价 数据 + diverList: any; // 司机评价 数据 + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('stFloat') private readonly stFloat!: STComponent; + @ViewChild('stFloatView') private readonly stFloatView!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + columns: STColumn[] = []; + columnsFloat: STColumn[] = []; + columnsFloatView: STColumn[] = []; + datass: any = [ + { + one: '1', + two: '1', + three: '1', + id: 1 + }, + { + one: '2', + two: '2', + three: '2', + id: 2 + }, + ]; + tabs = { + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + signQuantity: 0, + compolatelQuantity: 0, + GoingQuantity: 0, + totalCount: 0 + }; + resourceStatus: any; + + visible = false; + constructor( + public service: OrderManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + public router: Router, + public ar: ActivatedRoute + ) { + super(); + } + + /** + * 查询参数 + */ + get changeParams() { + return { + id: this.changeId + }; + } + get changeViewParams() { + return { + id: this.changeViewId + }; + } + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.billStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || this.paramsList); + delete params._$expand; + return { + ...a, + ...params, + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const a: any = {}; + if (this.resourceStatus) { + a.billStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || this.paramsList); + delete params._$expand; + this.paramsList = params + Object.assign(requestOptions.body, { + ...a, + ...this.paramsList, + }); + this.loading = true; + return requestOptions; + }; + afterRes = (data: any[], rawData?: any) => { + console.log(data); + this.loading = false; + return data.map(item => ({ + ...item, + disabled: item.billStatus == '6' + })); + }; + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + ngOnInit(): void { + this.getGoodsSourceStatistical(); + this.initSF(); + this.initST(); + this.initSTFloat(); + this.initSTFloatView(); + } + + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + getGoodsSourceStatistical() { + this.tabs = { + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + signQuantity: 0, + compolatelQuantity: 0, + GoingQuantity: 0, + totalCount: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.billStatus; + this.service.request(this.service.$api_statisticalStatus, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.billStatusLabel === '待发车') { + this.tabs.stayQuantity = element.quantity; + } else if (element.billStatusLabel === '待接单') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.billStatusLabel === '运输中') { + this.tabs.GoingQuantity = element.quantity; + } else if (element.billStatusLabel === '待签收') { + this.tabs.signQuantity = element.quantity; + } else if (element.billStatusLabel === '已完成') { + this.tabs.compolatelQuantity = element.quantity; + } else if (element.billStatusLabel === '已取消') { + this.tabs.cancelQuantity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '最多100个单号,空号隔开' + } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '最多100个单号,空号隔开', + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: {} + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: {} + }, + driverName: { + title: '承运司机', + type: 'string', + ui: {} + }, + + carNo: { + title: '车牌号', + type: 'string', + ui: {} + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: {} + }, + paymentStatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLable: true + } as SFSelectWidgetSchema + }, + // createTime: { + // title: '创建时间', + // type: 'string', + // ui: { + // widget: 'date', + // mode: 'range', + // format: 'yyyy-MM-dd' + // } as SFDateWidgetSchema + // }, + createTime: { + type: 'string', + title: '创建时间', + ui: { widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema, + }, + riskStatus: { + type: 'string', + title: '是否风险单', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: '3' }, + { label: '否', value: '1' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + // goodsNameId: { + // type: 'string', + // title: '货物名称', + // ui: { + // widget: 'select', + // placeholder: '请选择', + // errors: { required: '请选择货物类型' }, + // visibleIf: { + // _$expand: (value: boolean) => value, + // }, + // asyncData: () => + // this.shipperservice.loadConfigByKey('goods.name.config.type').pipe( + // map((data: any) => { + // return data[0].children?.map((m: any) => { + // return { label: m.name, value: m.id }; + // }); + // }) + // ), + // } as SFSelectWidgetSchema + // }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLable: true + } as SFSelectWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 95, grid: { span: 24, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '订单号', + width: '200px', + fixed: 'left', + className: 'text-left', + render: 'billCode' + }, + { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '180px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '180px', + index: 'unloadingAddressArr' + }, + { + title: '运费明细', + width: '250px', + className: 'text-right', + render: 'mybidDetailInfo' + }, + { + title: '货物信息', + className: 'text-left', + width: '170px', + render: 'goodsName' + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + render: 'driverName' + }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, + { title: '关联运单号', index: 'wayBillCode', width: '170px', className: 'text-left' }, + { title: '关联货源编号', index: 'resourceCode', width: '170px', className: 'text-left' }, + { + title: '装卸货时间', + width: '200px', + className: 'text-left', + render: 'loadingTime' + }, + { + title: '创建时间', + className: 'text-left', + index: 'createTime', + width: '170px' + }, + { + title: '操作', + fixed: 'right', + width: '130px', + className: 'text-center block-td', + buttons: [ + { + text: '运费变更记录', + click: _record => this.OpenPrice(_record), + iif: item => + item.billStatus == '4' || + item.billStatus == '5' || + item.billStatus == '2' || + item.billStatus == '3' || + item.billStatus == '6', + acl: { ability: ['ORDER-VEHICLE-ChangeApplyList'] } + }, + // { + // text: '查看详情', + // click: (item: any) => { + // this.router.navigate(['./vehicle-detail', item.id], { relativeTo: this.ar }); + // }, + // acl: { ability: ['USERCENTER-FREIGHT-USER-view'] } + // }, + { + text: '查看评价', + click: _record => this.viewEvaluate(_record), + iif: item => item.billStatus == '5', + acl: { ability: ['ORDER-VEHICLE-evaluation'] } + }, + { + text: '变更运费', + click: _record => this.updateFreight(_record), + iif: item => item.billStatus !== '1' && item.billStatus !== '6' && item.overallPaymentStatus != '2', + acl: { ability: ['ORDER-VEHICLE-FreightChangeWholeDetail'] } + }, + { + text: '确认签收', + click: _record => this.confirmReceipt(_record), + iif: item => item.billStatus == '4', + acl: { ability: ['ORDER-VEHICLE-signWholeOrder'] } + }, + { + text: '取消订单', + click: _record => this.cancellation(_record), + iif: item => item.billStatus !== '6' && item.overallPaymentStatus !== '2', + acl: { ability: ['ORDER-VEHICLE-cancelAnOrder'] } + }, + { + text: '修改订单', + click: _record => this.changeOrder(_record), + iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3', + acl: { ability: ['ORDER-VEHICLE-modificationOrder'] } + }, + { + text: '申请退款', + click: _record => this.applyRefund(_record), + iif: item => item.isApplyForRefund, + acl: { ability: ['ORDER-VEHICLE-modificationOrder'] } + }, + { + text: '查看轨迹', + click: _record => this.viewTrack(_record), + iif: item => item.billStatus !== '1' && item.billStatus !== '6' + // acl: { ability: ['VEHICLE-LIST-view'] }, + } + ] + } + ]; + } + initSTFloat() { + this.columnsFloat = [ + { + title: '序号', + className: 'text-center', + render: 'order' + }, + { + title: '操作时间', + className: 'text-center', + index: 'applyTime' + }, + { + title: '操作人', + className: 'text-center', + index: 'applyUserName' + }, + { title: '状态', index: 'handleStatusLabel', className: 'text-center' }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '查看', + click: _record => this.FloatView(_record) + }, + { + text: '撤销', + click: _record => this.revoke(_record), + iif: item => item.handleStatus === '1' || item.handleStatus === 1 + } + ] + } + ]; + } + initSTFloatView() { + this.columnsFloatView = [ + { + title: '费用名称', + width: '100px', + className: 'text-center', + index: 'costName' + }, + { + title: '变更前', + width: '100px', + className: 'text-center', + index: 'amountAfterChange', + render: 'amountAfterChange' + }, + { title: '变更值', index: 'amountchangeValue', render: 'amountchangeValue', width: '120px', className: 'text-center' }, + { title: '变更后', index: 'amountBeforeChange', render: 'amountBeforeChange', width: '120px', className: 'text-center' } + ]; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + console.log(item); + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + /** + * 导入货源 + */ + importGoodsSource() {} + audit(item: any) {} + + /* + * 审核关闭弹窗 + view: 1 + 浮动费用: 0 + 查看评价: 3 + */ + handleCancel(type: string) { + console.log(type); + if (type === '0') { + this.isVisible = false; + } else if (type === '1') { + this.isVisibleView = false; + } else if (type === '2') { + this.isVisibleEvaluate = false; + } + } + OpenPrice(value: any) { + this.changeId = value.id; + this.isVisible = true; + } + /** + * 浮动费用查看 + */ + FloatView(item: any) { + console.log(item); + this.changeViewId = item.id; + this.service.request(this.service.$api_getChangeRecordWholeDetail, { id: this.changeViewId }).subscribe(res => { + this.ViewCause = res; + }); + this.isVisibleView = true; + } + /** + *查看评价 + */ + viewEvaluate(item: any) { + console.log(item); + this.isVisibleEvaluate = true; + const params = { + businessCode: item.billCode, + evaluateUserId: item.shipperAppUserId + }; + const params2 = { + businessCode: item.billCode, + evaluateUserId: item.shipperAppUserId + }; + this.service.request(this.service.$api_getBillEvaluateByShipper, params).subscribe(res => { + console.log(res); + this.shipList = res.evaluateInfos; + }); + this.service.request(this.service.$api_getBillEvaluateDriverByShipper, params2).subscribe(res => { + console.log(res); + this.diverList = res.evaluateInfos; + }); + } + /** + *变更运费 + */ + updateFreight(item: any) { + console.log(item?.isFreightChangeApplication); + this.service.request(this.service.$api_get_getFreightChangeWholeDetail, { id: item.id }).subscribe(data => { + if (data) { + const modal = this.modal.create({ + nzTitle: '变更运费', + nzWidth: 580, + nzContent: VehicleUpdateFreightComponent, + nzComponentParams: { data: { ...data, id: item.id, isFreightChangeApplication: item?.isFreightChangeApplication } }, + nzFooter: null + }); + modal.afterClose.subscribe((res: Boolean) => { + if (res) { + this.st.load(); + this.getGoodsSourceStatistical(); + } + }); + } + }); + } + /** + *修改附加费率 + */ + modifyRate() { + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + if (params.length === 0) { + this.service.msgSrv.error('请先选择订单!'); + return; + } + const modal = this.modal.create({ + nzTitle: '修改附加费率', + nzWidth: 600, + nzContent: VehicleModifyRateComponent, + nzComponentParams: { data: { ids: params } }, + nzFooter: null + }); + modal.afterClose.subscribe(result => { + if (result) { + this.st.load(1); + this.getGoodsSourceStatistical(); + } + }); + } + /** + *修改网络货运人 + */ + modifyFreightPeople() { + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + let params2: any[] = []; + this.selectedRows.forEach(item => { + params2.push(item.enterpriseInfoId); + }); + if (params.length === 0) { + this.service.msgSrv.error('请先选择订单!'); + return; + } + const modal = this.modal.create({ + nzTitle: '修改网络货运人', + nzWidth: 600, + nzContent: VehicleFreightPeopleComponent, + nzComponentParams: { data: { ids: params, enterpriseInfoIds: params2 } }, + nzFooter: null + }); + modal.afterClose.subscribe(result => { + if (result) { + this.st.load(1); + this.getGoodsSourceStatistical(); + } + }); + } + /** + *修改网络货运人 + */ + modifycaptain() { + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + if (params.length === 0) { + this.service.msgSrv.error('请先选择订单!'); + return; + } + const modal = this.modal.create({ + nzTitle: '修改车队长', + nzWidth: 900, + nzContent: VehicleModifyCaptainComponent, + nzComponentParams: { data: { ids: params } }, + nzFooter: null + // nzOnOk: sin => { + // this.st.reload(); + // } + // }); + // return false; + // } + }); + modal.afterClose.subscribe(result => { + if (result) { + this.st.load(1); + this.getGoodsSourceStatistical(); + } + }); + } + + // *确认签收 + + confirmReceipt(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认签收', + nzWidth: '50%', + nzContent: VehicleConfirReceiptComponent, + nzComponentParams: { + i: item, + Status: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: boolean) => { + if (res) { + this.resetSF; + this.st.load(); + this.getGoodsSourceStatistical(); + } + }); + } + revoke(item: any) { + this.modal.confirm({ + nzTitle: '是否确定立即撤销费用变更!', + nzOnOk: () => + this.service.request(this.service.$api_get_revokeChangeRecord, { id: item.id }).subscribe(res => { + console.log(res); + if (res) { + this.service.msgSrv.success('撤销成功!'); + this.stFloat.reload(); + } + }) + }); + } + // 取消订单 + cancellation(item: any) { + // api_get_cancelAnOrder + this.modal.confirm({ + nzTitle: '确定取消该订单吗?', + nzContent: `取消后无法恢复,请确认`, + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: item.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.st.load(1); + this.getGoodsSourceStatistical(); + this.initST(); + } + }) + }); + } + userAction() { + let params: any[] = []; + if (this.selectedRows.length <= 0) { + this.service.msgSrv.warning('请选择需要签收的订单!'); + return; + } + let flag = true; + this.selectedRows.forEach(item => { + if (item.billStatus !== '4') { + this.service.msgSrv.warning('存在非待签收状态订单,无法签收!'); + flag = false; + } + params.push(item.id); + }); + if (!flag) return; + this.service.request(this.service.$api_get_batchSignWholeOrder, params).subscribe(res => { + if (res) { + console.log(res); + this.st.load(1); + this.getGoodsSourceStatistical(); + } + }); + } + // 修改订单 + changeOrder(value: any) { + this.router.navigate(['order-management/vehicle-detailChange', value.id]); + } + /** + *申请退款 + */ + applyRefund(item: any) { + const modalRef = this.modal.create({ + nzTitle: '申请退款', + nzContent: OneCarOrderCancelConfirmComponent, + nzComponentParams: { + i: item, + sts: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: boolean) => { + if (res) { + this.resetSF; + this.st.load(); + } + }); + } + /** + *查看轨迹 + */ + viewTrack(item: any) { + const modalRef = this.modal.create({ + nzTitle: '查看轨迹', + nzContent: OneCarOrderViewtrackComponent, + nzWidth: '800px', + nzComponentParams: { + i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: boolean) => { + if (res) { + } + }); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_get_asyncExportWholeList); + } +} diff --git a/src/app/routes/order-management/modal/audit/appeal/appeal.component.html b/src/app/routes/order-management/modal/audit/appeal/appeal.component.html new file mode 100644 index 00000000..6e717730 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/appeal/appeal.component.html @@ -0,0 +1,48 @@ + + +
    + + + {{ dataList?.representationsStatusLabel }} + + +
    +
    + {{ item?.complianceName }} +
    +
    +
    + + {{ dataList?.representationsCause }} + + + {{ dataList?.representationsDescribe }} + + +
    + + +
    +
    +
    +
    + diff --git a/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts b/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts new file mode 100644 index 00000000..451a3796 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/appeal/appeal.component.ts @@ -0,0 +1,123 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-appeal', + templateUrl: './appeal.component.html' +}) +export class OneCarOrderAppealComponent implements OnInit { + i: any; + dataList: any; + constructor( + private modalRef: NzModalRef, + private modal: NzModalService, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + this.initDate(); + } + // initSF() { + // this.schema = { + // properties: { + // abnormalCause: { + // type: 'string', + // title: '异常原因', + // default: this.i.abnormalCause, + // readOnly: true, + // ui: { + // widget: 'textarea', + // autosize: { minRows: 4, maxRows: 6 } + // } as SFTextareaWidgetSchema + // }, + // representationsCause: { + // type: 'string', + // title: '申诉原因', + // ui: { + // widget: 'dict-select', + // params: { dictKey: 'bill:representation:reason' }, + // containsAllLabel: false, + // placeholder: '请选择', + // errors: { required: '请选择' } + // } + // }, + // representationsDescribe: { + // type: 'string', + // title: '申诉描述', + // maxLength: 100, + // ui: { + // widget: 'textarea', + // autosize: { minRows: 4, maxRows: 6 } + // } as SFTextareaWidgetSchema + // }, + // fileArr: { + // type: 'string', + // title: '上传凭证', + // ui: { + // action: apiConf.fileUpload, + // accept: 'image/png,image/jpeg,image/jpg', + // limit: 5, + // limitFileCount: 5, + // resReName: 'data.fullFilePath', + // urlReName: 'data.fullFilePath', + // widget: 'upload', + // descriptionI18n: '不超过5张,单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + // name: 'multipartFile', + // multiple: true, + // listType: 'picture-card', + // beforeUpload: (file: any, _fileList: any) => { + // return new Observable((observer: Observer) => { + // const isLt2M = file.size / 1024 / 1024 < 5; + // if (!isLt2M) { + // this.service.msgSrv.warning('图片大小超过5M!'); + // observer.complete(); + // return; + // } + // observer.next(isLt2M); + // observer.complete(); + // }); + // } + // } as SFUploadWidgetSchema + // } + // }, + // required: ['representationsCause', 'representationsDescribe'] + // }; + // this.ui = { + // '*': { + // spanLabelFixed: 100, + // grid: { span: 20 } + // } + // }; + // } + initDate(): void { + console.log(this.i); + this.service.request(this.service.$api_get_getOrderComplaintDetail, { id: this.i?.id }).subscribe((res: any) => { + if (res) { + console.log(res); + this.dataList = res + } + }); + } + + close(): void { + this.modalRef.destroy(); + } +} diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html new file mode 100644 index 00000000..fe3fd680 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html @@ -0,0 +1,28 @@ + +
    + + +
    +
    电子装货单
    +
    +
    + +
    电子卸货单
    +
    +
    +
    + + diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.less b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.less new file mode 100644 index 00000000..2502ed97 --- /dev/null +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.less @@ -0,0 +1,106 @@ +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + .hideBtn .ant-upload-list-item-actions button{ + &:last-child{ + display: none; + } + } + } + } + .sfBox { + position: relative; + .example { + position: absolute; + top: 215px; + right: 265px; + color: #1890ff; + cursor: pointer; + .popBox { + position: absolute; + top: -170px; + left: -125px; + width: 300px; + padding: 20px; + text-align: center; + background: #fff; + border: solid 1px #eee; + border-radius: 6px; + box-shadow: 0 1px 5px 1px #ececec; + &::before { + position: absolute; + bottom: -5px; + left: 50%; + width: 10px; + height: 10px; + margin-left: -5px; + background: #fff; + box-shadow: 0 1px 5px 1px #ececec; + transform: rotate(45deg); + content: ''; + } + &::after { + position: absolute; + bottom: 0; + left: 0; + z-index: 10; + width: 100%; + height: 10px; + background: #fff; + content: ''; + } + img { + max-width: 100%; + max-height: 200px; + } + } + } + .pr { + position: relative; + } + + .pa { + position: absolute; + top: 35px; + left: 150px; + } + + .tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } + } + .positionSet{ + top: 356px; + right: 235px; + } + .positionSet01{ + top: 500px; + right: 200px; + } + .positionSet02{ + top: 664px; + right: 265px; + } + .positionSet03{ + top: 808px; + right: 205px; + + } + } + \ No newline at end of file diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts new file mode 100644 index 00000000..7cf3957c --- /dev/null +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -0,0 +1,523 @@ + +import { Component, OnInit, ViewChild } from '@angular/core'; +import { DatePipe } from '@angular/common'; +import { + SFComponent, + SFCustomWidgetSchema, + SFDateWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { apiConf } from '@conf/api.conf'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { EAEnvironmentService } from '@shared'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-voucher-view', + templateUrl: './voucher-view.component.html', + styleUrls: ['./voucher-view.component.less'], + providers: [DatePipe] +}) +export class orderManagementVoucherViewComponent implements OnInit { + record: any = {}; + i: any; + loadPDF: string = ''; + formData: any; + datas: any; + Status: any; + data: any ={ + weight: 0, + volume: 0 + }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: OrderManagementService,private datePipe: DatePipe,private envSrv: EAEnvironmentService, ) {} + + ngOnInit(): void { + // console.log(this.i) + this.initData() + this.i.time = this.i.loadingTime; + this.initSF(); + } + initSF() { + console.log(this.Status) + if(this.Status == 1) { + + this.schema = { + + properties: { + loadingLadingBillFilePath: { + type: 'string', + title: '装货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + loadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text', + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + }, + unloadingLadingBillFilePath: { + type: 'string', + title: '卸货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + unloadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + } + }, + required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath','unloadingLadingBillFilePath','unloadingPeopleVehiclesGoodsFilePath' ] + }; + }else { + this.schema = { + properties: { + no0: { + type: 'string', + title: '', + ui: { + widget: 'custom', + }, + }, + loadingLadingBillFilePath: { + type: 'string', + title: '装货凭证', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + loadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + + no4: { + type: 'string', + title: '', + ui: { + widget: 'text', + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + }, + no6: { + type: 'string', + title: '', + ui: { + widget: 'custom', + }, + }, + unloadingLadingBillFilePath: { + type: 'string', + title: '卸货凭证', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + }, + unloadingPeopleVehiclesGoodsFilePath: { + type: 'string', + title: '', + readOnly: true, + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + } as SFUploadWidgetSchema, + } + }, + required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath','unloadingLadingBillFilePath','unloadingPeopleVehiclesGoodsFilePath' ] + }; + } + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $unloadingLadingBillFilePath: { grid: { span: 12} }, + $unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12} }, + $loadingLadingBillFilePath: { grid: { span: 12} }, + $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12} }, + }; + } + save(value: any): void { + if(!this.sf.valid) { + this.service.msgSrv.warning('必填项为空!') + return; + } + console.log(value) + const params = { + id: this.i?.id, + loadingLadingBillFilePath: value?.loadingLadingBillFilePath?.data?.fullFilePath, + loadingPeopleVehiclesGoodsFilePath: value?.loadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, + unloadingLadingBillFilePath: value?.unloadingLadingBillFilePath?.data?.fullFilePath, + unloadingPeopleVehiclesGoodsFilePath: value?.unloadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, + } + console.log(params) + this.service.request(this.service.$api_get_updateBillExamine, params).subscribe((res) => { + if(res) { + this.service.msgSrv.success('修改成功!') + this.modal.destroy(true); + } + }) + } + sure() { + const params = [this.i?.id]; + this.service.downloadFile(this.service.$api_createBillTakeGoods,params) + this.service.downloadFile(this.service.$api_createBillDischargeGoods,params) + this.service.msgSrv.success('生成电子单据成功!') + this.modal.destroy(true); + } + // 确认到车界面信息(两个只能看的图片) + initData() { + this.service.request(this.service.$api_get_getCredentials, { id : this.i?.id}).subscribe((res) => { + console.log(res) + this.datas = res + if (res.unloadingLadingBillFilePath) { + this.formData = { + loadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.loadingLadingBillFilePath, + response: { + url: res.loadingLadingBillFilePath, + }, + }, + ], + loadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.loadingPeopleVehiclesGoodsFilePath, + response: { + url: res.loadingPeopleVehiclesGoodsFilePath, + }, + }, + ], + unloadingLadingBillFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.unloadingLadingBillFilePath, + response: { + url: res.unloadingLadingBillFilePath, + }, + }, + ], + unloadingPeopleVehiclesGoodsFilePath: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.unloadingPeopleVehiclesGoodsFilePath, + response: { + url: res.unloadingPeopleVehiclesGoodsFilePath, + }, + }, + ], + }; + } + }) + } + close(): void { + this.modal.destroy(true); + } + openlaod(value: any) { + if(value === 1) { + const a = document.createElement('a'); + a.href = this.datas?.loadingElectronicsLadingBillFilePath; + document.body.appendChild(a); + console.log(document.body.contains(a)) + a.click(); //点击下载 + document.body.removeChild(a); //下载完成移除元素 + } else { + const a = document.createElement('a'); + a.href = this.datas?.unloadingElectronicsLadingBillFilePath; + document.body.appendChild(a); + console.log(document.body.contains(a)) + a.click(); //点击下载 + document.body.removeChild(a); //下载完成移除元素 + } + + } +} diff --git a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html new file mode 100644 index 00000000..807acb0b --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html @@ -0,0 +1,100 @@ + +货物单价 + + + + + + {{detailList?.freightPrice}} {{detailList?.freightTypeLabel}} + + + +
    +
    以收货为准
    +
    以发货为准
    +
    保留小数
    +
    抹除小数
    +
    抹除个数
    +
    +
    + +
    + + +
    {{ detailList?.loadWeight }}吨
    +
    + +
    {{ detailList?.loadVolume }}方
    +
    +
    + + +
    {{ detailList?.settlementWeight }}吨
    +
    + +
    {{ detailList?.settlementVolume }}方
    +
    +
    + + +
    {{detailList?.price | currency}} 元
    +
    + +
    {{detailList?.driverName}} / {{detailList?.driverPhone}}/ {{detailList?.carNo}}
    +
    + +
    {{detailList?.payeeName}} / {{detailList?.payeePhone}}
    +
    + + +
    + +
    请上传图片
    +
    +
    + + + + + +
    +
    + diff --git a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.less b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.ts b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.ts new file mode 100644 index 00000000..9071e083 --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.ts @@ -0,0 +1,146 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-14 15:02:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:20:58 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\confir-receipt\\confir-receipt.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; +function getBase64(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} +@Component({ + selector: 'app-order-management-confir-receipt', + templateUrl: './confir-receipt.component.html', + styleUrls: ['./confir-receipt.component.less'] +}) +export class ConfirReceiptComponent implements OnInit { + i: any; + Status: any; + detailList: any; + data: any = {}; + driverList: any; + payeeList: any; + carList: any; + listImagUrls: any[] = []; + previewImage1 = ''; + previewVisible1 = false; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + this.initData(); + } + + save(): void { + // 大宗 + console.log(this.listImagUrls); + let imgList: any = []; + if (this.listImagUrls.length > 0) { + this.listImagUrls.forEach((res: any) => { + if (res.url) { + imgList.push(res.url); + } + }); + } + console.log(imgList); + const params = { + id: this.i?.id, + filePathList: imgList + }; + console.log(params); + this.service.request(this.service.$api_get_signBulkOrder, params).subscribe((res: any) => { + console.log(res.success); + if (res) { + this.service.msgSrv.success('确认签收成功!'); + this.modal.destroy(true); + } + }); + } + initData() { + // 大宗 + this.service.request(this.service.$api_get_getBulkSignForDetail, { id: this.i?.id }).subscribe((res: any) => { + console.log(res); + this.detailList = res; + let arr: any = []; + res.filePathList.forEach((element: any, index: any) => { + console.log(index); + arr.push({ + url: element, + status: 'done', + uid: index + }); + }); + this.listImagUrls = arr; + }); + } + close(): void { + this.modal.destroy(true); + } + userAction() {} + handlePreview1 = async (file: NzUploadFile) => { + if (!file.url && !file.preview) { + file.preview = await getBase64(file.originFileObj!); + } + this.previewImage1 = file.url || file.preview; + this.previewVisible1 = true; + }; + handleChange1(info: NzUploadChangeParam): void { + switch (info.file.status) { + case 'uploading': + break; + case 'done': + let fileList = [...info.fileList]; + // 2. Read from response and show file link + console.log(fileList); + fileList = fileList.map((file: any) => { + if (file.response) { + file.url = file.response.data.fullFilePath; + } + return file; + }); + console.log(this.listImagUrls); + break; + case 'error': + this.service.msgSrv.error('网络错误'); + break; + } + } + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + return new Observable((observer: Observer) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; + if (!isJpgOrPng) { + this.service.msgSrv.warning('只能上传图片!'); + observer.complete(); + return; + } + // tslint:disable-next-line: no-non-null-assertion + const isLt2M = file.size! / 1024 / 1024 < 3; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过3兆!'); + observer.complete(); + return; + } + observer.next(isJpgOrPng && isLt2M); + observer.complete(); + }); + }; +} diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html new file mode 100644 index 00000000..b6803fd0 --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + +
    +

    + 总运费:{{ data.totalAmount |currency }} +

    +

    运输费:{{ data.totalFreight |currency }},附加费:{{ data.totalSurcharge |currency}}

    +
    + diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.less b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts new file mode 100644 index 00000000..9ee9df5e --- /dev/null +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts @@ -0,0 +1,218 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-14 14:03:07 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-01 19:27:28 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFNumberWidgetSchema, SFSchema, SFSelectWidgetSchema, SFStringWidgetSchema, SFTextWidgetSchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Subscription } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-update-freight', + templateUrl: './update-freight.component.html', + styleUrls: ['./update-freight.component.less'] +}) +export class UpdateFreightComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + + @Input() + data: any; + freightTypeOptions: any; + + calculateSub!: Subscription; + constructor(private service: OrderManagementService, private modal: NzModalRef) {} + + ngOnInit(): void { + this.schema = this.initSF(this.data); + this.service.getDictByKey('freight:type').subscribe(res => { + this.freightTypeOptions = res; + }); + } + + /** + * 初始化表单 + */ + private initSF(data: any): SFSchema { + return { + properties: { + freightPrice: { + type: 'number', + title: '运费单价', + ui: { + placeholder: '请输入', + widget: 'custom', + grid: { span: 12 }, + } as SFStringWidgetSchema, + default: data.freightPrice + }, + rule: { + title: '', + type: 'string', + default: data.rule, + enum: [ + { label: '保留小数', value: '1' }, + { label: '抹除小数', value: '2' }, + { label: '抹除个数', value: '3' } + ], + ui: { + widget: 'select', + spanLabelFixed: 10, + grid: { + span: 10 + } + } as SFSelectWidgetSchema + }, + settlementBasis: { + title: '结算依据', + type: 'string', + default: data.settlementBasis, + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:settlement:type' }, + containsAllLabel: false, + placeholder: '结算依据', + errors: { required: '请选择结算依据' }, + grid: {span: 12} + } as SFSelectWidgetSchema + }, + blank1: { + title: '', + type: 'string', + ui: { widget: 'text', grid: { span: 12 }, class: 'input-back' }, + default: ' ' + }, + freightType: { + title: '', + type: 'string', + ui: { hidden: true }, + default: data.freightType + }, + loadWeight: { + type: 'number', + title: '装货重量', + default: data.loadWeight || 0, + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + loadVolume: { + type: 'number', + title: '装货体积', + default: data.loadVolume || 0, + minimum: 0, + maximum: 99999, + ui: { + unit: '方', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + settlementWeight: { + type: 'number', + title: '卸货重量', + default: data.settlementWeight || 0, + minimum: 0, + maximum: 99999, + ui: { + unit: '吨', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + settlementVolume: { + type: 'number', + title: '卸货体积', + default: data.settlementVolume || 0, + minimum: 0, + maximum: 99999, + ui: { + unit: '方', + placeholder: '请输入', + grid: { + span: 12 + }, + hideStep: true, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + changeCause: { + title: '审核备注', + type: 'string', + maxLength: 100, + default: data.changeCause, + ui: { + widget: 'textarea', + span: 24, + placeholder: '选填,最多不超过100字', + autosize: { + minRows: 3, + maxRows: 5 + } + } as SFTextWidgetSchema + }, + }, + required: ['freightPrice', 'settlementBasis'] + }; + } + + changeNumVal() { + console.log('444') + if (this.calculateSub) { + this.calculateSub.unsubscribe(); + } + const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} } + this.calculateSub = this.service + .request(this.service.$api_calculate_cost, params) + .subscribe(res => { + if (res) { + Object.assign(this.data, { + totalAmount: res.totalAmount, + totalFreight: res.totalFreight, + totalSurcharge: res.totalSurcharge + }); + } + }); + } + + save(value: any): void { + if (!this.sf.valid) { + this.sf.validator({ emitError: true }); + return; + } + const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} } + this.service.request(this.service.$api_change_bulk,params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('变更运费成功!'); + this.modal.destroy(true); + } + }); + } + + close(): void { + this.modal.destroy(false); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.html b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.html new file mode 100644 index 00000000..a609acaf --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.html @@ -0,0 +1,36 @@ + + + +
    {{ i.shipperAppUserName }}
    +
    + +
    {{ i.driverName }} / {{ i.driverPhone }} / {{ i.carNo }}
    +
    + +
    {{ i.payeeName }} / {{ i.payeePhone }}
    +
    + +

    + +

    +
    + 已选择 {{ index }} 项,运费:{{ List | currency}},附加费:{{ ATTPrice | currency }} +
    + + + diff --git a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts new file mode 100644 index 00000000..dc868538 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts @@ -0,0 +1,123 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-02-22 13:53:29 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-28 15:56:46 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + + +@Component({ + selector: 'app-order-management-cancel-confirm', + templateUrl: './cancel-confirm.component.html' +}) +export class OneCarOrderCancelConfirmComponent implements OnInit { + i: any; // 单行数据 + sts: any; // 区分大宗、整车 + index: any; // 项目数 + ATTPrice: any; // 附加费 + List: any; // 运费 + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor( + private modalRef: NzModalRef, + private modal: NzModalService, + private msgSrv: NzMessageService, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + console.log(this.i); + this.initSF(); + this.initData() + + } + initSF() { + this.schema = { + properties: { + reason: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 6, maxRows: 6 } + } as SFTextareaWidgetSchema + }, + }, + required: ['reason'] + }; + this.ui = { + '*': { + spanLabelFixed: 60, + grid: { span: 20 } + } + }; + } + initData() { + let indexId = 0 + let index = 0 + let indexSurcharge = 0 + this.i?.mybidDetailInfo.forEach((ele: any) => { + if(this.sts == 1) { + // 大宗 + if (ele?.paymentStatusLabel == '已支付' && ele.expenseCode == "TRA") { + index += ele?.price; + } + if (ele?.paymentStatusLabel == '已支付') { + indexId += 1; + indexSurcharge += ele?.surcharge; + } + } else { + // 整车 + if (ele?.paymentStatusLabel == '已支付') { + indexId += 1; + index += ele?.price; + indexSurcharge += ele?.surcharge; + } + console.log(ele.expenseCode) + } + }); + this.index = indexId + this.List = index + this.ATTPrice = indexSurcharge + console.log(this.index) + console.log(this.List) + } + save(value: any): void { + if (!this.sf.value.reason) { + this.service.msgSrv.error('请填写备注信息!'); + return; + } + const params = { billId: this.i?.id, ...this.sf.value }; + console.log(params) + this.service.request(this.service.$api_billRefundApplication_save, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功!'); + this.modalRef.close(true); + } + }); + } + + close(value: boolean): void { + this.modalRef.close(false); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html new file mode 100644 index 00000000..7681f210 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.html @@ -0,0 +1,7 @@ + + + + diff --git a/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts new file mode 100644 index 00000000..16e7c1c0 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/cancel/cancel.component.ts @@ -0,0 +1,84 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-21 10:14:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:21:43 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel\\cancel.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, SFSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-cancel', + templateUrl: './cancel.component.html' +}) +export class OneCarOrderCancelComponent implements OnInit { + record: any = {}; + i: any; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor(private modalRef: NzModalRef, private modal: NzModalService, public service: OrderManagementService) {} + + ngOnInit(): void { + this.initSF(); + console.log(this.i.billStatusLabel); + } + initSF() { + this.schema = { + properties: { + cancelReason: { + type: 'string', + title: '取消原因', + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } as SFTextareaWidgetSchema + } + }, + required: ['reason'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + } + }; + } + save(value: any): void { + if (this.i?.billStatus === '1') { + // 待接单状态 + this.modal.confirm({ + nzTitle: '是否确定立即取消运单!', + nzOnOk: () => + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.i?.id, ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.close(true); + } + }), + nzOnCancel: () => this.modalRef.destroy() + }); + } else { + this.service.request(this.service.$api_get_cancelAnOrder, { id: this.i?.id, ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.close(true); + } + }); + } + + this.modalRef.close(true); + } + + close(): void { + this.modalRef.destroy(); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html new file mode 100644 index 00000000..2c0d7063 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html @@ -0,0 +1,71 @@ + + + + + + + + {{item.PRE | currency}} + + + {{item.RECE | currency}} + + + {{item.BACK | currency}} + + + {{ item.traiPrice | currency}} + + + {{item.surcharge | currency}} + + + + +
    {{ dataInfo?.driverName|| '-' }} / {{dataInfo?.driverPhone || '-' }}/ {{ dataInfo?.carNo || '-' }}
    +
    + +
    {{ i?.payeeName || '-'}} / {{ i?.payeePhone || '-'}}
    +
    + + +
    + +
    请上传图片
    +
    +
    + + + + + +
    +
    + diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts new file mode 100644 index 00000000..fa5b8958 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts @@ -0,0 +1,199 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-15 13:17:42 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-31 17:36:46 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit } from '@angular/core'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; +function getBase64(file: File): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} +@Component({ + selector: 'app-order-management-vehicle-confir-receipt', + templateUrl: './confir-receipt.component.html', + styleUrls: ['./confir-receipt.component.less'] +}) +export class VehicleConfirReceiptComponent implements OnInit { + record: any = {}; + i: any; + Status: any; + costDetail: any; // 费用明细 + columns!: STColumn[]; + previewVisible1 = false; + dataInfo: any; + detailList: any; + data: any = {}; + previewImage1 = ''; + listImagUrls: any[] = []; + payeeList: any; + driverList: any; + carList: any; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + this.initST(); + this.initData(); + } + + save(): void { + let imgList: any = []; + if (this.listImagUrls.length > 0) { + this.listImagUrls.forEach((res: any) => { + if (res.url) { + imgList.push(res.url); + } + }); + } + console.log(imgList); + const params = { + id: this.i?.id, + filePathList: imgList + }; + this.service.request(this.service.$api_get_signWholeOrder, params).subscribe((res: any) => { + console.log(res); + if (res) { + this.service.msgSrv.success('确认签收成功!'); + this.modal.destroy(true); + } + }); + } + handlePreview1 = async (file: NzUploadFile) => { + if (!file.url && !file.preview) { + file.preview = await getBase64(file.originFileObj!); + } + this.previewImage1 = file.url || file.preview; + this.previewVisible1 = true; + }; + close(): void { + this.modal.destroy(); + } + + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + return new Observable((observer: Observer) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; + if (!isJpgOrPng) { + this.service.msgSrv.warning('只能上传图片!'); + observer.complete(); + return; + } + // tslint:disable-next-line: no-non-null-assertion + const isLt2M = file.size! / 1024 / 1024 < 3; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过3兆!'); + observer.complete(); + return; + } + observer.next(isJpgOrPng && isLt2M); + observer.complete(); + }); + }; + initData() { + // 大宗 + this.service.request(this.service.$api_get_getWholeSignForDetail, { id: this.i?.id }).subscribe((res: any) => { + console.log(res); + this.dataInfo = res; + const cost: any = {}; + res.mybidDetailInfo.forEach((element: any) => { + if (element.expenseName === '预付' || element.expenseCode === 'PRE') { + cost.PRE = element.price; + } else if (element.expenseName === '到付' || element.expenseCode === 'RECE') { + cost.RECE = element.price; + } else if (element.expenseName === '回单付' || element.expenseCode === 'BACK') { + cost.BACK = element.price; + } else if (element.expenseCode === 'ATT') { + cost.surcharge = element.price; + } else if (element.expenseCode === 'TOTAL') { + cost.traiPrice = element.price; + } + }); + let arr: any = []; + res.filePathList.forEach((element: any, index: any) => { + console.log(index); + arr.push({ + url: element, + status: 'done', + uid: index + }); + }); + this.listImagUrls = arr; + this.costDetail = [cost]; + }); + } + + initST() { + this.columns = [ + { + title: '预付', + index: 'PRE', + render:'PRE' + }, + { + title: '到付', + index: 'RECE', + render:'RECE' + }, + // { + // title: '油卡', + // index: 'OIL' + // }, + { + title: '回单付', + index: 'BACK', + render:'BACK' + }, + { + title: '附加费', + index: 'surcharge', + render:'surcharge' + }, + { + title: '总运费', + index: 'traiPrice', + render:'traiPrice' + } + ]; + } + + handleChange1(info: NzUploadChangeParam): void { + switch (info.file.status) { + case 'uploading': + break; + case 'done': + let fileList = [...info.fileList]; + // 2. Read from response and show file link + console.log(fileList); + fileList = fileList.map((file: any) => { + if (file.response) { + file.url = file.response.data.fullFilePath; + } + return file; + }); + console.log(this.listImagUrls); + break; + case 'error': + this.service.msgSrv.error('网络错误'); + break; + } + } +} diff --git a/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.html b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.html new file mode 100644 index 00000000..9e2db533 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.html @@ -0,0 +1,16 @@ + + + + diff --git a/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.less b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.ts b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.ts new file mode 100644 index 00000000..15410d98 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/freight-people/freight-people.component.ts @@ -0,0 +1,92 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-29 16:48:16 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-24 20:19:31 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\freight-people\\freight-people.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-vehicle-freight-people', + templateUrl: './freight-people.component.html', + styleUrls: ['./freight-people.component.less'] +}) +export class VehicleFreightPeopleComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + + aggreechecked = false; + + data: any; + + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public service: OrderManagementService, + public shipperservice: ShipperBaseService + ) {} + + ngOnInit(): void { + console.log(this.data); + this.initSF(); + } + initSF() { + this.schema = { + properties: { + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + } + }, + required: ['enterpriseInfoId'] + }; + this.ui = { + '*': { + spanLabelFixed: 130, + grid: { span: 16 } + } + }; + } + + save(value: any): void { + console.log(this.sf.value); + if(!this.sf.valid) { + this.service.msgSrv.error("请选择网络货运人!") + return; + } + const params = { + billIds: this.data?.ids, + enterpriseInfoId: this.sf.value?.enterpriseInfoId + }; + console.log(params); + this.service.request(this.service.$api_set_updateEnterpriseInfoBatch, params).subscribe((res: any) => { + if (res) { + this.modal.destroy(true); + this.service.msgSrv.success('修改网络货运人成功!'); + } + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.html b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.html new file mode 100644 index 00000000..dee32307 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.html @@ -0,0 +1,38 @@ + + +
    +
    + +
    + +
    + +
    +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.less b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.ts b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.ts new file mode 100644 index 00000000..845db74c --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-captain/modify-captain.component.ts @@ -0,0 +1,126 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-30 14:45:39 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-24 10:28:48 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\modify-captain\\modify-captain.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-vehicle-modify-captain', + templateUrl: './modify-captain.component.html', + styleUrls: ['./modify-captain.component.less'] +}) +export class VehicleModifyCaptainComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('st', { static: false }) st!: STComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + Columns: STColumn[] = []; + aggreechecked = false; + dataList: any = []; + data: any; + bankData: any; + + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {} + + ngOnInit(): void { + console.log(this.data); + this.initSF(); + this.initST(); + } + initSF() { + this.schema = { + properties: { + mobile: { + type: 'string', + title: '车队长手机号', + maxLength: 11 + } + }, + required: ['mobile'] + }; + this.ui = { + '*': { + spanLabelFixed: 130, + grid: { span: 16 } + } + }; + } + initST() { + this.Columns = [ + { title: '司机头像', render: 'avatar', width: '120px' }, + { title: '司机姓名', index: 'name', width: '120px' }, + { + title: '实名认证状态', + className: 'text-center', + index: 'certificationStatus', + type: 'badge', + width: '120px', + badge: { + '-1': { text: '未提交', color: 'warning' }, + '0': { text: '待审核', color: 'warning' }, + '1': { text: '通过', color: 'success' }, + '2': { text: '驳回', color: 'error' } + } + }, + { title: '收款账户', width: '200px', render: 'bankList' }, + { + title: '操作', + width: '120px', + className: 'text-center', + buttons: [ + { + text: '设置', + click: item => { + this.set(item); + } + } + ] + } + ]; + } + set(value: any): void { + console.log(this.st?._data); + console.log(this.data); + console.log(value); + console.log(this.bankData); + const params = { + billIds: this.data?.ids, + carCaptainId: value.appUserId, + bankData: this.bankData + }; + this.service.request(this.service.$api_get_updateCarCaptainBatch, params).subscribe((res: any) => { + if (res) { + this.modal.destroy(); + this.service.msgSrv.success('修改成功'); + } else { + this.service.msgSrv.error(res?.msg); + } + }); + } + initDate() { + const params = { + fetchBank: 1, + ...this.sf?.value + }; + this.service.request(this.service.$api_get_getCarCaptainByMobile, params).subscribe((res: any) => { + console.log(res); + if (res) { + this.dataList = [res]; + } + }); + } + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.html b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.html new file mode 100644 index 00000000..ad382091 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.html @@ -0,0 +1,32 @@ + + + + + + + {{ item?.oldAdditionalRate? (item?.oldAdditionalRate * 100).toFixed(2) + '%' : ''}} + + + {{ item?.oldSurcharge | currency}} + + + {{ item?.newSurcharge | currency}} + + + diff --git a/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.less b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.ts b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.ts new file mode 100644 index 00000000..6e61d083 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/modify-rate/modify-rate.component.ts @@ -0,0 +1,104 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-29 14:51:07 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-08 13:21:59 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\modify-rate\\modify-rate.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { STColumn } from '@delon/abc/st'; +import { SFComponent, SFNumberWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-vehicle-modify-rate', + templateUrl: './modify-rate.component.html', + styleUrls: ['./modify-rate.component.less'] +}) +export class VehicleModifyRateComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + columns: STColumn[] = [ + { title: '订单号', index: 'billCode' }, + { title: '原附加费率', render: 'oldAdditionalRate' }, + { title: '原附加费', render: 'oldSurcharge' }, + // { title: '新附加费', render: 'newSurcharge' }, + ]; + aggreechecked = false; + + @Input() + data: any; + + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {} + + ngOnInit(): void { + console.log(this.data); + this.initSF(); + console.log(this.data?.ids) + } + get reqParams() { + + return { + // operateObject: this.i?.resourceCode, + // operateType: 4, + ids: this.data?.ids, + additionalRate: this.sf?.value?.additionalRate || 0 + }; + } + initSF() { + this.schema = { + properties: { + additionalRate: { + type: 'number', + title: '附加费率', + maximum: 99, + minimum: 0, + ui: { + unit: '%', + widgetWidth: 200, + precision: 2 + } as SFNumberWidgetSchema + } + }, + required: ['additionalRate'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 16 } + } + }; + } + + save(value: any): void { + if (!this.sf.value?.additionalRate) { + this.service.msgSrv.warning('请填写附加费!'); + return; + } + console.log(this.sf.value); + const params = { + ids: this.data?.ids, + ...this.sf.value + }; + console.log(params); + this.service.request(this.service.$api_set_updateAdditionalRateBatch, params).subscribe((res: any) => { + if (res) { + this.modal.close(true); + this.service.msgSrv.success('变更运费成功'); + } else { + this.service.msgSrv.error(res?.msg); + } + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html new file mode 100644 index 00000000..5360747c --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.html @@ -0,0 +1,30 @@ + + + + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts new file mode 100644 index 00000000..6bf8d513 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts @@ -0,0 +1,519 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { DatePipe } from '@angular/common'; +import { + SFComponent, + SFCustomWidgetSchema, + SFDateWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { apiConf } from '@conf/api.conf'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { WaybillManagementServe } from 'src/app/routes/waybill-management/services/waybill-management.service'; +import { Observable, Observer } from 'rxjs'; +import { EAEnvironmentService } from '@shared'; + +@Component({ + selector: 'app-order-management-vehicle-sure-arrive', + templateUrl: './sure-arrive.component.html', + styleUrls: ['./sure-arrive.component.less'], + providers: [DatePipe] +}) +export class VehicleSureArriveComponent implements OnInit { + record: any = {}; + i: any; + formData: any; + Status: any; + data: any = { + weight: 0, + volume: 0 + }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: WaybillManagementServe, + private datePipe: DatePipe, + private envSrv: EAEnvironmentService + ) {} + + ngOnInit(): void { + console.log(this.i); + this.initData(); + this.i.time = this.i?.loadingTime; + this.initSF(); + } + initSF() { + if (this.Status === 1) { + this.schema = { + properties: { + time: { + type: 'string', + title: '卸货时间', + format: 'date-time' + }, + imgUrl3: { + type: 'string', + title: '装货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl4: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' + }, + imgUrl1: { + type: 'string', + title: '卸货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl2: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + } + }, + required: ['time'] + }; + } else { + this.schema = { + properties: { + time: { + type: 'string', + title: '卸货时间', + format: 'date-time' + }, + weight: { + type: 'string', + title: '卸货重量', + ui: { + widget: 'custom' + } + }, + volume: { + type: 'string', + title: '卸货体积', + ui: { + widget: 'custom' + } + }, + imgUrl3: { + type: 'string', + title: '装货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl4: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' + }, + imgUrl1: { + type: 'string', + title: '卸货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl2: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + } + }, + required: ['time', 'weight', 'volume'] + }; + } + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $imgUrl1: { grid: { span: 12 } }, + $imgUrl2: { grid: { span: 12 } }, + $imgUrl3: { grid: { span: 12 } }, + $imgUrl4: { grid: { span: 12 } } + }; + } + save(value: any): void { + console.log(this.Status); + console.log(value?.imgUrl3?.data?.fullFilePath); + console.log(value?.imgUrl3?.url); + + if (this.Status === 1) { + if (!value.time) { + this.service.msgSrv.warning('卸货时间为空!'); + return; + } + const params = { + id: this.i.id, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + setLading: value?.imgUrl3?.data?.fullFilePath || value?.imgUrl3?.url, + setPeoCarGoods: value?.imgUrl4?.data?.fullFilePath || value?.imgUrl4?.url, + time: value?.time + }; + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss '); + console.log(params); + + this.service.request(this.service.$api_get_insertWholeUnloadCarInfo, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('确认到车成功!'); + this.modal.destroy(true); + } + }); + } else { + if (!value?.time) { + this.service.msgSrv.warning('装货时间为空!'); + return; + } + if (!this.data?.volume) { + this.service.msgSrv.warning('装货重量为空!'); + return; + } + if (!this.data?.weight) { + this.service.msgSrv.warning('装货体积为空!'); + return; + } + const params = { + id: this.i?.id, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + setLading: value?.imgUrl3?.data?.fullFilePath || value?.imgUrl3?.url, + setPeoCarGoods: value?.imgUrl4?.data?.fullFilePath || value?.imgUrl4?.url, + time: value?.time, + volume: this.data?.volume, + weight: this.data?.weight + }; + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss '); + this.service.request(this.service.$api_get_insertBulkUnloadCarInfo, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('确认到车成功!'); + this.modal.destroy(true); + } + }); + } + } + // 确认到车界面信息(两个只能看的图片) + initData() { + this.service.request(this.service.$api_get_getUnloadCarInfo, { id: this.i?.id }).subscribe(res => { + console.log(res); + if (res.imgUrl1) { + this.formData = { + imgUrl3: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.imgUrl1, + response: { + url: res.imgUrl1 + } + } + ], + imgUrl4: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: res.imgUrl2, + response: { + url: res.imgUrl2 + } + } + ] + }; + } + }); + } + close(): void { + this.modal.destroy(true); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html new file mode 100644 index 00000000..3c703e39 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.html @@ -0,0 +1,30 @@ + + + + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts new file mode 100644 index 00000000..c51480bf --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts @@ -0,0 +1,325 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + SFComponent, + SFCustomWidgetSchema, + SFDateWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { apiConf } from '@conf/api.conf'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { WaybillManagementServe } from 'src/app/routes/waybill-management/services/waybill-management.service'; +import { EAEnvironmentService, EADateUtil } from '@shared'; +import { DatePipe } from '@angular/common'; + +@Component({ + selector: 'app-order-management-vehicle-sure-depart', + templateUrl: './sure-depart.component.html', + styleUrls: ['./sure-depart.component.less'], + providers: [DatePipe] +}) +export class VehicleSureDepartComponent implements OnInit { + record: any = {}; + i: any; + Status: any; + data: any = { + weight: '', + volume: '' + }; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: WaybillManagementServe, + private envSrv: EAEnvironmentService, + private datePipe: DatePipe + ) {} + + ngOnInit(): void { + this.initSF(); + console.log(this.i); + this.data.weight = this.i?.weight; + this.i.time = this.i.loadingTime; + } + initSF() { + if (this.Status === 1) { + this.schema = { + properties: { + time: { + type: 'string', + title: '装货时间', + format: 'date-time' + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' + }, + imgUrl1: { + type: 'string', + title: '装货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl2: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + } + }, + required: ['time'] + }; + } else { + this.schema = { + properties: { + time: { + type: 'string', + title: '装货时间', + format: 'date-time' + }, + weight: { + type: 'string', + title: '装货重量', + ui: { + widget: 'custom' + } + }, + volume: { + type: 'string', + title: '装货体积', + ui: { + widget: 'custom' + } + }, + no4: { + type: 'string', + title: '', + ui: { + widget: 'text' + }, + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' + }, + imgUrl1: { + type: 'string', + title: '装货凭证', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '提货单', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + }, + imgUrl2: { + type: 'string', + title: '', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '人车货照片', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg,image/jpg,image/gif'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card' + } as SFUploadWidgetSchema + } + }, + required: ['time', 'weight', 'volume'] + }; + } + + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 20 } + }, + $imgUrl1: { grid: { span: 12 } }, + $imgUrl2: { grid: { span: 12 } } + }; + } + save(value: any): void { + if (this.Status === 1) { + if (!value?.time) { + this.service.msgSrv.warning('装货时间为空!'); + return; + } + const params = { + id: this.i.id, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + time: value?.time + }; + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss '); + this.service.request(this.service.$api_get_insertWholeStartCarInfo, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('确认发车成功!'); + this.modal.destroy(true); + } + }); + } else { + if (!value?.time) { + this.service.msgSrv.warning('装货时间为空!'); + return; + } + if (!this.data?.volume) { + this.service.msgSrv.warning('装货重量为空!'); + return; + } + if (!this.data?.weight) { + this.service.msgSrv.warning('装货体积为空!'); + return; + } + console.log(value); + const params = { + id: this.i.id, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + time: value?.time, + volume: this.data?.volume, + weight: this.data?.weight + }; + params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss '); + this.service.request(this.service.$api_get_insertBulkStartCarInfo, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('确认发车成功!'); + this.modal.destroy(true); + } + }); + } + } + + close(): void { + this.modal.destroy(true); + } +} diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html new file mode 100644 index 00000000..04a93740 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.html @@ -0,0 +1,30 @@ + + + + +
    +

    + 总运费:{{ data?.totalAmount | currency }} + (运输费:{{ data?.totalFreight | currency }},附加费:{{ data?.totalSurcharge | currency }},附加费率:{{ (data?.totalRate * 100).toFixed(2) + '%' }}) +

    +

    + +  确认已阅读并知晓 《变更协议》 +

    +
    + + diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less new file mode 100644 index 00000000..30444d6b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.less @@ -0,0 +1,7 @@ + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts new file mode 100644 index 00000000..347247e1 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/update-freight/update-freight.component.ts @@ -0,0 +1,195 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-15 13:17:42 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-24 19:17:10 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\update-freight\\update-freight.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFNumberWidgetSchema, SFSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Subscription } from 'rxjs'; +import { OrderManagementService } from '../../../services/order-management.service'; + +@Component({ + selector: 'app-order-management-vehicle-update-freight', + templateUrl: './update-freight.component.html', + styleUrls: ['./update-freight.component.less'] +}) +export class VehicleUpdateFreightComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema: SFSchema = {}; + ui: SFUISchema = {}; + + aggreechecked = false; + + @Input() + data: any; + + dataJSON: any; + + calculateSub!: Subscription; + + constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {} + + ngOnInit(): void { + console.log(this.data) + this.dataJSON = JSON.stringify(this.data) + console.log(this.dataJSON) + this.initSF(this.data); + } + initSF(data: any) { + const info = { + prePay: data.list?.filter((item: any) => item.costCode === 'PRE')[0], + toPay: data.list?.filter((item: any) => item.costCode === 'RECE')[0], + receiptPay: data.list?.filter((item: any) => item.costCode === 'BACK')[0] + }; + this.schema = { + properties: { + prePay: { + type: 'number', + title: '预付', + default: info.prePay?.price || 0, + minimum: 0, + maximum: 99999, + readOnly: info.prePay?.paymentStatus === '2' || info.prePay?.paymentStatus === '4', + ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + toPay: { + type: 'number', + title: '到付', + default: info.toPay?.price || 0, + minimum: 0, + maximum: 99999, + readOnly: info.toPay?.paymentStatus === '2' || info.toPay?.paymentStatus === '4', + ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + // oilCardPay: { + // type: 'number', + // title: '油卡', + // default: 0.0, + // minimum:0, + // readOnly: this.i.oilCardPayStatus === '1' || this.i.oilCardPayStatus === '3', + // ui: { + // prefix: '¥', + // widgetWidth: 200, + // precision: 2, + // change: (val: any) => this.changeNumVal() + // } as SFNumberWidgetSchema + // }, + receiptPay: { + type: 'number', + title: '回单付', + maximum: 99999, + default: info.receiptPay?.price || 0, + minimum: 0, + readOnly: info.receiptPay?.paymentStatus === '2' || info.receiptPay?.paymentStatus === '4', + ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal() + } as SFNumberWidgetSchema + }, + changeCause: { + type: 'string', + title: '变更原因', + maxLength: 100, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 } + } as SFTextareaWidgetSchema + } + }, + required: ['changeCause'] + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 16 } + } + }; + } + + save(value: any): void { + if (this.data.isFreightChangeApplication) { + this.service.msgSrv.error('变更申请未处理,请勿重复申请!'); + return; + } + if (!this.save) { + this.service.msgSrv.error('请填写必填项!'); + return; + } + this.service.request(this.service.$api_get_insertFreightChangeWhole, this.getParams()).subscribe(res => { + if (res) { + this.modal.destroy(true); + this.service.msgSrv.success('变更运费成功'); + } + }); + } + + close(): void { + this.modal.destroy(false); + } + /** + * 更新数字框 + * + */ + changeNumVal() { + if (this.calculateSub) { + this.calculateSub.unsubscribe(); + } + this.calculateSub = this.service.request(this.service.$api_getWholeSurchargeDetail, this.getParams()).subscribe((res: any) => { + if (res) { + Object.assign(this.data, { + totalAmount: res.totalAmount, + totalFreight: res.totalFreight, + freight: res.freight, + surcharge: res.surcharge + }); + } + }); + // this.tranPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay; + // this.totalPrice = this.sf.value.prePay + this.sf.value.toPay + this.sf.value.oilCardPay + this.sf.value.receiptPay + this.otherPrice; + } + + getParams() { + const editItems = this.data.list?.filter((info: any) => info.toPay?.paymentStatus !== '2' && info.toPay?.paymentStatus !== '4'); + editItems.forEach((item: any) => { + switch (item.costName) { + case '预付': + item.price = this.sf.value.prePay; + break; + case '到付': + item.price = this.sf.value.toPay; + break; + case '回单付': + item.price = this.sf.value.receiptPay; + break; + default: + break; + } + }); + + const params = { + billId: this.data.id, + dtos: editItems, + changeCause: this.sf.value.changeCause + }; + return params; + } +} diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html new file mode 100644 index 00000000..1d27458b --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html @@ -0,0 +1,34 @@ + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    + + diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less new file mode 100644 index 00000000..ae775710 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less @@ -0,0 +1,11 @@ +:host { + ::ng-deep { + // .mapBox { + // iframe, canvas { + // width: 400px !important; + // } + // } + + } + + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts new file mode 100644 index 00000000..64dff652 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts @@ -0,0 +1,115 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-02-22 13:53:29 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-08 16:11:58 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\view-track\\view-track.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn } from '@delon/abc/st'; +import { + SFComponent, + SFCustomWidgetSchema, + SFNumberWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import format from 'date-fns/format'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { OrderManagementService } from '../../../services/order-management.service'; + + +@Component({ + selector: 'app-order-management-view-track', + styleUrls: ['./view-track.component.less'], + templateUrl: './view-track.component.html' +}) +export class OneCarOrderViewtrackComponent implements OnInit { + i: any; // 单行数据 + MapList:any[] = []; //地图点位数据组 + trajectory = 'car'; + mapList:any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' }, + ]; + constructor( + private modalRef: NzModalRef, + private modal: NzModalService, + private msgSrv: NzMessageService, + public service: OrderManagementService + ) {} + + ngOnInit(): void { + console.log(this.i); + this.getTrajectory(); + + } + close(value: boolean): void { + this.modalRef.close(false); + } + // 获取车辆轨迹 + getTrajectory(){ + this.service.request(this.service.$api_get_getTrajectory, { id: this.i?.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res.cityArray; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory(){ + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.i?.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event:any){ + if(event ==='car'){ + this.getTrajectory() + }else if(event ==='driver'){ + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/order-management/order-management-routing.module.ts b/src/app/routes/order-management/order-management-routing.module.ts new file mode 100644 index 00000000..7be4f4e5 --- /dev/null +++ b/src/app/routes/order-management/order-management-routing.module.ts @@ -0,0 +1,46 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-06 09:24:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 09:43:47 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\order-management-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { OrderManagementAbnormalWarningComponent } from './components/abnormal-warning/abnormal-warning.component'; +import { OrderManagementBulkDetailChangeComponent } from './components/bulk-detail-change/bulk-detail-change.component'; +import { OrderManagementBulkeDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { OrderManagementBulkComponent } from './components/bulk/bulk.component'; +import { OrderManagementComplaintDetailComponent } from './components/complaint-detail/complaint-detail.component'; +import { OrderManagementComplaintComponent } from './components/complaint/complaint.component'; +import { OrderManagementComplianceAuditComponent } from './components/compliance-audit/compliance-audit.component'; +import { OrderManagementReceiptsAuditComponent } from './components/receipts-audit/receipts-audit.component'; +import { OrderManagementRiskDetailComponent } from './components/risk-detail/risk-detail.component'; +import { OrderManagementRiskComponent } from './components/risk/risk.component'; +import { OrderManagementVehicleDetailChangeComponent } from './components/vehicle-detail-change/vehicle-detail-change.component'; +import { OrderManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; +import { OrderManagementVehicleComponent } from './components/vehicle/vehicle.component'; + +const routes: Routes = [ + { path: 'vehicle', component: OrderManagementVehicleComponent }, + { path: 'vehicle/vehicle-detail/:id', component: OrderManagementVehicleDetailComponent }, + { path: 'vehicle-detailChange/:id', component: OrderManagementVehicleDetailChangeComponent }, + { path: 'bulk', component: OrderManagementBulkComponent }, + { path: 'bulk/bulk-detail/:id', component: OrderManagementBulkeDetailComponent }, + { path: 'bulk-detailChange/:id', component: OrderManagementBulkDetailChangeComponent }, + { path: 'risk', component: OrderManagementRiskComponent }, + { path: 'risk-detail/:id', component: OrderManagementRiskDetailComponent }, + { path: 'complaint', component: OrderManagementComplaintComponent }, + { path: 'complaint-detail/:id', component: OrderManagementComplaintDetailComponent }, + { path: 'receipts-audit', component: OrderManagementReceiptsAuditComponent }, + { path: 'compliance-audit', component: OrderManagementComplianceAuditComponent }, + { path: 'abnormal-warning', component: OrderManagementAbnormalWarningComponent }, +] +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class OrderManagementRoutingModule { } diff --git a/src/app/routes/order-management/order-management.module.ts b/src/app/routes/order-management/order-management.module.ts new file mode 100644 index 00000000..8f00a622 --- /dev/null +++ b/src/app/routes/order-management/order-management.module.ts @@ -0,0 +1,81 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-06 09:24:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-25 14:10:36 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\order-management.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule, Type } from '@angular/core'; +import { SharedModule } from '@shared'; +import { OrderManagementAbnormalWarningComponent } from './components/abnormal-warning/abnormal-warning.component'; +import { OrderManagementBulkDetailChangeComponent } from './components/bulk-detail-change/bulk-detail-change.component'; +import { OrderManagementBulkeDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { OrderManagementBulkComponent } from './components/bulk/bulk.component'; +import { OrderManagementComplaintDetailComponent } from './components/complaint-detail/complaint-detail.component'; +import { OrderManagementComplaintComponent } from './components/complaint/complaint.component'; +import { OrderManagementComplianceAuditComponent } from './components/compliance-audit/compliance-audit.component'; +import { OrderManagementReceiptsAuditComponent } from './components/receipts-audit/receipts-audit.component'; +import { OrderManagementRiskDetailComponent } from './components/risk-detail/risk-detail.component'; +import { OrderManagementRiskComponent } from './components/risk/risk.component'; +import { OrderManagementVehicleDetailChangeComponent } from './components/vehicle-detail-change/vehicle-detail-change.component'; +import { OrderManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; + +import { OrderManagementVehicleComponent } from './components/vehicle/vehicle.component'; +import { OneCarOrderAppealComponent } from './modal/audit/appeal/appeal.component'; +import { orderManagementVoucherViewComponent } from './modal/audit/voucher-view/voucher-view.component'; +import { ConfirReceiptComponent } from './modal/bulk/confir-receipt/confir-receipt.component'; +import { UpdateFreightComponent } from './modal/bulk/update-freight/update-freight.component'; +import { OneCarOrderCancelConfirmComponent } from './modal/vehicle/cancel-confirm/cancel-confirm.component'; +import { OneCarOrderCancelComponent } from './modal/vehicle/cancel/cancel.component'; +import { VehicleConfirReceiptComponent } from './modal/vehicle/confir-receipt/confir-receipt.component'; +import { VehicleFreightPeopleComponent } from './modal/vehicle/freight-people/freight-people.component'; +import { VehicleModifyCaptainComponent } from './modal/vehicle/modify-captain/modify-captain.component'; +import { VehicleModifyRateComponent } from './modal/vehicle/modify-rate/modify-rate.component'; +import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.component'; +import { VehicleUpdateFreightComponent } from './modal/vehicle/update-freight/update-freight.component'; +import { OneCarOrderViewtrackComponent } from './modal/vehicle/view-track/view-track.component'; +import { OrderManagementRoutingModule } from './order-management-routing.module'; + +const COMPONENTS: Type[] = [ + OrderManagementVehicleComponent, + OrderManagementVehicleDetailComponent, + OrderManagementBulkComponent, + OrderManagementBulkeDetailComponent, + OrderManagementRiskComponent, + OrderManagementComplaintComponent, + UpdateFreightComponent, + ConfirReceiptComponent, + VehicleUpdateFreightComponent, + VehicleConfirReceiptComponent, + VehicleSureDepartComponent, + VehicleSureArriveComponent, + OrderManagementRiskDetailComponent, + OneCarOrderCancelComponent, + OrderManagementVehicleDetailChangeComponent, + OrderManagementBulkDetailChangeComponent, + VehicleModifyRateComponent, + VehicleFreightPeopleComponent, + VehicleModifyCaptainComponent, + OrderManagementComplaintDetailComponent, + OrderManagementReceiptsAuditComponent, + orderManagementVoucherViewComponent, + OrderManagementComplianceAuditComponent, + OneCarOrderCancelConfirmComponent, + OneCarOrderViewtrackComponent, + OneCarOrderAppealComponent, + OrderManagementAbnormalWarningComponent +]; + +@NgModule({ + imports: [ + SharedModule, + OrderManagementRoutingModule + ], + declarations: COMPONENTS, +}) +export class OrderManagementModule { } diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts new file mode 100644 index 00000000..f3b441f8 --- /dev/null +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -0,0 +1,243 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 15:31:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-07 09:49:44 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { EACacheService, ShipperBaseService } from '@shared'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class OrderManagementService extends ShipperBaseService { + $api_get_getEnterpriseNetTransHis = `/api/mdc/enterpriseNetTransHis/getEnterpriseNetTransHis`; + $api_get_catalogue_member = `/user?_allow_anonymous=true`; + $api_get_bulkPage_list = `/api/sdc/goodsResourceOperate/listBulkPage`; + // 据 手机号/姓名 查询 车队长/司机 + $api_get_getDriverInfo = `/api/mdc/cuc/user/getDriverInfo`; + $api_del_driver = ``; + // 获取货主企业列表 + public $api_getList = '/api/mdc/cuc/enterpriseInfo/cargoOwner/getList?_allow_anonymous=true'; + // 风险单: + // 风险单列表查询 + $api_get_listRiskPage = `/api/sdc/billRiskOperate/listRiskPage`; + // 风险单列表查询 + $api_get_listStatisticalStatus = `/api/sdc/billRiskOperate/listStatisticalStatus`; + // 风险单详情查询 + $api_get_getRiskDetail = `/api/sdc/billRiskOperate/getRiskDetail`; + // 风险单审核 + $api_get_listRisk_audit = `/api/sdc/billRiskOperate/audit`; + // 查询整车订单列表 + $api_get_listWholePage = `/api/sdc/billOperate/listWholePage`; + // 整车详情 + $api_get_getWholeBillDetail = `/api/sdc/billOperate/getWholeBillDetail`; + // 根据车牌号查询车辆信息 + $api_get_getCarLicenseListByCarNo = `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`; + + // 查询大宗订单列表 + $api_get_listBulkPage = `/api/sdc/billOperate/listBulkPage`; + // 查看运费变更记录详情-整车 + $api_get_getChangeRecordWholeDetail = `/api/sdc/billFreightChangeRecord/getChangeRecordWholeDetail`; + // 根据订单ID查看运费变更申请记录 + $api_get_listChangeApply = `/api/sdc/billFreightChangeApplication/listChangeApply`; + // 变更运费页面-整车-整车 + $api_get_getFreightChangeWholeDetail = `/api/sdc/billFreightChangeApplication/getFreightChangeWholeDetail`; + // 订单申请撤销 + $api_get_revokeChangeRecord = `/api/sdc/billFreightChangeApplication/revokeChangeRecord`; + // 运费变更申请-整车 + $api_get_insertFreightChangeWhole = `/api/sdc/billFreightChangeApplication/insertFreightChangeWhole`; + // 取消订单 + $api_get_cancelAnOrder = `/api/sdc/billOperate/cancelAnOrder`; + // 批量签收整车订单 + $api_get_batchSignWholeOrder = `/api/sdc/billOperate/batchSignWholeOrder`; + // 批量签收大宗订单 + $api_get_batchSignBulkOrder = `/api/sdc/billOperate/batchSignBulkOrder`; + // 大宗签收详情 + $api_get_getBulkSignForDetail = `/api/sdc/billOperate/getBulkSignForDetail`; + // 整车签收详情 + $api_get_getWholeSignForDetail = `/api/sdc/billOperate/getWholeSignForDetail`; + // 确认签收大宗订单 + $api_get_signBulkOrder = `/api/sdc/billOperate/signBulkOrder`; + // 确认签收整车订单 + $api_get_signWholeOrder = `/api/sdc/billOperate/signWholeOrder`; + // 上传图片 + public $api_upload_url = `/api/mdc/pbc/upload/multipartFile/file`; + // 根据用户id查用户信息(注意:nickName才是用户名称) + public $api_getUserDetailByAppUserId = `/api/mdc/cuc/userBasicInfo/get`; + // 根据车辆id查车辆信息 + public $api_getCarLicenseByIds = `/api/mdc/cuc/carLicense/getCarLicenseByIds`; + // 统计【整车】订单状态数量 + public $api_statisticalStatus = `/api/sdc/billOperate/getWholeStatistical`; + // 统计【大宗】订单状态数量 + public $api_getBulkStatistical = `/api/sdc/billOperate/getBulkStatistical`; + // 变更运费页面-大宗 + public $api_getFreightChangeBulkDetail = `/api/sdc/billFreightChangeApplication/getFreightChangeBulkDetail`; + // 变更运费页面-大宗 + public $api_insertFreightChangeBulk = `/api/sdc/billFreightChangeApplication/insertFreightChangeBulk`; + // 大宗详情 + public $api_getBulkBillDetail = `/api/sdc/billOperate/getBulkBillDetail`; + // 查看运费变更记录详情-大宗 + public $api_getChangeRecordBulkDetail = `/api/sdc/billFreightChangeRecord/getChangeRecordBulkDetail`; + // 查看运费变更记录详情-整车 + public $api_getChangeRecordWholeDetail = `/api/sdc/billFreightChangeRecord/getChangeRecordWholeDetail`; + //运费变更申请计算费用-大宗 + $api_calculate_cost = `/api/sdc/billFreightChangeApplication/getBulkSurchargeDetail`; + //运费变更申请计算费用-整车 + $api_getWholeSurchargeDetail = `/api/sdc/billFreightChangeApplication/getWholeSurchargeDetail`; + //运费变更申请-大宗 + $api_change_bulk = `/api/sdc/billFreightChangeApplication/insertFreightChangeBulk`; + // 删除装卸货信息 + $api_delete_Wholedeletebatch = `/api/sdc/unLoadingPlace/deletebatch`; + // 修改-大宗订单 + $api_set_modifyBulkOrder = `/api/sdc/billOperate/modifyBulkOrder`; + // 修改-整车订单 + $api_set_modifyWholeOrder = `/api/sdc/billOperate/modifyWholeOrder`; + // 批量修改网络货运人 + $api_set_updateEnterpriseInfoBatch = `/api/sdc/billOperate/updateEnterpriseInfoBatch`; + // 批量修改附加费率 + $api_set_updateAdditionalRateBatch = `/api/sdc/billOperate/updateAdditionalRateBatch`; + + // 查询投诉列表 + $api_get_operate_listPage = `/api/sdc/complaint/operate/listPage`; + // 获取投诉表详情 + $api_get_getComplaintDriverDetails = `/api/sdc/complaint/operate/getComplaintDriverDetails`; + // 处理投诉 + $api_get_dealWithComplaint = `/api/sdc/complaint/operate/dealWithComplaint`; + // 撤销投诉 + $api_get_canelComplaint = `/api/sdc/complaint/operate/canelComplaint`; + + // 批量修改车队长 + $api_get_updateCarCaptainBatch = `/api/sdc/billOperate/updateCarCaptainBatch`; + // 根据手机号查询车队长/司机 + $api_get_getCarCaptainByMobile = `/api/mdc/userDriverExpand/getCarCaptainByMobile`; + + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + // 查询系统配置项 + public $api_get_config_item_page = '/api/mdc/pbc/sysConfigItem/list/page'; + + // 查询单据审核 + public $api_get_billExamine_page = '/api/sdc/billExamine/listPage'; + // 单据审核查看凭证 + public $api_get_getCredentials = '/api/sdc/billExamine/getCredentials'; + // 单据审核 + public $api_get_billAudit = '/api/sdc/billExamine/billAudit'; + // 统计单据审核状态数量 + public $api_get_getAuditStatistical = '/api/sdc/billExamine/getAuditStatistical'; + // 修改单据审核 + public $api_get_updateBillExamine = '/api/sdc/billExamine/updateBillExamine'; + // 单据审核通过 + public $api_get_billAuditPass = '/api/sdc/billExamine/billAuditPassBatch'; + + // 查询规则抽查列表 + public $api_get_listCompliancePage = '/api/sdc/BillComplianceSpotCheck/list/Page'; + // 规则抽查审批 + public $api_get_updateBillByCompliance = '/api/sdc/billOperate/updateBillByCompliance'; + // 获取规则抽查分类统计 + public $api_get_getComplianceStatisticalStatus = '/api/sdc/billOperate/getComplianceStatisticalStatus'; + + // 货主端-货主查看评价(评价司机的) + public $api_getBillEvaluateByShipper = '/api/sdc/billEvaluate/getBillEvaluateByShipper'; + // 货主端-货主查看评价(司机评价货主的) + public $api_getBillEvaluateDriverByShipper = '/api/sdc/billEvaluate/getBillEvaluateDriverByShipper'; + + // 获取订单退款申请表 + public $api_billRefundApplication_get = '/api/fcc/billRefundApplication/get'; + // 同意退款 + public $api_billRefundApplication_agreeRefund = '/api/fcc/billRefundApplication/agreeRefund'; + // 保存订单退款申请表 + public $api_billRefundApplication_save = '/api/fcc/billRefundApplication/save'; + + // 批量修改费率-实时查看附加费 + public $api_searchAdditionalRateBatch = '/api/sdc/billOperate/searchAdditionalRateBatch'; + + // 风险异常 + public $api_listBillComplianceAbnormalByBillId = '/api/sdc/billCompliance/listBillComplianceAbnormalByBillId'; + // 异常预警 + public $api_getAbnormalWarningByBillId = '/api/sdc/abnormalWarning/getAbnormalWarningByBillId'; + + // 生成卸货单 + public $api_createBillDischargeGoods = '/api/sdc/billOperate/createBillDischargeGoods'; + // 生成提货单 + public $api_createBillTakeGoods = '/api/sdc/billOperate/createBillTakeGoods'; + // 生成卸货单-页面展示 + public $api_getBillDischargeGoodsVO = '/api/sdc/billOperate/getBillDischargeGoodsVO'; + // 生成提货单-页面展示 + public $api_getBillTakeGoodsVO = '/api/sdc/billOperate/getBillTakeGoodsVO'; + + getDictByKey(dictKey: string) { + const params = { dictKey: dictKey }; + return this.request(this.$api_getDictValue, params); + } + $api_get_risk_order_log = `/api/mdc/pbc/operationLogRecords/getOperationLogRecordsList`; // 获取货源的操作日志 + // 获取数据字典 + $api_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; + // 获取轨迹 + $api_get_getTrajectory = `/api/sdc/billShipper/getTrajectoryByBillId`; + // 获取订单司机轨迹 + $api_get_getAppDriverPosition = `/api/sdc/billShipper/getAppDriverPosition`; + // 查看申述记录 + $api_get_getOrderComplaintDetail = `/api/sdc/billOperate/getOrderComplaintDetail`; + + // 查询异常预警表 + $api_get_abnormalWarning = `/api/sdc/abnormalWarning/list/page`; + + + // 异步导出运营后台大宗订单列表 + $api_get_asyncExportBulkList = `/api/sdc/billOperate/asyncExportBulkList`; + // 异步导出运营后台整车订单列表 + $api_get_asyncExportWholeList = `/api/sdc/billOperate/asyncExportWholeList`; + // 异步导出风险单导出 + $api_get_asyncExportRiskBillList = `/api/sdc/billRiskOperate/asyncExportRiskBillList`; + // 异步导出合规抽查导出 + $api_get_asyncExportSpotCheckList= `/api/sdc/BillComplianceSpotCheck/asyncExportSpotCheckList`; + // 异步导出单据审核导出 + $api_get_asyncExportExamineBillList= `/api/sdc/billExamine/asyncExportExamineBillList`; + /** + * 根据企业ID,获取企业历史网络货运人 + * @returns + */ + getNetworkFreightForwarderHistory(params: any) { + const param = { + enterpriseIds: params.enterpriseInfoIds + }; + return this.request(this.$api_get_getEnterpriseNetTransHis, param).pipe( + map((res: any) => { + if (!res) { + return []; + } + const list = res.map((item: any) => ({ + label: item.networkTransporterName, + value: item.networkTransporterId + })); + return [{ value: '', label: '全部' }, ...list]; + }) + ); + } + /** + * 获取车型、车长字典数据 + * @returns + */ + getDictOptions(params = {}) { + return this.request(this.$api_getDictValue, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const obj = []; + obj.push({ label: '不限', value: '999' }); + return [...obj, ...res]; + }) + ); + } + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html new file mode 100644 index 00000000..b232905e --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.html @@ -0,0 +1,65 @@ + + + + + + + + + {{headerTotalInfo?.ltdName}} + + + {{headerTotalInfo?.allAmount |currency}} + + + {{headerTotalInfo?.incomeAmount |currency}} + + + {{headerTotalInfo?.payAmount |currency}} + + + + {{headerTotalInfo?.name}}   {{headerTotalInfo?.phone}} + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    - {{item.amount | currency:' ' }}
    +
    + {{item.amount | currency:' ' }}
    +
    + +
    {{item?.accountBalance |currency:' '}}
    +
    + +
    + +
    +
    diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less new file mode 100644 index 00000000..a485bd4c --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.less @@ -0,0 +1,21 @@ +:host { + ::ng-deep { + .search-header { + nz-range-picker { + width: 100%; + } + } + } + + .table-content { + position: relative; + + .total-footer { + position: absolute; + bottom: 0; + height: 32px; + margin: 16px 0; + line-height: 32px; + } + } +} diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts new file mode 100644 index 00000000..1233feec --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementAccountDetailComponent } from './account-detail.component'; + +describe('PartnerAccountManagementAccountDetailComponent', () => { + let component: PartnerAccountManagementAccountDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementAccountDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementAccountDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts new file mode 100644 index 00000000..4e595c8b --- /dev/null +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts @@ -0,0 +1,204 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-account-detail', + templateUrl: './account-detail.component.html', + styleUrls: ['./account-detail.component.less'] +}) +export class PartnerAccountManagementAccountDetailComponent implements OnInit { + headerTotalInfo: any = { + allAmount: 0, + incomeAmount: 0, + payAmount: 0, + name: '', + ltdName: '', + phone: '' + }; + footerTotalInfo: any = { + incomeAmount: 0, + payAmount: 0, + total: 0 + }; + + + url = `/user`; + schema: SFSchema = {}; + ui!: SFUISchema; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + + + columns: STColumn[] = []; + roleId = ''; + bankType = ''; + channelSource = ''; + ltdId = ''; + constructor(public service: AccountManagemantService, public ar: ActivatedRoute) { + + this.roleId = this.ar.snapshot.params.id; + this.ar.queryParamMap.subscribe((res: any) => { + this.ltdId = res?.params?.ltdId; + this.channelSource = res?.params?.channelSource; + this.bankType = res?.params?.bankType; + }) + } + + + get reqParams() { + return { ...this.sf?.value, roleId: this.roleId, ltdId: this.ltdId, channelSource: this.channelSource, bankType: this.bankType }; + } + ngOnInit(): void { + this.getHeaderSummary(); + this.getFooterSummary(); + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', ui: { hidden: true } + }, + createTime: { + type: 'string', + title: '交易时间', + ui: { + widget: 'sl-from-to', + type: 'date', + autoComplete: 'off', + format: 'yyyy-MM-dd', + } as SFDateWidgetSchema, + }, + transactionNumber: { + title: '流水号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + businessNumber: { + title: '交易单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + tradeType: { + type: 'string', + title: '交易类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'trade:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + incomeType: { + type: 'string', + title: '收支类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'income:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + + } + } + this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '交易时间', index: 'createTime', className: 'text-center', width: 200 }, + { title: '流水号', index: 'transactionNumber', className: 'text-center', width: 180 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 150 }, + { title: '交易单号', index: 'businessNumber', className: 'text-center', width: 180 }, + { title: '备注', index: 'tradeContent', className: 'text-center', width: 180 }, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 180 }, + { title: '交易金额', render: 'amount', className: 'text-center', width: 150 }, + { title: '账户余额', render: 'accountBalance', className: 'text-center', width: 150 }, + { title: '付款方', index: 'payName', className: 'text-center', width: 200 }, + { title: '收款方', index: 'payeeName', className: 'text-center', width: 200 }, + ]; + } + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 头部汇总 + */ + getHeaderSummary() { + const params = { + roleId: this.roleId, + ltdId: this.ltdId, + channelSource: this.channelSource, + bankType: this.bankType + }; + this.service.request(this.service.$api_get_account_detail_header_summary, { ...params }).subscribe(res => { + if (res) { + this.headerTotalInfo = res; + console.log(res); + } + }) + } + /** + * 脚部汇总 + */ + getFooterSummary() { + this.service.request(this.service.$api_get_account_detail_footer_summary, this.reqParams).subscribe(res => { + if (res) { + this.footerTotalInfo = res; + } + }) + } + + + search() { + this.st.load(1); + } + export() { } + + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/account-management/components/list/list.component.html b/src/app/routes/partner/account-management/components/list/list.component.html new file mode 100644 index 00000000..b811832d --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + +
    {{item.allBalance | currency:' '}}
    +
    + + {{item.unEntryAmount | currency:' + '}} + + +
    {{item.availableBalance | currency:' '}}
    +
    + + +
    +
    diff --git a/src/app/routes/partner/account-management/components/list/list.component.spec.ts b/src/app/routes/partner/account-management/components/list/list.component.spec.ts new file mode 100644 index 00000000..da38a52c --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementListComponent } from './list.component'; + +describe('PartnerAccountManagementListComponent', () => { + let component: PartnerAccountManagementListComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementListComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/list/list.component.ts b/src/app/routes/partner/account-management/components/list/list.component.ts new file mode 100644 index 00000000..3d98844e --- /dev/null +++ b/src/app/routes/partner/account-management/components/list/list.component.ts @@ -0,0 +1,119 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { BussinessStatisticsService } from '../../../business-statistics/services/bussiness-statistics.service'; +import { AccountManagemantService } from '../../services/account-managemant.service'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from '../virtual-account-detail/virtual-account-detail.component'; + +@Component({ + selector: 'app-partner-account-management-list', + templateUrl: './list.component.html', +}) +export class PartnerAccountManagementListComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + + constructor(public service: AccountManagemantService, public modal: NzModalService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + userName: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + phone: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 12 } }, }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '合伙人名称', index: 'name', className: 'text-center', width: 250 }, + { title: '手机号', index: 'phone', className: 'text-center', width: 200 }, + { + title: '账户总额(元)', index: 'allBalance', className: 'text-right', sort: true, width: 150, type: 'currency', + }, + { + title: '待入账余额(元)', render: 'unEntryAmount', className: 'text-right', width: 150, + }, + { + title: '可用余额(元)', index: 'availableBalance', className: 'text-right', sort: true, width: 150, type: 'currency' + }, + { title: '虚拟账户', index: 'virtualAccount', className: 'text-center', width: 220 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '虚拟账户明细', + click: (_record) => this.viewVirtual(_record) + } + ] + } + ]; + } + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** + * + * @param _record 当前行信息 + */ + viewVirtual(_record: any) { + const modalRef = this.modal.create({ + nzTitle: '虚拟账户明细', + nzContent: PartnerAccountManagementVirtualAccountDetailComponent, + nzComponentParams: { + roleId: _record?.roleId, + }, + nzWidth: '85%', + nzFooter: null + }); + // modalRef.afterClose.subscribe(result => { + // }); + } + + /** + * + */ + export() { + + } + +} diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html new file mode 100644 index 00000000..218de752 --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.html @@ -0,0 +1,79 @@ + + + + + + + + + {{summaryObj?.taxno}} + + + {{(summaryObj?.totalRebate?summaryObj?.totalRebate: 0 )|currency :' + '}} + + + {{(summaryObj?.recordedAmount?summaryObj?.recordedAmount:0 + )|currency:' '}} + + + {{(summaryObj?.taxPersonalSum?summaryObj?.taxPersonalSum:0 + )|currency:' '}} + + + {{(summaryObj?.waitRecordedAmount?summaryObj?.waitRecordedAmount:0) + |currency:' '}} + + + + {{summaryObj?.ltdName}} + + + +
    + +
    +
    + + +
    - {{item.amount | currency }}
    +
    + {{item.amount | currency }}
    +
    +
    + +
    +
    + + +
    +
    + {{detailRecord?.ltdName}} + {{detailRecord?.totalRebate |currency: ' '}} +
    + + +
    + {{item?.year }}年 + {{item?.month }}月 +
    +
    + +
    {{item?.profitAmountSum |currency :' '}}
    +
    + +
    +
    +
    diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts new file mode 100644 index 00000000..95af39f8 --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementRecordedDetailComponent } from './recorded-detail.component'; + +describe('PartnerAccountManagementRecordedDetailComponent', () => { + let component: PartnerAccountManagementRecordedDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementRecordedDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementRecordedDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts new file mode 100644 index 00000000..e7420c8c --- /dev/null +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts @@ -0,0 +1,186 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema, Widget } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-recorded-detail', + templateUrl: './recorded-detail.component.html', +}) +export class PartnerAccountManagementRecordedDetailComponent implements OnInit { + summaryObj: any = { + waitRecordedAmount: 0, + totalRebate: 0, + taxPersonalSum: 0, + recordedAmount: 0, + ltdName: '', + taxno: '' + }; + + footerSummary = { + total: 0, + income: 0, + spending: 0 + } + + detailRecord: any = {}; + + url = `/user`; + schema: SFSchema = {}; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + + + columns: STColumn[] = []; + billDetailColumns: STColumn[] = []; + showBillDetail = false; + billDetailList = []; + roleId = ''; + + constructor(public service: AccountManagemantService, public router: Router, public ar: ActivatedRoute) { + this.roleId = this.ar.snapshot.params.id; + + } + + + get reqParams() { + return { ...this.sf?.value, partnerId: this.roleId }; + } + + get billDetailReqParams() { + return {}; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.getInvoiceSummary(); + } + + initSF() { + this.schema = { + properties: { + ltdName: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '网络货运人', index: 'ltdName', className: 'text-center', width: 200 }, + { title: '银行类型', render: 'bankTypeLabel', className: 'text-center', width: 150 }, + { title: '虚拟账户', render: 'fictitiousAccount', className: 'text-center', width: 200 }, + { title: '返佣总额(元)', index: 'totalRebate', className: 'text-center', width: 180, type: 'currency' }, + { title: '已入账金额(元)', index: 'recordedAmount', className: 'text-center', width: 180, type: 'currency' }, + { title: '代缴个税(元)', index: 'taxPersonalSum', className: 'text-center', width: 180, type: 'currency' }, + { title: '待入账金额(元)', index: 'waitRecordedAmount', className: 'text-right', width: 180, type: 'currency' }, + { + title: '操作', className: 'text-center', width: 300, + buttons: [ + { + text: '查看入账记录', + click: (_record) => this.viewBookedRecord(_record) + }, + { + text: '查看账单明细', + click: (_record) => this.viewAccountDetail(_record) + }, + ] + }, + ]; + } + + initBillDetailST() { + this.billDetailColumns = [ + { title: '账单月份', render: 'month', className: 'text-center', width: '40%' }, + { title: '返佣金额(元)', render: 'profitAmountSum', className: 'text-center', width: '40%' }, + { + title: '操作', className: 'text-center', width: '20%', buttons: [ + { + text: '订单明细', + click: (_record) => window.open(location.origin + `#/partner/rebate/record?ltdId=${_record?.ltdId}`) + } + ] + }, + ] + } + + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + + + search() { + this.st.load(1); + } + + /** + * 获取账单明细 + */ + getBillDetail(ltdId: string) { + this.service.request(this.service.$api_get_bill_detail, { ltdId }).subscribe(res => { + if (res) { + this.billDetailList = res; + } + }) + } + + + export() { } + + /** + * 查看入账记录 + * @param record 当前行 + */ + viewBookedRecord(record: any) { + window.open(location.origin + `#/partner/recorded/record?ltdId=${record?.ltdId}`); + } + + /** + * 查看账单明细 + * @param record 当前行 + */ + viewAccountDetail(record: any) { + this.billDetailColumns = []; + this.showBillDetail = true; + this.initBillDetailST(); + this.detailRecord = record; + this.getBillDetail(record?.ltdId); + } + + getInvoiceSummary() { + this.service.request(this.service.$api_get_invoice_summary, { partnerId: this.roleId }).subscribe(res => { + if (res) { + this.summaryObj = res; + } + }) + } + + handleCancel() { + this.showBillDetail = false; + this.detailRecord = {}; + + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html new file mode 100644 index 00000000..21bfeea2 --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.html @@ -0,0 +1,38 @@ + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    + {{item.allBalance}} +
    +
    + +
    + {{item.availableBalance}} +
    +
    +
    +
    +
    + diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts new file mode 100644 index 00000000..9a7da573 --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from './virtual-account-detail.component'; + +describe('PartnerAccountManagementVirtualAccountDetailComponent', () => { + let component: PartnerAccountManagementVirtualAccountDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PartnerAccountManagementVirtualAccountDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerAccountManagementVirtualAccountDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts new file mode 100644 index 00000000..6840cddd --- /dev/null +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts @@ -0,0 +1,184 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { ShipperBaseService } from 'src/app/shared/services/business/shipper-base.service'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + +@Component({ + selector: 'app-partner-account-management-virtual-account-detail', + templateUrl: './virtual-account-detail.component.html', +}) +export class PartnerAccountManagementVirtualAccountDetailComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + roleId = ''; + _$expand = false; + record = {}; + + constructor(public shipperservice: ShipperBaseService, public service: AccountManagemantService, + private modalRef: NzModalRef, public router: Router) { + } + + get reqParams() { + return { ...this.sf?.value, roleId: this.roleId }; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', ui: { hidden: true } + }, + userName: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + phone: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + ltdId: { + title: '网络货运人', + type: 'string', + default: '', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder({}, true) + } + + }, + bankType: { + type: 'string', + title: '银行类型', + default: '', + ui: { + widget: 'dict-select', + params: { + dictKey: 'bankname:type' + }, + placeholder: '请选择', + allowClear: true, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + virtualAccount: { + title: '虚拟账户', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + }, + }, + }, + createTime: { + type: 'string', + title: '创建时间', + ui: { + widget: 'sl-from-to', + type: 'date', + autoComplete: 'off', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + } as SFDateWidgetSchema, + }, + } + } + this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, }; + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '合伙人', index: 'name', className: 'text-center', width: 200 }, + { title: '手机号', index: 'phone', className: 'text-center', width: 150 }, + { title: '网络货运人', index: 'ltdName', className: 'text-center', width: 200 }, + { title: '银行类型', index: 'bankTypeLabel', className: 'text-center', width: 120 }, + { title: '虚拟账户', index: 'virtualAccount', className: 'text-center', width: 180 }, + { title: '可用余额', render: 'availableBalance', className: 'text-center', width: 180 }, + { title: '账户总余额', render: 'allBalance', className: 'text-center', width: 180 }, + { title: '创建时间', index: 'createTime', className: 'text-center', width: 200 }, + { title: '状态', index: 'stateDeletedLabel', className: 'text-center', width: 120 }, + { + title: '操作', + width: 120, + buttons: [ + { + text: '查看明细', + click: (_record) => this.viewDetail(_record) + } + ] + } + ]; + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { } + /** + * + * @param _record 当前行信息 + */ + viewDetail(_record: any) { + // this.router.navigate([`/partner/account-management/am/detail/${_record?.roleId}`], { + // queryParams: { + // channelSource: _record?.accountType, + // bankType: _record?.bankType, + // ltdId: _record?.ltdId + // } + // }); + window.open(location.origin + `/#/partner/account-management/am/detail/${_record?.roleId}?ltdId=${_record?.ltdId}&channelSource=${_record?.accountType}&bankType=${_record?.bankType}`); + } + + close() { + this.modalRef.destroy(); + } + +} diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html new file mode 100644 index 00000000..e2073979 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html @@ -0,0 +1,64 @@ + + + + + + + + + + +
    + + {{formData?.ltdName}} + + + {{formData?.bankType==='1'?'平安银行':'浦发银行'}} + + + {{formData?.refundApplyCode}} + + + {{formData?.bankAccountName}} + + + {{formData?.createTime}} + + + {{formData?.virtualAccount}} + + + {{formData?.refundStatusLabel}} + + + {{formData?.amount | currency}} + + + {{formData?.bankSerialNumber}} + + + {{formData?.bankCardNumber}} + + + {{formData?.refundStatus==='3'?'下载回单':'暂无回单'}} + +
    + + +
    +
    + +
    +
    +
    diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less new file mode 100644 index 00000000..e299b7d1 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less @@ -0,0 +1,17 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color: rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size: 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts new file mode 100644 index 00000000..baf83686 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; + +@Component({ + selector: 'app-partner-account-management-withdrawals-detail', + templateUrl: './withdrawals-detail.component.html', + styleUrls: ['./withdrawals-detail.component.less'] +}) +export class PartnerAccountManagementWithdralDetailComponent implements OnInit { + formData: any = {}; + + timeLineData: any = []; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + const id = route.snapshot.params.id; + this.loadRefundDetail(id); + } + + ngOnInit(): void {} + + loadRefundDetail(id: string) { + this.service.request(this.service.$api_get_refund_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + let isEnd = false; + if (res.successTime) { + isEnd = true; + if (res.refundStatus === '3') { + this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + } else { + this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + } + } + if (res.agreeTime && res.refundStatus !== '4') { + this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + } + if (res.agreeTime) { + if (res.refundStatus === '4') { + isEnd = true; + this.timeLineData.push({ + time: res.agreeTime, + value: `拒绝提现
    操作人员:${res.handlerUserIdLabel}`, + color: 'red' + }); + } else { + this.timeLineData.push({ + time: res.agreeTime, + value: `审核通过
    操作人员:${res.handlerUserIdLabel}`, + color: 'gray' + }); + } + } + if (res.createTime) { + this.timeLineData.push({ + time: res.createTime, + value: `提交提现申请
    提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
    操作人员:${res.userIdLabel}`, + color: 'gray' + }); + } + if (this.timeLineData?.length > 0 && !isEnd) { + this.timeLineData[0].color = 'green'; + } + } + }); + } + + downBack() { + if (this.formData?.refundStatus !== '3') { + return; + } + this.service.getReceiptUrl(this.formData.receiptUrl, { + bankType: this.formData.bankType, + rmYll: this.formData.userId, + snglFlgCd: this.formData.coreSerNo, + bussType: '06', + ltdId: this.formData.ltdId, + accountType: this.formData.accountType + }); + } + + goBack() { + history.go(-1); + } +} diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html new file mode 100644 index 00000000..92dc20a4 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html @@ -0,0 +1,63 @@ + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据   累计提现 {{ + totalCallNo }} + +
    + +
    +
    + + + + {{ item.bankName }}
    {{ item.bankCardNumber }} +
    +
    +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts new file mode 100644 index 00000000..ad7c8ead --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts @@ -0,0 +1,336 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import Big from 'src/app/shared/utils/deal-precision'; +import { AccountManagemantService } from '../../services/account-managemant.service'; + + +@Component({ + selector: 'app-partner-account-management-withdrawals-record', + templateUrl: './withdrawals-record.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class PartnerAccountManagementWithdrawalsRecordComponent implements OnInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('auditModal', { static: false }) auditModal!: any; + @ViewChild('viewReasonModal', { static: false }) viewReasonModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + constructor(public service: FreightAccountService, public amService: AccountManagemantService, private nzModalService: NzModalService, private router: Router, public ar: ActivatedRoute) { } + + ngOnInit(): void { } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + data = data.map(node => ({ ...node, disabled: node.refundStatus !== '1' })); + return data; + }; + + stChange(e: STChange): void { + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + let totalCallNo = 0; + this.selectedRows.forEach((item => { + totalCallNo = new Big(this.totalCallNo).plus(item?.amount).parse(); + })); + this.totalCallNo = totalCallNo; + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any) { + this.msg = ''; + let params: Array = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + this.service + .request(this.service.$api_disagree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.service + .request(this.service.$api_agree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: item?.rejectionCause || item?.failCause, + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + refundApplyCode: { + type: 'string', + title: '提现单号', + ui: { + placeholder: '请输入' + } + }, + refundStatus: { + type: 'string', + title: '提现状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + }, + createTime: { + title: '提现时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + bankAccountName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + accountType: { + type: 'string', + title: '账户类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bank:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + bankType: { + type: 'string', + title: '银行类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bankname:type' }, + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', className: 'text-center' }, + { title: '提现时间', index: 'createTime', width: 180, className: 'text-center' }, + { title: '提现单号', index: 'refundApplyCode', width: 180, className: 'text-center' }, + { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' }, + { title: '银行类型', index: 'bankTypeLabel', width: 100, className: 'text-center' }, + { title: '账户类型', index: 'accountTypeLabel', width: 100, className: 'text-center' }, + { title: '账户名称', index: 'bankAccountName', width: 220, className: 'text-center' }, + { title: '虚拟账户', index: 'virtualAccount', width: 180, className: 'text-center' }, + { + title: '提现金额', + index: 'amount', + width: 200, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { title: '提现银行账户', render: 'bankCardNumber', width: 200, className: 'text-center' }, + { title: '提现状态', index: 'refundStatusLabel', width: 100, className: 'text-center' }, + { title: '银行流水号', index: 'bankSerialNumber', width: 160, className: 'text-center' }, + { title: '核心交易流水', index: 'coreSerNo', width: 180, className: 'text-center' }, + { title: '失败原因', index: 'rejectionCause', width: 200, format: item => item.failCause, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '查看回单', + iif: item => item.refundStatus === '3', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.userId, + snglFlgCd: item.coreSerNo, + bussType: '06', + ltdId: item.ltdId, + accountType: item.accountType + }) + }, + { + text: '查看原因', + iif: item => item.refundStatus === '4', + click: item => this.showReason(item) + }, + { + text: '审核', + iif: item => item.refundStatus === '1', + click: item => this.auditAction(item) + }, + { + text: '详情', + click: item => this.router.navigate(['./../detail/' + item.id], { relativeTo: this.ar }) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/account-management/services/account-managemant.service.ts b/src/app/routes/partner/account-management/services/account-managemant.service.ts new file mode 100644 index 00000000..f7fa89b0 --- /dev/null +++ b/src/app/routes/partner/account-management/services/account-managemant.service.ts @@ -0,0 +1,22 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountManagemantService extends BaseService { + + $api_get_account_management_page = `/api/bpc/accountBalancePartner/getPartnerAccountBalanceByOperator`; // 账户管理 + $api_get_virtual_detail_page = `/api/bpc/accountBalancePartner/getPartnerAccountBalanceInfoByOperator`;//虚拟账户明细 + $api_get_withdraw_record_page = `/api/fcc/refundApplicationOBC/list/partnerPage`;// 提现记录 + $api_get_account_detail_page = `/api/bpc/accountBalancePartner/getAccountBalancePartnerByOperatorPage`;// 账户明细 + $api_get_account_detail_footer_summary = `/api/bpc/accountBalancePartner/getAccountBalancePartnerIncomeDetailByOperator`;// 账户明细脚部汇总 + $api_get_account_detail_header_summary = `/api/bpc/accountBalancePartner/getAccountBalancePartnerAmountByOperator`;// 账户明细头部汇总 + $api_get_bill_detail = `/api/bpc/partnerIncomeDetail/findPartnerWaitIncomeByOperator`; // 查看账单明细 + $api_get_invoice_summary = `/api/bpc/partnerInvoiceEntry/oprationEntrySummary`; // 入账明细汇总 + $api_get_invoice_detail_page = `/api/bpc/partnerInvoiceEntry/oprationEntryDetail`; // 待入账明细列表 + + constructor(public injector: Injector) { + super(injector) + } +} diff --git a/src/app/routes/partner/ad/components/list/list.component.html b/src/app/routes/partner/ad/components/list/list.component.html new file mode 100644 index 00000000..5a266913 --- /dev/null +++ b/src/app/routes/partner/ad/components/list/list.component.html @@ -0,0 +1,62 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + + +
    diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html new file mode 100644 index 00000000..a0469712 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.html @@ -0,0 +1,46 @@ + + + + + + +
    +
    + +
    +
    +
    深圳市XXXXXXX有限公司
    +
    91440300357887492H
    + + + + + + +
    +
    +
    待审核
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + + + + + + +
    +
    +
    + + \ No newline at end of file diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less new file mode 100644 index 00000000..403e7692 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less @@ -0,0 +1,29 @@ +:host { + .head-box { + img { + width : 80px; + height : 80px; + padding: 8px; + } + + .right-h { + font-size: 16px; + } + + .right-s { + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size : 16px; + text-align : right; + } + + .left-rb { + display : flex; + justify-content: flex-end; + padding-top : 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts new file mode 100644 index 00000000..d7aa10db --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.ts @@ -0,0 +1,71 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ParterClaimAuditListChannelApproveComponent } from '../../../claim-audit/components/channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelRejectComponent } from '../../../claim-audit/components/channel-reject/channel-reject.component'; +import { AdviceFeedbackService } from '../../services/advice-feedback.service'; + +// import { ParterClaimAuditListChannelApproveComponent } from '../channel-approve/channel-approve.component'; +// import { ParterClaimAuditListChannelRejectComponent } from '../channel-reject/channel-reject.component'; + +@Component({ + selector: 'app-parter-feedback-detail-detail', + templateUrl: './feedback-detail.component.html', + styleUrls: ['./feedback-detail.component.less'] +}) +export class ParterAdviceFeedbackDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + public service: AdviceFeedbackService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/partner/advice-feedback/components/list/list.component.html b/src/app/routes/partner/advice-feedback/components/list/list.component.html new file mode 100644 index 00000000..ca389dea --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/list/list.component.html @@ -0,0 +1,47 @@ + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + diff --git a/src/app/routes/partner/advice-feedback/components/list/list.component.ts b/src/app/routes/partner/advice-feedback/components/list/list.component.ts new file mode 100644 index 00000000..80260b01 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/components/list/list.component.ts @@ -0,0 +1,228 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AdviceFeedbackService } from '../../services/advice-feedback.service'; + +@Component({ + selector: 'app-parter-advice-feedback', + templateUrl: './list.component.html' +}) +export class ParterAdviceFeedbackListComponent implements OnInit { + schema: SFSchema = {}; + columns1!: STColumn[]; + columns2!: STColumn[]; + @ViewChild('st1', { static: false }) + st1!: STComponent; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + _$expand = false; + selectedIndex = 0; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: AdviceFeedbackService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + ngOnInit() { + this.initSF(); + this.initST1(); + this.initST2(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '提交人' + }, + name1: { + type: 'string', + title: '企业管理员' + }, + name2: { + type: 'string', + title: '角色' + }, + name3: { + type: 'string', + title: '问题类型', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + name4: { + type: 'string', + title: '状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST1() { + this.columns1 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '企业管理员', + index: 'name1' + }, + { + title: '手机号', + index: 'name1' + }, + { + title: '角色', + index: 'name1' + }, + { + title: '问题类型', + index: 'name1' + }, + { + title: '描述或建议', + index: 'name1' + }, + { + title: '状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + { + text: '处理', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + ] + } + ]; + } + + initST2() { + this.columns2 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + + ] + } + ]; + } + + partnerView(record: STData) { + this.router.navigate(['/partner/advice-feedback/detail'], { queryParams: {} }); + } + + channelView(record: STData) { + this.router.navigate(['/partner/advice-feedback/detail'], { queryParams: {} }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + search() { + // this.st1?.load(1); + } + + tabChange(index:any){ + console.log(index) + switch (index) { + case 0: + this.initST1(); + break; + case 1: + this.initST2(); + break; + default: + break; + } + } + +} diff --git a/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts b/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts new file mode 100644 index 00000000..1e94e786 --- /dev/null +++ b/src/app/routes/partner/advice-feedback/services/advice-feedback.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class AdviceFeedbackService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/article-management/components/edit/edit.component.html b/src/app/routes/partner/article-management/components/edit/edit.component.html new file mode 100644 index 00000000..e8e4a5fc --- /dev/null +++ b/src/app/routes/partner/article-management/components/edit/edit.component.html @@ -0,0 +1,17 @@ + + + + + +
    + + +
    +
    + +
    + + +
    +
    + diff --git a/src/app/routes/partner/article-management/components/edit/edit.component.ts b/src/app/routes/partner/article-management/components/edit/edit.component.ts new file mode 100644 index 00000000..f65dea8f --- /dev/null +++ b/src/app/routes/partner/article-management/components/edit/edit.component.ts @@ -0,0 +1,189 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { Observable, Observer } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/channel-sales.service'; + +@Component({ + selector: 'app-parter-article-management-edit', + templateUrl: './edit.component.html' +}) +export class ParterArticleManagementEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + public service: ChannelSalesService, + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + type: 'string', + title: '文章标题', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + name2: { + type: 'string', + title: '文章简介', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + name3: { + type: 'string', + title: '封面图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 280px * 180 px)', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } as SFUploadWidgetSchema + }, + name: { + title: '分类', + type: 'string', + enum: [ + { label: '管理员', value: '1'}, + ], + ui: { + widget: 'select', + } as SFSelectWidgetSchema, + }, + name4: { + type: 'number', + title: '排序', + minimum: 0, + maximum: 99, + ui: { + widgetWidth: 300 , + placeholder:'请输入0~99,数字越大,排序越靠前' + } + }, + name5: { + type: 'string', + title: '跳转路径', + enum: [ + { label: '图文', value: '1'}, + { label: '视频', value: '2'}, + ], + ui: { + widget: 'radio', + } as SFRadioWidgetSchema, + default: '1', + }, + content: { + type: 'string', + title: '正文', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + name6: { + type: 'string', + title: '视频', + ui: { + action: apiConf.fileUpload, + accept: 'video/mp4,video/avi,video/mkv,video/vob', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '支持MP4、AVI、DAT、MKV、FLV、VOB格式,文件小于20M。', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 20; + if (!isLt2M) { + this.service.msgSrv.warning('视频大小超过20M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + visibleIf: { name5: (value: string) => value === '2' } + } as SFUploadWidgetSchema + }, + }, + required: ['name1', 'name2'] + }; + this.ui = { + '*': { + spanLabelFixed: 150, + grid: { span: 20 } + }, + + }; + } + + close() { + + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } +} diff --git a/src/app/routes/partner/article-management/components/list/list.component.html b/src/app/routes/partner/article-management/components/list/list.component.html new file mode 100644 index 00000000..721c85c0 --- /dev/null +++ b/src/app/routes/partner/article-management/components/list/list.component.html @@ -0,0 +1,49 @@ + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + + + diff --git a/src/app/routes/partner/article-management/components/list/list.component.ts b/src/app/routes/partner/article-management/components/list/list.component.ts new file mode 100644 index 00000000..89835f98 --- /dev/null +++ b/src/app/routes/partner/article-management/components/list/list.component.ts @@ -0,0 +1,200 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/channel-sales.service'; +import { ParterArticleManagementEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-article-management-list', + templateUrl: './list.component.html' +}) +export class ParterArticleManagementListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + search() { + // this.st1?.load(1); + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '文章标题' + }, + phone: { + type: 'string', + title: '分类' + }, + phone1: { + type: 'string', + title: '状态' + }, + phone2: { + type: 'string', + title: '推荐到首页', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '销售渠道姓名', + index: 'name1' + }, + { + title: '手机号', + index: 'name1' + }, + { + title: '所属组织', + index: 'name1' + }, + { + title: '职级', + index: 'name1' + }, + { + title: '等级', + index: 'name1' + }, + { + title: '省市', + index: 'name1' + }, + { + title: '邀请码', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '修改', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '禁用', + click: (_record, _modal, _instance) => this.stop(_record), + }, + { + text: '启用', + click: (_record, _modal, _instance) => this.start(_record.id), + }, + { + text: '推荐到首页', + click: (_record, _modal, _instance) => this.recommend(_record.id), + } + ] + } + ]; + } + // 新增 + add() { + this.router.navigate(['/partner/knowledge/article-management-add'], { queryParams: {} }); + } + + // 编辑 + edit(record: STData) { + this.router.navigate(['/partner/knowledge/article-management-edit'], { queryParams: {} }); + } + + + stop(record: STData) { + this.modalService.confirm({ + nzTitle: '禁用确认', + nzContent: `确定禁用此文章吗?
    `, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + start(record: STData) { + this.modalService.confirm({ + nzTitle: '启用确认', + nzContent: `确定启用此文章吗?
    `, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + recommend(record: STData) { + + } + +} diff --git a/src/app/routes/partner/article-management/services/channel-sales.service.ts b/src/app/routes/partner/article-management/services/channel-sales.service.ts new file mode 100644 index 00000000..6e7cb18c --- /dev/null +++ b/src/app/routes/partner/article-management/services/channel-sales.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/business-statistics/components/index/index.component.html b/src/app/routes/partner/business-statistics/components/index/index.component.html new file mode 100644 index 00000000..5074b929 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/index/index.component.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/index/index.component.ts b/src/app/routes/partner/business-statistics/components/index/index.component.ts new file mode 100644 index 00000000..a39d1fa2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/index/index.component.ts @@ -0,0 +1,37 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-business-statistics-index', + templateUrl: './index.component.html', +}) +export class PartnerBusinessStatisticsIndexComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = []; + selectedIndex = 0; + tabs = [ + { + name: '合伙人统计', + value: '0' + }, + { + name: '渠道销售统计', + value: '1' + } + ] + + constructor() { } + + + ngOnInit(): void { } + + + + add(): void { + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html new file mode 100644 index 00000000..b6cc6783 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.html @@ -0,0 +1,44 @@ + + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts new file mode 100644 index 00000000..4fddfb5d --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerCustomDetailComponent } from './partner-custom-detail.component'; + +describe('PartnerPartnerCustomDetailComponent', () => { + let component: PartnerPartnerCustomDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerCustomDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerCustomDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts new file mode 100644 index 00000000..f273d209 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-detail/partner-custom-detail.component.ts @@ -0,0 +1,163 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-custom-detail', + templateUrl: './partner-custom-detail.component.html', + styleUrls: ['./partner-custom-detail.component.less'] +}) +export class PartnerPartnerCustomDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + _$expand = false; + + constructor(public service: BussinessStatisticsService, public router: Router) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '客户名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '客户状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 11, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '客户名称', index: 'carNo', className: 'text-center', width: 150 }, + { title: '客户状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '结算时间段', index: 'carNo', className: 'text-center', width: 200 }, + { title: '本月交易数', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '累计交易数', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '本月已结算订单', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '累计已结算订单', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '本月交易金额(元)', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { title: '累计交易金额(元)', index: 'approvalStatus6', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { title: '本月已结算金额(元)', index: 'approvalStatus7', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '累计已结算金额(元)', index: 'approvalStatus8', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '本月已开票金额(元)', index: 'approvalStatus9', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '累计已开票金额(元)', index: 'approvalStatus10', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { title: '本月申请开票金额(元)', index: 'approvalStatus11', className: 'text-right', sort: true, type: 'currency', width: 200 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单明细', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + /** + * 查看订单明细 + * @param record 当前对象 + */ + viewOrderDetail(record: any) { + this.router.navigate([`/partner/business-statistics/partner/custom-order-detail/${record?.id}`]) + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html new file mode 100644 index 00000000..227ab356 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.html @@ -0,0 +1,44 @@ + + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts new file mode 100644 index 00000000..dc51f832 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerCustomOrderDetailComponent } from './partner-custom-order-detail.component'; + +describe('PartnerPartnerCustomOrderDetailComponent', () => { + let component: PartnerPartnerCustomOrderDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerCustomOrderDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerCustomOrderDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts new file mode 100644 index 00000000..71a30096 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component.ts @@ -0,0 +1,162 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-custom-order-detail', + templateUrl: './partner-custom-order-detail.component.html', + styleUrls: ['./partner-custom-order-detail.component.less'] +}) +export class PartnerPartnerCustomOrderDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + _$expand = false; + + constructor(public service: BussinessStatisticsService) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '订单状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause2: { + title: '开票状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 7, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '订单号', index: 'carNo', className: 'text-center', width: 150 }, + { title: '订单状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '订单金额(元)', index: 'carNo', className: 'text-center', width: 200 }, + { title: '实际付款金额(元)', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户附加费率', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '预估收益(元)', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '开票状态', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '开票金额(元)', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '下单时间', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单详情', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + viewOrderDetail(record: any) { + + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html new file mode 100644 index 00000000..fa14c129 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.html @@ -0,0 +1,49 @@ + + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less new file mode 100644 index 00000000..06c7da1f --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.less @@ -0,0 +1,11 @@ +:host { + .user-logo { + width: 90px; + } + + .letf-box { + display: inline-block; + width: 250px; + } + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts new file mode 100644 index 00000000..a77b84eb --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerOrderDetailComponent } from './partner-order-detail.component'; + +describe('PartnerPartnerOrderDetailComponent', () => { + let component: PartnerPartnerOrderDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerOrderDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerOrderDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts new file mode 100644 index 00000000..50c33e77 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-order-detail/partner-order-detail.component.ts @@ -0,0 +1,173 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-order-detail', + templateUrl: './partner-order-detail.component.html', + styleUrls: ['./partner-order-detail.component.less'] +}) +export class PartnerPartnerOrderDetailComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + company: '张三', + code: '91440300357887492H', + proxy: '企业合伙人', + belongCity: '深圳、上海、北京', + createTime: '2021-09-23 14:43:31' + } + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + _$expand = false; + isLoading: boolean = false; + + constructor(public service: BussinessStatisticsService) { + + } + + get reqParams() { + return { ...this.sf?.value }; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + resetSF() { + this._$expand = false; + this.sf.reset(); + this.isLoading = true + } + /** +* 伸缩查询条件 +*/ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + search() { + this.st.load(1); + } + export() { + + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + abnormalCause: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '订单状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause2: { + title: '开票状态', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + abnormalCause3: { + title: '客户名称', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + } + } + this.ui = { + '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } }, + }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '订单号', index: 'carNo', className: 'text-center', width: 150 }, + { title: '订单状态', render: 'carModelLabel', className: 'text-center', width: 120 }, + { title: '订单金额(元)', index: 'carNo', className: 'text-center', width: 200 }, + { title: '实际付款金额(元)', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户附加费率', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '预估收益(元)', render: 'approvalStatus1', className: 'text-center', sort: true, width: 120 }, + { title: '开票状态', render: 'approvalStatus2', className: 'text-center', sort: true, width: 180 }, + { title: '开票金额(元)', render: 'approvalStatus3', className: 'text-center', sort: true, width: 180 }, + { title: '下单时间', index: 'approvalStatus5', className: 'text-right', sort: true, type: 'currency', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '查看订单详情', + click: (_record) => this.viewOrderDetail(_record) + } + ] + }, + ]; + } + + viewOrderDetail(record: any) { + + } + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html new file mode 100644 index 00000000..e832275b --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + {{item.yskmoney}} + + +
    {{item.approvalStatus1 | currency:' '}}
    +
    + + {{item.yskmoney | currency:' + '}} + + + +
    {{item.yskmoney | currency:' '}}
    +
    + +
    {{item.armoney | currency:' '}}
    +
    +
    +
    diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts new file mode 100644 index 00000000..5396aaf2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerPartnerStatisticsComponent } from './partner-statistics.component'; + +describe('PartnerPartnerStatisticsComponent', () => { + let component: PartnerPartnerStatisticsComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerPartnerStatisticsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerPartnerStatisticsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts new file mode 100644 index 00000000..43cc7831 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/partner-statistics/partner-statistics.component.ts @@ -0,0 +1,98 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-partner-statistics', + templateUrl: './partner-statistics.component.html', +}) +export class PartnerPartnerStatisticsComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + isLoading: boolean = false; + + constructor(public service: BussinessStatisticsService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '合伙人名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '类型', + type: 'string', + default: '', + enum: [ + { + label: '全部', + value: '' + }, + { + label: '个人', + value: '1' + }, + { + label: '企业', + value: '2' + } + ], + ui: { + widget: 'select' + }, + }, + } + } + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 } } }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '合伙人名称', index: 'carNo', className: 'text-center', width: 150 }, + { title: '类型', render: 'carModelLabel', className: 'text-center', width: 150 }, + { title: '注册时间', index: 'carNo', className: 'text-center', width: 150 }, + { title: '本月新增客户', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 }, + { title: '本月已结算金额(元)', render: 'approvalStatus1', className: 'text-right', sort: true, width: 180 }, + { title: '累计已结算金额(元)', render: 'approvalStatus2', className: 'text-right', sort: true, width: 180 }, + { title: '本月预估收益(元)', render: 'approvalStatus3', className: 'text-right', sort: true, width: 180 }, + { title: '累计收益(元)', render: 'approvalStatus4', className: 'text-right', sort: true, width: 180 }, + ]; + } + + resetSF() { + this.sf.reset(); + this.isLoading = true + } + + export() { + + } + + + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html new file mode 100644 index 00000000..b376f70a --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts new file mode 100644 index 00000000..d88e4632 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSaleCustomDetailComponent } from './sale-custom-detail.component'; + +describe('PartnerSaleCustomDetailComponent', () => { + let component: PartnerSaleCustomDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSaleCustomDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSaleCustomDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts new file mode 100644 index 00000000..c3a63716 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-custom-detail/sale-custom-detail.component.ts @@ -0,0 +1,53 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-sale-custom-detail', + templateUrl: './sale-custom-detail.component.html', +}) +export class PartnerSaleCustomDetailComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + detailInfo: any = { + logo: './assets/images/user/logo.svg', + name: '张三', + phone: '1399999999', + proxy: '城市代理', + level: '二级', + createTime: '添加时间' + } + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html new file mode 100644 index 00000000..482ccb06 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts new file mode 100644 index 00000000..673661d9 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSalePartnerDetailComponent } from './sale-partner-detail.component'; + +describe('PartnerSalePartnerDetailComponent', () => { + let component: PartnerSalePartnerDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSalePartnerDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSalePartnerDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts new file mode 100644 index 00000000..229daf8d --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-partner-detail/sale-partner-detail.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-partner-sale-partner-detail', + templateUrl: './sale-partner-detail.component.html', +}) +export class PartnerSalePartnerDetailComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html new file mode 100644 index 00000000..3a68680d --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + {{item.yskmoney | currency:' ':false:'1.0-2'}} + + +
    {{item.approvalStatus1 | currency:' '}}
    +
    + +
    {{item.approvalStatus1 | currency:' '}}
    +
    + + +
    {{item.yskmoney | currency:' '}}
    +
    +
    +
    diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts new file mode 100644 index 00000000..bfa13cd2 --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerSaleStatisticsComponent } from './sale-statistics.component'; + +describe('PartnerSaleStatisticsComponent', () => { + let component: PartnerSaleStatisticsComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerSaleStatisticsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerSaleStatisticsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts new file mode 100644 index 00000000..5e3524ef --- /dev/null +++ b/src/app/routes/partner/business-statistics/components/sale-statistics/sale-statistics.component.ts @@ -0,0 +1,78 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { BussinessStatisticsService } from '../../services/bussiness-statistics.service'; + +@Component({ + selector: 'app-partner-sale-statistics', + templateUrl: './sale-statistics.component.html', +}) +export class PartnerSaleStatisticsComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + ui!: SFUISchema; + isLoading: boolean = false; + + constructor(public service: BussinessStatisticsService) { } + + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '渠道销售姓名', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入' + }, + }, + } + }; + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 8 } } }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '联系人', index: 'carNo', className: 'text-center' }, + { title: '手机号', render: 'carModelLabel', className: 'text-center' }, + { title: '添加时间', index: 'carNo', className: 'text-center' }, + { title: '本月新增客户', render: 'approvalStatus', className: 'text-center', sort: true }, + { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true }, + { title: '本月新增合伙人', render: 'approvalStatus1', className: 'text-center', sort: true }, + { title: '合伙人总数', render: 'approvalStatus1', className: 'text-center', sort: true }, + { title: '本月已结算金额(元)', render: 'approvalStatus2', className: 'text-right', sort: true }, + { title: '累计已结算金额(元)', render: 'approvalStatus3', className: 'text-right', sort: true }, + ]; + } + export() { + + } + resetSF() { + this.sf.reset(); + this.isLoading = true + } +} diff --git a/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts b/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts new file mode 100644 index 00000000..894da58b --- /dev/null +++ b/src/app/routes/partner/business-statistics/services/bussiness-statistics.service.ts @@ -0,0 +1,13 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class BussinessStatisticsService extends BaseService { + + $api_get_partner_statistics_page = `/api/fcc/ficoBrmH/list/page`; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.html b/src/app/routes/partner/channel-sales/components/edit/edit.component.html new file mode 100644 index 00000000..7386c7af --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.html @@ -0,0 +1,7 @@ + + + +
    + + +
    diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts new file mode 100644 index 00000000..6b143413 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts @@ -0,0 +1,156 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFAutoCompleteWidgetSchema, SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/channel-sales.service'; + +@Component({ + selector: 'app-parter-channel-sales-edit', + templateUrl: './edit.component.html' +}) +export class ParterChannelSalesEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + record:any; + currentOAItem:any; + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ChannelSalesService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + + this.service.request(this.service.$api_getChannelSalesInfo, {id:this.i?.id}).subscribe(res => { + if(res){ + this.record = res; + } + this.initSF(); + }); + + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name: { + title: '渠道销售姓名', + type: 'string', + maxLength: 12, + ui: { + placeholder:'请输入' + } + }, + phoneNumber: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder:'请输入' + } + }, + employeeVO: { + title: '关联OA员工', + type: 'string', + ui: { + widget: 'autocomplete', + placeholder:'请选择', + asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe( + map((res: any) => { + return res.map((item:any)=>{ + return {label: item.empName+"/"+item.empNo, value: item.empNo, obj: item} + }) + }) + ), + change:(item:any, org:any)=>{ + this.currentOAItem = org.obj; + } + } as SFAutoCompleteWidgetSchema, + }, + isAuthorization: { + type: 'string', + title: '授权登录运营后台', + enum: [ + { label: '否', value: '0' }, + { label: '是', value: '1' } + ], + ui: { + widget: 'radio', + } as SFRadioWidgetSchema, + default: '0', + }, + roleIds: { + title: '', + type: 'string', + ui: { + widget: 'select', + placeholder: '授权角色', + mode: 'multiple', + maxMultipleCount: 5, + asyncData: () => { + return this.service.request(this.service.$api_getAppRoleList).pipe( + map((res: any) => { + return res + .filter((role: any) => role.roleCode !== 'Administrator') + .map((item: any) => { + return { label: item.roleName, value: item.id }; + }); + }) + ); + }, + visibleIf: { isAuthorization: (value: string) => value === '1' } + }, + }, + remark: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name', 'phoneNumber', 'employeeVO', 'roleIds', 'remark'] + }; + this.ui = { + '*': { + spanLabelFixed: 150, + grid: { span: 24 } + }, + $isAuthorization:{ grid: { span: 12 }}, + $roleIds:{ spanLabelFixed: 10, grid: { span: 12 }}, + + + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + this.service.request(this.service.$api_save, { ...this.sf.value, employeeVO: this.currentOAItem}).subscribe(res => { + if (res) { + this.modalRef.destroy(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } +} diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.html b/src/app/routes/partner/channel-sales/components/list/list.component.html new file mode 100644 index 00000000..589c32e9 --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/list/list.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.ts b/src/app/routes/partner/channel-sales/components/list/list.component.ts new file mode 100644 index 00000000..ba7097ec --- /dev/null +++ b/src/app/routes/partner/channel-sales/components/list/list.component.ts @@ -0,0 +1,163 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/channel-sales.service'; +import { ParterChannelSalesEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-channel-sales-list', + templateUrl: './list.component.html' +}) +export class ParterChannelSalesListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: '销售渠道姓名' + }, + telephone: { + type: 'string', + title: '手机号' + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '销售渠道姓名', + index: 'name' + }, + { + title: '手机号', + index: 'telephone' + }, + { + title: '所属组织', + index: 'organLable' + }, + { + title: '职级', + index: 'station' + }, + { + title: '等级', + index: 'postLevel' + }, + { + title: '省市', + index: 'residencePlace' + }, + { + title: '邀请码', + index: 'inviteCode' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '冻结', + click: (_record, _modal, _instance) => this.stop(_record.id), + } + ] + } + ]; + } + + add() { + const modalRef = this.modalService.create({ + nzWidth:600, + nzTitle: '新增', + nzContent: ParterChannelSalesEditComponent, + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + edit(record: STData) { + const modalRef = this.modalService.create({ + nzWidth:600, + nzTitle: '编辑', + nzContent: ParterChannelSalesEditComponent, + nzComponentParams: { i: record } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + + + stop(id: any) { + this.modalService.confirm({ + nzTitle: '冻结确认', + nzContent: `确定冻结该账号吗?
    `, + // nzOnOk: () => + // this.service.request('', '').subscribe(res => { + // if (res) { + // this.service.msgSrv.success('冻结成功!'); + // this.st.reload(); + // } + // }) + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + +} diff --git a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts new file mode 100644 index 00000000..9382c6a9 --- /dev/null +++ b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts @@ -0,0 +1,27 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + + // 保存渠道销售管理 + $api_save = '/api/mdc/channelSalesManagement/save'; + + // 查询渠道销售管理表 + $api_getPage = '/api/mdc/channelSalesManagement/list/page'; + // OA员工模糊查询 + $api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery'; + // 获取角色列表 + $api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList'; + // 获取渠道销售管理详情 + $api_listChannelSalesManagement = '/api/mdc/channelSalesManagement/list/listChannelSalesManagement'; + // 根据渠道销售id获取渠道信息 + $api_getChannelSalesInfo = '/api/mdc/channelSalesManagement/getChannelSalesInfo'; + + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.html @@ -0,0 +1,9 @@ + + +
    + 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
    +
    + + +
    diff --git a/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts new file mode 100644 index 00000000..8856e337 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-approve/channel-approve.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-channel-approve', + templateUrl: './channel-approve.component.html' +}) +export class ParterClaimAuditListChannelApproveComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html new file mode 100644 index 00000000..08f52a77 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.html @@ -0,0 +1,62 @@ + + + + + + +
    +
    + +
    +
    +
    深圳市XXXXXXX有限公司
    +
    91440300357887492H
    + + + + + + +
    +
    +
    待审核
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + + 现渠道销售(提交人) + + + + + + +
    +
    + +
    +
    + + 原渠道销售 + + + + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less new file mode 100644 index 00000000..7d4ae911 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less @@ -0,0 +1,27 @@ +:host { + .head-box { + img { + width: 80px; + height: 80px; + padding: 8px; + } + .right-h{ + font-size: 16px; + } + .right-s{ + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size: 16px; + text-align: right; + } + + .left-rb { + display: flex; + justify-content: flex-end; + padding-top: 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts new file mode 100644 index 00000000..c3eca870 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.ts @@ -0,0 +1,82 @@ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; + +import { ClaimAuditService } from '../../services/claim-audit.service'; +import { ParterClaimAuditListChannelApproveComponent } from '../channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelRejectComponent } from '../channel-reject/channel-reject.component'; + +@Component({ + selector: 'app-parter-claim-audit-channel-detail', + templateUrl: './channel-detail.component.html', + styleUrls: ['./channel-detail.component.less'] +}) +export class ParterClaimAuditListChannelDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + columns: STColumn[] = [ + { title: '操作时间', index: 'id', width: 120 }, + { title: '操作人', type: 'img', width: 120, }, + { title: '操作人手机号', index: 'email', width: 120 }, + { title: '操作页面', index: 'phone' }, + { title: '操作内容', index: 'registered' } + ]; + + data=[{id:11111}] + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: ClaimAuditService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListChannelRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.html @@ -0,0 +1,9 @@ + + +
    + 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
    +
    + + +
    diff --git a/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts new file mode 100644 index 00000000..27566f45 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/channel-reject/channel-reject.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-channel-reject', + templateUrl: './channel-reject.component.html' +}) +export class ParterClaimAuditListChannelRejectComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/list/list.component.html b/src/app/routes/partner/claim-audit/components/list/list.component.html new file mode 100644 index 00000000..8e321e48 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/list/list.component.html @@ -0,0 +1,66 @@ + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + diff --git a/src/app/routes/partner/claim-audit/components/list/list.component.ts b/src/app/routes/partner/claim-audit/components/list/list.component.ts new file mode 100644 index 00000000..cf817568 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/list/list.component.ts @@ -0,0 +1,230 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + +@Component({ + selector: 'app-parter-claim-audit-list', + templateUrl: './list.component.html' +}) +export class ParterClaimAuditListComponent implements OnInit { + schema: SFSchema = {}; + columns1!: STColumn[]; + columns2!: STColumn[]; + @ViewChild('st1', { static: false }) + st1!: STComponent; + @ViewChild('st2', { static: false }) + st2!: STComponent; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + _$expand = false; + selectedIndex = 0; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ClaimAuditService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + ngOnInit() { + this.initSF(); + this.initST1(); + this.initST2(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '认领人' + }, + name1: { + type: 'string', + title: '客户名称' + }, + name2: { + type: 'string', + title: '平台审核状态' + }, + name3: { + type: 'string', + title: '渠道销售状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + name4: { + type: 'string', + title: 'CRM状态', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + } + }; + this.ui = { + '*': { + grid: { span: 8, gutter: 4 } + } + }; + } + + initST1() { + this.columns1 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: '渠道销售审核状态', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.partnerView(_record), + }, + ] + } + ]; + } + + initST2() { + this.columns2 = [ + { + title: '提交人', + index: 'name1' + }, + { + title: '客户名称', + index: 'name1' + }, + { + title: '认领备注', + index: 'name1' + }, + { + title: 'CRM状态', + index: 'name1' + }, + { + title: '平台审核状态', + index: 'name1' + }, + { + title: '提交时间', + index: 'name1' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '详情', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + { + text: '审核', + click: (_record, _modal, _instance) => this.channelView(_record), + }, + + ] + } + ]; + } + + partnerView(record: STData) { + this.router.navigate(['/partner/claim-audit/partner-detail'], { queryParams: {} }); + } + + channelView(record: STData) { + this.router.navigate(['/partner/claim-audit/channel-detail'], { queryParams: {} }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + search() { + // this.st1?.load(1); + } + + tabChange(index:any){ + console.log(index) + switch (index) { + case 0: + this.initST1(); + break; + case 1: + this.initST2(); + break; + default: + break; + } + } + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.html @@ -0,0 +1,9 @@ + + +
    + 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
    +
    + + +
    diff --git a/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts new file mode 100644 index 00000000..86f5e72d --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-approve/partner-approve.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-partner-approve', + templateUrl: './partner-approve.component.html' +}) +export class ParterClaimAuditListPartnerApproveComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html new file mode 100644 index 00000000..c6370656 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.html @@ -0,0 +1,79 @@ + + + + + + +
    +
    + +
    +
    +
    深圳市XXXXXXX有限公司
    +
    91440300357887492H
    + + + + + + +
    +
    +
    待审核
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + + 现合伙人(提交人) + + + + + + + +
    +
    + + 现渠道销售 + + + + +
    +
    + +
    +
    + + 原合伙人 + + + + + +
    +
    + + 原渠道销售 + + + + +
    +
    +
    + + + + diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less new file mode 100644 index 00000000..403e7692 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less @@ -0,0 +1,29 @@ +:host { + .head-box { + img { + width : 80px; + height : 80px; + padding: 8px; + } + + .right-h { + font-size: 16px; + } + + .right-s { + color: #7f7f7f; + } + + .left-rt { + font-weight: bold; + font-size : 16px; + text-align : right; + } + + .left-rb { + display : flex; + justify-content: flex-end; + padding-top : 16px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts new file mode 100644 index 00000000..41f5558f --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.ts @@ -0,0 +1,82 @@ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; +import { ClaimAuditService } from '../../services/claim-audit.service'; +import { ParterClaimAuditListPartnerRejectComponent } from '../partner-reject/partner-reject.component'; +import { ParterClaimAuditListPartnerApproveComponent } from '../partner-approve/partner-approve.component'; + +@Component({ + selector: 'app-parter-claim-audit-partner-detail', + templateUrl: './partner-detail.component.html', + styleUrls: ['./partner-detail.component.less'] +}) +export class ParterClaimAuditListPartnerDetailComponent implements OnInit { + id = this.route.snapshot.queryParams.id; + i: any; + imges: any; + isVisible = false; + columns: STColumn[] = [ + { title: '操作时间', index: 'id', width: 120 }, + { title: '操作人', type: 'img', width: 120, }, + { title: '操作人手机号', index: 'email', width: 120 }, + { title: '操作页面', index: 'phone' }, + { title: '操作内容', index: 'registered' } + ]; + + data=[{id:11111}] + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: ClaimAuditService, + private modalService: NzModalService, + private router: Router + ) {} + + ngOnInit(): void { + this.initData(); + } + + initData() { + // this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { + // if (res) { + // this.i = res; + // + // } + // }); + } + + approve() { + const modalRef = this.modalService.create({ + nzTitle: '同意', + nzWidth: 700, + nzContent: ParterClaimAuditListPartnerApproveComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + reject() { + const modalRef = this.modalService.create({ + nzTitle: '拒绝', + nzWidth: 700, + nzContent: ParterClaimAuditListPartnerRejectComponent, + nzComponentParams: { + i: this.i + }, + nzFooter: null + }); + } + goBack() { + window.history.go(-1); + } + + +} diff --git a/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html new file mode 100644 index 00000000..dc134ee2 --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.html @@ -0,0 +1,9 @@ + + +
    + 结算起算日:指给合伙人结算佣金的起算时间,更换合伙人,该日期是当前合伙人的结算起算日,原合伙人的结算结束时间则为此日期的前一天 +
    +
    + + +
    diff --git a/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts new file mode 100644 index 00000000..09abe28f --- /dev/null +++ b/src/app/routes/partner/claim-audit/components/partner-reject/partner-reject.component.ts @@ -0,0 +1,98 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ClaimAuditService } from '../../services/claim-audit.service'; + + +@Component({ + selector: 'app-parter-claim-audit-partner-reject', + templateUrl: './partner-reject.component.html' +}) +export class ParterClaimAuditListPartnerRejectComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ClaimAuditService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + name1: { + title: '合伙人(认领人)', + type: 'string', + ui: { + widget: 'text', + } , + }, + name2: { + title: '认领客户名称', + type: 'string', + ui: { + widget: 'text', + } , + }, + data: { + title: '结算起算日期', + type: 'string', + format: 'date', + }, + name3: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + }, + required: ['name3'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + // this.service.request('', { ...this.sf.value }).subscribe(res => { + // if (res) { + // this.modalRef.destroy(true); + // } else { + // this.service.msgSrv.error(res.msg); + // } + // }); + } + + +} diff --git a/src/app/routes/partner/claim-audit/services/claim-audit.service.ts b/src/app/routes/partner/claim-audit/services/claim-audit.service.ts new file mode 100644 index 00000000..a102b596 --- /dev/null +++ b/src/app/routes/partner/claim-audit/services/claim-audit.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ClaimAuditService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.html b/src/app/routes/partner/knowledge/banner/components/add/add.component.html new file mode 100644 index 00000000..6760c1a0 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts b/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts new file mode 100644 index 00000000..64562645 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BannerComponentsAddComponent } from './add.component'; + +describe('BannerComponentsAddComponent', () => { + let component: BannerComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BannerComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BannerComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.component.ts b/src/app/routes/partner/knowledge/banner/components/add/add.component.ts new file mode 100644 index 00000000..132e6bb2 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.component.ts @@ -0,0 +1,241 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { BannerService } from '../../services/banner.service'; +import { apiConf } from '@conf/api.conf'; + +@Component({ + selector: 'app-ad-components-add', + templateUrl: './add.component.html', + styleUrls: ['./add.less'] +}) +export class BannerComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + contentListData = []; + queryParams: any = {}; + oldTakeEffectTime = ''; + maxSort = 0; + isVisible = false; + validFalg = true; + detailData: any = { + advertisementContentDTOList: [] + }; + changeTimeFlag = false; + currentIndex = 0; + addFlag = true; + addId = 1; + inputPoint: any = { + lng: 0, + lat: 0 + }; + today = new Date(); + navData: any = []; + navigationName = ''; + ui: SFUISchema = { + '*': { + spanLabelFixed: 200, + grid: { span: 24 }, + }, + }; + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + public service: BannerService, + private route: ActivatedRoute, + private router: Router, + private cdr: ChangeDetectorRef, + private envSrv: EAEnvironmentService, + ) { } + + + ngOnInit(): void { + this.queryParams = this.route.snapshot.queryParams; + if (this.queryParams.type !== 'add') { + this.initDetailData(); + } + this.initSF(); + } + initDetailData() { + + } + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: 'banner名称', + maxLength: 10, + ui: { + showRequired: true, + placeholder: '请不要超过10个字', + } + }, + licensePhotoWatermark: { + type: 'string', + title: 'banner图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 700px * 286px)。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 2; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + }, + }, + sortId: { + type: 'string', + title: '顺序', + ui: { + showRequired: true, + widget: '=', + placeholder: '请输入0~99,数字越大,排序越靠前', + serverSearch: true, + } as SFSelectWidgetSchema, + }, + linkType: { + type: 'string', + title: '跳转路径', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '文章ID', value: 1 }, + { label: '分类ID', value: 2 }, + { label: '自编辑', value: 3 }, + ], + }, + content: { + type: 'string', + title: '内容', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + }, + required: [], + }; + if (this.queryParams.type === 'add'){ + setTimeout(() => { + this.sf.setValue('/takeEffectType', 1); + this.sf.setValue('/style', 1); + }, 500); + } + } + get reqParams() { + return {}; + } + disabledDate = (current: Date): boolean => { + // Can not select days before today and today + return differenceInCalendarDays(current, this.today) < 0; + } + changeTime(){ + this.changeTimeFlag = true; + } + + + checkSort(){ + const params: any = { + navigationId: this.sf?.value.navigationId, + sortId: this.sf?.value.sortId, + takeEffectType: this.sf?.value.takeEffectType, + }; + if (this.queryParams.id !== '0'){ + params.advertisementId = this.queryParams.id; + } + if (this.sf.value.takeEffectType === 2){ + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } + + } + save() { + const params: any = { + ...this.sf?.value, + latitude: this.inputPoint.lat, + longitude: this.inputPoint.lng, + id: this.queryParams.id + }; + this.detailData.advertisementContentDTOList.forEach((item: any) => { + delete item.addId; + }); + if (this.queryParams.type === 'add') { + delete params.id; + } + if (this.sf.value.takeEffectType === 2){ + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } else { + delete params.takeEffectTime; + } + this.service.request(this.service.$api_add_one, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.router.navigate(['../list'], {relativeTo: this.route}); + } + }); + } + + goBack() { + window.history.go(-1); + } + gotoMap() { + this.isVisible = true; + } + + handleOk(): void { + this.isVisible = false; + } + + handleCancel(): void { + this.isVisible = false; + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/add/add.less b/src/app/routes/partner/knowledge/banner/components/add/add.less new file mode 100644 index 00000000..0a6adacb --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/add/add.less @@ -0,0 +1,119 @@ +:host { + .styleBox { + display: flex; + align-items: flex-end; + margin: 10px 0 0 0; + } + .imgBox { + position: relative; + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + .leftBox, + .rightBox { + position: absolute; + top: 50%; + transform: translate(0, -50%); + } + img { + width: 170px; + height: 40px; + } + .leftBox { + left: 3px; + } + .rightBox { + right: 3px; + } + } + .imgBox_two { + width: 200px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_three { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 25%; + height: 40px; + margin: 0 6% 0 0; + &:first-child { + margin: 0 6%; + } + } + } + .imgBox_four { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 22%; + height: 40px; + margin: 0 2% 0 0; + &:first-child { + margin: 0 2%; + } + } + } + .imgBox_one { + width: 60px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_info { + width: 200px; + padding: 6px; + overflow: hidden; + border: solid 1px #eee; + .title { + width: 100%; + line-height: 30px; + text-align: center; + } + .infoBox { + .name { + line-height: 28px; + } + .map { + width: 100%; + text-align: center; + img { + width: 90%; + } + } + } + } + .hint { + margin: 0 0 0 10px; + color: #f00; + } + .addBtn { + margin: 0 0 10px 0; + } + } + .overflowText { + display: -webkit-box; + max-width: 200px; + overflow: hidden; + text-align: left; + text-overflow: -o-ellipsis-lastline; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + line-clamp: 1; + -webkit-box-orient: vertical; + } \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.html b/src/app/routes/partner/knowledge/banner/components/list/list.component.html new file mode 100644 index 00000000..d533734b --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.html @@ -0,0 +1,62 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + + +
    diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.less b/src/app/routes/partner/knowledge/banner/components/list/list.component.less new file mode 100644 index 00000000..0aae2779 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.less @@ -0,0 +1 @@ +@import '~@delon/theme/index'; diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts b/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts new file mode 100644 index 00000000..3bd8060c --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BannerComponentsListComponent } from './list.component'; + +describe('BannerComponentsListComponent', () => { + let component: BannerComponentsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BannerComponentsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BannerComponentsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.component.ts b/src/app/routes/partner/knowledge/banner/components/list/list.component.ts new file mode 100644 index 00000000..aae33fa5 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.component.ts @@ -0,0 +1,239 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { BannerService } from '../../services/banner.service'; + +@Component({ + selector: 'app-banner-components-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.less'] +}) + +export class BannerComponentsListComponent implements OnInit { + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + appList: any[] = []; + _$expand = false; + selectApp = { + appName: '', + appId: '' + }; + isLoading: boolean = false; + + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor(public service: BannerService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (params.status === '') { + delete params.status; + } + if (params.style === '') { + delete params.style; + } + if (params.navigationId === '') { + delete params.navigationId; + } + return { ...params}; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + selectAppFun(item: any) { + this.selectApp = item; + this.st.load(1); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + name: { + type: 'string', + title: 'banner名称', + maxLength: 10, + ui: { + widget: '', + placeholder: '请输入', + } + }, + status: { + type: 'string', + title: '状态', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '正常', value: 2 }, + { label: '禁用', value: 3 } + ] + }, + }, + }; + this.ui = { + '*': { + spanLabelFixed: 110, + grid: { span: 8 }, + }, + }; + } + + initST() { + this.columns = [ + { + title: 'banner名称', // 位:px + index: 'name', + className: 'text-center' + }, + { + title: 'banner', + index: 'navigationName', + className: 'text-center' + }, + { + title: '排序', // 位 px + index: 'sortId', + className: 'text-center' + }, + { + title: '状态', // 位 px + index: 'style', + className: 'text-center', + type: 'enum', + enum: { + 1: '正常', + 2: '禁用', + } + }, + { + title: '最后修改时间', // 位 px + index: 'createTime', + className: 'text-center' + }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 280, + buttons: [ + { + text: '修改', + click: (item) => { + this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar }); + } + }, + { + text: '禁用', + pop: { + title: `确定禁用此banner图吗??`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item.id); + }, + iif: (item) => item.status === 1 + }, + { + text: '启用', + pop: { + title: `确定启用此banner图吗?`, + okType: 'danger', + icon: 'success', + }, + click: (item) => { + this.changeStatus(item); + }, + iif: (item) => item.status === 2 + }, + ], + }, + ]; + } + changeStatus(item: any) { + const params = { + status, + idList: [item.id] + }; + // this.service.request(this.service.$api_openOrClose, params).subscribe(res => { + // if (res) { + // this.st.reload(); + // } + // }); + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + + /** + * 新增单个实例 + */ + add() { + this.router.navigate(['../banner/detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar }); + } + + /** + * 删除单个实例 + */ + del(item: any) { + const ids = []; + ids.push(item.id); + this.service.request(this.service.$api_del_many, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.reload(); + } + }); + } +} diff --git a/src/app/routes/partner/knowledge/banner/components/list/list.less b/src/app/routes/partner/knowledge/banner/components/list/list.less new file mode 100644 index 00000000..d9b6c73f --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/components/list/list.less @@ -0,0 +1,9 @@ +.selectApp { + display: flex; + .appTitle { + font-size: 14px; + } + } + .redfont{ + color: #f00; + } \ No newline at end of file diff --git a/src/app/routes/partner/knowledge/banner/services/banner.service.ts b/src/app/routes/partner/knowledge/banner/services/banner.service.ts new file mode 100644 index 00000000..6710ef04 --- /dev/null +++ b/src/app/routes/partner/knowledge/banner/services/banner.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class BannerService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html new file mode 100644 index 00000000..855ada53 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.html @@ -0,0 +1,8 @@ + + + + diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts new file mode 100644 index 00000000..e31fd9c9 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerEditComponent } from './edit.component'; + +describe('PartnerEditComponent', () => { + let component: PartnerEditComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerEditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts new file mode 100644 index 00000000..817ac254 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/edit/edit.component.ts @@ -0,0 +1,111 @@ +import { Component, OnInit } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { ClassificationService } from '../../services/classification.service'; + +@Component({ + selector: 'app-partner-edit', + templateUrl: './edit.component.html', +}) +export class PartnerEditComponent implements OnInit { + record: any = {}; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + status = 'add'; + + constructor( + private modal: NzModalRef, + public service: ClassificationService + ) { } + + ngOnInit(): void { + if (this.i) { + this.i.icon = [ + { + uid: -1, + name: 'xxx.png', + status: 'done', + url: this.i.url, + response: { + resource_id: 1, + }, + }, + ] + } + this.initSF(); + + } + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '分类名称', + type: 'string', + maxLength: 5, + ui: { + placeholder: '请输入', + }, + }, + icon: { + type: 'string', + title: '图标', + ui: { + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg', + limit: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸 88px * 88px)', + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + } + }, + abnormalCause2: { + title: '排序', + type: 'number', + maximum: 99, + minimum: 0, + ui: { + placeholder: '请输入', + widgetWidth: 350 + } + }, + }, + required: ['abnormalCause', 'icon', 'abnormalCause2'] + + } + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 20, gutter: 4 } }, }; + + } + + save(value: any): void { + this.service.request(`/user/${this.record.id}`, value).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.html b/src/app/routes/partner/knowledge/classification/components/list/list.component.html new file mode 100644 index 00000000..2947e9a8 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.html @@ -0,0 +1,28 @@ + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    + +
    + + + + + +
    diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts b/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts new file mode 100644 index 00000000..f63ab2ec --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { PartnerListComponent } from './list.component'; + +describe('PartnerListComponent', () => { + let component: PartnerListComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ PartnerListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PartnerListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/knowledge/classification/components/list/list.component.ts b/src/app/routes/partner/knowledge/classification/components/list/list.component.ts new file mode 100644 index 00000000..db88bed4 --- /dev/null +++ b/src/app/routes/partner/knowledge/classification/components/list/list.component.ts @@ -0,0 +1,173 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from 'src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component'; +import { AccountManagemantService } from 'src/app/routes/partner/account-management/services/account-managemant.service'; +import { PartnerEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-partner-list', + templateUrl: './list.component.html', +}) +export class PartnerKnowledgeClassificationListComponent implements OnInit { + url = `/user`; + schema!: SFSchema; + ui!: SFUISchema; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') private readonly sf!: SFComponent; + columns: STColumn[] = []; + + constructor(public service: AccountManagemantService, public modal: NzModalService) { } + /** + * 查询参数 + */ + get reqParams() { + const params = { ...this.sf?.value }; + return params + } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + abnormalCause: { + title: '分类ID', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause1: { + title: '分类名称', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + abnormalCause2: { + title: '状态', + type: 'string', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: '1' }, + { label: '禁用', value: '2' } + ], + default: '', + }, + } + } + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 } }, }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '分类ID', index: 'carNo', className: 'text-center', width: 150 }, + { title: '分类名称', render: 'carModelLabel', className: 'text-center', width: 200 }, + { title: '图标', render: 'icon', className: 'text-center', width: 200 }, + { title: '文章数', render: 'approvalStatus2', className: 'text-center', width: 120 }, + { title: '排序', render: 'approvalStatus3', className: 'text-center', width: 120 }, + { title: '状态', index: 'approvalStatus4', className: 'text-center', width: 120 }, + { title: '最后修改时间', index: 'approvalStatus4', className: 'text-center', width: 180 }, + { + title: '操作', + width: 150, + buttons: [ + { + text: '修改', + click: (_record) => this.edit(_record) + }, + { + text: '启用', + click: (_record) => this.operate(_record, 1) + }, + { + text: '禁用', + click: (_record) => this.operate(_record, 2) + } + ] + } + ]; + } + + resetSF() { + this.sf.reset(); + setTimeout(() => { + this.st.reset(); + }) + } + + /** + *新增 + * @param _record 当前行信息 + */ + add() { + const modalRef = this.modal.create({ + nzTitle: '新增分类', + nzContent: PartnerEditComponent, + nzWidth: 600, + nzComponentParams: { + i: null + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + + /** + *编辑 + * @param _record 当前行信息 + */ + edit(record: any) { + const modalRef = this.modal.create({ + nzTitle: '修改分类', + nzContent: PartnerEditComponent, + nzWidth: 600, + nzComponentParams: { + i: record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + + /** + *禁用或者启动 + * @param _record 当前行信息 + */ + operate(record: any, type = 1) { + this.modal.confirm({ + nzTitle: `确定${type === 1 ? '启用' : '禁用'}此分类吗?`, + nzOnOk: () => + this.service.request(this.service.$api_edit_one, { id: record.id }).subscribe((res) => { + if (res) { + this.st.load(1); + this.service.msgSrv.success(`${type === 1 ? '启用' : '禁用'}成功!`); + } + }), + }); + } + + /** + * + */ + export() { + + } + +} diff --git a/src/app/routes/demo/services/demo.service.ts b/src/app/routes/partner/knowledge/classification/services/classification.service.ts similarity index 61% rename from src/app/routes/demo/services/demo.service.ts rename to src/app/routes/partner/knowledge/classification/services/classification.service.ts index 0bc392c4..034cdb74 100644 --- a/src/app/routes/demo/services/demo.service.ts +++ b/src/app/routes/partner/knowledge/classification/services/classification.service.ts @@ -1,10 +1,11 @@ import { Injectable, Injector } from '@angular/core'; -import { BaseService } from 'src/app/shared/services'; +import { BaseService } from '@shared'; @Injectable({ providedIn: 'root' }) -export class DemoService extends BaseService { +export class ClassificationService extends BaseService { + constructor(public injector: Injector) { super(injector); } diff --git a/src/app/routes/partner/level-config/components/edit/edit.component.html b/src/app/routes/partner/level-config/components/edit/edit.component.html new file mode 100644 index 00000000..ba3e7981 --- /dev/null +++ b/src/app/routes/partner/level-config/components/edit/edit.component.html @@ -0,0 +1,7 @@ + + + +
    + + +
    diff --git a/src/app/routes/partner/level-config/components/edit/edit.component.ts b/src/app/routes/partner/level-config/components/edit/edit.component.ts new file mode 100644 index 00000000..029381d5 --- /dev/null +++ b/src/app/routes/partner/level-config/components/edit/edit.component.ts @@ -0,0 +1,85 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent } from 'src/app/shared/components/amap'; +import { ChannelSalesService } from '../../services/level-config.service'; + +@Component({ + selector: 'app-parter-LevelConfig-edit', + templateUrl: './edit.component.html' +}) +export class ParterLevelConfigEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + i: any; + type: any; + + constructor( + public http: _HttpClient, + private cdr: ChangeDetectorRef, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: ChannelSalesService, + private modalRef: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + id: { + type: 'string', + title: '', + ui: { hidden: true } + }, + gradeName: { + title: '等级名称', + type: 'string', + }, + sortId: { + title: '排序', + type: 'string', + }, + remark: { + type: 'string', + title: '备注', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请输入50字符' + } as SFTextareaWidgetSchema, + }, + }, + required: ['gradeName', 'sortId', 'remark'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + }, + }; + } + + close() { + this.modalRef.destroy(); + } + save() { + this.sf.validator({ emitError: true }); + if(!this.sf.valid) return; + this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!') + this.modalRef.destroy(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } +} diff --git a/src/app/routes/partner/level-config/components/list/list.component.html b/src/app/routes/partner/level-config/components/list/list.component.html new file mode 100644 index 00000000..e6f50f99 --- /dev/null +++ b/src/app/routes/partner/level-config/components/list/list.component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/app/routes/partner/level-config/components/list/list.component.ts b/src/app/routes/partner/level-config/components/list/list.component.ts new file mode 100644 index 00000000..e079f0e7 --- /dev/null +++ b/src/app/routes/partner/level-config/components/list/list.component.ts @@ -0,0 +1,190 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ChannelSalesService } from '../../services/level-config.service'; +import { ParterLevelConfigEditComponent } from '../edit/edit.component'; + +@Component({ + selector: 'app-parter-LevelConfig-list', + templateUrl: './list.component.html' +}) +export class ParterLevelConfigListComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + + data=[{name1:1111}] + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: ChannelSalesService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { ...this.sf?.value }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + gradeName: { + type: 'string', + title: '等级姓名', + }, + stateLocked: { + type: 'string', + title: '状态', + enum:[{label:'启用',value:'1'},{label:'禁用',value:'0'}], + ui:{ + widget:'select', + } + }, + } + }; + this.ui = { + '*': { + width:300, + grid: { span: 12, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '等级姓名', + index: 'gradeName' + }, + { + title: '备注', + index: 'remark' + }, + { + title: '创建时间', + index: 'createTime' + }, + { + title: '启用时间', + index: 'enableTime' + }, + { + title: '状态', + index: 'stateLocked', + format: (item: any) => { + return item.stateLocked ? '禁用':'启用' + } + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: (_record, _modal, _instance) => this.edit(_record), + }, + { + text: '禁用', + click: (_record, _modal, _instance) => this.stop(_record), + iif:(item)=>!item.stateLocked + }, + { + text: '启用', + click: (_record, _modal, _instance) => this.restart(_record), + iif:(item)=>item.stateLocked + } + ] + } + ]; + } + + add() { + const modalRef = this.modalService.create({ + nzWidth:500, + nzTitle: '新增', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + edit(record: STData) { + const modalRef = this.modalService.create({ + nzWidth:500, + nzTitle: '编辑', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { i: record, type: this.spuStatus } + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.reload(); + } + }); + } + + // 编辑 + view(record: STData) { + const modalRef = this.modalService.create({ + nzTitle: '查看', + nzContent: ParterLevelConfigEditComponent, + nzComponentParams: { i: record } + }); + } + + restart(item: any) { + this.modalService.confirm({ + nzTitle: '启用确认', + nzContent: `确定启用该账号吗?
    `, + nzOnOk: () => + this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => { + if (res) { + this.service.msgSrv.success('启用成功!'); + this.st.reload(); + } + }) + }); + } + stop(item: any) { + this.modalService.confirm({ + nzTitle: '禁用确认', + nzContent: `确定禁用该账号吗?
    `, + nzOnOk: () => + this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => { + if (res) { + this.service.msgSrv.success('禁用成功!'); + this.st.reload(); + } + }) + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + + +} diff --git a/src/app/routes/partner/level-config/services/level-config.service.ts b/src/app/routes/partner/level-config/services/level-config.service.ts new file mode 100644 index 00000000..df8e18b3 --- /dev/null +++ b/src/app/routes/partner/level-config/services/level-config.service.ts @@ -0,0 +1,22 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ChannelSalesService extends BaseService { + // 查询合伙人等级配置表 + $api_getList = '/api/mdc/partnerGradeConfig/list/page'; + // 获取合伙人等级配置表 + $api_getPartnerGradeConfig = '/api/mdc/partnerGradeConfig/get'; + // 保存合伙人等级配置表 + $api_save = '/api/mdc/partnerGradeConfig/save'; + // 删除合伙人等级配置表 + $api_del = '/api/mdc/partnerGradeConfig/deletebatch'; + // 启用/禁用等级配置 + $api_updatePartnerGradeConfig = '/api/mdc/partnerGradeConfig/updatePartnerGradeConfig'; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html new file mode 100644 index 00000000..bd95c61e --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html @@ -0,0 +1,91 @@ + + + + + + + + + +
    企业基本信息
    +
    + +
    + 请上传营业执照原件的高清照片,若上传复印件,则需加盖公司印章; +
    上传后系统会自动识别并填写
    +
    +
    + +
    万元
    +
    + + + +
    营业执照法人信息
    +
    + +
    +
    请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
    +
    上传后系统会自动识别并填写
    +
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    + + + +
    企业管理员信息
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    + + + +
    所属城市
    +
    + + + +
    渠道销售
    +
    +
    + +
    + + +
    +
    diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less new file mode 100644 index 00000000..6b70e074 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.less @@ -0,0 +1,68 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + + .pa { + position: absolute; + top : 50px; + left : 150px; + } + + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } + } \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts new file mode 100644 index 00000000..14efa97f --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts @@ -0,0 +1,666 @@ +import { Component, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { + SFUploadWidgetSchema, + SFComponent, + SFSchema, + SFUISchema, + SFDateWidgetSchema, + SFCheckboxWidgetSchema, + SFTreeSelectWidgetSchema +} from '@delon/form'; +import { NzTreeNode } from 'ng-zorro-antd/tree'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of, Subscription } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { PartnerListService } from '../../services/partner-list.service'; + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-add-etp-partner', + templateUrl: './add-etp-partner.component.html', + styleUrls: ['./add-etp-partner.component.less'] +}) +export class AddEtpPartnerComponent { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $_basicInfoTitle: { + spanLabelFixed: 0 + }, + $_legalPersontitle: { + spanLabelFixed: 0 + }, + $_isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + getIdentityInfoSub = new Subscription(); + loadingIdentityInfoSub = false; + + constructor(public service: PartnerListService) {} + + submitForm() { + if (!this.sf.valid) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('请修改填写错误信息'); + return; + } + if (this.sf.value.cityCodesList?.length > 3) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + // 校验企业营业期限 + const operatingStartTime = new Date(this.sf.value.operatingStartTime); + const operatingEndTime = new Date(this.sf.value.operatingEndTime); + if (operatingStartTime.getTime() > operatingEndTime.getTime()) { + this.service.msgSrv.warning('营业截止日期不能小于开始日期'); + return; + } + // 校验法人证件有效期限 + if (this.sf.value.legalPersonIdentity.validEndTime) { + const validStartTime = new Date(this.sf.value.legalPersonIdentity.validStartTime); + const validEndTime = new Date(this.sf.value.legalPersonIdentity.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('法人证件有效截止日期不能小于开始日期'); + return; + } + } + // 校验管理员证件有效期限 + if (this.sf.value.adminUserInfo.validEndTime) { + const validStartTime = new Date(this.sf.value.adminUserInfo.validStartTime); + const validEndTime = new Date(this.sf.value.adminUserInfo.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('管理员证件有效截止日期小于开始日期'); + return; + } + } + const params = {}; + Object.assign(params, { ...this.sf.value, source: 2 }); + // console.log(params); + + this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增企业合伙人成功'); + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/legalPersonIdentity/name', res.name); + } + if (res.number) { + this.sf.setValue('/legalPersonIdentity/certificateType', 0); + this.sf.setValue('/legalPersonIdentity/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/legalPersonIdentity/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/legalPersonIdentity/validEndTime', res.validTo); + this.sf.setValue('/legalPersonIdentity/_isLoingDate', false); + } else { + this.sf.setValue('/legalPersonIdentity/_isLoingDate', true); + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/adminUserInfo/name', res.name); + } + if (res.number) { + this.sf.setValue('/adminUserInfo/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/adminUserInfo/validEndTime', res.validTo); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + if (res.registrationNumber) { + this.sf.setValue('/unifiedSocialCreditCode', res.registrationNumber); + } + if (res.name) { + this.sf.setValue('/enterpriseName', res.name); + } + if (res.businessTermStartDate) { + this.sf.setValue('/operatingStartTime', res.businessTermStartDate); + } + if (res.businessTermEndDate) { + this.sf.setValue('/operatingEndTime', res.businessTermEndDate); + this.sf.setValue('/_isLoingDate', false); + } else { + this.sf.setValue('/_isLoingDate', true); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + // 企业基本信息 + _basicInfoTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + _licenseTips: { title: '营业执照', type: 'string', ui: { widget: 'custom' }, default: true }, + licensePhoto: { title: '', type: 'string', ui: { hidden: true } }, + licensePhotoWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); + this.checkBusinessLicense(args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + unifiedSocialCreditCode: { + title: '统一社会信用代码', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + optionalHelp: + '为了企业用户的使用体验,若公司代码即统一社会信用代码已在本应用其他关联平台注册,则此处填写的公司资料将同步更新至对应已注册的平台', + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入18位公司代码' + } + } + }, + enterpriseName: { + title: '公司名称', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入公司名称' + } + } + }, + operatingStartTime: { + title: '营业期限', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + operatingEndTime: { + title: '', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/operatingEndTime', null) + } as SFCheckboxWidgetSchema + }, + + // 法人信息 + legalPersonIdentity: { + type: 'object', + properties: { + _legalPersontitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + _certificatePhototips: { title: '法定代表人证件照', type: 'string', ui: { widget: 'custom' }, default: true }, + _certificatePhotoExmplateA: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/legalPersonIdentity/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1); + } + } + } as SFUploadWidgetSchema + }, + _certificatePhotoExmplateB: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/legalPersonIdentity/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '法人代表姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的法人姓名' + } + }, + certificateType: { + type: 'string', + title: '法人证件类型', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select' + } + }, + certificateNumber: { + title: ' 法定代表人证件号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法定代表人证件号' + } + }, + validStartTime: { + title: '法人证件有效开始日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '法人证件有效截止日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/legalPersonIdentity/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/legalPersonIdentity/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: [ + '_certificatePhototips', + 'certificatePhotoFront', + 'certificatePhotoBack', + 'name', + 'certificateType', + 'certificateNumber', + 'validStartTime' + ] + }, + _adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + adminMobile: { + title: ' 企业管理员手机号', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员手机号', + errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' }, + change: (mobile: any) => { + // 根据手机号获取实名信息 + if (mobile?.length === 11) { + if (this.loadingIdentityInfoSub) { + this.getIdentityInfoSub.unsubscribe(); + } + this.loadingIdentityInfoSub = true; + this.getIdentityInfoSub = this.service.request(this.service.$api_get_identityInfo_by_mobile, { mobile }).subscribe( + res => { + if (res) { + this.setInfo(res); + this.sf.setValue('/adminUserInfo/id', res.id); + this.sf.setValue('/adminUserInfo/userId', res.userId); + } + this.loadingIdentityInfoSub = false; + }, + _ => {}, + () => (this.loadingIdentityInfoSub = false) + ); + } + } + } + }, + // 企业管理员信息 + adminUserInfo: { + type: 'object', + properties: { + _adminCertificatePhotoTipsA: { + title: '企业管理员证件照', + type: 'string', + ui: { + widget: 'custom' + }, + default: true + }, + id: { title: '', type: 'string', ui: { hidden: true } }, + userId: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0); + } + } + } as SFUploadWidgetSchema + }, + _adminCertificatePhotoTipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 0); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '企业管理员姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员姓名' + } + }, + certificateNumber: { + title: '企业管理员身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员身份证号' + } + }, + validStartTime: { + title: '身份证有效开始日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '身份证有效截止日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/adminUserInfo/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: ['_adminCertificatePhotoTipsA', 'name', 'certificateNumber', 'operatingStartTime'] + }, + // 所属城市 + _addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + cityCodesList: { + type: 'string', + title: '所属城市', + ui: { + widget: 'tree-select', + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请选择城市(最多3个)', + checkable: true, + class: 'city-tree-select', + asyncData: () => + this.getRegionDetailByCode('').pipe( + map((res: any) => + res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, disabled: true, isDisableCheckbox: true })) + ) + ), + expandChange: ({ node }: { node: NzTreeNode }) => + this.getRegionDetailByCode(node.key).pipe( + map((res: any) => res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, isLeaf: true }))) + ) + } as SFTreeSelectWidgetSchema + }, + // 渠道销售 + _channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + invitationCode: { + title: '渠道销售邀请码', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入渠道销售邀请码', + errors: { + required: '请输入渠道销售邀请码' + } + } + } + }, + required: [ + '_licenseTips', + 'licensePhotoWatermark', + 'unifiedSocialCreditCode', + 'enterpriseName', + 'operatingStartTime', + 'cityCodesList', + 'adminMobile', + 'invitationCode' + ] + }; + } + + private setInfo(info: any) { + if (info.name) { + this.sf.setValue('/adminUserInfo/name', info.name); + } + if (info.certificatePhotoFront) { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', info.certificatePhotoFront); + } + if (info.certificatePhotoFrontWatermark) { + console.log(this.sf.getProperty('/adminUserInfo/certificatePhotoFrontWatermark')); + + this.sf.setValue('/adminUserInfo/certificatePhotoFrontWatermark', [ + { + uid: -1, + name: '文件', + status: 'done', + url: info.certificatePhotoFrontWatermark, + response: info.certificatePhotoFrontWatermark + } + ]); + } + if (info.certificatePhotoBack) { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', info.certificatePhotoBack); + } + if (info.certificatePhotoBackWatermark) { + this.sf.setValue('/adminUserInfo/certificatePhotoBackWatermark', [ + { + uid: -1, + name: '文件', + status: 'done', + url: info.certificatePhotoBackWatermark, + response: info.certificatePhotoBackWatermark + } + ]); + } + if (info.certificateNumber) { + this.sf.setValue('/adminUserInfo/certificateNumber', info.certificateNumber); + } + if (info.validStartTime) { + this.sf.setValue('/adminUserInfo/validStartTime', info.validStartTime); + } + if (info.validEndTime) { + this.sf.setValue('/adminUserInfo/validEndTime', info.validEndTime); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } +} diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html new file mode 100644 index 00000000..7a071adc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html @@ -0,0 +1,49 @@ + + + + + + + + + +
    合伙人信息
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    + + + +
    所属城市
    +
    + + + +
    渠道销售
    +
    +
    + +
    + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less new file mode 100644 index 00000000..6b70e074 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.less @@ -0,0 +1,68 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + + .pa { + position: absolute; + top : 50px; + left : 150px; + } + + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } + } \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts new file mode 100644 index 00000000..d21416e3 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts @@ -0,0 +1,388 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { + SFUploadWidgetSchema, + SFComponent, + SFSchema, + SFUISchema, + SFDateWidgetSchema, + SFCheckboxWidgetSchema, + SFTreeSelectWidgetSchema +} from '@delon/form'; +import { NzTreeNode } from 'ng-zorro-antd/tree'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of, Subscription } from 'rxjs'; +import { map } from 'rxjs/operators'; + +import { PartnerListService } from '../../services/partner-list.service'; + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-add-personal-partner', + templateUrl: './add-personal-partner.component.html', + styleUrls: ['./add-personal-partner.component.less'] +}) +export class AddPersonalPartnerComponent { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $_basicInfoTitle: { + spanLabelFixed: 0 + }, + $_legalPersontitle: { + spanLabelFixed: 0 + }, + $_isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + getIdentityInfoSub = new Subscription(); + loadingIdentityInfoSub = false; + + constructor(private router: Router, public service: PartnerListService) {} + + submitForm() { + if (!this.sf.valid) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('请修改填写错误信息'); + return; + } + if (this.sf.value.cityCodesList?.length > 3) { + this.sf.validator({ emitError: true }); + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + if (this.sf.value.validEndTime) { + const validStartTime = new Date(this.sf.value.validStartTime); + const validEndTime = new Date(this.sf.value.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('身份证有效截止日期不能小于开始日期'); + return; + } + } + const params = {}; + Object.assign(params, { ...this.sf.value, source: 2 }); + + this.service.request(this.service.$api_save_personal_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增个人合伙人成功'); + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/adminUserInfo/name', res.name); + } + if (res.number) { + this.sf.setValue('/adminUserInfo/certificateType', 0); + this.sf.setValue('/adminUserInfo/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf.setValue('/adminUserInfo/validEndTime', res.validTo); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + _adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + mobile: { + title: ' 手机号', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入手机号', + errors: { required: '请输入手机号', format: '手机号格式错误' }, + change: (mobile: any) => { + // 根据手机号获取实名信息 + if (mobile?.length === 11) { + if (this.loadingIdentityInfoSub) { + this.getIdentityInfoSub.unsubscribe(); + } + this.loadingIdentityInfoSub = true; + this.getIdentityInfoSub = this.service.request(this.service.$api_get_identityInfo_by_mobile, { mobile }).subscribe( + res => { + if (res) { + this.setInfo(res); + this.sf.setValue('/adminUserInfo/id', res.id); + this.sf.setValue('/adminUserInfo/userId', res.userId); + } + this.loadingIdentityInfoSub = false; + }, + _ => {}, + () => (this.loadingIdentityInfoSub = false) + ); + } + } + } + }, + // 合伙人信息 + adminUserInfo: { + type: 'object', + properties: { + _adminCertificatePhotoTipsA: { + title: '证件照', + type: 'string', + ui: { + widget: 'custom' + }, + default: true + }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + id: { title: '', type: 'string', ui: { hidden: true } }, + userId: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificateType: { title: '', type: 'string', ui: { hidden: true }, default: 0 }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front'); + } + } + } as SFUploadWidgetSchema + }, + _adminCertificatePhotoTipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back'); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入姓名' + } + }, + certificateNumber: { + title: '身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入身份证号' + } + }, + validStartTime: { + title: '身份证有效开始日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '身份证有效截止日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf?.setValue('/adminUserInfo/_isLoingDate', false); + } + } as SFDateWidgetSchema + }, + _isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: ['_adminCertificatePhotoTipsA', 'adminMobile', 'name', 'certificateNumber', 'validStartTime'] + }, + // 所属城市 + _addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + cityCodesList: { + type: 'string', + title: '所属城市', + ui: { + widget: 'tree-select', + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请选择城市(最多3个)', + checkable: true, + class: 'city-tree-select', + asyncData: () => + this.getRegionDetailByCode('').pipe( + map((res: any) => + res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, disabled: true, isDisableCheckbox: true })) + ) + ), + expandChange: ({ node }: { node: NzTreeNode }) => + this.getRegionDetailByCode(node.key).pipe( + map((res: any) => res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, isLeaf: true }))) + ) + } as SFTreeSelectWidgetSchema + }, + // 渠道销售 + _channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } }, + invitationCode: { + title: '渠道销售邀请码', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入渠道销售邀请码', + errors: { + required: '请输入渠道销售邀请码' + } + } + } + }, + required: ['cityCodesList', 'invitationCode'] + }; + } + + private setInfo(info: any) { + if (info.name) { + this.sf.setValue('/adminUserInfo/name', info.name); + } + if (info.certificatePhotoFront) { + this.sf.setValue('/adminUserInfo/certificatePhotoFront', info.certificatePhotoFront); + } + if (info.certificatePhotoFrontWatermark) { + console.log(this.sf.getProperty('/adminUserInfo/certificatePhotoFrontWatermark')); + + this.sf.setValue('/adminUserInfo/certificatePhotoFrontWatermark', [ + { + uid: -1, + name: '文件', + status: 'done', + url: info.certificatePhotoFrontWatermark, + response: info.certificatePhotoFrontWatermark + } + ]); + } + if (info.certificatePhotoBack) { + this.sf.setValue('/adminUserInfo/certificatePhotoBack', info.certificatePhotoBack); + } + if (info.certificatePhotoBackWatermark) { + this.sf.setValue('/adminUserInfo/certificatePhotoBackWatermark', [ + { + uid: -1, + name: '文件', + status: 'done', + url: info.certificatePhotoBackWatermark, + response: info.certificatePhotoBackWatermark + } + ]); + } + if (info.certificateNumber) { + this.sf.setValue('/adminUserInfo/certificateNumber', info.certificateNumber); + } + if (info.validStartTime) { + this.sf.setValue('/adminUserInfo/validStartTime', info.validStartTime); + } + if (info.validEndTime) { + this.sf.setValue('/adminUserInfo/validEndTime', info.validEndTime); + this.sf.setValue('/adminUserInfo/_isLoingDate', false); + } else { + this.sf.setValue('/adminUserInfo/_isLoingDate', true); + } + } +} diff --git a/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.html b/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.html new file mode 100644 index 00000000..a9d9fe7e --- /dev/null +++ b/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.html @@ -0,0 +1,13 @@ +

    转移客户数:{{changeST?.total}}

    + + +

    不转移客户数:{{noChangeST?.total}}

    + + +

    + 客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,修改成功后,修改时间也是合伙人与客户的结算结束时间,成为原来渠道销售的直客。 +

    \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.less b/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.ts b/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.ts new file mode 100644 index 00000000..6fc1e963 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/channel-log-modal/channel-log-modal.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { PartnerListService } from '../../services/partner-list.service'; + +@Component({ + selector: 'app-channel-log-modal', + templateUrl: './channel-log-modal.component.html' +}) +export class ChannelLogModalComponent implements OnInit { + columns: { changeColumn: STColumn[]; beChangeColumn: STColumn[] } = this.initST(); + id = ''; + constructor(public service: PartnerListService, public route: ActivatedRoute) {} + + ngOnInit(): void {} + + private initST(): { changeColumn: STColumn[]; beChangeColumn: STColumn[] } { + return { + changeColumn: [ + { title: '客户名称', index: 'payCode', width: 180 }, + { title: '合伙人', index: 'ltdName', width: 160 }, + { title: '渠道销售', index: 'payDate', className: 'text-center', width: 130 }, + { title: 'CRM审核状态', index: 'payDate', width: 150 }, + { title: '生效时间', index: 'payDate', className: 'text-center', width: 130 } + ], + beChangeColumn: [ + { title: '客户名称', index: 'payCode', width: 180 }, + { title: '合伙人', index: 'ltdName', width: 160 }, + { title: '渠道销售', index: 'payDate', className: 'text-center', width: 130 }, + { title: '生效时间', index: 'payDate', className: 'text-center', width: 130 } + ] + }; + } +} diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.html b/src/app/routes/partner/partner-list/components/index/partner-list.component.html new file mode 100644 index 00000000..ff6f4383 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.html @@ -0,0 +1,78 @@ + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + +
    + + +
    + + + +
    + + +
    +
    + {{selectItem?.enterpriseName || selectItem?.contactName}} + + + + + +
    +
    +

    说明:修改模板后,当月开始返佣收益将会按新模板计算

    +
    + + +
    +
    + {{selectItem?.enterpriseName || selectItem?.contactName}} + {{selectItem?.channelId}} + + + + + + + + + +

    已选(0)

    + + +
    + + + + + + +
    +
    +

    客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,成为渠道销售的直客

    +
    \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts new file mode 100644 index 00000000..ae12b403 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts @@ -0,0 +1,482 @@ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFAutoCompleteWidgetSchema, SFSelectWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-partner-list', + templateUrl: './partner-list.component.html', + styleUrls: ['../../../../commom/less/box.less'] +}) +export class PartnerListComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + _$expand = false; + + @ViewChild('editTemplate', { static: true }) + editTemplate: any; + templateId: any; + templates: any[] = []; + + @ViewChild('editCannel', { static: true }) + editCannel: any; + customers: any[] = []; + cannels: any[] = []; + selectedRows: any[] = []; + cannelItem: any = { channelId: null, effectiveNode: 1, enterpriseIdList: [], remark: '' }; + + selectItem: any = {}; + + constructor(public service: PartnerListService, private nzModalService: NzModalService, private router: Router) { + this.loadSelectOptions(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + let params = { ...this.sf.value }; + if (params.createTime) { + params.createTime = { start: this.sf?.value?.createTime?.[0], end: this.sf?.value?.createTime?.[1] }; + } + Object.assign(requestOptions.body, params); + } + return requestOptions; + }; + + loadSelectOptions() { + this.service.getRebateConfig().subscribe(res => { + if (res) { + this.customers = res; + } + }); + this.service.getChannel().subscribe(res => { + if (res) { + this.cannels = res; + } + }); + } + + auditPartner(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { info: { ...item, enterpriseName: item.enterpriseName || item.contactName }, sourcePage: '合伙人审核列表' }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + modal.destroy(); + }); + } + + editTemplateAction(item: any) { + this.selectItem = item; + this.templateId = item.templateId || null; + const modal = this.nzModalService.create({ + nzTitle: '修改返佣模板', + nzContent: this.editTemplate, + nzOnOk: () => { + if (!this.templateId) { + this.service.msgSrv.warning('请选择返佣模板'); + return false; + } + this.confirmEditTemplate(); + return false; + } + }); + } + + private confirmEditTemplate() { + const modal = this.nzModalService.confirm({ + nzTitle: '确定要修改返佣模板吗?', + nzOnOk: () => { + this.service + .request(this.service.$api_update_partner_template, { + id: this.selectItem.id, + templateId: this.templateId + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + this.nzModalService.closeAll(); + } + }); + return false; + } + }); + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + editCannelAction(item: any) { + this.selectItem = item; + this.cannelItem = { channelId: null, effectiveNode: 1, enterpriseIdList: [], remark: '' }; + this.selectedRows = []; + // 校验合伙人是否可修改渠道销售 true:可以修改 false:不可以修改 + this.service.request(this.service.$api_check_partenr_change_channel, { id: item.id }).subscribe(res => { + if (res) { + this.selectItem = item; + const modal = this.nzModalService.create({ + nzTitle: '修改渠道销售', + nzWidth: 650, + nzContent: this.editCannel, + nzOnOk: () => { + if (!this.cannelItem.channelId) { + this.service.msgSrv.warning('请选择渠道销售'); + return false; + } + if (!this.cannelItem.remark) { + this.service.msgSrv.warning('请填写备注'); + return false; + } + this.confirmEditCannel(item); + return false; + } + }); + } + }); + } + + confirmEditCannel(item: any) { + const modal = this.nzModalService.confirm({ + nzTitle: '确定提交吗?', + nzOnOk: () => { + this.cannelItem.enterpriseIdList = this.selectedRows.map(row => row.id); + this.service + .request(this.service.$api_update_partner_channel_by_id, { + ...this.cannelItem, + id: item.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.nzModalService.closeAll(); + this.st.load(1); + } + }); + } + }); + } + + /** + * 重新发起crm + * @param item + */ + reSendCRM(item: any) { + const modal = this.nzModalService.confirm({ + nzTitle: '是否确定重新发起CRM?', + nzOnOk: () => { + this.service + .request(this.service.$api_resend_crm, { + id: item.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('发起成功'); + } else { + this.service.msgSrv.warning('发起失败'); + } + this.st.load(1); + }); + } + }); + } + + routeTo(route: string) { + this.router.navigate([route]); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + enterpriseName: { + type: 'string', + title: '合伙人名称' + }, + contactName: { + type: 'string', + title: '企业管理员' + }, + contactMobile: { + type: 'string', + title: '手机号' + }, + channelId: { + type: 'string', + title: '渠道销售', + ui: { + widget: 'select', + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service.getChannel({ name: str }).toPromise(); + } else { + return of([]); + } + } + } as SFSelectWidgetSchema + }, + partnerType: { + type: 'string', + title: '类型', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '企业' }, + { value: 2, label: '个人' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + approvalStatus: { + type: 'string', + title: '认证审核状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + signStatus: { + type: 'string', + title: '签约状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + crmStatus: { + type: 'string', + title: 'CRM状态', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'pay:mode' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + paymo11de: { + type: 'string', + title: '注册渠道', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '合伙人注册' }, + { value: 2, label: '平台添加' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + templateId: { + type: 'string', + title: '返佣模板', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + lockedStatus: { + type: 'string', + title: '合伙人状态', + enum: [ + { value: '', label: '全部' }, + { value: 0, label: '启用' }, + { value: 1, label: '冻结' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + createTime: { + title: '注册时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { + title: '合伙人名称', + index: 'contactName', + width: 180 + }, + { title: '付款编码', index: 'payCode', width: 160 }, + { title: '邀请码', index: 'invitationCode', className: 'text-center', width: 130 }, + { title: '企业管理员', index: 'adminName', width: 150 }, + { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, + { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, + { title: '注册渠道', index: 'source', type: 'enum', enum: { 1: '合伙人注册', 2: '平台添加' }, width: 130 }, + { title: '注册时间', index: 'createTime', className: 'text-center', width: 170 }, + { title: '渠道销售', index: 'channelIdLabel', width: 170 }, + { title: '返佣模板', index: 'templateName', width: 150 }, + { + title: '认证审核状态', + index: 'approvalStatus', + width: 150, + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 10: { text: '待审核', color: 'processing' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: '签约状态', + index: 'signStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '未发起', color: 'default' }, + 10: { text: '待合伙人签约', color: 'default' }, + 15: { text: '签约中', color: 'processing' }, + 20: { text: '平台签约完成', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: 'CRM状态', + index: 'crmStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '未发起', color: 'default' }, + 10: { text: '审核失败', color: 'error' }, + 20: { text: '审核通过', color: 'success' } + } + }, + { + title: '合伙人状态', + index: 'lockedStatus', + className: 'text-center', + width: 140, + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 1: { text: '冻结', color: 'error' } + } + }, + { + title: '操作', + fixed: 'right', + width: '150px', + buttons: [ + { type: 'divider' }, + { + text: '审核', + iif: item => item.id && item.approvalStatus === 10, + click: item => this.auditPartner(item) + }, + { + text: '详情
    ', + iif: item => item.id, + click: item => { + if (item.partnerType === 1) { + this.router.navigate([`/partner/partner-list/etp-detail/${item.id}`]); + } else { + this.router.navigate([`/partner/partner-list/personal-detail/${item.id}`]); + } + } + }, + { + text: '修改返佣模板', + iif: item => item.id, + click: item => this.editTemplateAction(item) + }, + { + text: '修改渠道销售', + iif: item => item.id, + click: item => this.editCannelAction(item) + }, + { + text: '重发CRM流程', + click: item => item.id && this.reSendCRM(item), + iif: item => item.crmStatus === 10 + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html new file mode 100644 index 00000000..fc8043d6 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html @@ -0,0 +1,7 @@ +
    + +
    + \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.less b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts new file mode 100644 index 00000000..f6fbcaac --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts @@ -0,0 +1,132 @@ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFValue } from '@delon/form'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { PartnerListService } from '../../services/partner-list.service'; + +@Component({ + selector: 'app-partner-audit-modal', + templateUrl: './partner-audit-modal.component.html', + styleUrls: ['./partner-audit-modal.component.less'] +}) +export class PartnerAuditModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @Input() + info: any; + schema!: SFSchema; + sourcePage = ''; + constructor(private nzModalService: NzModalService, public service: PartnerListService) {} + + ngOnInit(): void { + this.initSF(this.info); + } + + initSF(user: any) { + this.schema = { + properties: { + isPass: { + type: 'boolean', + ui: { + hidden: true + }, + default: this.info.isPass + }, + staffName: { + title: '合伙人名称', + type: 'string', + ui: { widget: 'text' }, + default: user.enterpriseName + }, + status: { + title: '审核结果', + type: 'string', + maxLength: 11, + enum: [ + { value: true, label: '通过' }, + { value: false, label: '驳回' } + ], + ui: { + widget: 'radio', + hidden: this.info.isPass !== undefined + }, + default: true + }, + channelId: { + title: '渠道销售', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getChannel(), + hidden: this.info.isPass === false, + visibleIf: { + status: value => value + }, + errors: { + required: ' ' + } + }, + default: '' + }, + approvalOpinion: { + title: '备注', + type: 'string', + maxLength: 100, + ui: { + widget: 'textarea', + placeholder: '请不要超过100个字', + autosize: { minRows: 3 }, + hidden: this.info.isPass === true, + visibleIf: { + status: value => !value || this.info.isPass === false + }, + errors: { + required: ' ' + } + } + } + }, + required: ['channelId', 'approvalOpinion'] + }; + } + + sure() { + if (this.info.isPass || this.sf.value.status) { + this.nzModalService.confirm({ + nzTitle: `确定以“${this.info.channelIdLabel}”的名义重新发起CRM《付款对象合同管理》吗?`, + nzOnOk: () => { + this.audit(); + } + }); + } else { + this.audit(); + } + } + + audit() { + const params: any = { + ...this.sf.value, + id: this.info.id, + auditStatusEnum: this.info.isPass || this.sf.value.status ? '20' : '30' + }; + this.service + .request(this.service.$api_audit_partner, { + ...params, + auditStatusEnum: params.auditStatusEnum, + id: params.id, + approvalOpinion: params.approvalOpinion, + sourcePage: this.sourcePage + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核成功!'); + this.close(); + } + }); + } + + close() { + this.nzModalService.closeAll(); + } +} diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html new file mode 100644 index 00000000..1606454d --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + 企业管理员信息 + + + + + + {{detailData.adminUserInfo.mobile}} + + + + + +
    + + + + +
    +
    + + + + - + + + + + + + + + +
    + + + + + + + + +

    + 四要素验证: + + + +

    +
    + + + {{detailData.enterpriseName}} + + + + {{detailData.unifiedSocialCreditCode}} + + + + + + + + + + - + + + + + + + + + +
    + + + 企业法人信息 + + + + + + + + + - + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + {{ enterpriseDefaultCityName || '-' }} + + +
    + + + 渠道销售信息 + {{ detailData?.channelName }} + {{ detailData?.channelMobile }} + {{ detailData?.bindChannelTime }} + +
    + + + + 修改渠道销售记录 + + + + + + + + +
    + +
    {{ title }} +
    +
    + {{ content }} +
    +
    +
    + + + + + +
    上传
    +
    +
    + + +
    +
    +
    diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less new file mode 100644 index 00000000..be442cbc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.less @@ -0,0 +1,37 @@ +@import '../../../../usercenter/less/edit.less'; + + +.user-info { + font-size: 16px; + + .enterprise-name { + margin-right: 15px; + } + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + .user-info-des { + margin-bottom: 5px; + } +} + +:host::ng-deep { + .affix { + position: fixed !important; + top : 20px !important; + z-index : 999 !important; + width : 100% !important; + } + + .image-hover .delete-icon { + top : unset !important; + right : unset !important; + margin-top : -15px; + margin-left: -15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts new file mode 100644 index 00000000..80a9aa45 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts @@ -0,0 +1,379 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; +import { Subscription, fromEvent } from 'rxjs'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { ChannelLogModalComponent } from '../channel-log-modal/channel-log-modal.component'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-partner-detail', + templateUrl: './partner-detail.component.html', + styleUrls: ['./partner-detail.component.less'], + providers: [DatePipe] +}) +export class PartnerDetailComponent implements OnInit, OnDestroy { + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; + + columns: STColumn[] = this.initST(); + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentity: { name: '' } }; + tempalateData = { ...this.detailData }; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; + + esignCheckStatus: any = { + 0: '不通过', + 1: '通过', + 2: '未认证' + }; + + scrollTop = 0; + subscribeScoll!: Subscription; + constructor( + public service: PartnerListService, + public route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} + ngOnDestroy(): void { + this.subscribeScoll.unsubscribe(); + } + + ngOnInit() { + this.initData(); + this.loadlAreaList(); + this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { + this.scrollTop = document.documentElement.scrollTop; + }); + } + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_ent_partner_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + // 存储数据源 + this.tempalateData = { ...this.detailData }; + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; + } + // 拼接渠道销售信息 + if (this.detailData?.channelIdLabel) { + const channel = (this.detailData.channelIdLabel as string).split('/'); + Object.assign(this.detailData, { + channelName: channel[0], + channelMobile: channel[1] + }); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + appUserId: [this.detailData.appUserId], + freezeOrResume: !!type, + pageName: '合伙人详情', + telephone: this.detailData.adminUserInfo.mobile + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + auditPartner(isPass: boolean) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { info: { ...this.detailData, isPass }, sourcePage: '合伙人审核详情' }, + nzFooter: null + }); + } + + ratify() { + this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'legalFront' || id === 'legalBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'legalFront' ? 'front' : 'back', 1); + } + if (id === 'certificateBackFront' || id === 'certificateBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'certificateBackFront' ? 'front' : 'back', 0); + } + if (id === 'detailPhoto') { + this.checkBusinessLicense(file.response.data?.fullFilePath); + } + } + } + + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + + /** + * 级联获取地区数据 + * + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( + res => { + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); + }, + _ => {}, + () => { + resolve(rs); + } + ); + }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + if (this.enterpriseAddressCode?.length > 3) { + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + const dateil = { ...this.detailData }; + Object.assign(dateil.legalPersonIdentity, { + validStartTime: this.datePipe.transform(dateil.legalPersonIdentity.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.legalPersonIdentity.validEndTime, 'yyyy-MM-dd') + }); + Object.assign(dateil.adminUserInfo, { + validStartTime: this.datePipe.transform(dateil.adminUserInfo.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.adminUserInfo.validEndTime, 'yyyy-MM-dd') + }); + const params = {}; + Object.assign(params, { + ...dateil, + cityCodesList: this.enterpriseAddressCode, + enterpriseRegistrationTime: this.datePipe.transform(dateil.enterpriseRegistrationTime, 'yyyy-MM-dd'), + operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), + operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd') + }); + + this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业合伙人修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.legalPersonIdentity.name = res.name; + } + if (res.number) { + this.detailData.legalPersonIdentity.certificateType = 0; + this.detailData.legalPersonIdentity.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.legalPersonIdentity.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.legalPersonIdentity.validEndTime = res.validTo; + } else { + this.detailData.legalPersonIdentity.validEndTime = null; + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.adminUserInfo.name = res.name; + } + if (res.number) { + this.detailData.adminUserInfo.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.adminUserInfo.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.adminUserInfo.validEndTime = res.validTo; + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + // if (res.registrationNumber) { + // this.detailData.unifiedSocialCreditCode = res.registrationNumber; + // } + // if (res.name) { + // this.detailData.enterpriseName = res.name; + // } + if (res.businessTermStartDate) { + this.detailData.operatingStartTime = res.businessTermStartDate; + } + if (res.businessTermEndDate) { + this.detailData.operatingEndTime = res.businessTermEndDate; + } else { + this.detailData.operatingEndTime = null; + } + } + }); + } + + private initST(): STColumn[] { + return [ + { title: '修改后渠道销售', index: 'newChannelIdLabel', width: 180 }, + { title: '修改前渠道销售', index: 'originalChannelIdLabel', width: 160 }, + { title: '转移客户数', index: 'quantity', className: 'text-center', width: 130 }, + { title: '生效节点', index: 'effectiveNode', width: 150, type: 'enum', enum: { 1: '立即生效', 2: 'CRM审核后生效' } }, + { title: '备注', index: 'remark', className: 'text-center', width: 150 }, + { title: '修改时间', index: 'effectiveTime', className: 'text-center', width: 180, type: 'date' }, + { title: '操作人', index: 'modifyUserIdLabel', width: 180 }, + { + title: '操作', + fixed: 'right', + width: '140px', + buttons: [ + { + text: '详情', + click: (item) => this.service.showChangeDetail(item.id) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html new file mode 100644 index 00000000..87573d13 --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + 合伙人信息 + + + + + + {{detailData.adminUserInfo.mobile}} + + + + + + + + - + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + {{ enterpriseDefaultCityName || '-' }} + + +
    + + + 渠道销售信息 + {{ detailData?.channelName }} + {{ detailData?.channelMobile }} + {{ detailData?.bindChannelTime }} + +
    + + + + 修改渠道销售记录 + + + + + + + + +
    + +
    {{ title }} +
    +
    + {{ content }} +
    +
    +
    + + + + + +
    上传
    +
    +
    + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less new file mode 100644 index 00000000..be442cbc --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.less @@ -0,0 +1,37 @@ +@import '../../../../usercenter/less/edit.less'; + + +.user-info { + font-size: 16px; + + .enterprise-name { + margin-right: 15px; + } + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + .user-info-des { + margin-bottom: 5px; + } +} + +:host::ng-deep { + .affix { + position: fixed !important; + top : 20px !important; + z-index : 999 !important; + width : 100% !important; + } + + .image-hover .delete-icon { + top : unset !important; + right : unset !important; + margin-top : -15px; + margin-left: -15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts new file mode 100644 index 00000000..ab33519c --- /dev/null +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts @@ -0,0 +1,301 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; +import { Subscription, fromEvent } from 'rxjs'; + +import { PartnerListService } from '../../services/partner-list.service'; +import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; + +@Component({ + selector: 'app-personal-partner-detail', + templateUrl: './personal-partner-detail.component.html', + styleUrls: ['./personal-partner-detail.component.less'], + providers: [DatePipe] +}) +export class PersonalPartnerDetailComponent implements OnInit { + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; + + columns: STColumn[] = this.initST(); + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentity: { name: '' } }; + tempalateData = { ...this.detailData }; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; + + constructor( + public service: PartnerListService, + public route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} + + ngOnInit() { + this.initData(); + this.loadlAreaList(); + } + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_personal_partner_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + console.log(this.detailData); + + this.tempalateData = { ...this.detailData }; + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; + } + if (this.detailData?.channelIdLabel) { + const channel = (this.detailData.channelIdLabel as string).split('/'); + Object.assign(this.detailData, { + channelName: channel[0], + channelMobile: channel[1] + }); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + appUserId: [this.detailData.appUserId], + freezeOrResume: !!type, + pageName: '合伙人详情', + telephone: this.detailData.adminUserInfo.mobile + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + auditPartner(isPass: boolean) { + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: PartnerAuditModalComponent, + nzComponentParams: { + info: { ...this.detailData, isPass, enterpriseName: this.detailData.adminUserInfo?.name }, + sourcePage: '合伙人审核详情' + }, + nzFooter: null + }); + } + + ratify() { + this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'legalFront' || id === 'legalBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'legalFront' ? 'front' : 'back'); + } + } + } + + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + + /** + * 级联获取地区数据 + * + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( + res => { + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); + }, + _ => {}, + () => { + resolve(rs); + } + ); + }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + if (this.enterpriseAddressCode?.length > 3) { + this.service.msgSrv.warning('所属城市不能超过3个'); + return; + } + const dateil = { ...this.detailData, cityCodesList: this.enterpriseAddressCode }; + Object.assign(dateil.adminUserInfo, { + validStartTime: this.datePipe.transform(dateil.adminUserInfo.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.adminUserInfo.validEndTime, 'yyyy-MM-dd') + }); + + this.service.request(this.service.$api_save_personal_partner, dateil).subscribe(res => { + if (res) { + this.service.msgSrv.success('个人合伙人修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + // 企业管理员证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.adminUserInfo.name = res.name; + } + if (res.number) { + this.detailData.adminUserInfo.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.adminUserInfo.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.adminUserInfo.validEndTime = res.validTo; + } + } + } + }); + } + + private initST(): STColumn[] { + return [ + { title: '修改后渠道销售', index: 'newChannelIdLabel', width: 180 }, + { title: '修改前渠道销售', index: 'originalChannelIdLabel', width: 160 }, + { title: '转移客户数', index: 'quantity', className: 'text-center', width: 130 }, + { title: '生效节点', index: 'effectiveNode', width: 150, type: 'enum', enum: { 1: '立即生效', 2: 'CRM审核后生效' } }, + { title: '备注', index: 'remark', className: 'text-center', width: 150 }, + { title: '修改时间', index: 'effectiveTime', className: 'text-center', width: 180, type: 'date' }, + { title: '操作人', index: 'modifyUserIdLabel', width: 180 }, + { + title: '操作', + fixed: 'right', + width: '140px', + buttons: [ + { + text: '详情', + click: item => this.service.showChangeDetail(item.id) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/partner-list/services/partner-list.service.ts b/src/app/routes/partner/partner-list/services/partner-list.service.ts new file mode 100644 index 00000000..22151e83 --- /dev/null +++ b/src/app/routes/partner/partner-list/services/partner-list.service.ts @@ -0,0 +1,75 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService, EACacheService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { ChannelLogModalComponent } from '../components/channel-log-modal/channel-log-modal.component'; + +@Injectable() +export class PartnerListService extends ShipperBaseService { + $mock_url = '/rule?_allow_anonymous=true'; + + // 查询合伙人信息-分页 + $api_get_partner_page = '/api/mdc/partner/list/page'; + // 新增/更新保存企业合伙人信息 + $api_save_entp_partner = '/api/mdc/partner/saveEnterprise'; + // 新增/更新个人合伙人信息 + $api_save_personal_partner = '/api/mdc/partner/savePersonally'; + // 获取企业合伙人信息 + $api_get_ent_partner_detail = '/api/mdc/partner/getEnterprise'; + // 获取合伙人信息 + $api_get_personal_partner_detail = '/api/mdc/partner/getPersonally'; + // 审核合伙人 + $api_audit_partner = '/api/mdc/partner/audit'; + // 修改返佣模板 + $api_update_partner_template = '/api/mdc/partner/updateTemplate'; + // 更新渠道销售 + $api_update_partner_channel = '/api/mdc/partner/updateChannelSale'; + // 更新渠道销售 + $api_update_partner_channel_by_id = '/api/mdc/partner/updateChannelSaleByID'; + // 重新发起CRM + $api_resend_crm = '/api/mdc/partner/reSendCrm'; + // 查询合伙人修改渠道渠道销售记录 + $api_get_personal_channel_list = '/api/mdc/partnerChannelRelLog/list/page'; + // 查询客户关系列表-不分页 + $api_get_enterprice_rel_list = '/api/mdc/EnterpriseRelLog/list'; + // 校验合伙人是否可修改渠道销售 true:可以修改 false:不可以修改 + $api_check_partenr_change_channel = '/api/mdc/partner/updateChannelCheck'; + // 根据手机号查询实名信息 + $api_get_identityInfo_by_mobile = '/api/mdc/cuc/identityInfo/getByMobile'; + // 渠道销售修改详情 + $api_get_partner_change_list = '/api/mdc/partnerChannelRelLog/partnerChannelUpdateDetaiList'; + // 冻结/启用企业业 + $api_lock_freight = '/api/mdc/cuc/userApp/freezeOrResume'; + + // 根据地区code查询列表 + $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; + // 根据地区code查询地区详情 + $api_get_region_detail_by_code = '/api/mdc/pbc/region/getRegionDetailByCode'; + // 营业执照识别 + $api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense'; + // 身份证识别 + $api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + + constructor(public injector: Injector, private nzModalService: NzModalService) { + super(injector); + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + showChangeDetail(id: string) { + const modal = this.nzModalService.create({ + nzTitle: '详情', + nzContent: ChannelLogModalComponent, + nzComponentParams: { id }, + nzNoAnimation: true, + nzWidth: 800, + nzFooter: null + }); + } +} diff --git a/src/app/routes/partner/partner-routing.module.ts b/src/app/routes/partner/partner-routing.module.ts new file mode 100644 index 00000000..8c979b66 --- /dev/null +++ b/src/app/routes/partner/partner-routing.module.ts @@ -0,0 +1,171 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-02-24 15:07:57 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-11 15:22:36 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\partner-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; +import { PartnerAccountManagementListComponent } from './account-management/components/list/list.component'; +import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component'; +import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component'; +import { PartnerPartnerCustomOrderDetailComponent } from './business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component'; +import { PartnerPartnerOrderDetailComponent } from './business-statistics/components/partner-order-detail/partner-order-detail.component'; +import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component'; +import { PartnerSalePartnerDetailComponent } from './business-statistics/components/sale-partner-detail/sale-partner-detail.component'; +import { ParterChannelSalesEditComponent } from './channel-sales/components/edit/edit.component'; +import { ParterChannelSalesListComponent } from './channel-sales/components/list/list.component'; +import { ParterClaimAuditListChannelDetailComponent } from './claim-audit/components/channel-detail/channel-detail.component'; +import { ParterClaimAuditListComponent } from './claim-audit/components/list/list.component'; +import { ParterClaimAuditListPartnerDetailComponent } from './claim-audit/components/partner-detail/partner-detail.component'; +import { ParterLevelConfigEditComponent } from './level-config/components/edit/edit.component'; +import { ParterLevelConfigListComponent } from './level-config/components/list/list.component'; +import { PartnerDetailComponent } from './partner-list/components/partner-detail/partner-detail.component'; +import { ParterRebateManageMentParticularsComponent } from './rebate-management/components/particulars/particulars.component'; +import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerAccountManagementWithdralDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { ParterRebateManageMentAddComponent } from './rebate-management/components/rebate-setting/add/add.component'; +import { ParterRebateManageMentSettingComponent } from './rebate-management/components/rebate-setting/rebate-setting.component'; +import { PartnerRecordedDetailComponent } from './recorded/components/detail/detail.component'; +import { PartnerRecordedRecordComponent } from './recorded/components/record/record.component'; +import { AddEtpPartnerComponent } from './partner-list/components/add-etp-partner/add-etp-partner.component'; +import { AddPersonalPartnerComponent } from './partner-list/components/add-personal-partner/add-personal-partner.component'; +import { PartnerListComponent } from './partner-list/components/index/partner-list.component'; +import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component'; +import { ParterArticleManagementListComponent } from './article-management/components/list/list.component'; +import { ParterArticleManagementEditComponent } from './article-management/components/edit/edit.component'; +import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component'; +import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component'; +import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component'; +import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component'; +import { PersonalPartnerDetailComponent } from './partner-list/components/personal-partner-detail/personal-partner-detail.component'; +import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/list/list.component'; +import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component'; + +const routes: Routes = [ + { + path: 'business-statistics', + children: [ + { path: '', redirectTo: 'index' }, + { path: 'index', component: PartnerBusinessStatisticsIndexComponent }, + { path: 'partner/order-detail/:id', component: PartnerPartnerOrderDetailComponent }, + { path: 'partner/custom-detail/:id', component: PartnerPartnerCustomDetailComponent }, + { path: 'partner/custom-order-detail/:id', component: PartnerPartnerCustomOrderDetailComponent }, + { path: 'sale/custom-detail/:id', component: PartnerSaleCustomDetailComponent }, + { path: 'sale/partner-detail/:id', component: PartnerSalePartnerDetailComponent } + ] + }, + { + path: 'channel-sales', + children: [ + { path: '', component: ParterChannelSalesListComponent }, + { path: 'list', component: ParterChannelSalesListComponent }, + { path: 'edit', component: ParterChannelSalesEditComponent } + ] + }, + { + path: 'level-config', + children: [ + { path: '', component: ParterLevelConfigListComponent }, + { path: 'list', component: ParterLevelConfigListComponent }, + { path: 'edit', component: ParterLevelConfigEditComponent } + ] + }, + { + path: 'rebate', + children: [ + { path: 'particulars', component: ParterRebateManageMentParticularsComponent }, + { path: 'record', component: ParterRebateManageMentRecordComponent }, + { path: 'setting', component: ParterRebateManageMentSettingComponent }, + { path: 'setting/add/:id', component: ParterRebateManageMentAddComponent } + ] + }, + { + path: 'account-management', + children: [ + { + path: 'am', + children: [ + { path: '', redirectTo: 'list' }, + { path: 'list', component: PartnerAccountManagementListComponent }, + { path: 'detail/:id', component: PartnerAccountManagementAccountDetailComponent }, + { path: 'recorded/detail/:id', component: PartnerAccountManagementRecordedDetailComponent } + ] + }, + { + path: 'withdraw-record', + children: [ + { path: '', redirectTo: 'list' }, + { path: 'list', component: PartnerAccountManagementWithdrawalsRecordComponent }, + { path: 'detail/:id', component: PartnerAccountManagementWithdralDetailComponent } + ] + } + ] + }, + { + path: 'partner-list', + children: [ + { path: '', component: PartnerListComponent }, + { path: 'etp-detail/:id', component: PartnerDetailComponent }, + { path: 'personal-detail/:id', component: PersonalPartnerDetailComponent }, + { path: 'add-etp-partner', component: AddEtpPartnerComponent }, + { path: 'add-personal-partner', component: AddPersonalPartnerComponent } + ] + }, + { + path: 'claim-audit', + children: [ + { path: '', component: ParterClaimAuditListComponent }, + { path: 'list', component: ParterClaimAuditListComponent }, + { path: 'channel-detail', component: ParterClaimAuditListChannelDetailComponent }, + { path: 'partner-detail', component: ParterClaimAuditListPartnerDetailComponent } + ] + }, + { + path: 'scrollimg', + children: [ + { path: '', component: ScrollImgComponentsListComponent }, + { path: 'list', component: ScrollImgComponentsListComponent }, + { path: 'detail', component: ScrollimgComponentsAddComponent } + ] + }, + { + path: 'advice-feedback', + children: [ + { path: '', component: ParterAdviceFeedbackListComponent }, + { path: 'list', component: ParterAdviceFeedbackListComponent }, + { path: 'detail', component: ParterAdviceFeedbackDetailComponent } + ] + }, + { + path: 'recorded', + children: [ + { path: 'record', component: PartnerRecordedRecordComponent }, + { path: 'record/detail/:id', component: PartnerRecordedDetailComponent } + ] + }, + { + path: 'knowledge', + children: [ + { path: 'classification', component: PartnerKnowledgeClassificationListComponent }, + { path: 'article-management-list', component: ParterArticleManagementListComponent }, + { path: 'article-management-add', component: ParterArticleManagementEditComponent }, + { path: 'article-management-edit', component: ParterArticleManagementEditComponent }, + { path: 'banner', component: BannerComponentsListComponent }, + { path: 'banner/detail', component: BannerComponentsAddComponent } + ] + } +]; +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PartnerRoutingModule {} diff --git a/src/app/routes/partner/partner.module.ts b/src/app/routes/partner/partner.module.ts new file mode 100644 index 00000000..3255e0c1 --- /dev/null +++ b/src/app/routes/partner/partner.module.ts @@ -0,0 +1,126 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-09 14:34:55 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-11 15:28:01 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\partner.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { SharedModule } from '@shared'; +import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; +import { PartnerAccountManagementListComponent } from './account-management/components/list/list.component'; +import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerAccountManagementVirtualAccountDetailComponent } from './account-management/components/virtual-account-detail/virtual-account-detail.component'; +import { PartnerAccountManagementWithdralDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component'; +import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component'; +import { PartnerPartnerCustomOrderDetailComponent } from './business-statistics/components/partner-custom-order-detail/partner-custom-order-detail.component'; +import { PartnerPartnerOrderDetailComponent } from './business-statistics/components/partner-order-detail/partner-order-detail.component'; +import { PartnerPartnerStatisticsComponent } from './business-statistics/components/partner-statistics/partner-statistics.component'; +import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component'; +import { PartnerSalePartnerDetailComponent } from './business-statistics/components/sale-partner-detail/sale-partner-detail.component'; +import { PartnerSaleStatisticsComponent } from './business-statistics/components/sale-statistics/sale-statistics.component'; +import { ParterChannelSalesEditComponent } from './channel-sales/components/edit/edit.component'; +import { ParterChannelSalesListComponent } from './channel-sales/components/list/list.component'; +import { ParterClaimAuditListChannelApproveComponent } from './claim-audit/components/channel-approve/channel-approve.component'; +import { ParterClaimAuditListChannelDetailComponent } from './claim-audit/components/channel-detail/channel-detail.component'; +import { ParterClaimAuditListChannelRejectComponent } from './claim-audit/components/channel-reject/channel-reject.component'; +import { ParterClaimAuditListComponent } from './claim-audit/components/list/list.component'; +import { ParterClaimAuditListPartnerApproveComponent } from './claim-audit/components/partner-approve/partner-approve.component'; +import { ParterClaimAuditListPartnerDetailComponent } from './claim-audit/components/partner-detail/partner-detail.component'; +import { ParterClaimAuditListPartnerRejectComponent } from './claim-audit/components/partner-reject/partner-reject.component'; +import { ParterLevelConfigEditComponent } from './level-config/components/edit/edit.component'; +import { ParterLevelConfigListComponent } from './level-config/components/list/list.component'; +import { PartnerListComponent } from './partner-list/components/index/partner-list.component'; +import { PartnerAuditModalComponent } from './partner-list/components/partner-audit-modal/partner-audit-modal.component'; +import { PartnerDetailComponent } from './partner-list/components/partner-detail/partner-detail.component'; +import { PartnerListService } from './partner-list/services/partner-list.service'; +import { PartnerRoutingModule } from './partner-routing.module'; +import { ParterRebateManageMentParticularsComponent } from './rebate-management/components/particulars/particulars.component'; +import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; +import { ParterRebateManageMentSettingComponent } from './rebate-management/components/rebate-setting/rebate-setting.component'; +import { AddEtpPartnerComponent } from './partner-list/components/add-etp-partner/add-etp-partner.component'; +import { AddPersonalPartnerComponent } from './partner-list/components/add-personal-partner/add-personal-partner.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from './rebate-management/model/abnormal-feedback/abnormal-feedback.component'; +import { PartnerRecordedDetailComponent } from './recorded/components/detail/detail.component'; +import { PartnerRecordedRecordComponent } from './recorded/components/record/record.component'; +import { ParterRebateManageMentAddComponent } from './rebate-management/components/rebate-setting/add/add.component'; +import { ParterArticleManagementEditComponent } from './article-management/components/edit/edit.component'; +import { ParterArticleManagementListComponent } from './article-management/components/list/list.component'; +import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component'; +import { PartnerEditComponent } from './knowledge/classification/components/edit/edit.component'; +import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component'; +import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component'; +import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component'; +import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component'; +import { PersonalPartnerDetailComponent } from './partner-list/components/personal-partner-detail/personal-partner-detail.component'; +import { ParterAdviceFeedbackListComponent } from './advice-feedback/components/list/list.component'; +import { ParterAdviceFeedbackDetailComponent } from './advice-feedback/components/feedback-detail/feedback-detail.component'; +import { ParterRebateManageMentAddPartnerListComponent } from './rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component'; +import { ChannelLogModalComponent } from './partner-list/components/channel-log-modal/channel-log-modal.component'; + +const COMPONENTS: any[] = [ + PartnerBusinessStatisticsIndexComponent, + ParterChannelSalesListComponent, + ParterChannelSalesEditComponent, + ParterLevelConfigListComponent, + ParterLevelConfigEditComponent, + PartnerPartnerStatisticsComponent, + PartnerSaleStatisticsComponent, + PartnerPartnerCustomDetailComponent, + PartnerPartnerCustomDetailComponent, + PartnerSaleCustomDetailComponent, + ParterRebateManageMentParticularsComponent, + ParterRebateManageMentRecordComponent, + PartnerSalePartnerDetailComponent, + PartnerPartnerCustomOrderDetailComponent, + PartnerPartnerOrderDetailComponent, + PartnerAccountManagementListComponent, + ParterClaimAuditListComponent, + ParterClaimAuditListChannelDetailComponent, + ParterClaimAuditListPartnerDetailComponent, + ParterClaimAuditListPartnerApproveComponent, + ParterClaimAuditListPartnerRejectComponent, + ParterClaimAuditListChannelApproveComponent, + ParterClaimAuditListChannelRejectComponent, + PartnerAccountManagementVirtualAccountDetailComponent, + PartnerAccountManagementAccountDetailComponent, + PartnerAccountManagementRecordedDetailComponent, + PartnerAccountManagementWithdrawalsRecordComponent, + PartnerAccountManagementWithdralDetailComponent, + PartnerRecordedRecordComponent, + PartnerRecordedDetailComponent, + PartnerListComponent, + PartnerDetailComponent, + ParterRebateManageMenAbnormalFeedbackComponent, + ParterRebateManageMentSettingComponent, + PartnerAuditModalComponent, + ParterRebateManageMentAddComponent, + AddEtpPartnerComponent, + AddPersonalPartnerComponent, + ScrollImgComponentsListComponent, + ScrollimgComponentsAddComponent, + ParterArticleManagementEditComponent, + ParterArticleManagementListComponent, + PartnerKnowledgeClassificationListComponent, + PartnerEditComponent, + BannerComponentsListComponent, + BannerComponentsAddComponent, + PersonalPartnerDetailComponent, + ParterAdviceFeedbackListComponent, + ParterAdviceFeedbackDetailComponent, + ParterRebateManageMentAddPartnerListComponent, + ChannelLogModalComponent +]; + +@NgModule({ + declarations: [...COMPONENTS], + imports: [CommonModule, PartnerRoutingModule, SharedModule], + providers: [PartnerListService] +}) +export class PartnerModule {} diff --git a/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html new file mode 100644 index 00000000..0ebf82f0 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.html @@ -0,0 +1,60 @@ + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + diff --git a/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts new file mode 100644 index 00000000..55ed5dd9 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/particulars/particulars.component.ts @@ -0,0 +1,188 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; + +@Component({ + selector: 'app-parter-channel-rebate-management-particulars', + templateUrl: './particulars.component.html' +}) +export class ParterRebateManageMentParticularsComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '', + }, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '订单号' + }, + phone: { + type: 'string', + title: '付款单号' + }, + phone2: { + type: 'string', + title: '下单客户' + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + phone3: { + type: 'string', + title: '合伙人名称', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, + deadlineTime: { + title: '时间范围', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } as SFDateWidgetSchema + } + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '订单号', + index: 'name1' + }, + { + title: '订单金额(元)', + index: 'name1' + }, + { + title: '付款金额(元)', + index: 'name1' + }, + { + title: '预估返佣金额(元)', + index: 'name1' + }, + { + title: '附加费率', + index: 'name1' + }, + { + title: '下单客户', + index: 'name1' + }, + { + title: '网络货运人', + index: 'name1' + }, + { + title: '销售渠道', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'name1' + }, + { + title: '合伙人等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'name1' + }, + { + title: '固定结算费率', + index: 'name1' + }, + { + title: '返佣时间', + index: 'name1' + } + ]; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html new file mode 100644 index 00000000..2456985d --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html @@ -0,0 +1,48 @@ + + + +
    + + +
    + + + +
    +
    +
    + + + + + +
    123212{{item?.abnormalFeedback}}
    +
    +
    +
    diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts new file mode 100644 index 00000000..e1d2b4c3 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts @@ -0,0 +1,154 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { ParterRebateManageMenRecordDetailComponent } from '../../model/record-detail/record-detail.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from '../../model/abnormal-feedback/abnormal-feedback.component'; + +@Component({ + selector: 'app-parter-channel-rebate-management-record', + templateUrl: './rebate-record.component.html' +}) +export class ParterRebateManageMentRecordComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + return { + ...params, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + month: { + type: 'string', + title: '时间月份', + format: 'month', + }, + phone: { + type: 'string', + title: '合伙人名称' + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '月份', + index: 'month', + format: (item: any) => {return item?.month ? item?.month + '月' : ''} + }, + { + title: '返佣金额(元)', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'partnerName' + }, + { + title: '实际等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'rebateRatio' + }, + { + title: '返佣时间', + index: 'name1' + }, + { + title: '异常反馈', + render: 'abnormalFeedback' + }, + { + title: '操作', + fixed: 'right', + width: '90px', + className: 'text-left', + buttons: [ + { + text: '明细', + click: _record => this.viewEvaluate(_record), + } + ] + } + ]; + } + /** + *查看明细 + */ + viewEvaluate(item: any) { + const modal = this.modal.create({ + nzTitle: '明细', + nzWidth: 1200, + nzContent: ParterRebateManageMenRecordDetailComponent, + nzComponentParams: { }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + /** + *异常反馈 + */ + feedback(item?: any) { + const modal = this.modal.create({ + nzTitle: '异常反馈', + nzWidth: 580, + nzContent: ParterRebateManageMenAbnormalFeedbackComponent, + nzComponentParams: { i: item }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.html new file mode 100644 index 00000000..a537892f --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.html @@ -0,0 +1,30 @@ + + +
    + +
    + +
    +
    +
    + + + + + + diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.less b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.less new file mode 100644 index 00000000..e87948ce --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.less @@ -0,0 +1,20 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } + .imgBox { + display: flex; + img { + width: 60px !important; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts new file mode 100644 index 00000000..65ce3f8c --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts @@ -0,0 +1,141 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { + SFComponent, + SFDateWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFUISchema +} from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { RebateManagementService } from '../../../services/rebate-management.service'; + +@Component({ + selector: 'app-add-partnerlist', + templateUrl: './add-partnerlist.component.html', + styleUrls: ['./add-partnerlist.component.less'] +}) +export class ParterRebateManageMentAddPartnerListComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + ui: SFUISchema = {}; + i: any; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData: any; + isVisible = false; + edit = false; + editId = false; + selectedIndex = 0; + + columns: STColumn[] = [ + { title: '', type: 'checkbox', width: '50px', className: 'text-center' }, + { + title: '合伙人名称', + index: 'enterpriseName', + width: 180, + format: item => (item.partnerType ? `${item.enterpriseName || item.contactName}` : '') + }, + { title: '联系人', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') }, + { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, + { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, + { + title: '操作', + width: '90px', + fixed: 'right', + buttons: [ + { + text: '添加', + click: _record => this.add(_record), + acl: { ability: ['AbnormalAppear-reply'] } + } + ] + } + ]; + + get reqParams() { + // signStatus固定传20 代表签约完成 signStatus: 20 + let params: any = { ...this.sf?.value, }; + return params; + } + + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + + constructor( + public service: RebateManagementService, + public shipperSrv: ShipperBaseService, + private modal: NzModalService, + private modals: NzModalRef + ) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + enterpriseName: { + type: 'string', + title: '合伙人名称' + }, + partnerType: { + type: 'string', + title: '类型', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '企业' }, + { value: 2, label: '个人' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + } + } + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + search() { + this.st?.load(1); + } + + selectedIndexChange(event: any) { + if (this.selectedIndex === 0) { + this.st?.load(1); + } + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + // 回复操作 + add(item: any) { + console.log(item); + this.modals.destroy(item); + } + // 批量回复操作 + batchReply() { + // if (this.selectedRows.length === 0) { + // this.service.msgSrv.warning('请勾选数据!') + // return; + // } + this.modals.destroy(this.selectedRows); + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html new file mode 100644 index 00000000..65cd23f9 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html @@ -0,0 +1,70 @@ + + + +
    + + + +    + 固定结算费率配置 +     % + 业务量和管理费比例配置 +    + + + + + + +    + + + 关联合伙人配置 +    + + + + + +   添加 + + + +    + + 1 + 2 + 3 + 4 + 5 + + +    + + +    + + + +
    + + +
    +
    +
    diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less new file mode 100644 index 00000000..fe7d3fd2 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less @@ -0,0 +1,16 @@ +:host { + ::ng-deep { + .sv__label { + color: #000; + } + .sv__title { + font-weight: 700; + } + } + .align-center { + display: flex; + align-items: center; + justify-content: center; + } + +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts new file mode 100644 index 00000000..958809db --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts @@ -0,0 +1,149 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-21 09:26:45 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-29 10:53:39 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../../services/rebate-management.service'; +import { ParterRebateManageMentAddPartnerListComponent } from '../add-partnerlist/add-partnerlist.component'; +import { inRange } from '@delon/util'; +@Component({ + selector: 'app-parter-channel-rebate-management-add', + styleUrls: ['./add.component.less'], + templateUrl: './add.component.html' +}) +export class ParterRebateManageMentAddComponent implements OnInit { + @ViewChild('table') table!: any; + tabelData: any; + configName: string = ''; + partnerType: string = ''; + remarke: string = ''; + accountingRate: Number = 0; + priority: string = ''; + partnerPeopleList: any; + configType = '1'; + precision = 2; + partnerId :Array =[]; + inputValue = ''; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema1!: SFSchema; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService + ) {} + columns: STColumn[] = [ + { + title: '合伙人名称', + index: 'enterpriseName', + width: 180, + format: item => (item.partnerType ? `${item.enterpriseName || item.contactName}` : '') + }, + { title: '联系人', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') }, + { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, + { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, + { + title: '操作', width: '90px', fixed: 'right', + buttons: [ + { + text: '移除', + click: _record => this.delete(_record), + acl: { ability: ['AbnormalAppear-reply'] } + }, + ] + }, + ]; + initSF(data?: any) { + this.schema1 = { + properties: { + ruleDescription: { + type: 'string', + title: '', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 650 + } + }, + // default: data?.agreementContent || '' + } + } + }; + } + ngOnInit() { + this.initSF(); + } + goBack() { + window.history.go(-1); + } + /** + *合伙人选择 + */ + add(item?: any) { + const modalRef = this.modal.create({ + nzTitle: '合伙人选择', + nzWidth: 1000, + nzContent: ParterRebateManageMentAddPartnerListComponent, + nzComponentParams: { + i: item, + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + this.partnerId = []; + if (res) { + console.log(Array.isArray(res)); + console.log(res); + if(Array.isArray(res)) { + this.partnerPeopleList = res; + res.forEach((ele: any) => { + this.partnerId.push(ele?.id); + }) + } else { + this.partnerPeopleList = [res]; + this.partnerId.push(res?.id); + } + } + }); + } + delete(item: any) { + console.log(item); + } + save () { + const params = { + accountingRate: this.accountingRate, + configName: this.configName, + configType: this.configType, + rebateConfigLineDTO: this.table.data, + priority: this.priority,// 优先级 + partnerId: this.partnerId.join(','), + ruleDescription: this.sf.value.ruleDescription, + remarke: this.remarke, + partnerType: this.partnerType + } + console.log(params); + this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => { + if(res) { + console.log(res); + this.service.msgSrv.success('新增成功!') + this.router.navigate(['/partner/rebate/setting']) + } + }) + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html new file mode 100644 index 00000000..5d636436 --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html @@ -0,0 +1,64 @@ + + + +
    + + +
    + + + +
    +
    +
    + + + + +
    +
    + +
    +
    + + +
    按全部等级配置
    +
    按不同等级配置
    +
    + +
    全部合伙人
    +
    新注册合伙人
    +
    自定义合伙人
    +
    + +
    {{item?.stateLocked ? '启用' : '禁用'}}
    +
    +
    +
    diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts new file mode 100644 index 00000000..ee9b5b9d --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts @@ -0,0 +1,200 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { ParterRebateManageMenRecordDetailComponent } from '../../model/record-detail/record-detail.component'; +import { ParterRebateManageMenAbnormalFeedbackComponent } from '../../model/abnormal-feedback/abnormal-feedback.component'; + +@Component({ + selector: 'app-parter-channel-rebate-management-setting', + templateUrl: './rebate-setting.component.html' +}) +export class ParterRebateManageMentSettingComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + _$expand = false; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modal: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + return { + ...params, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + configName: { + type: 'string', + title: '配置名称', + }, + stateLocked: { + type: 'string', + title: '状态', + enum: [ + {label: '全部', value: ''}, + {label: '启用', value: 0}, + {label: '禁用', value: 1}, + ], + ui: { + widget: 'select', + }, + + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '配置名称', + index: 'configName', + width: '200px', + }, + { + title: '配置类型', + render: 'configType', + width: '200px', + + }, + { + title: '备注', + index: 'remark', + width: '250px', + }, + { + title: '关联合伙人范围', + render: 'partnerType', + width: '200px', + }, + { + title: '创建时间', + index: 'enableTime', + width: '200px', + }, + { + title: '启用时间', + index: 'enableTime', + width: '200px', + }, + { + title: '优先级', + index: 'priority', + width: '100px', + }, + { + title: '状态', + render: 'stateLocked', + width: '100px', + }, + { + title: '操作', + fixed: 'right', + width: '90px', + className: 'text-left', + buttons: [ + { + text: '查看', + click: _record => this.viewEvaluate(_record), + }, + { + text: '禁用', + iif: (_record) =>{ return _record.stateLocked == true}, + click: _record => this.viewEvaluate(_record), + }, + { + text: '启用', + iif: (_record) =>{ return _record.stateLocked == false}, + click: _record => this.viewEvaluate(_record), + }, + ] + } + ]; + } + /** + *禁用 + */ + viewEvaluate(item: any) { + console.log(item.stateLocked); + let title = '' + let stateLocked: boolean; + if(item.stateLocked) { + title = '是否禁用该配置?' + stateLocked = false + } else { + title = '是否启用该配置?' + stateLocked = true + } + this.modal.confirm({ + nzTitle: title, + nzOnOk: () => { + const params = { + id: item?.id, + stateLocked: stateLocked, + } + this.service.request(this.service.$api_set_updateRebateConfig,params).subscribe((res: any) => { + if(res) { + this.service.msgSrv.success('设置成功!') + this.st.reload(); + } + }) + } + }); + } + /** + *查看 + */ + feedback(item?: any) { + const modal = this.modal.create({ + nzTitle: '查看', + nzWidth: 580, + nzContent: ParterRebateManageMenAbnormalFeedbackComponent, + nzComponentParams: { i: item }, + nzFooter: null + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + } + }); + } + configAction() { + this.router.navigate(['/partner/rebate/setting/add/', 1]) + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } +} diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html new file mode 100644 index 00000000..cef84c44 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.html @@ -0,0 +1,38 @@ + + + +
    有订单有异常请查看
    +
    2022-09-08 00:00:00
    +
    + +
    +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less new file mode 100644 index 00000000..52b47a0e --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.less @@ -0,0 +1,6 @@ +:host { + [nz-button] { + margin-right: 8px; + margin-bottom: 12px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts new file mode 100644 index 00000000..3d8c1fd4 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/abnormal-feedback/abnormal-feedback.component.ts @@ -0,0 +1,72 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-10 14:50:45 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-10 15:09:51 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\model\\abnormal-feedback\\abnormal-feedback.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { NzButtonSize } from 'ng-zorro-antd/button'; + +@Component({ + selector: 'app-parter-channel-rebate-management-abnormal-feedback', + templateUrl: './abnormal-feedback.component.html' +}) +export class ParterRebateManageMenAbnormalFeedbackComponent implements OnInit { + schema: SFSchema = {}; + ui!: SFUISchema; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i!: any; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService, + public modalRef: NzModalRef, + ) {} + + + ngOnInit() { + this.initSF(); + } + + initSF() { + this.schema = { + properties: { + name3: { + type: 'string', + title: '回复', + maxLength: 50, + ui: { + widget: 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + placeholder:'请不要超过50个字' + } as SFTextareaWidgetSchema, + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 60, + grid: { span: 16 }, + } + }; + } + close() { + this.modalRef.destroy() + } +} + diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html new file mode 100644 index 00000000..63f8290c --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.html @@ -0,0 +1,38 @@ + +
    + +
    + + + +
    合计:2999.00元
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less new file mode 100644 index 00000000..52b47a0e --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.less @@ -0,0 +1,6 @@ +:host { + [nz-button] { + margin-right: 8px; + margin-bottom: 12px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts new file mode 100644 index 00000000..1efde6a2 --- /dev/null +++ b/src/app/routes/partner/rebate-management/model/record-detail/record-detail.component.ts @@ -0,0 +1,171 @@ +import { ModalHelper } from '@delon/theme'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { processSingleSort, ShipperBaseService } from '@shared'; +import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; +import { RebateManagementService } from '../../services/rebate-management.service'; +import { NzButtonSize } from 'ng-zorro-antd/button'; + +@Component({ + selector: 'app-parter-channel-rebate-management-record-detail', + templateUrl: './record-detail.component.html' +}) +export class ParterRebateManageMenRecordDetailComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + ui!: SFUISchema; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + spuStatus = '1'; + size: NzButtonSize = 'large'; + _$expand = false; + data = [{ name1: 1111 }]; + constructor( + public router: Router, + public ar: ActivatedRoute, + public service: RebateManagementService, + private modalService: NzModalService, + public shipperservice: ShipperBaseService, + public modalRef: NzModalRef, + ) {} + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + + initSF() { + this.schema = { + properties: { + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + change: (value: any) => { + console.log(value) + this.st.reload() + } + } + }, + paymentStatus: { + title: '银行类型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + change: (value: any) => { + console.log(value) + this.st.reload() + } + } as SFSelectWidgetSchema + }, + } + }; + this.ui = { + '*': { + spanLabelFixed: 140, + grid: { span: 8, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '订单号', + index: 'billCode' + }, + { + title: '订单金额(元)', + index: 'name1' + }, + { + title: '付款金额(元)', + index: 'name1' + }, + { + title: '预估返佣金额(元)', + index: 'name1' + }, + { + title: '附加费率', + index: 'name1' + }, + { + title: '下单客户', + index: 'name1' + }, + { + title: '网络货运人', + index: 'name1' + }, + { + title: '销售渠道', + index: 'name1' + }, + { + title: '合伙人名称', + index: 'name1' + }, + { + title: '合伙人等级', + index: 'name1' + }, + { + title: '管理费比例', + index: 'name1' + }, + { + title: '固定结算费率', + index: 'name1' + }, + { + title: '返佣时间', + index: 'name1' + } + ]; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.st.load(1); + } + close() { + this.modalRef.destroy() + } +} + diff --git a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts new file mode 100644 index 00000000..fd12644c --- /dev/null +++ b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts @@ -0,0 +1,35 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-10 11:19:00 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-29 11:26:38 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\services\\rebate-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class RebateManagementService extends BaseService { + // 查询规则抽查列表 + public $api_get_listCompliancePage = '/api/sdc/billRiskOperate/listRiskPage'; + // 查询返佣配置表 + public $api_get_rebateConfig = '/api/mdc/rebateConfig/list/page'; + // 保存返佣配置表 + public $api_save_rebateConfig = '/api/mdc/rebateConfig/save'; + // 启用/禁用返佣配置 + public $api_set_updateRebateConfig = '/api/mdc/rebateConfig/updateRebateConfig'; + + + // 运营端查询合伙人返佣 + public $api_get_getIncomeByBillpage = '/api/bpc/partnerIncomeHead/getIncomeByBillpage'; +   // 查询合伙人信息-分页 + public $api_get_partner_page = '/api/mdc/partner/list/page'; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.html b/src/app/routes/partner/recorded/components/detail/detail.component.html new file mode 100644 index 00000000..8bfafd61 --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.html @@ -0,0 +1,97 @@ + + + + + + +
    +

    {{formData?.stsLabel}}

    +
    + +
    +
    +
    +
    + + + + +
    + + {{formData?.accountName}} + + + {{formData?.ltdName}} + + + {{formData?.entryNumber}} + + + {{formData?.bankName}} + + + {{formData?.fictitiousAccount}} + + + {{formData?.submitTime}} + + + {{formData?.invoiceAmount | currency}} + + + {{formData?.taxPersonal | currency}} + + + {{formData?.recordedAmount | currency}} + + + {{formData?.stsLabel}} + + + + - + + + {{formData?.expressName}} + + + + - + + + {{formData?.bankFlow}} + +
    + + +
    +
    + +
    +
    +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.less b/src/app/routes/partner/recorded/components/detail/detail.component.less new file mode 100644 index 00000000..e299b7d1 --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.less @@ -0,0 +1,17 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color: rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size: 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/recorded/components/detail/detail.component.ts b/src/app/routes/partner/recorded/components/detail/detail.component.ts new file mode 100644 index 00000000..bbfad88e --- /dev/null +++ b/src/app/routes/partner/recorded/components/detail/detail.component.ts @@ -0,0 +1,130 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import { RecordedService } from '../../services/recorded.service'; + + +@Component({ + selector: 'app-partner-recored-detail', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'] +}) +export class PartnerRecordedDetailComponent implements OnInit { + @ViewChild('auditModal', { static: false }) auditModal!: any; + formData: any = {}; + timeLineData: any = []; + msg = ''; + id = ''; + + constructor(public service: RecordedService, private route: ActivatedRoute, private nzModalService: NzModalService) { + this.id = route.snapshot.params.id; + this.getRecordedDetail(this.id); + } + + ngOnInit(): void { } + + getRecordedDetail(id: string) { + this.service.request(this.service.$api_get_recorded_record_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + // let isEnd = false; + // if (res.successTime) { + // isEnd = true; + // if (res.refundStatus === '3') { + // this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + // } else { + // this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + // } + // } + // if (res.agreeTime && res.refundStatus !== '4') { + // this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + // } + // if (res.agreeTime) { + // if (res.refundStatus === '4') { + // isEnd = true; + // this.timeLineData.push({ + // time: res.agreeTime, + // value: `拒绝提现
    操作人员:${res.handlerUserIdLabel}`, + // color: 'red' + // }); + // } else { + // this.timeLineData.push({ + // time: res.agreeTime, + // value: `审核通过
    操作人员:${res.handlerUserIdLabel}`, + // color: 'gray' + // }); + // } + // } + // if (res.createTime) { + // this.timeLineData.push({ + // time: res.createTime, + // value: `提交提现申请
    提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
    操作人员:${res.userIdLabel}`, + // color: 'gray' + // }); + // } + // if (this.timeLineData?.length > 0 && !isEnd) { + // this.timeLineData[0].color = 'green'; + // } + } + }); + } + + auditAction(item?: any, type: string = '1') { + this.msg = ''; + let params: Array = []; + params = [item.id]; + const modal = this.nzModalService.create({ + nzTitle: type === '1' ? '审核' : '复审', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + if (!this.msg || this.msg.trim().length === 0) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return; + } + this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { + modal.destroy(true); + }, '审核拒绝成功'); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.audit({ ids: params, rejectReason: this.msg, sts: this.formData?.sts === '0' ? 1 : 2 }, () => { + modal.destroy(true); + }, `${this.formData?.sts === '1' ? '审核' : '复审'}通过成功`); + } + } + ] + }); + modal.afterClose.subscribe((res: any) => { + if (res) { + this.getRecordedDetail(this.id); + } + }); + } + goBack() { + history.go(-1); + } + + /** + * 审核 + */ + audit(params: any, callback: Function, msg = '成功') { + this.service + .request(this.service.$api_audit_recored, ...params) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + callback(); + } + }); + } +} diff --git a/src/app/routes/partner/recorded/components/record/record.component.html b/src/app/routes/partner/recorded/components/record/record.component.html new file mode 100644 index 00000000..ca550d9d --- /dev/null +++ b/src/app/routes/partner/recorded/components/record/record.component.html @@ -0,0 +1,76 @@ + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据,累计入账 {{ + totalCallNo }} + +
    + +
    +
    + +
    + + + {{ item.bankName }}
    {{ item.bankCardNumber }} +
    +
    +
    + 合伙人数: + 入账笔数: + 开票金额: + 代缴个税: + 入账金额: +
    +
    +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/partner/recorded/components/record/record.component.ts b/src/app/routes/partner/recorded/components/record/record.component.ts new file mode 100644 index 00000000..2a554c41 --- /dev/null +++ b/src/app/routes/partner/recorded/components/record/record.component.ts @@ -0,0 +1,363 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; +import Big from 'src/app/shared/utils/deal-precision'; +import { RecordedService } from '../../services/recorded.service'; + + +@Component({ + selector: 'app-partner-recorded-record', + templateUrl: './record.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class PartnerRecordedRecordComponent implements OnInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('auditModal', { static: false }) auditModal!: any; + @ViewChild('viewReasonModal', { static: false }) viewReasonModal!: any; + columns!: STColumn[]; + searchSchema!: SFSchema; + totalInfo: any = { + invoiceAmountSum: 0, + invoiceEntryNum: 0, + partnerNum: 0, + recordedAmountSum: 0, + taxPersonalSum: 0 + } + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + + ltdId = ''; // 网络货运人 + accountName = ''; // 账户名称 + + + constructor(public service: RecordedService, private nzModalService: NzModalService, + private router: Router, public ar: ActivatedRoute, public shipperSrv: ShipperBaseService) { + this.ltdId = this.ar.snapshot.queryParams?.ltdId || ''; + + } + + ngOnInit(): void { + this.searchSchema = this.initSF(); + this.columns = this.initST(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + delete requestOptions?.body?.expand; + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + // data = data.map(node => ({ ...node, disabled: node.sts !== '0' })); + return data; + }; + + stChange(e: STChange): void { + if (e.type === 'checkbox') { + const checkRows = (e.checkbox as STData[]) || []; + //判断当前页是否有选中的行 + if (checkRows.length === 0) { + // 当前页没有存在已勾选的行,移除之前所记录的当前页的行 + const stList = this.st.list; + stList.forEach(item => { + this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); + }) + } else { + //添加新增的行 + checkRows.forEach((item: any) => { + const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); + if (newSelectedList.length === 0) { + this.selectedRows.push(item); + + } + }) + // 移除取消选中的行 + const stList = this.st.list; + stList.forEach(item => { + if (!item.checked) { + const index = this.selectedRows.findIndex(_item => item.id === _item.id); + if (index !== -1) this.selectedRows.splice(index, 1); + } + }) + } + let totalCallNo = 0; + this.selectedRows.forEach((item => { + totalCallNo = new Big(this.totalCallNo).plus(item?.entryAmount).parse(); + })); + this.totalCallNo = totalCallNo; + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any, type: string = '1') { + if (!item && this.selectedRows.length === 0) { + this.service.msgSrv.warning('请选择需要审核的记录'); + return; + } + this.msg = ''; + let params: Array = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: type === '1' ? '审核' : '复审', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + if (!this.msg || this.msg.trim().length === 0) { + this.service.msgSrv.warning('请填写拒绝原因 '); + return; + } + this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { + modal.destroy(); + this.st.load(1); + }, '审核拒绝成功'); + // this.service + // .request(this.service.$api_disagree_recorded, { + // id: params, + // rejectReason: this.msg + // }) + // .subscribe(res => { + // if (res) { + // this.service.msgSrv.success('审核拒绝成功'); + // modal.destroy(); + // this.st.load(1); + // } + // }); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.audit({ ids: params, rejectReason: this.msg, sts: '1' }, () => { + modal.destroy(); + this.st.load(1); + }, '审核通过成功'); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: item?.rejectionCause || item?.failCause, + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + accountName: { + type: 'string', + title: '账户名称', + default: this.accountName, + ui: { + placeholder: '请输入' + } + }, + sts: { + type: 'string', + title: '入账状态', + default: '', + enum: [ + { label: '全部', value: '' }, + { label: '待初审', value: '0' }, + { label: '待复核', value: '1' }, + { label: '已入账', value: '2' }, + { label: '已拒绝', value: '3' }, + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + default: this.ltdId, + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, true), + } + }, + submitTime: { + title: '提交时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', className: 'text-center' }, + { title: '账户名称', index: 'accountName', width: 180, className: 'text-center' }, + { title: '虚拟账户', index: 'fictitiousAccount', width: 180, className: 'text-center' }, + { title: '入账单号', index: 'entryNumber', width: 190, className: 'text-center' }, + { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' }, + { + title: '开票金额', + index: 'amount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '代缴个税', + index: 'taxPersonal', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + { + title: '入账金额', + index: 'entryAmount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } + }, + + { title: '提交时间', index: 'submitTime', width: 180, className: 'text-center' }, + { title: '入账状态', index: 'stsLabel', width: 120, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '审核', + iif: item => item.sts === '0', + click: item => this.auditAction(item) + }, + { + text: '复审', + iif: item => item.sts === '1', + click: item => this.router.navigate(['./detail/' + item.id], { relativeTo: this.ar }) + }, + { + text: '详情', + click: item => this.router.navigate(['./detail/' + item.id], { relativeTo: this.ar }) + } + ] + } + ]; + } + + /** + * 审核 + */ + audit(params: any, callback: Function, msg = '成功') { + this.service + .request(this.service.$api_audit_recored, { ...params }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + callback(); + } + }); + } + + search() { + this.st.load(1); + this.getSummary(); + } + /** + * 底部统计 + */ + getSummary() { + this.service.request(this.service.$api_get_list_summary, { ...this.sf.value }).subscribe(res => { + if (res) { + this.totalInfo = res; + } + }) + } +} diff --git a/src/app/routes/partner/recorded/services/recorded.service.ts b/src/app/routes/partner/recorded/services/recorded.service.ts new file mode 100644 index 00000000..72d088aa --- /dev/null +++ b/src/app/routes/partner/recorded/services/recorded.service.ts @@ -0,0 +1,18 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class RecordedService extends BaseService { + + $api_get_recorded_page = `/api/bpc/partnerInvoiceEntry/queryInvoiceEntrylist`; // 查询合伙人发票入账主表 + $api_get_recorded_record_detail = `/api/bpc/partnerInvoice/getDetailByOpration`; // 入账记录详情 + $api_disagree_recorded = ``; // 拒绝审核 + $api_agree_recorded = ``; // 同意审核 + $api_audit_recored = `/api/bpc/partnerInvoiceEntry/oprationAudit`; // 审核单据 + $api_get_list_summary = `/api/bpc/partnerInvoiceEntry/invoiceEntrySummary`; // 每页统计 + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.html b/src/app/routes/partner/scrollimg/components/add/add.component.html new file mode 100644 index 00000000..f6a39e94 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts b/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts new file mode 100644 index 00000000..80b44d19 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AdComponentsAddComponent } from './add.component'; + +describe('AdComponentsAddComponent', () => { + let component: AdComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AdComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/scrollimg/components/add/add.component.ts b/src/app/routes/partner/scrollimg/components/add/add.component.ts new file mode 100644 index 00000000..e8345d9e --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.component.ts @@ -0,0 +1,243 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { apiConf } from '@conf/api.conf'; +import { ScrollImgService } from '../../services/scrollimg.service'; + +@Component({ + selector: 'app-ad-components-add', + templateUrl: './add.component.html', + styleUrls: ['./add.less'] +}) +export class ScrollimgComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + contentListData = []; + queryParams: any = {}; + oldTakeEffectTime = ''; + maxSort = 0; + isVisible = false; + validFalg = true; + detailData: any = { + advertisementContentDTOList: [] + }; + changeTimeFlag = false; + currentIndex = 0; + addFlag = true; + addId = 1; + inputPoint: any = { + lng: 0, + lat: 0 + }; + today = new Date(); + navData: any = []; + navigationName = ''; + ui: SFUISchema = { + '*': { + spanLabelFixed: 200, + grid: { span: 24 }, + }, + }; + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + public service: ScrollImgService, + private route: ActivatedRoute, + private router: Router, + private envSrv: EAEnvironmentService, + ) { } + + + ngOnInit(): void { + this.queryParams = this.route.snapshot.queryParams; + if (this.queryParams.type !== 'add') { + this.initDetailData(); + } + this.initSF(); + } + initDetailData() { + + } + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: '轮播图名称', + maxLength: 10, + ui: { + showRequired: true, + placeholder: '请不要超过10个字', + } + }, + licensePhotoWatermark: { + type: 'string', + title: '轮播图', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持JPG、PNG格式,文件小于2M(建议尺寸 702px * 280px)', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 2; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + }, + }, + linkType: { + type: 'string', + title: '可见范围', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '全部可见', value: 1 }, + { label: '合伙人可见', value: 2 }, + { label: '销售渠道可见', value: 3 }, + ], + }, + sortId: { + type: 'string', + title: '顺序', + ui: { + showRequired: true, + widget: '=', + placeholder: '请输入0~99,数字越大,排序越靠前', + serverSearch: true, + } as SFSelectWidgetSchema, + }, + content: { + type: 'string', + title: '内容', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 450 + }, + visibleIf: { name5: (value: string) => value === '1' } + }, + }, + }, + required: [], + }; + if (this.queryParams.type === 'add') { + setTimeout(() => { + this.sf.setValue('/takeEffectType', 1); + this.sf.setValue('/style', 1); + }, 500); + } + } + get reqParams() { + return {}; + } + disabledDate = (current: Date): boolean => { + // Can not select days before today and today + return differenceInCalendarDays(current, this.today) < 0; + } + changeTime() { + this.changeTimeFlag = true; + } + + + checkSort() { + const params: any = { + navigationId: this.sf?.value.navigationId, + sortId: this.sf?.value.sortId, + takeEffectType: this.sf?.value.takeEffectType, + }; + if (this.queryParams.id !== '0') { + params.advertisementId = this.queryParams.id; + } + if (this.sf.value.takeEffectType === 2) { + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } + + } + save() { + const params: any = { + ...this.sf?.value, + latitude: this.inputPoint.lat, + longitude: this.inputPoint.lng, + id: this.queryParams.id + }; + this.detailData.advertisementContentDTOList.forEach((item: any) => { + delete item.addId; + }); + if (this.queryParams.type === 'add') { + delete params.id; + } + if (this.sf.value.takeEffectType === 2) { + if (this.changeTimeFlag) { + params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm'); + } else { + params.takeEffectTime = this.detailData.takeEffectTime; + } + } else { + delete params.takeEffectTime; + } + this.service.request(this.service.$api_add_one, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.router.navigate(['../list'], { relativeTo: this.route }); + } + }); + } + + goBack() { + window.history.go(-1); + } + gotoMap() { + this.isVisible = true; + } + + handleOk(): void { + this.isVisible = false; + } + + handleCancel(): void { + this.isVisible = false; + } + outputPointAddress(data: any) { + this.sf.setValue('/companyAddress', data.address); + this.inputPoint = data.inputPoint; + } +} diff --git a/src/app/routes/partner/scrollimg/components/add/add.less b/src/app/routes/partner/scrollimg/components/add/add.less new file mode 100644 index 00000000..0a6adacb --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/add/add.less @@ -0,0 +1,119 @@ +:host { + .styleBox { + display: flex; + align-items: flex-end; + margin: 10px 0 0 0; + } + .imgBox { + position: relative; + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + .leftBox, + .rightBox { + position: absolute; + top: 50%; + transform: translate(0, -50%); + } + img { + width: 170px; + height: 40px; + } + .leftBox { + left: 3px; + } + .rightBox { + right: 3px; + } + } + .imgBox_two { + width: 200px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_three { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 25%; + height: 40px; + margin: 0 6% 0 0; + &:first-child { + margin: 0 6%; + } + } + } + .imgBox_four { + width: 200px; + padding: 6px 0; + text-align: center; + border: solid 1px #eee; + img { + width: 22%; + height: 40px; + margin: 0 2% 0 0; + &:first-child { + margin: 0 2%; + } + } + } + .imgBox_one { + width: 60px; + padding: 6px; + text-align: center; + border: solid 1px #eee; + img { + width: 100%; + height: 40px; + } + } + .imgBox_info { + width: 200px; + padding: 6px; + overflow: hidden; + border: solid 1px #eee; + .title { + width: 100%; + line-height: 30px; + text-align: center; + } + .infoBox { + .name { + line-height: 28px; + } + .map { + width: 100%; + text-align: center; + img { + width: 90%; + } + } + } + } + .hint { + margin: 0 0 0 10px; + color: #f00; + } + .addBtn { + margin: 0 0 10px 0; + } + } + .overflowText { + display: -webkit-box; + max-width: 200px; + overflow: hidden; + text-align: left; + text-overflow: -o-ellipsis-lastline; + text-overflow: ellipsis; + -webkit-line-clamp: 1; + line-clamp: 1; + -webkit-box-orient: vertical; + } \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.html b/src/app/routes/partner/scrollimg/components/list/list.component.html new file mode 100644 index 00000000..54ecf965 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.html @@ -0,0 +1,62 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + + +
    diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.less b/src/app/routes/partner/scrollimg/components/list/list.component.less new file mode 100644 index 00000000..0aae2779 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.less @@ -0,0 +1 @@ +@import '~@delon/theme/index'; diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts b/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts new file mode 100644 index 00000000..c8ac7672 --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { AdComponentsListComponent } from './list.component'; + +describe('AdComponentsListComponent', () => { + let component: AdComponentsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AdComponentsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdComponentsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/partner/scrollimg/components/list/list.component.ts b/src/app/routes/partner/scrollimg/components/list/list.component.ts new file mode 100644 index 00000000..f1b7e90d --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.component.ts @@ -0,0 +1,283 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ScrollImgService } from '../../services/scrollimg.service'; + +@Component({ + selector: 'app-scrollimg-components-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.less'] +}) + +export class ScrollImgComponentsListComponent implements OnInit { + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + appList: any[] = []; + _$expand = false; + selectApp = { + appName: '', + appId: '' + }; + isLoading: boolean = false; + + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor(public service: ScrollImgService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (params.status === '') { + delete params.status; + } + if (params.style === '') { + delete params.style; + } + if (params.navigationId === '') { + delete params.navigationId; + } + return { ...params}; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit() { + this.initSF(); + this.initST(); + } + selectAppFun(item: any) { + this.selectApp = item; + this.st.load(1); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + initSF() { + this.schema = { + properties: { + _$expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + name: { + type: 'string', + title: '轮播图名称', + maxLength: 10, + ui: { + widget: '', + placeholder: '请输入', + } + }, + status1: { + type: 'string', + title: '可见范围', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '全部可见', value: 2 }, + { label: '渠道销售可见', value: 3 }, + { label: '合伙人可见', value: 4 }, + ] + }, + status: { + type: 'string', + title: '状态', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema, + enum: [ + { label: '全部', value: 1 }, + { label: '正常', value: 2 }, + { label: '禁用', value: 3 } + ] + }, + }, + }; + this.ui = { + '*': { + spanLabelFixed: 110, + grid: { span: 8 }, + }, + }; + } + + initST() { + this.columns = [ + { + title: '轮播图名称', // 位:px + index: 'name', + className: 'text-center' + }, + { + title: '轮播图', + index: 'navigationName', + className: 'text-center' + }, + { + title: '可见范围', + index: 'navigationName', + className: 'text-center' + }, + { + title: '排序', // 位 px + index: 'sortId', + className: 'text-center' + }, + { + title: '状态', // 位 px + index: 'style', + className: 'text-center', + type: 'enum', + enum: { + 1: '正常', + 2: '禁用', + } + }, + { + title: '最后修改时间', // 位 px + index: 'createTime', + className: 'text-center' + }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 280, + buttons: [ + { + text: '修改', + click: (item) => { + this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar }); + } + }, + { + text: '禁用', + pop: { + title: `是否确认禁用?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item.id); + }, + iif: (item) => item.status === 1 + }, + { + text: '启用', + pop: { + title: `是否确认启用?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.changeStatus(item); + }, + iif: (item) => item.status === 2 + }, + { + text: '查看', + click: (item) => { + this.router.navigate(['../view'], { queryParams: { id: item.id, type: 'view' }, relativeTo: this.ar }); + } + }, + { + text: '删除', + pop: { + title: `确定删除吗?`, + okType: 'danger', + icon: 'alert', + }, + click: (item) => { + this.del(item); + }, + iif: (item) => item.status === 2 + }, + { + text: '操作记录', + click: (item) => { + this.router.navigate(['../operatordata'], { queryParams: { id: item.id }, relativeTo: this.ar }); + } + }, + ], + }, + ]; + } + changeStatus(item: any) { + const params = { + status, + idList: [item.id] + }; + // this.service.request(this.service.$api_openOrClose, params).subscribe(res => { + // if (res) { + // this.st.reload(); + // } + // }); + } + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + + /** + * 新增单个实例 + */ + add() { + this.router.navigate(['../detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar }); + } + + /** + * 删除单个实例 + */ + del(item: any) { + const ids = []; + ids.push(item.id); + this.service.request(this.service.$api_del_many, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.reload(); + } + }); + } +} diff --git a/src/app/routes/partner/scrollimg/components/list/list.less b/src/app/routes/partner/scrollimg/components/list/list.less new file mode 100644 index 00000000..d9b6c73f --- /dev/null +++ b/src/app/routes/partner/scrollimg/components/list/list.less @@ -0,0 +1,9 @@ +.selectApp { + display: flex; + .appTitle { + font-size: 14px; + } + } + .redfont{ + color: #f00; + } \ No newline at end of file diff --git a/src/app/routes/partner/scrollimg/services/scrollimg.service.ts b/src/app/routes/partner/scrollimg/services/scrollimg.service.ts new file mode 100644 index 00000000..0af4095c --- /dev/null +++ b/src/app/routes/partner/scrollimg/services/scrollimg.service.ts @@ -0,0 +1,12 @@ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from '@shared'; + +@Injectable({ + providedIn: 'root', +}) +export class ScrollImgService extends BaseService { + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/passport/callback.component.ts b/src/app/routes/passport/callback.component.ts deleted file mode 100644 index 8e205c62..00000000 --- a/src/app/routes/passport/callback.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { SocialService } from '@delon/auth'; -import { SettingsService } from '@delon/theme'; - -@Component({ - selector: 'app-callback', - template: ``, - providers: [SocialService] -}) -export class CallbackComponent implements OnInit { - type = ''; - - constructor(private socialService: SocialService, private settingsSrv: SettingsService, private route: ActivatedRoute) {} - - ngOnInit(): void { - this.type = this.route.snapshot.params.type; - this.mockModel(); - } - - private mockModel(): void { - const info = { - token: '123456789', - name: 'cipchk', - email: `${this.type}@${this.type}.com`, - id: 10000, - time: +new Date() - }; - this.settingsSrv.setUser({ - ...this.settingsSrv.user, - ...info - }); - this.socialService.callback(info); - } -} diff --git a/src/app/routes/passport/components/login/login.component.html b/src/app/routes/passport/components/login/login.component.html new file mode 100644 index 00000000..79afbdb7 --- /dev/null +++ b/src/app/routes/passport/components/login/login.component.html @@ -0,0 +1,156 @@ + + +
    +
    +
    +
    + + +
    +
    + +
    + + + + 获取验证码 + + 请等待{{ count }}s + diff --git a/src/app/routes/passport/components/login/login.component.less b/src/app/routes/passport/components/login/login.component.less new file mode 100644 index 00000000..5e69a1b2 --- /dev/null +++ b/src/app/routes/passport/components/login/login.component.less @@ -0,0 +1,193 @@ +.body-box { + display : flex; + -webkit-flex-direction: column; + -ms-flex-direction : column; + flex-direction : column; + justify-content : space-between; + width : 100%; + max-width : 960px; + height : calc(100vh - 64px); + margin : auto; + -webkit-box-orient : vertical; + + .box-content { + width : 100%; + height : 600px; + border-radius: 0px 16px 16px 0px; + + .login-logo { + width : 310px; + height: 600px; + } + + .login-box { + flex : 1; + background-color: #fff; + + .login-box-content { + max-width: 434px; + margin : auto; + padding : 88px 0 38px; + } + } + + .form-box { + margin : 0 auto; + padding: 40px 88px 40px; + + + .title { + margin-bottom: 30px; + color : #1890ff; + font-weight : 800; + font-size : 32px; + text-align : center; + } + + .other { + margin-top : 24px; + line-height: 22px; + text-align : left; + } + } + } + + .box-footer { + padding-top: 70px; + color : #626262; + font-weight: 400; + font-size : 14px; + text-align : center; + } +} + +.forgetPwd { + font-weight: 400; + color : #26282A; + font-size : 14px; + text-align : center; + cursor : pointer; +} + +.agreement { + text-align: center; + font-size : 12px; + color : #86909C; + margin-top: 88px; + + a { + color: #E60012; + } +} + +::ng-deep { + passport-login { + background-color: #F8FBFD; + } + + .pro-passport { + min-height: calc(100vh - 64px); + } +} + +:host ::ng-deep { + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + } + + /* 火狐 */ + input[type='number'] { + -moz-appearance: textfield; + } + + // tabs样式调整 + .ant-tabs-nav-list { + width: 281px; + + .ant-tabs-tab-btn { + font-size : 24px; + color : #86909C; + font-weight: 500; + } + + } + + .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn { + color: #26282A; + } + + .ant-tabs-tab { + padding: 8px 0; + } + + .ant-tabs-top>.ant-tabs-nav { + margin: 0 0 38px 0; + + .ant-tabs-ink-bar { + background: #26282A; + } + } + + // input 框样式修改 + nz-input-group { + height : 44px; + font-size : 14px; + border-radius: 4px; + border-color : #E5E6EB; + box-shadow : none; + } + + .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover { + border-color: #E5E6EB; + } + + .ant-input { + padding : 10px 16px; + border-color : #E5E6EB; + border-radius: 4px; + font-size : 14px; + box-shadow : none; + } + + .ant-form-item { + margin-bottom: 32px; + } + + .ant-form-item-with-help { + margin-bottom: 0 !important; + } + + .ant-form-item-explain, + .ant-form-item-extra { + min-height : 32px; + line-height: 2; + } + + // 按钮样式修改 + .ant-btn { + padding: 0 16px 12px; + } + + .ant-btn-primary { + color : #fff; + background : #26282A; + border-color : #26282A; + font-size : 14px; + line-height : 40px; + height : 44px; + border-radius: 4px + } +} + +@media (max-width: 990px) { + .box-content { + + .login-logo { + width : 0px !important; + height: 0px !important; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/passport/components/login/login.component.ts b/src/app/routes/passport/components/login/login.component.ts new file mode 100644 index 00000000..d9874028 --- /dev/null +++ b/src/app/routes/passport/components/login/login.component.ts @@ -0,0 +1,232 @@ +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnDestroy, OnInit, Optional, ViewChild } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; +import { StartupService } from '@core'; +import { ReuseTabService } from '@delon/abc/reuse-tab'; +import { DA_SERVICE_TOKEN, ITokenService, SocialOpenType, SocialService } from '@delon/auth'; +import { SFComponent, SFSchema, SFUISchema, SFStringWidgetSchema } from '@delon/form'; +import { SettingsService, _HttpClient } from '@delon/theme'; +import { environment } from '@env/environment'; +import { NzTabChangeEvent } from 'ng-zorro-antd/tabs'; +import { interval } from 'rxjs'; +import { finalize, take } from 'rxjs/operators'; +import { DunHelper } from 'src/app/shared/components/captcha'; +import { EAUserService, EACaptchaService, EAValidateService, EAPlatformService } from 'src/app/shared/services'; + +@Component({ + selector: 'passport-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.less'], + host: { + '[class.ant-row]': 'true', + '[class.pro-passport]': 'true' + } +}) +export class UserLoginComponent implements OnInit, OnDestroy { + @ViewChild('accountSF', { static: false }) + accountSF!: SFComponent; + @ViewChild('captchaSF', { static: false }) + captchaSF!: SFComponent; + accountSchema!: SFSchema; + accountUI!: SFUISchema; + captchaSchema!: SFSchema; + captchaUI!: SFUISchema; + count = 0; + type = 0; + + isPasswordType = true; + // vcode = null; + + copyright = ''; + constructor( + public userSrv: EAUserService, + private captchaSrv: EACaptchaService, + private validateSrv: EAValidateService, + private dunHelper: DunHelper, + private cdr: ChangeDetectorRef, + private router: Router + ) { + // this.vcode = this.platformSrv.getOperatorCode(); + // 加载copyright信息 + // this.userSrv + // .request(this.platformSrv.$api_get_config, { + // pageIndex: 1, + // pageSize: 999, + // }) + // .subscribe((res: any) => { + // this.copyright = res?.records?.find((f: any) => f.configKey === 'website.copyright')?.configValue; + // this.imageUrl = res?.records?.find((f: any) => f.configKey === 'platform.saas.logo')?.configValue; + // }); + } + + ngOnInit(): void { + this.initAccountSF(); + this.initCaptchaSF(); + } + + initAccountSF(): void { + this.accountSchema = { + properties: { + username: { + title: '', + type: 'string', + maxLength: 11, + ui: { + widget: 'custom', + size: 'large', + errors: { required: '请输入手机号', format: '手机号格式错误' } + } + }, + password: { + title: '', + type: 'string', + ui: { + widget: 'custom', + size: 'large', + errors: { required: '请输入密码' } + } + } + // sc: { + // title: '', + // type: 'string', + // ui: { + // hidden: !!this.vcode, + // placeholder: '请输入安全码', + // prefixIcon: 'safety', + // size: 'large', + // errors: { + // required: '请输入安全码' + // } + // } as SFStringWidgetSchema, + // default: this.vcode + // } + }, + required: ['username', 'password'] + }; + this.accountUI = { + '*': { spanLabelFixed: 110, grid: { span: 24 } } + }; + } + + initCaptchaSF(): void { + this.captchaSchema = { + properties: { + phone: { + title: '', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + placeholder: '请输入手机号', + widget: 'custom', + size: 'large', + errors: { required: '请输入手机号!', format: '手机号格式错误' } + } + }, + smsCode: { + title: '', + type: 'string', + maxLength: 6, + ui: { + widget: 'custom', + size: 'large', + errors: { required: '请输入验证码!', maxLength: '验证码错误' } + } + } + // sc: { + // title: '', + // type: 'string', + // ui: { + // hidden: !!this.vcode, + // placeholder: '请输入安全码', + // prefixIcon: 'safety', + // size: 'large', + // errors: { + // required: '请输入安全码' + // } + // } as SFStringWidgetSchema, + // default: this.vcode + // } + }, + required: ['phone', 'smsCode'] + }; + this.captchaUI = { + '*': { spanLabelFixed: 110, grid: { span: 24 } } + }; + } + + /** + * 获取验证码 + */ + getCaptcha(): void { + this.captchaSF.getProperty('/phone')?.updateValueAndValidity(); + const result = this.validateSrv.validateMobile(this.captchaSF.value.phone); + // this.captchaSrv.sendSMSCaptchaByMobile(); + if (result) { + this.captchaSrv.sendSMSCaptchaByMobile(this.captchaSF.value.phone).subscribe(res => { + console.log(res); + + if (res.success && res.data.code === '1') { + this.captchaSrv.msgSrv.success('发送验证码成功'); + this.createInterval(); + } + // else if (res.status === 503609) { + // this.dunHelper.popUp(this.captchaSF.value.phone).subscribe(_ => { + // this.createInterval(); + // this.dunHelper.destory(); + // }); + // } + else { + this.captchaSrv.msgSrv.warning(res.msg); + } + }); + } + } + + /** + * 登录 + */ + submit(): void { + if (this.type === 0) { + this.accountSF.validator({ emitError: true }); + if (!this.accountSF.valid) { + return; + } + this.userSrv.loginByAccount(this.accountSF.value.username, this.accountSF.value.password); + } else { + this.captchaSF.validator({ emitError: true }); + if (!this.captchaSF.valid) { + return; + } + this.userSrv.loginByMobile(this.captchaSF.value.phone, this.captchaSF.value.smsCode, this.captchaSF.value.sc); + } + // this.router.navigateByUrl('/'); + /* if (!this.accountSF.valid && !this.captchaSF.valid) { + return; + } + + Object.prototype.hasOwnProperty.call(value, 'username') + ? this.userSrv.loginByAccount(value.username, value.password) + : this.userSrv.loginByCaptcha(value.phone, value.smsCode); */ + } + + switch(ret: any) { + this.type = ret.index; + } + + ngOnDestroy(): void {} + + changeInputType(a: any) { + console.log(a); + } + + private createInterval() { + this.count = 59; + interval(1000) + .pipe(take(60)) + .subscribe(x => { + this.count = 59 - (x + 1); + this.cdr.detectChanges(); + }); + } +} diff --git a/src/app/routes/passport/components/order-agreement/order-agreement.component.html b/src/app/routes/passport/components/order-agreement/order-agreement.component.html new file mode 100644 index 00000000..a9106098 --- /dev/null +++ b/src/app/routes/passport/components/order-agreement/order-agreement.component.html @@ -0,0 +1,19 @@ + +
    +
    +

    + {{ agreementContent?.agreementName }} +

    +

    最新版本生效日期:{{ agreementContent?.modifyTime }}

    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/passport/components/order-agreement/order-agreement.component.less b/src/app/routes/passport/components/order-agreement/order-agreement.component.less new file mode 100644 index 00000000..867915ea --- /dev/null +++ b/src/app/routes/passport/components/order-agreement/order-agreement.component.less @@ -0,0 +1,12 @@ +@import '~@delon/theme/index'; + +:host { + .page-box { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 50px; + background-color: #fff; + } +} diff --git a/src/app/routes/passport/components/order-agreement/order-agreement.component.ts b/src/app/routes/passport/components/order-agreement/order-agreement.component.ts new file mode 100644 index 00000000..5fa44cad --- /dev/null +++ b/src/app/routes/passport/components/order-agreement/order-agreement.component.ts @@ -0,0 +1,50 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-14 14:17:38 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-25 13:52:54 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\passport\\components\\order-agreement\\order-agreement.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Params } from '@angular/router'; +import { PassportService } from '../../services/passport.service'; + +@Component({ + selector: 'app-buyer-components-serve-order-agreement', + templateUrl: './order-agreement.component.html', + styleUrls: ['./order-agreement.component.less'] +}) +export class OrderAgreementComponent implements OnInit { + agreementContent: any; + type = 2; + data : any; + constructor(private ar: ActivatedRoute, private service: PassportService) { + ar.queryParams.subscribe((params: Params) => { + console.log(params); + + this.type = params?.type || 2; + this.data = JSON.parse(params?.data) || {}; + }); + } + ngOnInit() { + console.log(this.type); + if(this.type == 3) { + console.log(this.data); + + this.service.request(this.service.$api_get_getSupplementaryAgreement, { billId: this.data?.billId, billCode: this.data?.billCode }).subscribe(res => { + if (res) { + this.agreementContent = res; + } + }); + } else { + this.service.request(this.service.$api_get_agreement, { type: this.type }).subscribe(res => { + if (res) { + this.agreementContent = res; + } + }); + } + } +} diff --git a/src/app/routes/passport/components/retrieve-password/retrieve-password.component.html b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.html new file mode 100644 index 00000000..cd15accc --- /dev/null +++ b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.html @@ -0,0 +1,140 @@ +
    + + + + + + + +
    + +
    +
    +
    + + 手机号 + + + + + + 验证码 + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    +
    + + 设置新密码 + + + + + + + + +
    +
    + + +
    + +
    +
    + + 重复新密码 + + + + + + + + + +
    +
    + + +
    + +
    +
    + + + + + +
    +
    +
    +
    + + + + +
    + + 密码设置成功! + 密码设置失败! +
    +
    + +
    请牢记您的新密码,3秒后自动跳转至登录页...
    +
    + + + +
    +
    +
    +
    +
    + + + + 获取验证码 + + 请等待{{ count }}s + + + \ No newline at end of file diff --git a/src/app/routes/passport/components/retrieve-password/retrieve-password.component.less b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.less new file mode 100644 index 00000000..1922612a --- /dev/null +++ b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.less @@ -0,0 +1,85 @@ +:host { + ::ng-deep { + .ant-steps { + width : 500px; + margin: 0 auto; + } + + .ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-tail::after { + background-color: #999494; + } + + .ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-tail::after { + background-color: #999494; + } + + .ant-spin-container { + background-color: #f8f8f8; + } + + .ant-form-item-label>label { + height: 40px; + } + + } + + .main { + max-width: 1200px; + margin : 0 auto; + overflow : hidden; + } + + page-grid { + width : 100%; + height : 100%; + margin : 100px auto; + background-color: #fff; + + .myForm { + margin-top : 3rem; + margin-bottom: 5rem; + } + + .steps-content { + min-height : 250px; + margin-top : 16px; + background-color: #fff; + border : 1px dashed #e9e9e9; + border-radius : 6px; + // text-align: center; + } + + .steps-action { + margin-top: 24px; + } + + button { + margin-right: 8px; + } + } +} + +.input-tootip { + display : flex; + align-items : center; + width : 250px; + padding-left: 20px; + + .dot { + color : #bdb8b8; + font-size: 21px; + } + + .valid-icon { + color: rgb(217 0 27); + } + + .invalid-icon { + color: rgb(82 196 26); + } + + .tootip-label { + margin-left: 8px; + font-size : 12px; + } +} \ No newline at end of file diff --git a/src/app/routes/passport/components/retrieve-password/retrieve-password.component.ts b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.ts new file mode 100644 index 00000000..df0184b0 --- /dev/null +++ b/src/app/routes/passport/components/retrieve-password/retrieve-password.component.ts @@ -0,0 +1,187 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; +import { interval } from 'rxjs'; +import { take } from 'rxjs/operators'; +import { EAUserService } from 'src/app/shared/services/business/user.service'; + +@Component({ + selector: 'app-routes-password-retrieve-password', + templateUrl: './retrieve-password.component.html', + styleUrls: ['./retrieve-password.component.less'] +}) +export class UserRetrievePasswordComponent implements OnInit, AfterViewInit { + step = 0; + count = 0; + formGroup1!: FormGroup; + formGroup2!: FormGroup; + confirmPasswordValidator!: ValidatorFn; + result = true; + + isPassWordHide = true; + isConfirmPassWordHide = true; + + constructor(private fb: FormBuilder, public service: EAUserService, private router: Router, private cdr: ChangeDetectorRef) {} + + ngAfterViewInit(): void {} + + ngOnInit() { + this.initForm(); + } + + initForm() { + this.confirmPasswordValidator = control => { + if (!control.value) { + return { error: true, required: true }; + } else if (control.value !== this.formGroup2.controls.passWord.value) { + return { passWordTo: true, error: true }; + } + return {}; + }; + + this.formGroup1 = this.fb.group({ + phone: [null, [Validators.required]], + smsVerifyCode: [null, [Validators.required]], + voucher: [null, [Validators.required]] + }); + + this.formGroup2 = this.fb.group({ + passWord: [ + null, + [ + Validators.required, + Validators.maxLength(16), + Validators.minLength(8), + Validators.pattern('^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z-_]{8,16}$') + ] + ], + passWordTo: [null, [this.confirmPasswordValidator, Validators.maxLength(16), Validators.minLength(8)]], + voucher: [null, [Validators.required]], + phone: [null, [Validators.required]] + }); + } + + formSubmit() { + switch (this.step) { + case 0: + this.submitForm1(); + break; + case 1: + this.submitForm2(); + break; + } + } + + submitForm1() { + for (const i in this.formGroup1.controls) { + if (this.formGroup1.controls[i]) { + this.formGroup1.controls[i].markAsDirty(); + this.formGroup1.controls[i].updateValueAndValidity(); + } + } + if (this.formGroup1.value.smsVerifyCode.length !== 6) { + this.service.msgSrv.error('请输入6位验证码'); + return; + } + if (this.formGroup1.valid) { + const param = Object.assign({}, this.formGroup1.value); + this.service.http.post(this.service.$forgetPasswordVerifyIdentity, param).subscribe((res: any) => { + // console.log(res, 'submitForm1'); + if (res.success === true) { + this.formGroup2.patchValue( + { + voucher: res.data.voucher, + phone: this.formGroup1.value.phone + }, + { onlySelf: true } + ); + this.step = 1; + // clearInterval(this.interval$); + } else { + this.service.msgSrv.warning(res?.msg || '操作超时,请重新开始找回密码的流程!'); + // this.refreshPage(); + } + }); + } + } + + submitForm2() { + for (const i in this.formGroup2.controls) { + if (this.formGroup2.controls[i]) { + this.formGroup2.controls[i].markAsDirty(); + this.formGroup2.controls[i].updateValueAndValidity(); + } + } + + if (this.formGroup2.valid) { + this.service.http + .post(this.service.$voucherUpdatePassword, this.formGroup2.value) + .subscribe((res: { success: any; data: boolean; msg: any }) => { + if (res.success && res.data === true) { + this.result = true; + this.step = 2; + setTimeout(() => { + //this.service.logout(); + this.router.navigateByUrl('/passport/login'); + }, 3000); + } else { + this.result = false; + this.service.msgSrv.warning(res.msg || '密码修改失败!'); + } + }); + } + } + + getCaptcha() { + for (const i in this.formGroup1.controls) { + if (true) { + this.formGroup1.controls[i].markAsDirty(); + this.formGroup1.controls[i].updateValueAndValidity(); + } + } + if (this.formGroup1.value.phone.length !== 11) { + this.service.msgSrv.error('请输入11位手机号'); + return; + } + if (this.formGroup1.value.phone) { + this.service.http + .post(`${this.service.$getAccountSMVerificationCode}`, null, { phoneNumber: this.formGroup1.value.phone }) + .subscribe((res: any) => { + // console.log(res, 'res'); + if (res.success) { + this.formGroup1.patchValue( + { + voucher: res?.data?.voucher + }, + { onlySelf: true } + ); + if (res?.data?.code === '1') { + this.codeCountDown(); + this.service.msgSrv.success('验证码已发送到该账号绑定的手机号!'); + } else if (res?.data?.code === '503046') { + // this.dun.popUp(); + } else { + this.service.msgSrv.error('获取验证码失败!'); + } + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + } + + /* code倒计时 */ + codeCountDown() { + this.count = 59; + interval(1000) + .pipe(take(60)) + .subscribe(x => { + this.count = 59 - (x + 1); + this.cdr.detectChanges(); + }); + } + + validateConfirmPassword(): void { + setTimeout(() => this.formGroup2.controls.passWordTo.updateValueAndValidity()); + } +} diff --git a/src/app/routes/passport/lock/lock.component.html b/src/app/routes/passport/lock/lock.component.html deleted file mode 100644 index 7f56ecdd..00000000 --- a/src/app/routes/passport/lock/lock.component.html +++ /dev/null @@ -1,21 +0,0 @@ -
    -
    -
    - -
    -
    - - - - - - - - - - - - -
    -
    -
    \ No newline at end of file diff --git a/src/app/routes/passport/lock/lock.component.less b/src/app/routes/passport/lock/lock.component.less deleted file mode 100644 index 80251d7a..00000000 --- a/src/app/routes/passport/lock/lock.component.less +++ /dev/null @@ -1,12 +0,0 @@ -:host ::ng-deep { - .ant-card-body { - position: relative; - margin-top: 80px; - } - .avatar { - position: absolute; - top: -20px; - left: 50%; - margin-left: -20px; - } -} diff --git a/src/app/routes/passport/lock/lock.component.ts b/src/app/routes/passport/lock/lock.component.ts deleted file mode 100644 index aac5496b..00000000 --- a/src/app/routes/passport/lock/lock.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Component, Inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; -import { SettingsService, User } from '@delon/theme'; - -@Component({ - selector: 'passport-lock', - templateUrl: './lock.component.html', - styleUrls: ['./lock.component.less'] -}) -export class UserLockComponent { - f: FormGroup; - - get user(): User { - return this.settings.user; - } - - constructor( - fb: FormBuilder, - @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, - private settings: SettingsService, - private router: Router - ) { - this.f = fb.group({ - password: [null, Validators.required] - }); - } - - submit(): void { - for (const i in this.f.controls) { - this.f.controls[i].markAsDirty(); - this.f.controls[i].updateValueAndValidity(); - } - if (this.f.valid) { - console.log('Valid!'); - console.log(this.f.value); - this.tokenService.set({ - token: '123' - }); - this.router.navigate(['dashboard']); - } - } -} diff --git a/src/app/routes/passport/login/login.component.html b/src/app/routes/passport/login/login.component.html deleted file mode 100644 index 924ddc48..00000000 --- a/src/app/routes/passport/login/login.component.html +++ /dev/null @@ -1,77 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - 请输入手机号! - - - 手机号格式错误! - - - - - - - - - - - - - - - - - - - - - - - - - - 忘记密码 - - - - - -
    -
    - 其他登录方式 - - - - 注册账户 -
    \ No newline at end of file diff --git a/src/app/routes/passport/login/login.component.less b/src/app/routes/passport/login/login.component.less deleted file mode 100644 index eb8287b9..00000000 --- a/src/app/routes/passport/login/login.component.less +++ /dev/null @@ -1,53 +0,0 @@ -@import '~@delon/theme/index'; -:host { - display: block; - width: 368px; - margin: 0 auto; - ::ng-deep { - .ant-tabs .ant-tabs-bar { - margin-bottom: 24px; - text-align: center; - border-bottom: 0; - } - .ant-tabs-tab { - font-size: 16px; - line-height: 24px; - } - .ant-input-affix-wrapper .ant-input:not(:first-child) { - padding-left: 4px; - } - .icon { - margin-left: 16px; - color: rgba(0, 0, 0, 0.2); - font-size: 24px; - vertical-align: middle; - cursor: pointer; - transition: color 0.3s; - &:hover { - color: @primary-color; - } - } - .other { - margin-top: 24px; - line-height: 22px; - text-align: left; - nz-tooltip { - vertical-align: middle; - } - .register { - float: right; - } - } - } -} - -[data-theme='dark'] { - :host ::ng-deep { - .icon { - color: rgba(255, 255, 255, 0.2); - &:hover { - color: #fff; - } - } - } -} diff --git a/src/app/routes/passport/login/login.component.ts b/src/app/routes/passport/login/login.component.ts deleted file mode 100644 index 99300009..00000000 --- a/src/app/routes/passport/login/login.component.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnDestroy, Optional } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { StartupService } from '@core'; -import { ReuseTabService } from '@delon/abc/reuse-tab'; -import { DA_SERVICE_TOKEN, ITokenService, SocialOpenType, SocialService } from '@delon/auth'; -import { SettingsService, _HttpClient } from '@delon/theme'; -import { environment } from '@env/environment'; -import { NzTabChangeEvent } from 'ng-zorro-antd/tabs'; -import { finalize } from 'rxjs/operators'; - -@Component({ - selector: 'passport-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.less'], - providers: [SocialService], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class UserLoginComponent implements OnDestroy { - constructor( - fb: FormBuilder, - private router: Router, - private settingsService: SettingsService, - private socialService: SocialService, - @Optional() - @Inject(ReuseTabService) - private reuseTabService: ReuseTabService, - @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, - private startupSrv: StartupService, - private http: _HttpClient, - private cdr: ChangeDetectorRef - ) { - this.form = fb.group({ - userName: [null, [Validators.required]], - password: [null, [Validators.required]], - mobile: [null, [Validators.required, Validators.pattern(/^1\d{10}$/)]], - captcha: [null, [Validators.required]], - remember: [true] - }); - } - - // #region fields - - get userName(): AbstractControl { - return this.form.controls.userName; - } - get password(): AbstractControl { - return this.form.controls.password; - } - get mobile(): AbstractControl { - return this.form.controls.mobile; - } - get captcha(): AbstractControl { - return this.form.controls.captcha; - } - form: FormGroup; - error = ''; - type = 0; - loading = false; - - // #region get captcha - - count = 0; - interval$: any; - - // #endregion - - switch({ index }: NzTabChangeEvent): void { - this.type = index!; - } - - getCaptcha(): void { - if (this.mobile.invalid) { - this.mobile.markAsDirty({ onlySelf: true }); - this.mobile.updateValueAndValidity({ onlySelf: true }); - return; - } - this.count = 59; - this.interval$ = setInterval(() => { - this.count -= 1; - if (this.count <= 0) { - clearInterval(this.interval$); - } - }, 1000); - } - - // #endregion - - submit(): void { - this.error = ''; - if (this.type === 0) { - this.userName.markAsDirty(); - this.userName.updateValueAndValidity(); - this.password.markAsDirty(); - this.password.updateValueAndValidity(); - if (this.userName.invalid || this.password.invalid) { - return; - } - } else { - this.mobile.markAsDirty(); - this.mobile.updateValueAndValidity(); - this.captcha.markAsDirty(); - this.captcha.updateValueAndValidity(); - if (this.mobile.invalid || this.captcha.invalid) { - return; - } - } - - // 默认配置中对所有HTTP请求都会强制 [校验](https://ng-alain.com/auth/getting-started) 用户 Token - // 然一般来说登录请求不需要校验,因此可以在请求URL加上:`/login?_allow_anonymous=true` 表示不触发用户 Token 校验 - this.loading = true; - this.cdr.detectChanges(); - this.befaultLogin(); - return; - this.http - .post('/login/account?_allow_anonymous=true', { - type: this.type, - userName: this.userName.value, - password: this.password.value - }) - .pipe( - finalize(() => { - this.loading = true; - this.cdr.detectChanges(); - }) - ) - .subscribe(res => { - if (res.msg !== 'ok') { - this.error = res.msg; - this.cdr.detectChanges(); - return; - } - // 清空路由复用信息 - this.reuseTabService.clear(); - // 设置用户Token信息 - // TODO: Mock expired value - res.user.expired = +new Date() + 1000 * 60 * 5; - this.tokenService.set(res.user); - // 重新获取 StartupService 内容,我们始终认为应用信息一般都会受当前用户授权范围而影响 - this.startupSrv.load().then(() => { - let url = this.tokenService.referrer!.url || '/'; - if (url.includes('/passport')) { - url = '/'; - } - this.router.navigateByUrl(url); - }); - }); - } - - befaultLogin() { - // 清空路由复用信息 - this.reuseTabService.clear(); - // 设置用户Token信息 - // TODO: Mock expired value - // 重新获取 StartupService 内容,我们始终认为应用信息一般都会受当前用户授权范围而影响 - this.startupSrv.load().then(() => { - let url = this.tokenService.referrer!.url || '/'; - if (url.includes('/passport')) { - url = '/'; - } - this.router.navigateByUrl(url); - }); - } - - // #region social - - open(type: string, openType: SocialOpenType = 'href'): void { - let url = ``; - let callback = ``; - if (environment.production) { - callback = `https://ng-alain.github.io/ng-alain/#/passport/callback/${type}`; - } else { - callback = `http://localhost:4200/#/passport/callback/${type}`; - } - switch (type) { - case 'auth0': - url = `//cipchk.auth0.com/login?client=8gcNydIDzGBYxzqV0Vm1CX_RXH-wsWo5&redirect_uri=${decodeURIComponent(callback)}`; - break; - case 'github': - url = `//github.com/login/oauth/authorize?client_id=9d6baae4b04a23fcafa2&response_type=code&redirect_uri=${decodeURIComponent( - callback - )}`; - break; - case 'weibo': - url = `https://api.weibo.com/oauth2/authorize?client_id=1239507802&response_type=code&redirect_uri=${decodeURIComponent(callback)}`; - break; - } - if (openType === 'window') { - this.socialService - .login(url, '/', { - type: 'window' - }) - .subscribe(res => { - if (res) { - this.settingsService.setUser(res); - this.router.navigateByUrl('/'); - } - }); - } else { - this.socialService.login(url, '/', { - type: 'href' - }); - } - } - - // #endregion - - ngOnDestroy(): void { - if (this.interval$) { - clearInterval(this.interval$); - } - } -} diff --git a/src/app/routes/passport/login2/login2.component.html b/src/app/routes/passport/login2/login2.component.html deleted file mode 100644 index b07a7154..00000000 --- a/src/app/routes/passport/login2/login2.component.html +++ /dev/null @@ -1,56 +0,0 @@ - -
    -
    -
    -

    Work with us

    -

    Our researchers are embedded in teams across computer science, to discover, invent, and build at the largest - scale.

    -
    -
    -
    - -

    注册

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    \ No newline at end of file diff --git a/src/app/routes/passport/login2/login2.component.less b/src/app/routes/passport/login2/login2.component.less deleted file mode 100644 index cc23d678..00000000 --- a/src/app/routes/passport/login2/login2.component.less +++ /dev/null @@ -1,28 +0,0 @@ -@import '~@delon/theme/index'; - -:host ::ng-deep { - .pro-passport__bg { - position: relative; - display: flex; - align-items: center; - padding: 48px; - @media (max-width: @screen-md-max) { - display: none !important; - } - .text { - position: relative; - padding: 0 64px; - color: #fff; - h1 { - margin-bottom: 24px; - color: #fff; - font-weight: 900; - font-size: 56px; - } - p { - font-size: 22px; - line-height: 32px; - } - } - } -} diff --git a/src/app/routes/passport/login2/login2.component.ts b/src/app/routes/passport/login2/login2.component.ts deleted file mode 100644 index 06b0d178..00000000 --- a/src/app/routes/passport/login2/login2.component.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Component, OnDestroy } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { _HttpClient } from '@delon/theme'; -import { NzMessageService } from 'ng-zorro-antd/message'; - -@Component({ - selector: 'passport-login2', - templateUrl: './login2.component.html', - styleUrls: ['./login2.component.less'], - host: { - '[class.ant-row]': 'true', - '[class.pro-passport]': 'true' - } -}) -export class UserLogin2Component implements OnDestroy { - form: FormGroup; - error = ''; - - constructor(fb: FormBuilder, private router: Router, private msg: NzMessageService, public http: _HttpClient) { - this.form = fb.group({ - mobilePrefix: ['+86'], - mobile: [null, [Validators.required, Validators.pattern(/^1\d{10}$/)]], - captcha: [null, [Validators.required]], - password: [null, [Validators.required, Validators.minLength(6)]] - }); - } - - // #region fields - - get password(): AbstractControl { - return this.form.controls.password; - } - get mobile(): AbstractControl { - return this.form.controls.mobile; - } - get captcha(): AbstractControl { - return this.form.controls.captcha; - } - - // #endregion - - // #region get captcha - - count = 0; - interval$: any; - - getCaptcha(): void { - if (this.mobile.invalid) { - this.mobile.markAsDirty({ onlySelf: true }); - this.mobile.updateValueAndValidity({ onlySelf: true }); - return; - } - this.count = 59; - this.interval$ = setInterval(() => { - this.count -= 1; - if (this.count <= 0) { - clearInterval(this.interval$); - } - }, 1000); - } - - // #endregion - - submit(): void { - this.error = ''; - const data = this.form.value; - this.http.post('/register', data).subscribe(() => { - this.router.navigate(['passport', 'register-result'], { queryParams: { email: data.mail } }); - }); - } - - ngOnDestroy(): void { - if (this.interval$) { - clearInterval(this.interval$); - } - } -} diff --git a/src/app/routes/passport/login3/login3.component.html b/src/app/routes/passport/login3/login3.component.html deleted file mode 100644 index 3ec68a6e..00000000 --- a/src/app/routes/passport/login3/login3.component.html +++ /dev/null @@ -1,51 +0,0 @@ - -
    -
    -
    - -

    注册

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    \ No newline at end of file diff --git a/src/app/routes/passport/login3/login3.component.less b/src/app/routes/passport/login3/login3.component.less deleted file mode 100644 index 63bf91c6..00000000 --- a/src/app/routes/passport/login3/login3.component.less +++ /dev/null @@ -1,13 +0,0 @@ -@import '~@delon/theme/index'; - -:host ::ng-deep { - .pro-passport { - &__form { - position: relative; - max-width: 380px; - margin: 48px auto 0 auto; - background: #fff; - border-radius: 4px; - } - } -} diff --git a/src/app/routes/passport/login3/login3.component.ts b/src/app/routes/passport/login3/login3.component.ts deleted file mode 100644 index 641e079c..00000000 --- a/src/app/routes/passport/login3/login3.component.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Component, OnDestroy } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { _HttpClient } from '@delon/theme'; -import { NzMessageService } from 'ng-zorro-antd/message'; - -@Component({ - selector: 'passport-login3', - templateUrl: './login3.component.html', - styleUrls: ['./login3.component.less'], - host: { - '[class.ant-row]': 'true', - '[class.pro-passport]': 'true' - } -}) -export class UserLogin3Component implements OnDestroy { - form: FormGroup; - error = ''; - - constructor(fb: FormBuilder, private router: Router, private msg: NzMessageService, public http: _HttpClient) { - this.form = fb.group({ - mobilePrefix: ['+86'], - mobile: [null, [Validators.required, Validators.pattern(/^1\d{10}$/)]], - captcha: [null, [Validators.required]], - password: [null, [Validators.required, Validators.minLength(6)]] - }); - } - - // #region fields - - get password(): AbstractControl { - return this.form.controls.password; - } - get mobile(): AbstractControl { - return this.form.controls.mobile; - } - get captcha(): AbstractControl { - return this.form.controls.captcha; - } - - // #endregion - - // #region get captcha - - count = 0; - interval$: any; - - getCaptcha(): void { - if (this.mobile.invalid) { - this.mobile.markAsDirty({ onlySelf: true }); - this.mobile.updateValueAndValidity({ onlySelf: true }); - return; - } - this.count = 59; - this.interval$ = setInterval(() => { - this.count -= 1; - if (this.count <= 0) { - clearInterval(this.interval$); - } - }, 1000); - } - - // #endregion - - submit(): void { - this.error = ''; - const data = this.form.value; - this.http.post('/register', data).subscribe(() => { - this.router.navigate(['passport', 'register-result'], { queryParams: { email: data.mail } }); - }); - } - - ngOnDestroy(): void { - if (this.interval$) { - clearInterval(this.interval$); - } - } -} diff --git a/src/app/routes/passport/passport-routing.module.ts b/src/app/routes/passport/passport-routing.module.ts index ba8032bd..171e40f2 100644 --- a/src/app/routes/passport/passport-routing.module.ts +++ b/src/app/routes/passport/passport-routing.module.ts @@ -2,13 +2,9 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { LayoutPassportComponent } from '../../layout/passport/passport.component'; -import { CallbackComponent } from './callback.component'; -import { UserLockComponent } from './lock/lock.component'; -import { UserLoginComponent } from './login/login.component'; -import { UserLogin2Component } from './login2/login2.component'; -import { UserLogin3Component } from './login3/login3.component'; -import { UserRegisterResultComponent } from './register-result/register-result.component'; -import { UserRegisterComponent } from './register/register.component'; +import { UserLoginComponent } from './components/login/login.component'; +import { OrderAgreementComponent } from './components/order-agreement/order-agreement.component'; +import { UserRetrievePasswordComponent } from './components/retrieve-password/retrieve-password.component'; const routes: Routes = [ // passport @@ -22,26 +18,17 @@ const routes: Routes = [ data: { title: '登录' } }, { - path: 'register', - component: UserRegisterComponent, - data: { title: '注册' } + path: 'agreement', + component: OrderAgreementComponent, + data: { title: '协议' } }, { - path: 'register-result', - component: UserRegisterResultComponent, - data: { title: '注册结果' } - }, - { - path: 'lock', - component: UserLockComponent, - data: { title: '锁屏' } + path: 'retrieve-password', + component: UserRetrievePasswordComponent, + data: { title: '忘记密码' } } ] - }, - // 单页不包裹Layout - { path: 'login2', component: UserLogin2Component }, - { path: 'login3', component: UserLogin3Component }, - { path: 'passport/callback/:type', component: CallbackComponent } + } ]; @NgModule({ diff --git a/src/app/routes/passport/passport.module.ts b/src/app/routes/passport/passport.module.ts index 964929bc..ad3a9f31 100644 --- a/src/app/routes/passport/passport.module.ts +++ b/src/app/routes/passport/passport.module.ts @@ -3,7 +3,10 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ResultModule } from '@delon/abc/result'; import { SEModule } from '@delon/abc/se'; +import { DelonACLModule } from '@delon/acl'; +import { DelonFormModule } from '@delon/form'; import { AlainThemeModule } from '@delon/theme'; +import { PipeModule } from '@shared'; import { NzAlertModule } from 'ng-zorro-antd/alert'; import { NzAvatarModule } from 'ng-zorro-antd/avatar'; import { NzButtonModule } from 'ng-zorro-antd/button'; @@ -15,28 +18,21 @@ import { NzInputModule } from 'ng-zorro-antd/input'; import { NzPopoverModule } from 'ng-zorro-antd/popover'; import { NzProgressModule } from 'ng-zorro-antd/progress'; import { NzSelectModule } from 'ng-zorro-antd/select'; +import { NzStepsModule } from 'ng-zorro-antd/steps'; import { NzTabsModule } from 'ng-zorro-antd/tabs'; import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; +import { ProPageModule } from 'src/app/layout/pro/shared/page'; +import { UserLoginComponent } from './components/login/login.component'; +import { OrderAgreementComponent } from './components/order-agreement/order-agreement.component'; +import { UserRetrievePasswordComponent } from './components/retrieve-password/retrieve-password.component'; -import { CallbackComponent } from './callback.component'; -import { UserLockComponent } from './lock/lock.component'; -import { UserLoginComponent } from './login/login.component'; -import { UserLogin2Component } from './login2/login2.component'; -import { UserLogin3Component } from './login3/login3.component'; import { PassportRoutingModule } from './passport-routing.module'; -import { UserRegisterResultComponent } from './register-result/register-result.component'; -import { UserRegisterComponent } from './register/register.component'; const COMPONENTS = [ // passport pages UserLoginComponent, - UserRegisterComponent, - UserRegisterResultComponent, - UserLockComponent, - // single pages - UserLogin2Component, - UserLogin3Component, - CallbackComponent + UserRetrievePasswordComponent, + OrderAgreementComponent ]; @NgModule({ @@ -60,7 +56,12 @@ const COMPONENTS = [ NzProgressModule, NzAvatarModule, SEModule, - ResultModule + ResultModule, + DelonACLModule, + DelonFormModule, + NzStepsModule, + ProPageModule, + PipeModule ], declarations: COMPONENTS }) diff --git a/src/app/routes/passport/register-result/register-result.component.html b/src/app/routes/passport/register-result/register-result.component.html deleted file mode 100644 index 1d637c6a..00000000 --- a/src/app/routes/passport/register-result/register-result.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
    - 你的账户:{{params?.email}} 注册成功 -
    -
    - - -
    \ No newline at end of file diff --git a/src/app/routes/passport/register-result/register-result.component.ts b/src/app/routes/passport/register-result/register-result.component.ts deleted file mode 100644 index a5a7cbc0..00000000 --- a/src/app/routes/passport/register-result/register-result.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { NzMessageService } from 'ng-zorro-antd/message'; - -@Component({ - selector: 'passport-register-result', - templateUrl: './register-result.component.html' -}) -export class UserRegisterResultComponent { - params = { email: '' }; - email = ''; - constructor(route: ActivatedRoute, public msg: NzMessageService) { - this.params.email = this.email = route.snapshot.queryParams.email || 'ng-alain@example.com'; - } -} diff --git a/src/app/routes/passport/register/register.component.html b/src/app/routes/passport/register/register.component.html deleted file mode 100644 index 61d3d43f..00000000 --- a/src/app/routes/passport/register/register.component.html +++ /dev/null @@ -1,89 +0,0 @@ -

    注册

    -
    - - - - - - - - 请输入邮箱地址! - 邮箱地址格式错误! - - - - - - - - - -
    - -
    强度:强
    -
    强度:中
    -
    强度:太短
    -
    -
    - -
    -

    请至少输入 6 个字符。请不要使用容易被猜到的密码。

    -
    -
    -
    -
    - - - - - - - 请确认密码! - 两次输入的密码不匹配! - - - - - - - - - - - - - - - - 请输入手机号! - 手机号格式错误! - - - - - - - - - - - - - - - - - - - - - -
    \ No newline at end of file diff --git a/src/app/routes/passport/register/register.component.ts b/src/app/routes/passport/register/register.component.ts deleted file mode 100644 index 701f05d0..00000000 --- a/src/app/routes/passport/register/register.component.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy } from '@angular/core'; -import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { _HttpClient } from '@delon/theme'; -import { MatchControl } from '@delon/util/form'; -import { NzSafeAny } from 'ng-zorro-antd/core/types'; -import { finalize } from 'rxjs/operators'; - -@Component({ - selector: 'passport-register', - templateUrl: './register.component.html', - styleUrls: ['./register.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class UserRegisterComponent implements OnDestroy { - constructor(fb: FormBuilder, private router: Router, private http: _HttpClient, private cdr: ChangeDetectorRef) { - this.form = fb.group( - { - mail: [null, [Validators.required, Validators.email]], - password: [null, [Validators.required, Validators.minLength(6), UserRegisterComponent.checkPassword.bind(this)]], - confirm: [null, [Validators.required, Validators.minLength(6)]], - mobilePrefix: ['+86'], - mobile: [null, [Validators.required, Validators.pattern(/^1\d{10}$/)]], - captcha: [null, [Validators.required]] - }, - { - validators: MatchControl('password', 'confirm') - } - ); - } - - // #region fields - - get mail(): AbstractControl { - return this.form.controls.mail; - } - get password(): AbstractControl { - return this.form.controls.password; - } - get confirm(): AbstractControl { - return this.form.controls.confirm; - } - get mobile(): AbstractControl { - return this.form.controls.mobile; - } - get captcha(): AbstractControl { - return this.form.controls.captcha; - } - form: FormGroup; - error = ''; - type = 0; - loading = false; - visible = false; - status = 'pool'; - progress = 0; - passwordProgressMap: { [key: string]: 'success' | 'normal' | 'exception' } = { - ok: 'success', - pass: 'normal', - pool: 'exception' - }; - - // #endregion - - // #region get captcha - - count = 0; - interval$: any; - - static checkPassword(control: FormControl): NzSafeAny { - if (!control) { - return null; - } - // eslint-disable-next-line @typescript-eslint/no-this-alias - const self: any = this; - self.visible = !!control.value; - if (control.value && control.value.length > 9) { - self.status = 'ok'; - } else if (control.value && control.value.length > 5) { - self.status = 'pass'; - } else { - self.status = 'pool'; - } - - if (self.visible) { - self.progress = control.value.length * 10 > 100 ? 100 : control.value.length * 10; - } - } - - getCaptcha(): void { - if (this.mobile.invalid) { - this.mobile.markAsDirty({ onlySelf: true }); - this.mobile.updateValueAndValidity({ onlySelf: true }); - return; - } - this.count = 59; - this.cdr.detectChanges(); - this.interval$ = setInterval(() => { - this.count -= 1; - this.cdr.detectChanges(); - if (this.count <= 0) { - clearInterval(this.interval$); - } - }, 1000); - } - - // #endregion - - submit(): void { - this.error = ''; - Object.keys(this.form.controls).forEach(key => { - this.form.controls[key].markAsDirty(); - this.form.controls[key].updateValueAndValidity(); - }); - if (this.form.invalid) { - return; - } - - const data = this.form.value; - this.loading = true; - this.cdr.detectChanges(); - this.http - .post('/register?_allow_anonymous=true', data) - .pipe( - finalize(() => { - this.loading = false; - this.cdr.detectChanges(); - }) - ) - .subscribe(() => { - this.router.navigate(['passport', 'register-result'], { queryParams: { email: data.mail } }); - }); - } - - ngOnDestroy(): void { - if (this.interval$) { - clearInterval(this.interval$); - } - } -} diff --git a/src/app/routes/passport/services/passport.service.ts b/src/app/routes/passport/services/passport.service.ts new file mode 100644 index 00000000..bb23b727 --- /dev/null +++ b/src/app/routes/passport/services/passport.service.ts @@ -0,0 +1,27 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 21:08:36 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-24 09:59:50 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\passport\\services\\passport.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from 'src/app/shared/services/core/base.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PassportService extends BaseService { + // 登录协议,服务订购协议 + public $api_get_agreement = `/api/mdc/pbc/agreementInfo/getAgreementInfoByType?_allow_anonymous=true`; + // 查看补充协议 + public $api_get_getSupplementaryAgreement = `/api/sdc/billOperate/getSupplementaryAgreement?_allow_anonymous=true`; + // 未登录账号发送验证码 + public $getAccountSMVerificationCode = `/api/mdc/cuc/userBasicInfo/forgetPassword/getAccountSMVerificationCode?_allow_anonymous=true`; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html new file mode 100644 index 00000000..06139f88 --- /dev/null +++ b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.html @@ -0,0 +1,13 @@ + + diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.less b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts new file mode 100644 index 00000000..d895eedc --- /dev/null +++ b/src/app/routes/regulatory-data/components/dashboard/dashboard.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { NzMessageService } from 'ng-zorro-antd/message'; + +@Component({ + selector: 'app-dashboard', + templateUrl: './dashboard.component.html', + styleUrls: ['./dashboard.component.less'] +}) +export class DashboardComponent implements OnInit { + @ViewChild('pie', { static: false }) readonly pie!: G2PieComponent; + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private msg: NzMessageService) { + this.refresh(); + } + ngOnInit(): void { + throw new Error('Method not implemented.'); + } + + refresh(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv() + }, + { + x: '食用酒水', + y: rv() + }, + { + x: '个护健康', + y: rv() + }, + { + x: '服饰箱包', + y: rv() + }, + { + x: '母婴产品', + y: rv() + } + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv() + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => this.pie.changeData()); + } + } + + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + + handleClick(data: G2PieClickItem): void { + this.msg.info(`${data.item.x} - ${data.item.y}`); + } +} diff --git a/src/app/routes/regulatory-data/regulatory-data-routing.module.ts b/src/app/routes/regulatory-data/regulatory-data-routing.module.ts new file mode 100644 index 00000000..bb68bd97 --- /dev/null +++ b/src/app/routes/regulatory-data/regulatory-data-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { DashboardComponent } from './components/dashboard/dashboard.component'; + +const routes: Routes = [{ path: 'dashboard', component: DashboardComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class RegulatoryDataRoutingModule {} diff --git a/src/app/routes/regulatory-data/regulatory-data.module.ts b/src/app/routes/regulatory-data/regulatory-data.module.ts new file mode 100644 index 00000000..c76d3521 --- /dev/null +++ b/src/app/routes/regulatory-data/regulatory-data.module.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { SharedModule, SHARED_G2_MODULES } from '@shared'; + +import { DashboardComponent } from './components/dashboard/dashboard.component'; +import { RegulatoryDataRoutingModule } from './regulatory-data-routing.module'; + +const COMPONENTS: any = [DashboardComponent]; +const NOTROUTECOMPONENTS: any = []; +@NgModule({ + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, RegulatoryDataRoutingModule, SharedModule, SHARED_G2_MODULES] +}) +export class RegulatoryDataModule {} diff --git a/src/app/routes/regulatory-data/services/regulatory-data.service.ts b/src/app/routes/regulatory-data/services/regulatory-data.service.ts new file mode 100644 index 00000000..7206840f --- /dev/null +++ b/src/app/routes/regulatory-data/services/regulatory-data.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class RegulatoryDataService { + + constructor() { } +} diff --git a/src/app/routes/routes-routing.module.ts b/src/app/routes/routes-routing.module.ts index b1e59f60..544a7684 100644 --- a/src/app/routes/routes-routing.module.ts +++ b/src/app/routes/routes-routing.module.ts @@ -1,23 +1,90 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-13 19:22:47 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-30 14:09:00 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\routes-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; // layout import { LayoutProComponent } from '@brand'; +import { EATokenGuard } from '@core'; import { environment } from '@env/environment'; +import { AuthGuard } from '../core/guards/auth.guard'; + // dashboard pages import { DashboardComponent } from './dashboard/dashboard.component'; +import { OrderAgreementComponent } from './passport/components/order-agreement/order-agreement.component'; const routes: Routes = [ { path: '', component: LayoutProComponent, + canActivate: [AuthGuard, EATokenGuard], + canActivateChild: [AuthGuard, EATokenGuard], children: [ { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, { path: 'dashboard', component: DashboardComponent }, - { path: 'demo', loadChildren: () => import('./demo/demo.module').then(m => m.DemoModule) } + { + path: 'account', + loadChildren: () => import('./account/account.module').then(m => m.AccountModule) + }, + { + path: 'usercenter', + loadChildren: () => import('./usercenter/usercenter.module').then(m => m.UsercenterModule) + }, + { path: 'system', loadChildren: () => import('./sys-setting/sys-setting.module').then(m => m.SysSettingModule) }, + { path: 'logs', loadChildren: () => import('./logs/logs.module').then(m => m.LogsModule) }, + { path: 'ticket', loadChildren: () => import('./ticket-management/ticket-management.module').then(m => m.TicketManagementModule) }, + { path: 'supplygoods', loadChildren: () => import('./supply-goods/supply-goods.module').then(m => m.SupplyGoodsModule) }, + { path: 'vehicle', loadChildren: () => import('./vehicle/vehicle.module').then(m => m.VehicleModule) }, + { + path: 'supply-management', + loadChildren: () => import('./supply-management/supply-management.module').then(m => m.SupplyManagementModule) + }, + { + path: 'insurance-management', + loadChildren: () => import('./insurance-management/insurance-management.module').then(m => m.InsuranceManagementModule) + }, + { + path: 'order-management', + loadChildren: () => import('./order-management/order-management.module').then(m => m.OrderManagementModule) + }, + { + path: 'waybill-management', + loadChildren: () => import('./waybill-management/waybill-management.module').then(m => m.WaybillManagementModule) + }, + { + path: 'financial-management', + loadChildren: () => import('./financial-management/financial-management.module').then(m => m.FinancialManagementModule) + }, + { + path: 'contract-management', + loadChildren: () => import('./contract-management/contract-management.module').then(m => m.ContractManagementManagementModule) + }, + { path: 'menu-management', loadChildren: () => import('./menu-manager/menu-manager.module').then(m => m.MenuManagerModule) }, + { path: 'partner', loadChildren: () => import('./partner/partner.module').then(m => m.PartnerModule) }, + { path: 'regulatory-data', loadChildren: () => import('./regulatory-data/regulatory-data.module').then(m => m.RegulatoryDataModule) }, + { + path: 'download', + loadChildren: () => import('./download/download.module').then(m => m.DownloadModule) + }, + { path: 'datatable', loadChildren: () => import('./datatable/datatable.module').then((m) => m.DatatableModule) }, + { path: 'tax', loadChildren: () => import('./tax-management/taxmanagement.module').then((m) => m.TaxManagementModule) }, ] }, // passport + { + path: 'agreement', + component: OrderAgreementComponent, + data: { title: '协议', titleI18n: 'app.login.agreement' } + }, { path: '', loadChildren: () => import('./passport/passport.module').then(m => m.PassportModule) }, { path: 'exception', loadChildren: () => import('./exception/exception.module').then(m => m.ExceptionModule) }, // 单页不包裹Layout @@ -35,4 +102,4 @@ const routes: Routes = [ ], exports: [RouterModule] }) -export class RouteRoutingModule {} +export class RouteRoutingModule { } diff --git a/src/app/routes/routes.module.ts b/src/app/routes/routes.module.ts index 1651bc70..a185d251 100644 --- a/src/app/routes/routes.module.ts +++ b/src/app/routes/routes.module.ts @@ -4,8 +4,9 @@ import { SharedModule } from '@shared'; // dashboard pages import { DashboardComponent } from './dashboard/dashboard.component'; import { RouteRoutingModule } from './routes-routing.module'; +import { BasicTableComponent } from './commom/components/basic-table/basic-table.component'; -const COMPONENTS = [DashboardComponent]; +const COMPONENTS = [DashboardComponent, BasicTableComponent]; const COMPONENTS_NOROUNT: Array> = []; @NgModule({ diff --git a/src/app/routes/supply-goods/components/carload/carload.component.html b/src/app/routes/supply-goods/components/carload/carload.component.html new file mode 100644 index 00000000..a7cae549 --- /dev/null +++ b/src/app/routes/supply-goods/components/carload/carload.component.html @@ -0,0 +1,213 @@ + + + + +
    + +
    + +
    + + + + +
    + +
    +
    + + + +
    +
    +
    +
    + +
    + +
    + + + + 共 {{ total }} 条 + + + 货源编号 + 货源类型 + 货主 + 项目名称 + 装货地 + 卸货地 + 货物名称 + 重量/体积 + 用车需求 + 总费用 + 附加费 + 用车需求 + 货源状态 + 创建时间 + 审核状态 + 操作 + + + + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + +
    已接单
    +
    已取消
    +
    待接单
    + + + {{ data.id3 }} + + +
    +
    审核通过
    +
    不通过
    +
    待审核
    + +
    + + + + + + +
    +
    +
    +
    + + + + + +
    + {{ this.sfFre.value.contactsName }} +
    +
    + +    天内支付运费。 + + 15.00(费率:5.3 +
    +
    + + + + +
    + + + + + + + + + + + + diff --git a/src/app/routes/supply-goods/components/carload/carload.component.less b/src/app/routes/supply-goods/components/carload/carload.component.less new file mode 100644 index 00000000..36f9126d --- /dev/null +++ b/src/app/routes/supply-goods/components/carload/carload.component.less @@ -0,0 +1,7 @@ + +.status-point { + display: inline-block; + width: 6px; + height: 6px; + border-radius: 50%; +} diff --git a/src/app/routes/supply-goods/components/carload/carload.component.spec.ts b/src/app/routes/supply-goods/components/carload/carload.component.spec.ts new file mode 100644 index 00000000..00b3e821 --- /dev/null +++ b/src/app/routes/supply-goods/components/carload/carload.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Description: + * @Author: wsm + * @Date: 2021-07-08 15:46:29 + * @LastEditTime: 2021-12-01 10:02:07 + * @LastEditors: Please set LastEditors + * @Reference: + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyGoodsComponentListCarloadComponent } from './carload.component'; + +describe('SupplyGoodsComponentListCarloadComponent', () => { + let component: SupplyGoodsComponentListCarloadComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SupplyGoodsComponentListCarloadComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyGoodsComponentListCarloadComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-goods/components/carload/carload.component.ts b/src/app/routes/supply-goods/components/carload/carload.component.ts new file mode 100644 index 00000000..a14ed204 --- /dev/null +++ b/src/app/routes/supply-goods/components/carload/carload.component.ts @@ -0,0 +1,394 @@ +/* + * @Description: + * @Author: wsm + * @Date: 2021-07-15 09:42:57 + * @LastEditTime : 2022-02-25 15:34:50 + * @LastEditors : Shiming + * @Reference: + */ +import { AfterViewInit, Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; +import { STChange, STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { filter } from 'rxjs/operators'; + + +@Component({ + selector: 'app-supply-goods-components-list-carload', + templateUrl: './carload.component.html', + styleUrls: ['./carload.component.less'], +}) +export class SupplyGoodsComponentListCarloadComponent implements OnInit, AfterViewInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('stAssign', { static: true }) stAssign!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfAssign', { static: false }) sfAssign!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + isVisible = false; + isVisibleAssign = false; + ColumnsAssign!: STColumn[]; + ui: SFUISchema = {}; + uiFre: SFUISchema = {}; + mode: any = 'search'; + demoValue: any; + tabs = ['全部', '待接单', '已接单', '已取消']; + listData: any =[ + { + id: 1, + id2: 2, + id3:3, + id4: 4, + } + ] + listData2: any = [ + { + clientGroupName: '姓名', + clientCount: '姓名', + clientCount2: '姓名', + clientCount3: '姓名', + } + ] + orderStatus: any = '0'; // 订单状态, 10为已提交待付款, 20为已付款待发,30为已发货待收货,50取消订单,40 已完成 + nzSelectedIndex = 0; + total = 1; + loading = false; + pageSize = 20; + pageIndex = 1; + toSendCount = 0; + addTimeStart = ''; + addTimeEnd = ''; + sfExpand = false; + _$expand = false; + ssdsad: any; + schema!: SFSchema; + schemaAssign!: SFSchema; + freightSchema!: SFSchema; + payStatus: any; + constructor( + private fb: FormBuilder, + private modal: NzModalService, + private router: Router, + private ar: ActivatedRoute, + private modalHelper: ModalHelper, + ) {} + + ngOnInit(): void { + this.getList(); + this.initSF(); + this.initUI(); + this.initSFFre(); + this.initSFAssign(); + } + + ngAfterViewInit() { + // this.router.events.pipe(filter((evt) => evt instanceof NavigationEnd)).subscribe(() => { + // + // }); + } + /** + * 指定客户分组查询参数 + */ + get reqParamsAssign() { + const params = Object.assign({}); + return { ...params, ...this.sfAssign?.value }; + } + change(change: STChange) { + console.log(change.checkbox) + } + initSFFre() { + this.freightSchema = { + properties: { + btn: { + type: 'string', + title: '是否回单', + enum: ['需要', '不需要'], + ui: { + widget: 'radio', + } as SFRadioWidgetSchema, + default: '需要', + }, + contactsName: { + title: '预付', + type: 'string', + minimum:0, + maximum:99999, + ui: { + showRequired: false, + }, + }, + unifiedSocialCreditCode: { + title: '到付', + type: 'string', + minimum:0, + maximum:99999, + ui: { + showRequired: false, + }, + }, + // unifiedSocialCreditCode2: { + // title: '油卡', + // type: 'string', + // minimum:0, + // maximum:99999, + // ui: { + // showRequired: false, + // }, + // }, + unifiedSocialCreditCode3: { + title: '回单付', + type: 'string', + minimum:0, + maximum:99999, + ui: { + showRequired: false, + }, + }, + '小计': { type: 'number', ui: { widget: 'text', defaultText: '5000 text' } as SFTextWidgetSchema }, + fujia: { type: 'string',title: '附加费', ui: { widget: 'custom'}}, + manys: { type: 'string',title: '总费用', ui: { widget: 'custom'}}, + unifiedSocia: { type: 'string',title: '总费用', ui: { widget: 'custom'}}, + + }, + }; + this.schemaAssign = { + properties: { + clientGroupName: { + title: '分组名称', + type: 'string', + ui: { + placeholder: '请输入司机姓名/手机号', + enter: (e: KeyboardEvent) => { + this.stAssign.load(); + }, + }, + }, + clientGroupName2: { + title: '分组名称', + type: 'string', + ui: { + placeholder: '请输入车牌号', + enter: (e: KeyboardEvent) => { + this.stAssign.load(); + }, + }, + }, + }, + }; + this.uiFre = { '*': { spanLabelFixed: 90, grid: { span: 16 }, enter: () => this.st.load() } }; + } + initSFAssign() { + this.ColumnsAssign = [ + { title: '', type: 'checkbox', width: '40px', className: 'text-center' }, + { title: '司机姓名', index: 'clientGroupName', width: '300px', className: 'text-center' }, + { title: '手机号', index: 'clientCount', width: '300px', className: 'text-center' }, + { title: '车牌号', index: 'clientCount2', width: '300px', className: 'text-center' }, + { title: '状态', index: 'clientCount3', width: '300px', className: 'text-center' }, + ]; + } + + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + storeName: { title: '货源编号', type: 'string', ui: { showRequired: false } }, + contactsName: { + title: '货物名称', + type: 'string', + ui: { + showRequired: false, + }, + }, + unifiedSocialCreditCode: { + title: '装货地', + type: 'string', + ui: { + showRequired: false, + }, + }, + unifiedSocialCreditCode2: { + title: '卸货地', + type: 'string', + ui: { + showRequired: false, + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + unifiedSocialCreditCode3: { + title: '货主', + type: 'string', + ui: { + showRequired: false, + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + enStatus2: { + type: 'string', + title: '审核状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 }, + { label: '废弃', value: 2 }, + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + }, + }; + + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } }; + } + initUI() { + this.ui = { + '*': { + spanLabelFixed: 90, + grid: { span: 8 }, + }, + }; + } + tabChange(i: number) { + console.log(i) + this.changeIndex(i); + this.getList(); + } + changeIndex(i: number) { + if (i === 0) { + this.orderStatus = '0'; + this.payStatus = null; + } else if (i === 1) { + this.orderStatus = '5'; + this.payStatus = null; + } else if (i === 2) { + this.orderStatus = null; + this.payStatus = '10'; + } else if (i === 3) { + this.orderStatus = '20'; + this.payStatus = null; + } + this.pageIndex = 1; + } + getList(type?: string) { + // this.loading = true; + const params: any = { + pageSize: this.pageSize, + pageIndex: this.pageIndex, + ...this.sf?.value, + orderStatus: this.orderStatus, + payStatus: this.payStatus, + createTime: this.sf?.value.createTime || [], + time: {}, + }; + if (this.sf?.value?.createTime) { + delete params.createTime; + params.time.start = this.sf?.value?.createTime[0]; + params.time.end = this.sf?.value?.createTime[1]; + } + delete params.expand; + if (type === 'search') { + params.pageIndex = 1; + } + // this.service.request(this.service.$api_get_page, params).subscribe((res) => { + // this.loading = false; + // this.listData = res.orderPage.records; + // this.toSendCount = res.toSendCount; + // this.listData.forEach((element: { goodsList: { goodsSpecJson: string }[] }) => { + // element.goodsList.forEach((item: { goodsSpecJson: string }) => { + // if (item.goodsSpecJson) { + // item.goodsSpecJson = JSON.parse(item.goodsSpecJson); + // } + // }); + // }); + // this.total = res.orderPage.total; + // }); + } + + orderExport() { + // this.service.exportStart(params, this.service.$api_export); + this.modal.create({ + nzTitle: '订单导出', + // nzContent: this.exportTemplate, + // nzContent: `待导出订单总数:${this.pageInfo.total}条,确定要导出吗?`, + nzOnOk: () => { + const params: any = { + pageSize: this.pageSize, + pageIndex: this.pageIndex, + ...this.sf?.value, + orderStatus: this.orderStatus, + // createTime: this.sf?.value.createTime || [], + }; + delete params.expand; + }, + }); + } + + goDetail(data: any) { + this.router.navigate(['../order-detail', data.orderSn], { relativeTo: this.ar }); + } + + + changePageIndex(pageIndex: number) { + this.pageIndex = pageIndex; + this.getList(); + } + changePageSize(value: number) { + this.pageSize = value; + this.getList(); + } + expandToggle() { + this.sfExpand = !this.sfExpand; + this.sf?.setValue('/expand', this.sfExpand); + } + + showApply() { + this.isVisible = true + } + showAssign() { + this.isVisibleAssign = true + } + handleOK() { + + } +handleCancel(type: any) { + if(type === 'suppliersType') { + this.isVisible = false + } else if(type === 'assign') { + this.isVisibleAssign = false + } +} + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.sfExpand = false; + } + resetSFAssign() { + this.sfAssign.reset(); + } + + + + /** + * 查询字段个数navigate + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } +} diff --git a/src/app/routes/supply-goods/components/large-amount/large-amount.component.html b/src/app/routes/supply-goods/components/large-amount/large-amount.component.html new file mode 100644 index 00000000..c6d18d1a --- /dev/null +++ b/src/app/routes/supply-goods/components/large-amount/large-amount.component.html @@ -0,0 +1,158 @@ + + + + + +
    + +
    + +
    + + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + + 共 {{ total }} 条 + + + 货源编号 + 货源类型 + 货主 + 项目名称 + 关联运单 + 货物信息 + 装货地 + 卸货地 + 用车需求 + 运费单价 + 结算重量 + 录单员 + 调度员 + 货源状态 + 截止时间 + 创建时间 + 审核状态 + 操作 + + + + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + + {{ data.id3 }} + + +
    已接单
    +
    已取消
    +
    待接单
    + + + {{ data.id3 }} + + + + {{ data.id3 }} + + +
    +
    审核通过
    +
    不通过
    +
    待审核
    + +
    + + + + + + +
    +
    +
    +
    diff --git a/src/app/routes/supply-goods/components/large-amount/large-amount.component.less b/src/app/routes/supply-goods/components/large-amount/large-amount.component.less new file mode 100644 index 00000000..36f9126d --- /dev/null +++ b/src/app/routes/supply-goods/components/large-amount/large-amount.component.less @@ -0,0 +1,7 @@ + +.status-point { + display: inline-block; + width: 6px; + height: 6px; + border-radius: 50%; +} diff --git a/src/app/routes/supply-goods/components/large-amount/large-amount.component.spec.ts b/src/app/routes/supply-goods/components/large-amount/large-amount.component.spec.ts new file mode 100644 index 00000000..4511b1f3 --- /dev/null +++ b/src/app/routes/supply-goods/components/large-amount/large-amount.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Description: + * @Author: wsm + * @Date: 2021-07-08 15:46:29 + * @LastEditTime: 2021-12-01 10:02:07 + * @LastEditors: Please set LastEditors + * @Reference: + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyGoodsComponentListLargeAmountComponent } from './large-amount.component'; + +describe('SupplyGoodsComponentListLargeAmountComponent', () => { + let component: SupplyGoodsComponentListLargeAmountComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SupplyGoodsComponentListLargeAmountComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyGoodsComponentListLargeAmountComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-goods/components/large-amount/large-amount.component.ts b/src/app/routes/supply-goods/components/large-amount/large-amount.component.ts new file mode 100644 index 00000000..50ac2849 --- /dev/null +++ b/src/app/routes/supply-goods/components/large-amount/large-amount.component.ts @@ -0,0 +1,252 @@ +/* + * @Description: + * @Author: wsm + * @Date: 2021-07-15 09:42:57 + * @LastEditTime: 2021-12-01 15:06:11 + * @LastEditors: Please set LastEditors + * @Reference: + */ +import { AfterViewInit, Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; +import { STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { filter } from 'rxjs/operators'; + + +@Component({ + selector: 'app-supply-goods-components-list-large-amount', + templateUrl: './large-amount.component.html', + styleUrls: ['./large-amount.component.less'], +}) +export class SupplyGoodsComponentListLargeAmountComponent implements OnInit, AfterViewInit { + @ViewChild('st', { static: true }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + validateForm!: FormGroup; + @ViewChild('exportTemplate') + exportTemplate!: TemplateRef; + ui: SFUISchema = {}; + mode: any = 'search'; + tabs = ['全部', '进行中', '已完结', '已取消']; + listData: any =[ + { + id: 1, + id2: 2, + id3:3, + id4: 4, + } + ] + orderStatus: any = '0'; // 订单状态, 10为已提交待付款, 20为已付款待发,30为已发货待收货,50取消订单,40 已完成 + nzSelectedIndex = 0; + total = 1; + loading = false; + pageSize = 20; + pageIndex = 1; + toSendCount = 0; + addTimeStart = ''; + addTimeEnd = ''; + sfExpand = false; + _$expand = false; + + schema!: SFSchema; + payStatus: any; + constructor( + private fb: FormBuilder, + private modal: NzModalService, + private router: Router, + private ar: ActivatedRoute, + private modalHelper: ModalHelper, + public shipperSrv: ShipperBaseService + + ) {} + + ngOnInit(): void { + this.getList(); + this.initSF(); + this.initUI(); + } + + ngAfterViewInit() { + // this.router.events.pipe(filter((evt) => evt instanceof NavigationEnd)).subscribe(() => { + // + // }); + } + + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + storeName: { title: '货源编号', type: 'string', ui: { showRequired: false } }, + contactsName: { + title: '货物名称', + type: 'string', + ui: { + showRequired: false, + }, + }, + unifiedSocialCreditCode: { + title: '装货地', + type: 'string', + ui: { + showRequired: false, + }, + }, + unifiedSocialCreditCode2: { + title: '卸货地', + type: 'string', + ui: { + showRequired: false, + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + createUserId: { + type: 'string', + title: '录单员', + default: '', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value, + }, + asyncData: () => this.shipperSrv.getStaffList(), + allowClear: true, + }, + }, + }, + }; + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } }; + } + initUI() { + this.ui = { + '*': { + spanLabelFixed: 90, + grid: { span: 8 }, + }, + }; + } + tabChange(i: number) { + console.log(i) + this.changeIndex(i); + this.getList(); + } + changeIndex(i: number) { + if (i === 0) { + this.orderStatus = '0'; + this.payStatus = null; + } else if (i === 1) { + this.orderStatus = '5'; + this.payStatus = null; + } else if (i === 2) { + this.orderStatus = null; + this.payStatus = '10'; + } else if (i === 3) { + this.orderStatus = '20'; + this.payStatus = null; + } + this.pageIndex = 1; + } + getList(type?: string) { + // this.loading = true; + const params: any = { + pageSize: this.pageSize, + pageIndex: this.pageIndex, + ...this.sf?.value, + orderStatus: this.orderStatus, + payStatus: this.payStatus, + createTime: this.sf?.value.createTime || [], + time: {}, + }; + if (this.sf?.value?.createTime) { + delete params.createTime; + params.time.start = this.sf?.value?.createTime[0]; + params.time.end = this.sf?.value?.createTime[1]; + } + delete params.expand; + if (type === 'search') { + params.pageIndex = 1; + } + // this.service.request(this.service.$api_get_page, params).subscribe((res) => { + // this.loading = false; + // this.listData = res.orderPage.records; + // this.toSendCount = res.toSendCount; + // this.listData.forEach((element: { goodsList: { goodsSpecJson: string }[] }) => { + // element.goodsList.forEach((item: { goodsSpecJson: string }) => { + // if (item.goodsSpecJson) { + // item.goodsSpecJson = JSON.parse(item.goodsSpecJson); + // } + // }); + // }); + // this.total = res.orderPage.total; + // }); + } + + orderExport() { + // this.service.exportStart(params, this.service.$api_export); + this.modal.create({ + nzTitle: '订单导出', + nzContent: this.exportTemplate, + // nzContent: `待导出订单总数:${this.pageInfo.total}条,确定要导出吗?`, + nzOnOk: () => { + const params: any = { + pageSize: this.pageSize, + pageIndex: this.pageIndex, + ...this.sf?.value, + orderStatus: this.orderStatus, + // createTime: this.sf?.value.createTime || [], + }; + delete params.expand; + }, + }); + } + + goDetail(data: any) { + this.router.navigate(['../order-detail', data.orderSn], { relativeTo: this.ar }); + } + + + changePageIndex(pageIndex: number) { + this.pageIndex = pageIndex; + this.getList(); + } + changePageSize(value: number) { + this.pageSize = value; + this.getList(); + } + expandToggle() { + this.sfExpand = !this.sfExpand; + this.sf?.setValue('/expand', this.sfExpand); + } + + showApply() { + + } + + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.sfExpand = false; + } + + + + /** + * 查询字段个数navigate + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } +} diff --git a/src/app/routes/supply-goods/components/list/list.component.html b/src/app/routes/supply-goods/components/list/list.component.html new file mode 100644 index 00000000..49b36faf --- /dev/null +++ b/src/app/routes/supply-goods/components/list/list.component.html @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/src/app/routes/supply-goods/components/list/list.component.spec.ts b/src/app/routes/supply-goods/components/list/list.component.spec.ts new file mode 100644 index 00000000..1327ea76 --- /dev/null +++ b/src/app/routes/supply-goods/components/list/list.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-01 09:25:32 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:26:01 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-goods\\components\\list\\list.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyGoodsComponentListComponent } from './list.component'; + +describe('SupplyGoodsComponentListComponent', () => { + let component: SupplyGoodsComponentListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SupplyGoodsComponentListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyGoodsComponentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-goods/components/list/list.component.ts b/src/app/routes/supply-goods/components/list/list.component.ts new file mode 100644 index 00000000..66b5c93b --- /dev/null +++ b/src/app/routes/supply-goods/components/list/list.component.ts @@ -0,0 +1,25 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-01 09:25:32 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:26:12 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-goods\\components\\list\\list.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'app-supply-goods-components-list', + templateUrl: './list.component.html' +}) +export class SupplyGoodsComponentListComponent implements OnInit { + constructor(private ar: ActivatedRoute) {} + nzSelectedIndex = 0; + ngOnInit(): void { + this.nzSelectedIndex = this.ar.snapshot.queryParams.nzSelectedIndex; + } +} diff --git a/src/app/routes/supply-goods/services/supply-goods.service.ts b/src/app/routes/supply-goods/services/supply-goods.service.ts new file mode 100644 index 00000000..49f54aac --- /dev/null +++ b/src/app/routes/supply-goods/services/supply-goods.service.ts @@ -0,0 +1,22 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-01 09:24:09 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:26:22 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-goods\\services\\supply-goods.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from 'src/app/shared/services/core/base.service'; + +@Injectable({ + providedIn: 'root' +}) +export class SupplyGoodsService extends BaseService { + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/supply-goods/supply-goods-routing.module.ts b/src/app/routes/supply-goods/supply-goods-routing.module.ts new file mode 100644 index 00000000..6a0cfb06 --- /dev/null +++ b/src/app/routes/supply-goods/supply-goods-routing.module.ts @@ -0,0 +1,22 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-01 09:24:09 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:25:04 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-goods\\supply-goods-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { SupplyGoodsComponentListComponent } from './components/list/list.component'; + +const routes: Routes = [{ path: 'list', component: SupplyGoodsComponentListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SupplyGoodsRoutingModule {} diff --git a/src/app/routes/supply-goods/supply-goods.module.ts b/src/app/routes/supply-goods/supply-goods.module.ts new file mode 100644 index 00000000..ecec755d --- /dev/null +++ b/src/app/routes/supply-goods/supply-goods.module.ts @@ -0,0 +1,30 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-01 09:24:09 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:25:15 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-goods\\supply-goods.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { SharedModule } from '@shared'; +import { SupplyGoodsComponentListCarloadComponent } from './components/carload/carload.component'; +import { SupplyGoodsComponentListLargeAmountComponent } from './components/large-amount/large-amount.component'; +import { SupplyGoodsComponentListComponent } from './components/list/list.component'; +import { SupplyGoodsRoutingModule } from './supply-goods-routing.module'; + + +const COMPONENTS = [ + SupplyGoodsComponentListComponent, + SupplyGoodsComponentListCarloadComponent, + SupplyGoodsComponentListLargeAmountComponent +]; + +@NgModule({ + imports: [SharedModule, SupplyGoodsRoutingModule], + declarations: [...COMPONENTS] +}) +export class SupplyGoodsModule {} diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.html b/src/app/routes/supply-management/components/add-driver/add-driver.component.html new file mode 100644 index 00000000..e7df0e64 --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.html @@ -0,0 +1,62 @@ + + + +
    + + +
    +
    +
    正面照
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照
    +
    示例
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    + \ No newline at end of file diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.less b/src/app/routes/supply-management/components/add-driver/add-driver.component.less new file mode 100644 index 00000000..af8ad338 --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.less @@ -0,0 +1,57 @@ +.sfBox{ + position: relative; +} +.pr { + position: relative; +} + +.pa { + position: absolute; + top: 35px; + left: 150px; + img{border: solid 1px #ebf0fb;} +} + +.tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } +} +.drivercard{ + position: absolute; + top: 620px; + left: 330px; + border: solid 1px #ebf0fb; +} +.jopcard{ + position: absolute; + top: 1034px; + left: 330px; + border: solid 1px #ebf0fb; +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + .setCustom .ant-form-item-control{ + margin-left: -100px !important + } + .borderImg{ + border: solid 1px #ebf0fb; + } + } +} \ No newline at end of file diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts b/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts new file mode 100644 index 00000000..92751ffa --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarAddDriverComponent } from './add-driver.component'; + +describe('CarAddDriverComponent', () => { + let component: CarAddDriverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarAddDriverComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarAddDriverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/add-driver/add-driver.component.ts b/src/app/routes/supply-management/components/add-driver/add-driver.component.ts new file mode 100644 index 00000000..18c09240 --- /dev/null +++ b/src/app/routes/supply-management/components/add-driver/add-driver.component.ts @@ -0,0 +1,640 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFComponent, SFUISchema, SFSchema, SFUploadWidgetSchema, SFDateWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { AnyRecord } from 'dns'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; +@Component({ + selector: 'app-car-add-driver', + templateUrl: './add-driver.component.html', + styleUrls: ['./add-driver.component.less'] +}) +export class CarAddDriverComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + record: any = {}; + i: any; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + ui3: SFUISchema = {}; + schema: SFSchema = {}; + schema1: SFSchema = {}; + schema2: SFSchema = {}; + showCardFlag = false; + showJopFlag = false; + detailData: any = { + identityInfoDTO: {}, + userDriverLicenseDTO: {}, + userPracticeSeniorityDTO: {} + }; + companyData: any = {}; + mobile = '' + checked = false + constructor( + private modal: NzModalRef, + public service: SupplyManagementService, + private envSrv: EAEnvironmentService, + private eaCacheSrv: EACacheService, + ) { } + + ngOnInit(): void { + this.companyData = this.eaCacheSrv.get(cacheConf.env) + this.initSF() + } + initSF() { + this.schema = { + properties: { + titleA: { + title: '司机信息(必填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + mobile: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + widget: '', + }, + default: this.mobile + }, + showName: { + title: '身份证照片', + type: 'string', + readOnly: true, + ui: { + widget: 'textarea', + borderless:true, + showRequired: true, + }, + default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写', + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoFrontWatermark', avatar); + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'front', 0); + } else { + this.detailData.certificatePhotoFront = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + }, + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoBackWatermark', avatar); + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'back', 0); + } else { + this.detailData.certificatePhotoBack = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url),} + }, + name: { + title: '姓名', + type: 'string', + maxLength: 32, + ui: { + widget: '', + placeholder: '请输入姓名', + }, + }, + certificateNumber: { + title: '身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + widget: '', + placeholder: '请输入法定代表人证件号', + errors: { + required: '请输入18位身份证号码', + }, + }, + }, + }, + required: [ + 'certificatePhotoFrontWatermark', + 'certificatePhotoBackWatermark', + 'name', + 'certificateNumber' + ], + }; + this.schema1 = { + properties: { + titleB: { + title: '驾驶证信息(必填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + certificatePhotoWatermark: { + type: 'string', + title: '驾驶证照片', + ui: { + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传驾驶证照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath + this.checkDriverCard(args.file.response.data.fullFilePath, 'front', 0); + } else { + this.detailData.userDriverLicenseDTO.certificatePhoto = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 5; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url),} + }, + roadImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + licenseNo: { + title: '驾驶证号', + type: 'string', + ui: { + // widget: 'text', + placeholder: '请输入', + }, + // default: this.ar.snapshot.queryParams.licenseNo + }, + driverModel: { + title: '准驾车型', + type: 'string', + ui: { + widget: 'select', + mode: 'multiple', + containsAllLabel: false, + placeholder: '请选择准驾车型', + asyncData: () => + this.service.request(this.service.$api_getDictValue, { dictKey: 'driverModel' }).pipe( + map((data: any) => { + return data.map((m: any) => { + return { label: m.label, value: m.label }; + }); + }), + ), + }, + }, + validStartTime: { + title: '有效期起', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + validEndTime: { + title: '有效期止', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择终止日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + signingOrganization: { + title: '签发机关', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + }, + required: [ + 'certificatePhotoWatermark', + 'licenseNo', + 'driverModel', + 'validStartTime', + 'validEndTime', + ], + }; + this.schema2 = { + properties: { + titleC: { + title: '从业资格证(选填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏', + }, + certificatePhotoWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.userPracticeSeniorityDTO.certificatePhoto = args.file.response.data.fullFilePath + this.checkQualificationCertificate(args.file.response.data.fullFilePath); + } else{ + this.detailData.userPracticeSeniorityDTO.certificatePhoto = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url),} + }, + agreeImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + licenseNo: { + title: '从业资格证号', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + regionCode: { + title: '签发省份', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + asyncData: () => this.getProvinceData(), + } as SFDateWidgetSchema, + }, + validStartTime: { + title: '发证日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + validEndTime: { + title: '有效期止', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择终止日期', + }, + change: (i) => { }, + } as SFDateWidgetSchema, + }, + }, + required: [ + + ], + }; + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 }, + width: 700, + }, + }; + this.ui2 = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $titleB:{ + grid: { span: 24 }, + }, + $certificatePhotoWatermark: { + grid: { span: 12 }, + }, + $roadImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + }; + this.ui3 = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $titleC:{ + grid: { span: 24 }, + }, + $certificatePhotoWatermark: { + grid: { span: 12 }, + }, + $agreeImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + }; + } + checkQualificationCertificate(imgurl: any) { + // 识别从业资格证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + qualificationCertificateUrl: imgurl, + }; + this.service.request(this.service.$api_recognizeQualificationCertificate, params).subscribe((res: any) => { + if (res) { + this.sf2.setValue('/licenseNo', res.certificateNumber); + this.sf2.setValue('/regionCode', res.addressRegionCodes[0]); + res.qualificationCategoryList.forEach((item: any) => { + console.log(item.category.indexOf('道路货物运输驾驶员') !== -1) + if (item.category.indexOf('道路货物运输驾驶员') !== -1) { + this.sf2.setValue('/validStartTime', item.initialIssueDate.split(' ')[0]); + this.sf2.setValue('/validEndTime', item.expiryDate.split(' ')[0]); + } + }) + + } + }); + } + getProvinceData() { + return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe( + map((res: any) => { + const result: any = [] + if (res) { + res.map((m: any) => { + const item = { label: m.name, value: m.regionCode } + result.push(item) + }); + } + return result + }) + ); + } + checkIdCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + idCardUrl: imgurl, + side, + }; + this.service.request(this.service.$api_checkIdCard, params).subscribe((res: any)=> { + if (res) { + if (type === 0) { + // 法定代表人身份证 + if (side === 'front') { + // 正面 + this.sf.setValue('/name', res.name); + this.sf.setValue('/certificateNumber', res.number); + } + } + } + }); + } + checkDriverCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + driverLicenseUrl: imgurl, + side, + }; + this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res: any) => { + if (res) { + if (type === 0) { + // 法定代表人身份证 + if (side === 'front') { + // 正面 + this.sf1.setValue('/licenseNo', res.number); + this.sf1.setValue('/driverModel', [(res.classType).toUpperCase()]); + this.sf1.setValue('/validStartTime', res.validFrom); + this.sf1.setValue('/validEndTime', res.validTo); + this.sf1.setValue('/signingOrganization', res.issuingAuthority); + } + } + } + }); + } + close(): void { + this.modal.destroy(); + } + showExample(){ + this.showCardFlag = !this.showCardFlag + } + showJopExample(){ + this.showJopFlag = !this.showJopFlag + } + submitForm(){ + const params:any = { + source: 1, + mobile: this.sf.value.mobile, + identityInfoDTO:{ + ...this.sf.value, + certificatePhotoFront: this.detailData.certificatePhotoFront, + certificatePhotoBack: this.detailData.certificatePhotoBack, + }, + userDriverLicenseDTO: { + ...this.sf1.value, + certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto, + }, + userPracticeSeniorityDTO: { + ...this.sf2.value, + certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto, + }, + }; + if(params.userPracticeSeniorityDTO.certificatePhoto === '' || params.userPracticeSeniorityDTO.certificatePhotoWatermark === '') { + delete params.userPracticeSeniorityDTO.certificatePhotoWatermark + delete params.userPracticeSeniorityDTO.certificatePhoto + } + params.userDriverLicenseDTO.driverModel = params.userDriverLicenseDTO.driverModel.join(',') + delete params.identityInfoDTO.showName; + delete params.identityInfoDTO.titleA; + delete params.userDriverLicenseDTO.titleB; + delete params.userPracticeSeniorityDTO.titleC; + delete params.userDriverLicenseDTO.tipsA; + delete params.userPracticeSeniorityDTO.tipsC; + if(JSON.stringify(params.userPracticeSeniorityDTO) === '{}') { + params.userPracticeSeniorityDTO = null + } + this.checked = true + this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe((res: any) => { + this.checked = false + if(res){ + this.service.msgSrv.success('添加成功') + this.modal.close(true) + } + }) + } +} diff --git a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html new file mode 100644 index 00000000..1ff67246 --- /dev/null +++ b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.html @@ -0,0 +1,14 @@ +
    +
    +
    + + + +
    +
    +
    + + +
    + +
    diff --git a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.spec.ts b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.spec.ts new file mode 100644 index 00000000..ef047291 --- /dev/null +++ b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementAddDriversComponent } from './add-drivers.component'; + +describe('SupplyManagementAddDriversComponent', () => { + let component: SupplyManagementAddDriversComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementAddDriversComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementAddDriversComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts new file mode 100644 index 00000000..da816bfe --- /dev/null +++ b/src/app/routes/supply-management/components/add-drivers/add-drivers.component.ts @@ -0,0 +1,120 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STColumnButton, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; + +@Component({ + selector: 'app-supply-management-add-drivers', + templateUrl: './add-drivers.component.html', +}) +export class SupplyManagementAddDriversComponent implements OnInit { + url = `/user?_allow_anonymous=true`; + i: any; + searchSchema: SFSchema = {}; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf') sf!: SFComponent; + ui: SFUISchema = {} + columns: STColumn[] = []; + isVisible = false; + diverList: object[] = []; + dirvierInfo: any = {}; + constructor(public service: SupplyManagementService, private modal: NzModalRef) { } + + ngOnInit(): void { + this.initSF(); + this.initST(); + } + + /** +* 查询参数 +*/ + get reqParams() { + return { + ...this.sf?.value + }; + } + /** +* 初始化查询表单 +*/ + initSF() { + this.searchSchema = { + properties: { + mobile: { + type: 'string', + title: '车队长手机号', + ui: { + placeholder: '请输入' + } + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { + title: '司机头像', + width: '100px', + className: 'text-center', + index: 'avatar', + type: 'img', + }, + { title: '司机姓名', index: 'name', width: '120px', className: 'text-center' }, + { title: '实名认证状态', index: 'linkUrl', width: '120px', className: 'text-center' }, + { + title: '操作', + fixed: 'right', + width: '200px', + className: 'text-center', + buttons: [ + { + text: '设置', + click: (_record) => this.addCaptain(_record) + // iif: (item: STData, btn: STColumnButton, column: STColumn) => item?.status > 0, + }, + ], + }, + ]; + } + + + + search() { + this.getDriverList(); + } + + + getDriverList() { + this.service.request(this.service.$api_get_car_captain_by_mobile, { ...this.sf?.value }).subscribe((res: any) => { + this.diverList = []; + if (res.userId) { + this.diverList.push(res); + } + // this.st.reload(); + }) + } + + + /** + * + */ + addCaptain(item: any) { + this.modal.close(item); // 虚设置车队长 + // const { appUserId: carCaptain } = item; + // const { appUserId } = this.dirvierInfo; + // this.service.request(this.service.$api_add_car_caption, { carCaptain, appUserId }).subscribe(res => { + // if (res) { + // this.service.msgSrv.success('设置成功'); + // this.modal.close(true); + // } + // }) + } + +} diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.html b/src/app/routes/supply-management/components/addmodal/addmodal.component.html new file mode 100644 index 00000000..ce7b7eb1 --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.html @@ -0,0 +1,88 @@ + + + +
    + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    + + +
    + + +
    + 未认证 +
    +
    + 待审核 +
    +
    + 已成功 +
    +
    + 已驳回 +
    +
    + + {{ item.carModelLabel }}-{{ item.carLengthLabel }}米-{{ item.carLoad }}吨 + +
    +
    + + +
    + diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.less b/src/app/routes/supply-management/components/addmodal/addmodal.component.less new file mode 100644 index 00000000..700887cc --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.less @@ -0,0 +1,38 @@ + +:host{ + ::ng-deep{ + .ant-card-meta-title{ + display: flex; + align-items: center; + justify-content: space-between; + } + .nameBox { + display: flex; + align-items: baseline; + .name{ + margin: 0 10px 0 0; + } + } + .ant-badge-status{ + color: #666 + } + + } + .title{ + clear: both; + margin: 10px 0; + font-weight: bold; + font-size: 14px; + } + .noContent{ + width: 100%; + min-height: 300px; + font-size: 16px; + line-height: 300px; + text-align: center; + span { + color: #1890ff; + cursor: pointer; + } + } +} \ No newline at end of file diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts b/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts new file mode 100644 index 00000000..b15da72d --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarAddmodalComponent } from './addmodal.component'; + +describe('CarAddmodalComponent', () => { + let component: CarAddmodalComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarAddmodalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarAddmodalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/addmodal/addmodal.component.ts b/src/app/routes/supply-management/components/addmodal/addmodal.component.ts new file mode 100644 index 00000000..7497b56a --- /dev/null +++ b/src/app/routes/supply-management/components/addmodal/addmodal.component.ts @@ -0,0 +1,175 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { cacheConf } from '@conf/cache.conf'; +import { STColumn, STComponent, STChange, STData } from '@delon/abc/st'; +import { SFUISchema, SFSchema, SFComponent } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EACacheService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { CarAddDriverComponent } from '../add-driver/add-driver.component'; + +@Component({ + selector: 'app-car-addmodal', + templateUrl: './addmodal.component.html', + styleUrls: ['./addmodal.component.less'] +}) +export class CarAddmodalComponent implements OnInit { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + tableData: any = []; + companyData: any = {}; + flag = false + isLoading: boolean = false; + constructor( + private modal: NzModalRef, + private eaCacheSrv: EACacheService, + public service: SupplyManagementService, private router: Router, private ar: ActivatedRoute, + private modalHelper: ModalHelper + ) { } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item: any) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.companyData = this.eaCacheSrv.get(cacheConf.env) + this.initSF(); + this.initST() + this.initData() + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + mobile: { title: '司机手机号', type: 'string', maxLength: 11, ui: { showRequired: false, placeholder: '请输入司机手机号', } }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.st?.load(1) }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '司机头像', type: 'img', index: 'avatar', className: 'text-center' }, + { title: '司机姓名', index: 'name', className: 'text-center' }, + { title: '当前车辆', index: 'carNo', className: 'text-center' }, + { title: '车辆信息', render: 'carModel', className: 'text-center' }, + { + title: '个人认证状态', + render: 'certificationStatus', + className: 'text-center', + }, + { title: '驾驶证类型', index: 'driverType', className: 'text-center' }, + { + title: '操作', + width: '180px', + className: 'text-center', + buttons: [ + { text: '添加', click: (_record: any) => this.add(_record) }, + ], + }, + ]; + } + initData(flag?: any) { + if (this.sf?.value.mobile) { + this.service.request(this.service.$api_getCarCaptainByMobile, { mobile: this.sf?.value.mobile }).subscribe((res: any) => { + this.flag = flag + if (res.userId) { + this.tableData = [res]; + setTimeout(() => { + this.st.reload() + }) + } else { + this.tableData = [] + } + }) + } + } + /** + * 数据列表状态变化事件 + */ + change(change: STChange) { + // console.log(change); + } + + /** + * 新增 + */ + add(item: any) { + const params: any = { + source: 1, + appUserId: item.appUserId ? item.appUserId : '', + mobile: item.mobile + } + this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('添加成功') + this.modal.close(true) + } + }) + } + addModal() { + this.modalHelper.create(CarAddDriverComponent, {mobile: this.sf?.value.mobile}, { size: 900 }).subscribe((res) => { + this.initData() + }); + //this.router.navigate(['/car/add']) + } + goBack() { + window.history.go(-1); + } + close(): void { + this.modal.close(true); + } +} diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html new file mode 100644 index 00000000..22030b03 --- /dev/null +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html @@ -0,0 +1,49 @@ +
    +
    +
    + +
    + +
    + +
    + + + + + + {{car.carNo}} - + {{car.carLength}}米,{{car.carLoad}}吨 - + 空闲 + 在途 + 未认证 + + + + + + {{item.captainName}} {{item.captainPhone}} + 设置 + + + 空闲 + 在途 + 未认证 + + +
    + +
    diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.spec.ts b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.spec.ts new file mode 100644 index 00000000..1dc14946 --- /dev/null +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementAssignedCarComponent } from './assigned-car.component'; + +describe('SupplyManagementAssignedCarComponent', () => { + let component: SupplyManagementAssignedCarComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementAssignedCarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementAssignedCarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts new file mode 100644 index 00000000..1793c83e --- /dev/null +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts @@ -0,0 +1,274 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component'; +import { CarAddmodalComponent } from '../addmodal/addmodal.component'; + + +const BADGE: STColumnBadge = { + 1: { text: '空闲', color: 'success' }, + 2: { text: '未实名', color: 'error' }, + 3: { text: '在途', color: 'warning' }, +}; + +@Component({ + selector: 'app-supply-management-assigned-car', + templateUrl: './assigned-car.component.html', +}) +export class SupplyManagementVehicleAssignedCarComponent implements OnInit { + record: any = {}; + i: any; + schema: SFSchema = {}; + ui: SFUISchema = {}; + columns: STColumn[] = []; + + @ViewChild('st') st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + status: string = 'anew'; + url = ''; // 请求的api地址 + params: any = {}; // 传进来的参数 + cardBADGE: STColumnBadge | any = { + 0: { text: '空闲', color: 'success' }, + 1: { text: '在途', color: 'warning' }, + 2: { text: '未认证', color: 'error' }, + }; + selectedRows: any = null; // 已选行 + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public service: SupplyManagementService, + private modalHelper: ModalHelper, + private envSrv: EAEnvironmentService, + private modalSrv: NzModalService + ) { + this.initSF(); + this.initSt(); + } + + /** +* 查询参数 +*/ + get reqParams() { + return { + ...this.sf?.value, + loadingTime: this.params?.loadingTime, + enterpriseId: this.params?.shipperAppUserId, + enterpriseProjectId: this.params?.enterpriseProjectId, + unloadingTime: this.params?.unloadingTime, + }; + } + + + + + /** +* 初始化查询表单 +*/ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + nameOrPhone: { + type: 'string', + title: '承运司机', + ui: { + placeholder: '请输入司机姓名/手机号' + } + }, + carNo: { + type: 'string', + title: '车牌号', + maxLength: 9, + ui: { + placeholder: '请输入车牌号' + } + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 10, grid: { span: 8, gutter: 1 } } }; + } + + /** + * 初始化数据列表 + */ + initSt() { + this.columns = [ + { width: 50, type: 'radio', className: 'text-center' }, + { title: '司机姓名', width: 120, index: 'name', className: 'text-center' }, + { title: '手机号', index: 'telephone', width: 200, className: 'text-center' }, + { title: '车队长', render: 'carCaptain', className: 'text-center' }, + { title: '指定车辆', width: 300, render: 'carId', className: 'text-center' }, + { title: '状态', render: 'driverStatus', className: 'text-center', type: 'badge', badge: BADGE }, + ]; + } + + ngOnInit(): void { + console.log(this.params) + } + + dataProcess = (data: STData[], rawData: any): STData[] => { + if (rawData.status === 505016) { + this.modalSrv.confirm({ + nzTitle: '系统提示', + nzContent: '该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + this.sendMsg(this.sf?.value?.nameOrPhone).subscribe((res => { + if (res.code === '1') { + this.service.msgSrv.success('发送成功'); + } else { + this.service.msgSrv.success('发送失败'); + } + })); + } + }); + return []; + } + return data.map((i, index) => { + i.carId = ''; + i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1); + const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault); + if (defaultCar) { + i.carId = defaultCar?.carId; + } + return i; + }); + } + + save(): void { + const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; + const params: any = { carId, driverId, carCaptainId }; + this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('指派成功!'); + this.modal.close(res); + } + }) + + } + + changeSt(e: STChange): void { + if (e?.type === 'loaded') this.selectedRows = null; + if (e?.type === 'radio') this.selectedRows = e?.radio; + + } + /** + * 添加司机 + * @param item + */ + addDriver() { + this.modalHelper.create(CarAddmodalComponent, {}, { size: 900, modalOptions: { nzMaskClosable: false } }).subscribe((res) => { + if (res) this.st.reload(); + }); + } + + /** + * 校验司机是否能设置车队长 + * @param item 当前对象 + */ + verifyCanSetCarCaptain(item: any) { + this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => { + if (res && res.length > 0) { + const { itemValue } = res[0]; + if (itemValue !== '1') { + this.service.msgSrv.error('不可设置车队长!'); + return; + } + this.setCarCaptain(item); + } + }) + } + + /** + * 设置车队长 + */ + setCarCaptain(item: any) { + + this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, { + size: 900, + modalOptions: { nzMaskClosable: false, nzTitle: '设置' } + } + ).subscribe((res) => { + if (res) { + item.captainName = res?.name; + item.captainPhone = res?.mobile; + item.captainAppUserId = res?.appUserId; + } + }); + } + + close(): void { + this.modal.destroy(); + } + + reset() { + this.sf.reset(); + this.st.load(1); + } + + /** + * 验证车辆的状态 + */ + verifyVechicleStatus(params: any) { + if (this.selectedRows) { + const obj = this.status === 'anew' ? { resourceId: params.id } : { ...params }; + const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; + const carInfo: any = { carId, driverId, carCaptainId }; + this.service.request(this.service.$api_verify_vehicle_status, { ...obj, ...carInfo }).subscribe(res => { + if (res) { + const { title, alert, subContent, content } = res; + switch (alert) { + case 'Error': + // if (code === '3' || code === '4' || code === '8') { + // this.error(title, subContent, '#CF3834'); + // } else { + this.error(title, content, subContent); + break; + case 'Warn': + this.showConfirm(title, content, subContent); + break; + case 'Success': + this.save(); + break; + } + } + }) + } + + } + + error(title: string, content: string, subContent: string): void { + this.modalSrv.error({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '知道了' + }); + } + + showConfirm(title: string, content: string, subContent: string): void { + this.modalSrv.confirm({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.save(); + } + }); + } + + /** +* 发送邀请司机注册短信 +*/ + sendMsg(phoneNumber: string) { + return this.service.request(this.service.$api_send_msg_code, phoneNumber) + } + +} diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html new file mode 100644 index 00000000..3f4f76a1 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html @@ -0,0 +1,189 @@ +
    + + + + + +
    + +

    货源编码 : {{ i?.resourceCode }}

    +
    +
    +
    网络货运人:{{ i?.shipperAppUserName }}
    +
    + + + +
    +
    +
    +
    + 总费用:{{ i?.totalAmount | currency: '¥' }} +
    +
    + +
    + {{ i?.enterpriseProjectName }} + {{ i?.deadlineTime }} + {{ i?.createUserName }}/{{ i?.createUserPhone }} + {{ i?.dispatchName }}/{{ i?.dispatchPhone }} + {{ i?.serviceTypeLabel }} +
    +
    +
    + +
    +
    + + + + + + +
    +
    +
    + + + + 货物信息 + + + {{item.goodsTypeName}} > {{item.goodsName}} + + + {{item.weight}}吨 / {{item.volume>=0?item.volume:'-'}}方 + + + {{i?.surplusWeight!==null?i?.surplusWeight:'--'}}吨 / {{i?.surplusVolume!==null?i?.surplusVolume:'-'}}方 + + + {{item.carModelLabel || '--'}} / {{item.carLengthLabel || '--'}} + + + + + +
    +

    装货卸货信息 + ( + + + ) + +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

    +

    联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

    +

    联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +

    到货后{{ i?.paymentDays }}天内支付运费

    +

    {{ settlementBasis[item?.settlementBasis] }},{{ rule[item?.rule] }}

    +
    + +
    + + {{ item?.freightPrice | currency: '¥' }} {{ + freightType[item?.freightType] }} + (附加费率{{i?.rate * 100 | number: '0.2-2'}}%) +
    +
    +
    +
    +
    + + + + ({{ item?.count }}) + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptTypeLabel }} + + + {{ i?.supplementaryInformationVO?.receiptUserName ? i?.supplementaryInformationVO?.receiptUserName + '/' : '' }} {{ i?.supplementaryInformationVO?.phon }} + + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + {{ i?.supplementaryInformationVO?.remarks }} + + + + + + + +
    diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.less b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.less new file mode 100644 index 00000000..957a1f03 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.less @@ -0,0 +1,84 @@ +:host { + .source-info { + min-height: 210px; + + p { + margin-bottom: .5em; + } + } + + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .title { + font-weight: bold; + font-size: 26; + } + + .freight-info-box { + width: 95%; + + p { + margin-bottom: 5px; + } + } + + .freigth-label { + display: inline-block; + width: 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width: 70%; + margin: 0 auto; + } + } + } + + .handling-info { + min-height: 100px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.spec.ts b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.spec.ts new file mode 100644 index 00000000..a1781458 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementBulkDetailComponent } from './bulk-detail.component'; + +describe('SupplyManagementBulkDetailComponent', () => { + let component: SupplyManagementBulkDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [SupplyManagementBulkDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementBulkDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.ts new file mode 100644 index 00000000..75b71007 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.ts @@ -0,0 +1,192 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +// import { PublishGoodsChooseFamifiarComponent } from 'src/app/routes/publish-goods/components/choose-famifiar-bulk/choose-famifiar.component'; +import { SupplyManagementService } from '../../services/supply-management.service'; +// import { SupplyManagementCurrentAssignmentComponent } from '../current-assignment/current-assignment.component'; +import { SupplyManagementUpdatePriceComponent } from '../update-price/update-price.component'; + +@Component({ + selector: 'app-supply-management-bulk-detail', + templateUrl: './bulk-detail.component.html', + styleUrls: ['./bulk-detail.component.less'] +}) +export class SupplyManagementBulkDetailComponent implements OnInit { + + id = this.route.snapshot.params.id; + i: any; + logColumns: STColumn[] = [ + { title: '内容', index: 'operationContent' }, + { title: '操作人', index: 'operator' }, + { title: '操作时间', index: 'operatorTimestamp' }, + ]; + driverColums: STColumn[] = [ + { title: '司机姓名', index: 'theme' }, + { title: '手机号', index: 'operationUserPhone' }, + { title: '车牌号', index: ' createTime' }, + { title: '承运次数', index: 'operationUserPhone' }, + { title: '承运数量', index: ' createTime' }, + { + title: '操作', + fixed: 'right', + width: '200px', + className: 'text-center', + buttons: [ + { + text: '移除', + click: (_record) => this.delDiver(_record), + }, + ], + }, + ]; + status: any = { 1: '待接单', 2: '已接单', 3: '已取消' }; + serviceType: any = { + 1: '抢单', + 2: '指派' + } + freightType: any = { + 1: '元/吨', + 2: '元/方', + 3: '元/车' + } // 运单类型 + + settlementBasis: any = { + 1: '以收获为准', + 2: '以发货为准' + } // 结算依据 + + rule: any = { + 1: '保留小数', + 2: '抹除小数', + 3: '抹除个数' + } // 取整规则 + get reqParams() { + return { + operateObject: this.i?.resourceCode, + operateTypeList: [4,7], + }; + } + currentStatus = 0; + + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + public service: SupplyManagementService, + private modal: NzModalService, + private router: Router + ) { + + } + + ngOnInit(): void { + this.getGoodsSourceDetail(); + } + + /** + * 移除司机 + */ + delDiver(item: any) { + const { id } = item; + // this.modal.confirm({ + // nzTitle: '删除确认', + // nzContent: `请仔细核对,避免误操作!
    是否删除?
    `, + // nzOnOk: () => { + // this.service.http.post(this.service.$api_del_driver, { id }).subscribe((res) => { + // if (res) { + // this.service.msgSrv.success('数据删除成功!'); + // // this.st1.reload(); + // } else { + // this.service.msgSrv.error('删除失败!'); + // } + // }); + // }, + // }); + } + + /** + * 查看当前指派 + */ + viewCurrentAssign(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '当前指派', + // nzWidth: '600px', + // nzContent: SupplyManagementCurrentAssignmentComponent, + // nzComponentParams: { + // i: item, + // }, + // nzFooter: null, + // }); + } + /** + *再下一单 + * @param record + */ + placeOrder(record: any) { + console.log(record) + this.router.navigate(['/supply-management/bulk-amend', record.id], { + queryParams: { + sta: 4 + }, + }) + } + /** + * 修改货源 + */ + updateGoodsSource(record: any) { + this.router.navigate(['./pbg/onecar-publish'], { + queryParams: { + id: record?.id + } + }) + } + + /** + * 更新单价 + */ + updatePrice(item: any) { + const modalRef = this.modal.create({ + nzTitle: '修改单价', + nzWidth: '600px', + nzContent: SupplyManagementUpdatePriceComponent, + nzComponentParams: { + record: item, + }, + nzFooter: null, + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.getGoodsSourceDetail(); + } + }) + } + + /** + * 取消货源 + */ + cancleGoodsSource() { + this.modal.confirm({ + nzTitle: '确定取消货源吗?', + nzContent: `取消后不可恢复,谨慎操作`, + nzOnOk: () => + this.service.request(this.service.$api_cancle_goods_source, { id: this.i.id }).subscribe((res) => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.getGoodsSourceDetail(); + } + }), + }) + } + + getGoodsSourceDetail() { + this.service.request(this.service.$api_get_getBulkDetail, { id: this.id }).subscribe(res => { + this.i = res; + this.currentStatus = +this.i?.resourceStatus - 1; + }) + } + + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html new file mode 100644 index 00000000..7e3d5937 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.html @@ -0,0 +1,228 @@ + + + + + + +
    货源单设置
    + +
    + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    + +
    +
    +
    +
    + + 装货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    + + +
    货物信息
    +
    +
    + + + + + + + + + + + + + +
    + + + + + + + +

    例如 付司机运费 = 重量*单价 = 999.99

    +

    保留小数,即 999.99

    +

    抹除小数,即 999.00

    +

    抹除个位,即 990.00

    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    补充信息
    +
    +
    + + +
    +
    +
    + +
    +
    +  天内支付运费 +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + +
    +
    diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.less b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.less new file mode 100644 index 00000000..193ba9aa --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.less @@ -0,0 +1,52 @@ +:host { + ::ng-deep { + nz-input-number { + width: 100%; + } + nz-date-picker { + width: 100%; + } + } + i { + cursor: pointer; + } +} + +.tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; +} + +.card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; +} + +.align-center { + display: flex; + align-items: center; + justify-content: center; +} + +.swap-icon { + padding: 24px; + color: #7d7d7d; + font-size: 30px; + :hover{color: #52acff;} +} + +#container { + width: 300px; + height: 180px; +} + +input[type='number'] { + -moz-appearance: textfield; +} +input[type='number']::-webkit-inner-spin-button, +input[type='number']::-webkit-outer-spin-button { + margin: 0; + -webkit-appearance: none; +} diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts new file mode 100644 index 00000000..57f100ae --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -0,0 +1,1124 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { + SFComponent, + SFNumberWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { map } from 'rxjs/operators'; +import { of } from 'rxjs'; +import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component'; +import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component'; +@Component({ + selector: 'app-publish-goods-bulk-publish', + templateUrl: './bulk-publish.component.html', + styleUrls: ['./bulk-publish.component.less'] +}) +export class SupplyManagementBulkPublishComponent implements OnInit { + validateForm1: FormGroup; + sf1data: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + sf5data: any; // 货源单设置回显 + sf7data: any; // 货源单设置回显 + creatTime: any; // 货源单设置回显 + modifyTime: any; // 货源单设置回显 + totalFees: any; // 总数信息 + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + currentGoodsTypeName: any; + enterpriseProjectIds: any; + freightTypeOptions: any; + ruleOptions: any; + id = this.route.snapshot.params.id; // 传参id + // // 单位 + startInfo: any = []; + endInfo: any = []; + PageStatus = ''; + shipperName = ''; + limitValues = { + maxMonth: 99, + maxWeight: 99999, + maxVolume: 99999, + maxTrainNumber: 99999, + maxFreight: 9999999 + }; + constructor( + private http: _HttpClient, + fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: SupplyManagementService, + private amapService: AmapService, + public shipperSrv: ShipperBaseService + ) { + this.validateForm1 = fb.group({ + loadAddress0: [null, [Validators.required]], + loadName0: [null, [Validators.required]], + loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], + unloadAddress0: [null, [Validators.required]], + unloadName0: [null, [Validators.required]], + unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]] + }); + } + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + schema1: SFSchema = {}; + ui1!: SFUISchema; + + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + schema2: SFSchema = {}; + ui2!: SFUISchema; + + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + ui4!: SFUISchema; + + @ViewChild('sf7', { static: false }) sf7!: SFComponent; + schema7: SFSchema = {}; + ui7!: SFUISchema; + // 初始化 + ngOnInit(): void { + if (this.route.snapshot?.queryParams?.sta === '3') { + this.PageStatus = '大宗修改'; + } else if (this.route.snapshot?.queryParams?.sta === '4') { + this.PageStatus = '大宗下一单'; + } + this.initSF1(); + this.initSF3(); + this.initSF4(); + this.initSF6(); + this.initdata(); + this.initDict(); + this.getLimitvalue(); + } + initSF1() { + this.schema1 = { + properties: { + shipperAppUserId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + serverSearch: true, + allowClear: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any, qs: any) => { + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + this.getRegionCode(str); + this.shipperName = qs?.label; + } + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '项目', + ui: { + widget: 'select', + placeholder: '请选择' + } as SFSelectWidgetSchema + }, + enterpriseInfoName: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'text' + } + }, + deadlineTime: { + title: '有效期', + type: 'string', + format: 'date-time', + ui: { + placeholder: '请输入', + format: 'yyyy-MM-dd HH:mm:ss', + validator: val => { + let d = new Date(); + let year = d.getFullYear(); + let month = d.getMonth(); + let date = d.getDate(); + let mydate = new Date(year, month + this.limitValues.maxMonth, date); + if (new Date(val) < new Date()) { + return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }]; + } + if (new Date(val) > mydate) { + return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }]; + } + return []; + } + } + }, + dispatchName: { + type: 'string', + title: '调度员姓名', + maxLength: 30, + ui: { + optionalHelp: '选若未填写,司机直接联系您', + placeholder: '请输入' + } + }, + dispatchPhone: { + type: 'string', + title: '调度员手机号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + } + }, + required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', 'deadlineTime'] + }; + this.ui1 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + } + }; + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物类型' }, + asyncData: () => + this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + maxLength: 20, + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 90, + grid: { span: 12 } + } + }; + } + initSF4() { + this.schema4 = { + properties: { + freightPrice: { + type: 'string', + title: '运费单价', + ui: { + errors: { required: '请选择运费单价' }, + widget: 'custom', + placeholder: '请输入' + } + }, + freightType: { + type: 'string', + title: '', + ui: { + hidden: true + }, + default: '1' + }, + rule: { + type: 'string', + title: '', + ui: { + widget: 'custom', + errors: { required: '请选择运费取整规则' } + } + }, + settlementBasis: { + type: 'string', + title: '', + enum: [ + { label: '以收货为准', value: '1' }, + { label: '以发货为准', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '结算依据', + errors: { required: '请选择结算依据' } + } as SFSelectWidgetSchema + }, + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '请填写总重量' } + } + }, + volume: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + number: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + carModel: { + type: 'string', + title: '车型/车长', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车型', + errors: { required: '请选择车型' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); + } + } + } + }, + carLength: { + type: 'string', + title: '', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车长', + errors: { required: '请选择车长' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); + } + } + } + } + }, + required: ['weight', 'carModel', 'carLength', 'freightPrice', 'rule', 'settlementBasis'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + }, + $freightPrice: { + grid: { span: 8 } + }, + $rule: { + grid: { span: 8 } + }, + $settlementBasis: { + grid: { span: 8 } + }, + $weight: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $volume: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $number: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $carModel: { + spanLabelFixed: 120, + grid: { span: 8 } + }, + $carLength: { + grid: { span: 8 } + } + }; + } + initSF6() { + this.schema7 = { + properties: { + stateReceipt: { + type: 'string', + title: '是否回单', + enum: [ + { label: '需要', value: true }, + { label: '不需要', value: false } + ], + ui: { + widget: 'select', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + receiptType: { + type: 'string', + title: '回单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'receipt:type' }, + containsAllLabel: false, + placeholder: '请选择', + errors: { required: '请选择' }, + visibleIf: { + stateReceipt: value => value === true + } + } + }, + receiptUserName: { + type: 'string', + title: '联系人', + maxLength: 15, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptUserPhone: { + type: 'string', + title: '联系电话', + maxLength: 11, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddressArea: { + type: 'string', + title: '所在地区', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddress: { + type: 'string', + title: '详细地址', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + paymentDays: { + type: 'string', + title: '到货后', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '请输入付款承诺天数' } + } + }, + remarks: { + type: 'string', + title: '备注', + maxLength: 200, + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { minRows: 3, maxRows: 3 } + } as SFTextareaWidgetSchema + } + }, + required: [ + 'stateReceipt', + 'receiptType', + 'receiptUserName', + 'receiptUserPhone', + 'receiptAddressArea', + 'receiptAddress', + 'paymentDays' + ] + }; + this.ui7 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + } + }; + } + changeValue() { + this.totalFees = + Number(this.sf7?.value?.appendFee) + + Number(this.sf7?.value?.oilCardPay) + + Number(this.sf7?.value?.prePay) + + Number(this.sf7?.value?.receiptPay) + + Number(this.sf7?.value?.toPay); + } + initDict() { + this.service.getDictByKey('freight:type').subscribe(res => { + this.freightTypeOptions = res; + }); + this.service.getDictByKey('goodresource:rounding:rules').subscribe(res => { + this.ruleOptions = res; + }); + } + // 获取城市列表 + getRegionCode(regionCode: any) { + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); + if (this.enterpriseProjectIds) { + this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + } + }); + } + addStartInfo(event: any) { + if (this.startInfo.length < 5) { + const controlId = this.startInfo.length; + this.startInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: 1 + }); + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); + } + } + subStartInfo(event: any, index: number, id?: any) { + if (id) { + this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {}); + } + this.startInfo.splice(index, 1); + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + } + addEndInfo(event: any) { + if (this.addEndInfo.length < 5) { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: 2 + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } + } + subEndInfo(event: any, index: number, id?: any) { + if (id) { + this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {}); + } + this.endInfo.splice(index, 1); + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + } + // 指派熟车 + chooseFamifiar(item: any) { + const modalRef = this.modalService.create({ + nzTitle: '指派熟车', + nzContent: PublishGoodsChooseFamifiarComponent, + nzComponentParams: { + submitParams: item, + submitUrl: this.service.$api_save_bulk_assign + }, + nzWidth: 1300 + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.openFinishPage(result); + } + }); + } + // 打开下单完成页面 + openFinishPage(resourceObj: any = null) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'bulk' } + }); + } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { + Object.keys(this.validateForm1.controls).forEach(key => { + this.validateForm1.controls[key].markAsDirty(); + this.validateForm1.controls[key].updateValueAndValidity(); + }); + this.sf1.validator({ emitError: true }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid) { + this.service.msgSrv.warning('请完善必填项!'); + return; + } + if (this.totalDistance <= 0) { + this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); + return; + } + // 校验各个输入限定值 + if ( + this.sf4.value?.weight > this.limitValues?.maxWeight || + this.sf4.value?.volume > this.limitValues?.maxVolume || + this.sf4.value?.number > this.limitValues?.maxTrainNumber + ) { + this.service.msgSrv.error( + `当前货物核载信息已超出限定值【${this.limitValues?.maxWeight}吨、${this.limitValues?.maxVolume}方、${this.limitValues?.maxTrainNumber}车】` + ); + return; + } + + if (this.sf4.value?.freightPrice > this.limitValues?.maxFreight) { + this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`); + return; + } + + // //装卸货信息 + const LoadingList = this.startInfo.concat(this.endInfo); + // 货物信息 + const sf3Values = { ...this.sf3.value }; + if (sf3Values.goodsTypeName === '其它') { + sf3Values.goodsName = sf3Values.goodsName1; + delete sf3Values.goodsName1; + } + if (this.sf4.value.carModel.includes('999')) { + this.sf4.value.carModel = ['999']; + } + if (this.sf4.value.carLength.includes('999')) { + this.sf4.value.carLength = ['999']; + } + const goodsInfoDTOList = [ + { + ...this.sf4.value, + ...this.sf3.value, + carModel: this.sf4.value?.carModel.join(','), + carLength: this.sf4.value?.carLength.join(',') + } + ]; + // 从“再下一单”过来,将所有的子参数内的id都删除 + if ((this.PageStatus = '大宗下一单')) { + LoadingList.forEach((ele: any) => { + delete ele.id; + }); + goodsInfoDTOList.forEach((ele: any) => { + delete ele.id; + }); + } + const params: any = { + ...this.sf1.value, + ...this.sf7.value, + unLoadingPlaceDTOList: LoadingList, + goodsInfoDTOList: goodsInfoDTOList, + estimatedKilometers: this.totalDistance, + estimatedTravelTime: this.totalTime + }; + params.freightPrice = this.totalFees; + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { object: params, shipperName: this.shipperName, type: 'bulk' } + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType, params); + } + }); + } + // 确认提交 + submit(submitType?: string, params?: any): void { + if (submitType) { + if (submitType == 'assign') { + this.chooseFamifiar(params); + return; + } else if (submitType === 'qrcode') { + this.service.request(this.service.$api_saveAnotherBulkOrderQRCode, params).subscribe(res => { + if (res) { + this.assignedQrcode(res, params); + } + }); + return; + } + } + if (this.PageStatus === '大宗修改') { + this.requests(this.service.$api_set_bulkModify, params, 1); + } else if (this.PageStatus === '大宗下一单') { + this.requests(this.service.$api_set_saveAnotherBulkOrder, params, 2); + } + } + // 生成二维码 + assignedQrcode(id: string, parms: any) { + const item = { + id, + enterpriseInfoName: parms.enterpriseInfoName, + loadingAddressArr: this.startInfo.map((ele: any) => ele.detailedAddress), + unloadingAddressArr: this.endInfo.map((ele: any) => ele.detailedAddress), + deadlineTime: parms.deadlineTime + }; + const modalRef = this.modalService.create({ + nzTitle: '二维码', + nzWidth: '468px', + nzContent: SupplyManagementQrcodePageComponent, + nzComponentParams: { + i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(() => { + this.router.navigate(['/supply-management/index'], { queryParams: { type: 'bulk' } }); + }); + } + requests(url: any, params: any, change?: any) { + this.service.request(url, params).subscribe((res: any) => { + if (res) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'onecar', change: change } + }); + } + }); + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget.reset(res); + if (this.sf3data.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); + } + } + }); + } + backBillChange() { + const modalRef = this.modalService.create({ + nzTitle: '选择收回单地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '2' }, + nzOnOk: item => { + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + this.sf7.setValue('/receiptAddressId', data.id); + this.sf7.setValue('/receiptUserName', data.contactName); + this.sf7.setValue('/phon', data.contactTelephone); + this.sf7.setValue('/area', `${data.province}-${data.city}-${data.area}`); + this.sf7.setValue('/address', data.detailedAddress); + } + }); + } + // 打开地图 + openMap(type: string, index: number) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.location.toString().split(','); + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.district + poi.name; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.cityInfo.province; + this.startInfo[index].city = poi.cityInfo.city; + this.startInfo[index].area = poi.cityInfo.district; + this.startInfo[index].address = poi.name; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.district + poi.name; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.cityInfo.province; + this.endInfo[index].city = poi.cityInfo.city; + this.endInfo[index].area = poi.cityInfo.district; + this.endInfo[index].address = poi.name; + break; + default: + break; + } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + }); + } + goBack() { + window.history.go(-1); + } + // 初始化信息 + initdata() { + this.service.request(`${this.service.$api_get_getBulkDetail}`, { id: this.id }).subscribe(res => { + this.dataR(res); + }); + } + + // 初始化信息 + dataR(res: any) { + // 注:区分编辑和下一单 区别是初始化的时候加不加ID + if (res?.shipperAppUserName) { + this.shipperName = res?.shipperAppUserName; + const List: any = []; + this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => { + rs?.forEach((element: any) => { + List.push({ label: element.enterpriseName, value: element.id }); + }); + this.sf1.getProperty('/shipperAppUserId')!.schema.enum = List; + this.sf1.getProperty('/shipperAppUserId')!.widget.reset(List); + if (res?.shipperAppUserId) { + this.sf1.setValue('/shipperAppUserId', res?.shipperAppUserId); + this.getRegionCode(res?.shipperAppUserId); + } + }); + } + if (res?.enterpriseProjectId) { + this.enterpriseProjectIds = res.enterpriseProjectId; + } + this.totalDistance = res?.estimatedKilometers; + this.totalTime = res?.estimatedTravelTime; + this.sf1data = { + dispatchPhone: res?.dispatchPhone, + dispatchName: res?.dispatchName, + // shipperAppUserName: res?.shipperAppUserName || '', + enterpriseProjectId: res?.enterpriseProjectId || '', + enterpriseInfoName: res?.enterpriseInfoName || '', + externalResourceCode: res?.externalResourceCode || '', + deadlineTime: res?.deadlineTime || '' + }; + if (this.PageStatus === '大宗修改') { + this.sf1data.id = res?.id; + } + res?.unLoadingPlaceVOList.forEach((element: any) => { + if (element.type === 1 || element.type === '1') { + const controlId = this.startInfo.length; + if (this.PageStatus === '大宗修改') { + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + } else { + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type + }); + } + if (element.createTime) { + this.creatTime = element?.createTime; + this.modifyTime = element?.modifyTime; + } + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); + } else if (element.type === 2 || element.type === '2') { + const controlId = this.endInfo.length; + if (this.PageStatus === '大宗修改') { + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + } else { + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type + }); + } + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } + }); + this.sf3data = { + goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '', + goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '', + goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '', + goodsName: res?.goodsInfoVOList[0]?.goodsName || '' + }; + if (this.sf3data.goodsTypeName === '其它') { + this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || ''; + } + this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId }); + + this.sf4data = { + freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '', + freightType: res?.goodsInfoVOList[0]?.freightType || '', + rule: res?.goodsInfoVOList[0]?.rule || '', + settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '', + weight: res?.goodsInfoVOList[0]?.weight || '', + volume: res?.goodsInfoVOList[0]?.volume || '', + number: res?.goodsInfoVOList[0]?.number || '', + carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || '', + carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || '' + }; + if (this.PageStatus === '大宗修改') { + this.sf4data.id = res?.goodsInfoVOList[0]?.id; + } + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + this.totalFees = res?.freightPrice || '0'; + this.sf7data = { + stateReceipt: res?.stateReceipt, + receiptType: res?.receiptType || '', + receiptUserName: res?.supplementaryInformationVO?.receiptUserName || '', + receiptAddressArea: res?.supplementaryInformationVO?.area || '', + receiptUserPhone: res?.supplementaryInformationVO?.phon || '', + receiptAddress: res?.receiptAddress || '', + paymentDays: res?.paymentDays || '', + remarks: res?.remarks || '' + }; + } + // 回退 + choose() { + window.history.go(-1); + } + // 选择地址 + chooseAddress(index: number, type: string) { + const modalRef = this.modalService.create({ + nzTitle: '选择地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '1' }, + nzOnOk: item => { + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + switch (type) { + case 'start': + this.startInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '1' + }; + break; + case 'end': + this.endInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '2' + }; + break; + default: + break; + } + } + }); + } + // 装卸货地址互换 + swapAddress() { + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any) => { + element.type = '1'; + }); + this.endInfo.forEach((element: any) => { + element.type = '2'; + }); + + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + getLimitvalue() { + const getlimitvaluesParms = [ + this.service.limitKeys2.month, + this.service.limitKeys2.weight, + this.service.limitKeys2.volume, + this.service.limitKeys2.trainNumber, + this.service.limitKeys2.freight + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => { + const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue; + const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue; + const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue; + const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue; + const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue; + this.limitValues = { + maxMonth: Number(maxMonth), + maxWeight: Number(maxWeight), + maxVolume: Number(maxVolume), + maxTrainNumber: Number(maxTrainNumber), + maxFreight: Number(maxFreight) + }; + }); + } +} diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html new file mode 100644 index 00000000..db754dcf --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html @@ -0,0 +1,238 @@ + + + + + + +
    货源单设置
    + + {{ i.value }} + +
    + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    + +
    +
    +
    +
    + + 装货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    + + +
    货物信息
    +
    +
    + + + + + + + + + + + + + +
    + + + + + + + +

    例如 付司机运费 = 重量*单价 = 999.99

    +

    保留小数,即 999.99

    +

    抹除小数,即 999.00

    +

    抹除个位,即 990.00

    +
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    补充信息
    +
    +
    + + +
    +
    +
    + +
    +
    +  天内支付运费 +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + + + +
    +
    diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less new file mode 100644 index 00000000..6abb9df7 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less @@ -0,0 +1,48 @@ +:host { + ::ng-deep { + nz-input-number { + width: 100%; + } + nz-date-picker { + width: 94.3%; + } + } + i { + cursor: pointer; + } +} + +.tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; +} + +.card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; +} + +.align-center { + display: flex; + align-items: center; + justify-content: center; +} + +.swap-icon { + padding: 24px; + color: #7d7d7d; + font-size: 30px; + :hover{color: #52acff;} +} + + +input[type='number'] { + -moz-appearance: textfield; +} +input[type='number']::-webkit-inner-spin-button, +input[type='number']::-webkit-outer-spin-button { + margin: 0; + -webkit-appearance: none; +} diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts new file mode 100644 index 00000000..78ce97a5 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts @@ -0,0 +1,876 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { NgForm } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { + SFComponent, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { SettingsService, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component'; +import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component'; +import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component'; +@Component({ + selector: 'app-publish-goods-bulk-publish', + templateUrl: './bulk-release-publish.component.html', + styleUrls: ['./bulk-release-publish.component.less'] +}) +export class SupplyManagementBulkReleasePublishComponent implements OnInit { + @ViewChild('ngForm') + ngForm!: NgForm; + sf1data: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + sf5data: any; // 货源单设置回显 + sf6data: any; // 货源单设置回显 + sf7data: any; // 货源单设置回显 + creatTime: any; // 货源单设置回显 + modifyTime: any; // 货源单设置回显 + totalFees: any; // 总数信息 + ruleOptions: any; + id = ''; + type = 'add'; + limitValues = { + maxMonth: 99, + maxWeight: 99999, + maxVolume: 99999, + maxTrainNumber: 99999, + maxFreight: 9999999 + } + shipperName = ''; + // // 单位 + startInfo: any[] = []; + endInfo: any[] = []; + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + freightTypeOptions: any; + constructor( + private http: _HttpClient, + private modalService: NzModalService, + private settingSrv: SettingsService, + private service: SupplyManagementService, + private router: Router, + private route: ActivatedRoute, + private amapService: AmapService, + public shipperSrv: ShipperBaseService + ) { + + } + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + schema1: SFSchema = {}; + ui1!: SFUISchema; + + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + ui4!: SFUISchema; + + @ViewChild('sf6', { static: false }) sf6!: SFComponent; + schema6: SFSchema = {}; + ui6!: SFUISchema; + // 初始化 + ngOnInit(): void { + this.initSF1(); + this.initSF3(); + this.initSF4(); + this.initSF6(); + this.getLimitvalue(); + this.initDict(); + this.startInfo = [ + { + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '1' + } + ]; + this.endInfo = [ + { + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '2' + } + ]; + } + initSF1() { + this.schema1 = { + properties: { + shipperAppUserId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str =q?.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any, qs: any) => { + let str =q?.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + this.shipperName = qs?.label; + } + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '项目', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + } as SFSelectWidgetSchema + }, + // enterpriseInfoName: { + // type: 'string', + // title: '网络货运人', + // ui: { + // widget: 'custom' + // }, + // default: '天津市怡亚通XXXX有限公司' + // }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperSrv.getNetworkFreightForwarder() + } + }, + deadlineTime: { + title: '有效期', + type: 'string', + format: 'date-time', + ui: { + placeholder: '请输入', + format: 'yyyy-MM-dd HH:mm:ss', + validator: (val) => { + let d = new Date(); + let year = d.getFullYear(); + let month = d.getMonth(); + let date = d.getDate(); + let mydate = new Date(year, month + this.limitValues.maxMonth, date); + if (new Date(val) < new Date()) { + return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }]; + } + if (new Date(val) > mydate) { + return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }]; + } + return []; + }, + } + }, + dispatchName: { + type: 'string', + title: '调度员姓名', + maxLength: 30, + ui: { + optionalHelp: '选若未填写,司机直接联系您', + placeholder: '请输入' + } + }, + dispatchPhone: { + type: 'string', + title: '调度员手机号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + }, + required: ['shipperAppUserId', 'enterpriseProjectId','enterpriseInfoName','enterpriseInfoId', 'deadlineTime',] + }; + this.ui1 = { + '*': { + spanLabelFixed: 110, + grid: { span: 12 } + }, + $enterpriseInfoName: { + grid: { span: 24 } + } + }; + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物类型' }, + asyncData: () => + this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + maxLength: 20, + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 90, + grid: { span: 12 } + } + }; + } + initSF4() { + this.schema4 = { + properties: { + freightPrice: { + type: 'string', + title: '运费单价', + ui: { + errors: { required: '请选择运费单价' }, + widget: 'custom', + placeholder: '请输入' + } + }, + freightType: { + type: 'string', + title: '', + ui: { + hidden: true + }, + default: '1' + }, + + rule: { + type: 'string', + title: '', + ui: { + widget: 'custom', + errors: { required: '请选择运费取整规则' } + } + }, + settlementBasis: { + type: 'string', + title: '', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:settlement:type' }, + placeholder: '结算依据', + errors: { required: '请选择结算依据' } + } as SFSelectWidgetSchema + }, + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '请填写总重量' } + } + }, + volume: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + number: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + carModel: { + type: 'string', + title: '车型/车长', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount:3, + placeholder: '请选择车型', + errors: { required: '请选择车型' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), + change:(tag:any , org:any)=>{ + if(tag.includes("999")){ + this.sf4.setValue('/carModel',["999"]); + } + } + } + }, + carLength: { + type: 'string', + title: '', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount:3, + placeholder: '请选择车长', + errors: { required: '请选择车长' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), + change:(tag:any , org:any)=>{ + if(tag.includes("999")){ + this.sf4.setValue('/carModel',["999"]); + } + } + } + }, + }, + required: ['weight', 'carModel', 'carLength', 'freightPrice', 'rule', 'settlementBasis'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + }, + $freightPrice: { + grid: { span: 8 } + }, + $rule: { + grid: { span: 8 } + }, + $settlementBasis: { + grid: { span: 8 } + }, + $weight: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $volume: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $number: { + grid: { lg: 8, md: 12, sm: 12, xs: 24 } + }, + $carModel: { + spanLabelFixed: 120, + grid: { span: 8 } + }, + $carLength: { + grid: { span: 8 } + } + }; + } + initSF6() { + this.schema6 = { + properties: { + stateReceipt: { + type: 'string', + title: '是否回单', + enum: [ + { label: '需要', value: true }, + { label: '不需要', value: false } + ], + ui: { + widget: 'select', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + receiptType: { + type: 'string', + title: '回单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'receipt:type' }, + containsAllLabel: false, + placeholder: '请选择', + errors: { required: '请选择' }, + visibleIf: { + stateReceipt: value => value === true + } + } + }, + receiptUserName: { + type: 'string', + title: '联系人', + maxLength: 15, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + }, + }, + receiptUserPhone: { + type: 'string', + title: '联系电话', + maxLength: 11, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + }, + }, + receiptAddressArea: { + type: 'string', + title: '所在地区', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + }, + }, + receiptAddress: { + type: 'string', + title: '详细地址', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + }, + }, + paymentDays: { + type: 'string', + title: '到货后', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '请输入付款承诺天数' } + } + }, + remarks: { + type: 'string', + title: '备注', + maxLength: 200, + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { minRows: 3, maxRows: 3 } + } as SFTextareaWidgetSchema + } + }, + required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays'] + }; + this.ui6 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + } + }; + } + initDict() { + this.service.getDictByKey('freight:type').subscribe(res => { + this.freightTypeOptions = res; + }); + this.service.getDictByKey('goodresource:rounding:rules').subscribe(res => { + this.ruleOptions = res; + }); + } + //指派熟车 + chooseFamifiar(item: any) { + const modalRef = this.modalService.create({ + nzTitle: '指派熟车', + nzContent: PublishGoodsChooseFamifiarComponent, + nzComponentParams: { + submitParams: item, + submitUrl: this.service.$api_save_consignBulkAssign + }, + nzWidth: 1300 + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.openFinishPage(result); + } + }); + } + // 打开下单完成页面 + openFinishPage(resourceObj: any = null) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'bulk' } + }); + } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { + // 校验规则 + Object.keys(this.ngForm.form.controls).forEach(key => { + this.ngForm.form.controls[key].markAsDirty(); + this.ngForm.form.controls[key].updateValueAndValidity(); + }); + this.sf1.validator({ emitError: true }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + this.sf6.validator({ emitError: true }); + if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) { + this.service.msgSrv.warning('请完善必填项!'); + return; + } + if (this.totalDistance <= 0) { + this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); + return; + } + // 校验各个输入限定值 + if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) { + this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`); + return; + } + + if (this.sf4.value.freightPrice > this.limitValues.maxFreight) { + this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`); + return; + } + + // //装卸货信息 + const LoadingList = this.startInfo.concat(this.endInfo); + + // 货物信息 + const sf3Values = { ...this.sf3.value }; + if (sf3Values.goodsTypeName === '其它') { + sf3Values.goodsName = sf3Values.goodsName1; + delete sf3Values.goodsName1; + } + if (this.sf4.value.carModel.includes('999')) { + this.sf4.value.carModel = ['999'] + } + if (this.sf4.value.carLength.includes('999')) { + this.sf4.value.carLength = ['999'] + } + + const goodsInfoList = [ + { + ...sf3Values, + ...this.sf4.value, + carModel: this.sf4.value.carModel.join(','), + carLength: this.sf4.value.carLength.join(',') + } + ]; + const params = { + id: '', + ...this.sf1.value, + unLoadingPlaceDTOList: LoadingList, + goodsInfoDTOList: goodsInfoList, + ...this.sf6.value, + estimatedKilometers: this.totalDistance, + estimatedTravelTime: this.totalTime, + }; + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { object: params, shipperName: this.shipperName , type:'bulk'} + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType, params); + } + }); + } + // 确认提交(下单) + submit(submitType?: string, params?: any): void { + + + let reqUrl = this.service.$api_consignBulk; + if (submitType === 'assign') { + this.chooseFamifiar(params); + }else if(submitType === 'qrcode'){ + this.service.request(this.service.$api_consignBulkQRCode, params).subscribe(res => { + if (res) { + this.assignedQrcode( res, params ) + } + }); + return; + } else { + this.service.request(reqUrl, params).subscribe(res => { + if (res) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'bulk' } + }); + } + }); + } + } + // 生成二维码 + assignedQrcode(id:string,parms:any ) { + const item = { + id, + enterpriseInfoName: parms.enterpriseInfoName, + loadingAddressArr: this.startInfo.map((ele: any)=>ele.detailedAddress), + unloadingAddressArr: this.endInfo.map((ele: any)=>ele.detailedAddress), + deadlineTime: parms.deadlineTime, + } + const modalRef = this.modalService.create({ + nzTitle: '二维码', + nzWidth: '468px', + nzContent: SupplyManagementQrcodePageComponent, + nzComponentParams: { + i: item, + }, + nzFooter: null, + }); + modalRef.afterClose.subscribe(() => { + this.router.navigate(['/supply-management/index'], { queryParams: { type: 'bulk' } }); + }); + } + // 获取城市列表 + getRegionCode(regionCode: any) { + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); + }); + } + // 打开地图 + openMap(type: string, index: number) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.pois; + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.formattedAddress; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.formattedAddress; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + break; + default: + break; + } + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + }); + } + // 选择地址 + chooseAddress(index: number, type: string) { + const modalRef = this.modalService.create({ + nzTitle: '选择地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '1' }, + nzOnOk: item => { + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + switch (type) { + case 'start': + this.startInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '1' + }; + break; + case 'end': + this.endInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '2' + }; + break; + default: + break; + } + } + }); + } + // 返回上一页 + goBack() { + window.history.go(-1); + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget.reset(res); + if (this.sf3data?.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); + } + } + }); + } + // 装卸货地址互换 + swapAddress(){ + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any) => { + element.type = '1'; + }); + this.endInfo.forEach((element: any) => { + element.type = '2'; + }); + + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + getLimitvalue() { + const getlimitvaluesParms = [ + this.service.limitKeys2.month, + this.service.limitKeys2.weight, + this.service.limitKeys2.volume, + this.service.limitKeys2.trainNumber, + this.service.limitKeys2.freight, + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => { + const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue; + const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue; + const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue; + const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue; + const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue; + this.limitValues = { + maxMonth: Number(maxMonth), + maxWeight: Number(maxWeight), + maxVolume: Number(maxVolume), + maxTrainNumber: Number(maxTrainNumber), + maxFreight: Number(maxFreight) + } + }) + } +} diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.html b/src/app/routes/supply-management/components/bulk/bulk.component.html new file mode 100644 index 00000000..483a6ed1 --- /dev/null +++ b/src/app/routes/supply-management/components/bulk/bulk.component.html @@ -0,0 +1,136 @@ + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + +
    + + +
    +
    + + + + + + + +
    + + +
    +
    + + +
    {{ item?.createUserName }}{{ item?.createUserPhone ? '/' + item?.createUserPhone : ''}}
    +
    + + +
    {{ item?.freightPrice | currency }}
    +
    + + + {{ item?.resourceCode }} +
    {{ item?.resourceTypeLabel }}{{ item?.serviceTypeLabel }}
    +
    {{ item?.resourceStatusLabel === '已完成' ? '已完结' : item?.resourceStatusLabel }}
    +
    + + +
    抢单
    +
    指派
    +
    + + +
    + + ({{ item?.count }}) +
    +
    + + +
    {{ item?.goodsInfos?.goodsName }}
    +
    货源:{{ item?.goodsInfos?.goodsResource }}
    +
    剩余: {{ item?.goodsInfos?.remainingAmount }}
    +
    + + +
    车型: {{ item?.carModelLabel }}
    +
    车长: {{ item?.carLengthLabel }} 米
    +
    +
    +
    +
    + + +
    + + +
    + +
    + + + + +
    + diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.spec.ts b/src/app/routes/supply-management/components/bulk/bulk.component.spec.ts new file mode 100644 index 00000000..1f54e37b --- /dev/null +++ b/src/app/routes/supply-management/components/bulk/bulk.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementBulkComponent } from './bulk.component'; + +describe('SupplyManagementBulkComponent', () => { + let component: SupplyManagementBulkComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementBulkComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementBulkComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.ts b/src/app/routes/supply-management/components/bulk/bulk.component.ts new file mode 100644 index 00000000..14fddd9a --- /dev/null +++ b/src/app/routes/supply-management/components/bulk/bulk.component.ts @@ -0,0 +1,573 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component'; +import { SupplyManagementUpdatePriceComponent } from '../update-price/update-price.component'; + +@Component({ + selector: 'app-supply-management-bulk', + templateUrl: './bulk.component.html' +}) +export class SupplyManagementBulkComponent implements OnInit { + resourceStatus: any; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + auditMany = false; + isVisible = false; + loading: boolean = true; + auditID: any; + _$expand = false; + columns: STColumn[] = []; + freightSchema: SFSchema = {}; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + + tabs: any = { + totalQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + constructor( + public service: SupplyManagementService, + private modal: NzModalService, + private router: Router, + public shipperservice: ShipperBaseService + ) {} + + ngOnInit(): void { + this.initSF(); + this.initST(); + this.initSFFre(); + this.getGoodsSourceStatistical(); + } + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + releaseTime: { + start: this.sf?.value?.releaseTime?.[0] || '', + end: this.sf?.value?.releaseTime?.[1] || '' + }, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '' + } + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const a: any = {}; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + if (this.sf) { + Object.assign(requestOptions.body, { + ...a, + ...params, + releaseTime: { + start: this.sf?.value?.releaseTime?.[0] || '', + end: this.sf?.value?.releaseTime?.[1] || '' + }, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '' + } + }); + } + this.loading = true; + return requestOptions; + }; + search() { + this.st?.load(); + this.getGoodsSourceStatistical(); + } + afterRes = (data: any[], rawData?: any) => { + console.log(data); + this.loading = false; + return data.map(item => ({ + ...item, + disabled: item.auditStatus !== '1' + })); + }; + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + loadingPlace: { + type: 'string', + title: '装货地' + }, + dischargePlace: { + type: 'string', + title: '卸货地' + }, + serviceType: { + title: '服务类型', + type: 'string', + default: '', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'service:type' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + settlementBasis: { + title: '结算依据', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'goodresource:settlement:type' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + releaseTime: { + title: '发布时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } as SFDateWidgetSchema + }, + deadlineTime: { + title: '截止时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } as SFDateWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + } + } as SFSelectWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.freightSchema = { + properties: { + remarks: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '请输入备注', + widget: 'textarea' + } + } + } + }; + this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 16 } } }; + } + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '货源编号', + width: '200px', + fixed: 'left', + className: 'text-left', + render: 'resourceCode' + }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '220px', className: 'text-left' }, + { title: '项目名称', index: 'enterpriseProjectName', width: '220px', className: 'text-left' }, + { title: '关联订单', render: 'orderSn', width: '200px', className: 'text-left' }, + { title: '货物信息', render: 'goodsInfos', width: '280px', className: 'text-left' }, + { + title: '装货地', + className: 'text-left', + index: 'loadingAddressArr', + width: '200px' + }, + { + title: '卸货地', + className: 'text-left', + index: 'unloadingAddressArr', + width: '200px' + }, + { + title: '用车需求', + className: 'text-left', + width: '200px', + render: 'useCarDemand' + }, + { + title: '运费单价', + className: 'text-right', + width: '150px', + index: 'freightPrice', + render: 'freightPrice' + }, + { + title: '结算依据', + className: 'text-left', + width: '200px', + index: 'settlementBasisLabel' + }, + { + title: '货源状态', + className: 'text-left', + index: 'resourceStatusLabel', + width: '120px' + }, + { + title: '截止时间', + width: '170px', + className: 'text-left', + index: 'deadlineTime' + }, + { + title: '发布时间', + width: '170px', + className: 'text-left', + index: 'createTime' + }, + { + title: '审核状态', + className: 'text-left', + index: 'auditStatus', + type: 'badge', + width: '170px', + badge: { + '1': { text: '待审核', color: 'warning' }, + '2': { text: '审核通过', color: 'success' }, + '3': { text: '不通过', color: 'default' }, + '4': { text: '已取消', color: 'default' } + } + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center block-td', + buttons: [ + { + text: '货源审核', + click: _record => this.audit(_record, 1), + iif: item => item.auditStatus === '1', + acl: { ability: ['SUPPLY-INDEX-bulkBatchAudit'] } + }, + { + text: '二维码', + click: _record => this.assignedQrcode(_record), + iif: item => item.resourceStatus == 1 + }, + { + text: '修改单价', + click: _record => this.modification(_record), + iif: item => item.resourceStatus == 1, + acl: { ability: ['SUPPLY-INDEX-modificationUnitPrice'] } + }, + { + text: '取消货源', + click: _record => this.delOne(_record), + iif: item => item.resourceStatus == 1, + acl: { ability: ['SUPPLY-INDEX-bulkCancelSupply'] } + }, + { + text: '再下一单', + click: _record => this.nextOrder(_record), + acl: { ability: ['SUPPLY-INDEX-bulkPlaceOrder'] } + }, + { type: 'divider' } + ] + } + ]; + } + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + + selectChange(e: number) { + console.log(e); + if (e == 2) { + this.resourceStatus = 4; + } else { + this.resourceStatus = e; + } + this.initST(); + setTimeout(() => { + this.st.load(1); + }, 500); + } + + /** + * 二维码 + */ + assignedQrcode(item: any) { + const modalRef = this.modal.create({ + nzTitle: '二维码', + nzWidth: '468px', + nzContent: SupplyManagementQrcodePageComponent, + nzComponentParams: { + i: item + }, + nzFooter: null + }); + } + tabChange(item: any) { + console.log(item); + } + /** + * 审核 + * status : 1 单个 2:批量 + * value : 单个单条数据 + */ + audit(value: any, status?: any) { + console.log(value); + console.log(status); + if (status === 2) { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('未选择货源单!'); + return; + } + let list: any[] = []; + this.selectedRows.forEach(item => { + list.push(item.id); + }); + this.auditID = list; + this.auditMany = true; + } else { + this.auditID = value.id; + this.auditMany = false; + } + this.isVisible = true; + } + /** + * 审核关闭弹窗 + */ + handleCancel(type: any) { + this.isVisible = false; + } + /** + * 代发货源 + */ + releaseGoods() { + this.router.navigate(['/supply-management/bulk-release']); + } + /** + * 审核通过按钮 + */ + handleOK(value: any) { + if (this.selectedRows.length <= 0) { + const params: any = { + id: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log(params); + this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } else { + const params: any = { + ids: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log(params); + this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } + } + // 修改单价 + modification(item: any) { + const modalRef = this.modal.create({ + nzTitle: '修改单价', + nzWidth: '600px', + nzContent: SupplyManagementUpdatePriceComponent, + nzComponentParams: { + record: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } + // getGoodsSourceDetail() { + // this.service.request(this.service.$api_get_bulk_detail, { id: this.id }).subscribe(res => { + // this.i = res; + // this.currentStatus = +this.i?.resourceStatus - 1; + // }) + // } + + // 再下一单 + nextOrder(item: any) { + this.router.navigate(['/supply-management/bulk-amend', item.id], { + queryParams: { + sta: 4 + } + }); + } + // 取消货源 + delOne(item: any) { + this.modal.confirm({ + nzTitle: '确定取消货源吗?', + nzContent: `取消后不可恢复,谨慎操作`, + nzOnOk: () => + this.service.request(this.service.$api_cancelSource, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('已取消货源!'); + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }) + }); + } + // 获取货源状态统计 + getGoodsSourceStatistical() { + this.tabs = { + totalQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.resourceStatus; + this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 2, ...params }).subscribe(res => { + if (res) { + console.log(res); + this.tabs = res; + } + }); + } + userAction() {} + // 导出 + exportFire() { + this.service.asyncExport(this.reqParams, this.service.$api_asyncExportBulkList); + } +} diff --git a/src/app/routes/supply-management/components/choose-famifiar/add/add.component.html b/src/app/routes/supply-management/components/choose-famifiar/add/add.component.html new file mode 100644 index 00000000..b33e4119 --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/add/add.component.html @@ -0,0 +1,6 @@ + + +
    + + +
    diff --git a/src/app/routes/supply-management/components/choose-famifiar/add/add.component.ts b/src/app/routes/supply-management/components/choose-famifiar/add/add.component.ts new file mode 100644 index 00000000..383d919d --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/add/add.component.ts @@ -0,0 +1,44 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'app-choose-famifiar-add', + templateUrl: './add.component.html' +}) +export class PublishchooseFamifiarAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + + i: any; + + constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + name: { + type: 'string', + title: '司机手机号' + } + }, + required: ['name'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + } + + close() {} + save() {} +} diff --git a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html new file mode 100644 index 00000000..0f517765 --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.html @@ -0,0 +1,61 @@ + + + +
    +
    + +
    +
    + + +
    +
    +
    +
    + + + + + + + + + +
    +
    + +
    已选择{{ st2Data.length }}位司机
    + + + {{ item.captainName }} {{ item.captainPhone }}   + 设置 + + + {{item.default?.carNo}} + + +
    +
    +
    + + +
    diff --git a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts new file mode 100644 index 00000000..3b5ada90 --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts @@ -0,0 +1,345 @@ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzDrawerService } from 'ng-zorro-antd/drawer'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { CarAddmodalComponent } from '../addmodal/addmodal.component'; + + +@Component({ + selector: 'app-publish-goods-choose-famifiar', + templateUrl: './choose-famifiar.component.html' +}) +export class PublishGoodsChooseFamifiarComponent implements OnInit { + schema: SFSchema = {}; + columns!: STColumn[]; + i: any; + ui!: SFUISchema; + sfExpand = false; + @ViewChild('st', { static: false }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + @ViewChild('st2', { static: false }) + st2!: STComponent; + columns2!: STColumn[]; + st2Data: STData[] = []; + + @Input() + submitUrl = ''; + + @Input() + submitParams: any; + + constructor( + private modal: NzModalRef, + public router: Router, + public ar: ActivatedRoute, + private drawerService: NzDrawerService, + public service: SupplyManagementService, + private modalService: NzModalService, + private modalHelper: ModalHelper, + private envSrv: EAEnvironmentService + ) { } + + /** + * 查询参数 + */ + get reqParams() { + return { + ...this.sf?.value, + isManage: 0 + }; + } + ngOnInit() { + this.initSF(); + this.initST(); + this.initST2(); + } + + initSF() { + this.schema = { + properties: { + nameOrPhone: { + type: 'string', + title: '承运司机', + ui: { + placeholder: '请输入司机姓名/手机号' + } + }, + carNo: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入车牌号' + } + } + } + }; + this.ui = { + '*': { + grid: { span: 12, gutter: 4 } + } + }; + } + + initST() { + this.columns = [ + { + title: '司机姓名', + index: 'name' + }, + { + title: '手机号', + index: 'telephone' + }, + { + title: '指定车辆', + width: 130, + render: 'userCarLicenseDesensitizationVOList' + }, + { + title: '状态', + className: 'text-center', + index: 'certificationStatus', + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 0: { text: '待审核', color: 'processing' }, + 1: { text: '已认证', color: 'success' }, + 2: { text: '未认证', color: 'error' } + } + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '选择', + iif: item => item.showChoose != false, + click: (_record, _modal, _instance) => this.verifyVechicleStatus(_record), + iifBehavior: 'disabled' + } + ] + } + ]; + } + + initST2() { + this.columns2 = [ + { + title: '司机姓名', + index: 'name', + width: '90px' + }, + { + title: '手机号', + index: 'telephone', + width: '120px' + }, + { + title: '车队长', + render: 'captain', + width: '200px' + }, + { + title: '指定车辆', + render: 'defaultCar', + width: '130px' + }, + { + title: '操作', + className: 'text-center', + width: '90px', + buttons: [ + { + text: '移除', + click: (_record, _modal, _instance) => this.remove(_record, _modal, _instance) + } + ] + } + ]; + } + + // 选择 + choose(record: STData) { + this.st2Data = [...this.st2Data, ...[record]]; + this.st.setRow(record, { showChoose: false }); + } + // 移除 + remove(record: STData, value1: any, comp: any) { + const index = this.st?.list.findIndex((obj: any) => obj.appUserId === record.appUserId); + if (index >= 0) { + comp!.removeRow(record); + this.st2Data = this.st2Data.filter(item => item.appUserId !== record.appUserId); + this.st.setRow(index, { showChoose: true }); + } + } + + //添加司机 + add() { + this.modalHelper.create(CarAddmodalComponent, {}, { size: 900, modalOptions: { nzMaskClosable: false } }).subscribe(res => { + if (res) this.st.reload(); + }); + } + + /** + * 校验司机是否能设置车队长 + * @param item 当前对象 + */ + verifyCanSetCarCaptain(item: any, index: any) { + this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => { + if (res && res.length > 0) { + const { itemValue } = res[0]; + if (itemValue !== '1') { + this.service.msgSrv.error('不可设置车队长!'); + return; + } + this.setCaptain(item, index); + } + }) + } + + //设置车队长 + setCaptain(record: STData, index: any) { + this.modalHelper + .create( + SupplyManagementAddDriversComponent, + { dirvierInfo: record }, + { + size: 900, + modalOptions: { nzMaskClosable: false, nzTitle: '设置' } + } + ) + .subscribe(res => { + if (res) { + this.st2.setRow(index, { captainName: res.name, captainPhone: res.mobile, captainAppUserId: res.appUserId }); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.sfExpand = false; + this.st.load(1); + } + + expandToggle() { + this.sfExpand = !this.sfExpand; + this.sf?.setValue('/_expand', this.sfExpand); + } + + // 熟车请求数据处理 + reqProcess = (data: STData[], rawData: any): STData[] => { + if (rawData.status === 505016) { + this.modalService.confirm({ + nzTitle: '系统提示', + nzContent: '该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + this.sendMsg(this.sf?.value?.nameOrPhone).subscribe((res => { + if (res.code === '1') { + this.service.msgSrv.success('发送成功'); + } else { + this.service.msgSrv.success('发送失败'); + } + })); + } + }); + return []; + } + return data.map((i, index) => { + const defaultCart = i.userCarLicenseDesensitizationVOList.find((cart: any) => cart.isDefault); + return { ...i, default: defaultCart || '' }; + }); + } + + cancel() { + this.modal.destroy(); + } + + ok() { + if (this.st2._data?.length <= 0) { + this.service.msgSrv.warning('请选择熟车'); + return; + } + const data = this.st2._data.map(item => ({ + driverId: item.appUserId, + carId: item.default?.carId || null, + carCaptainId: item.captainAppUserId + })); + this.service.request(this.submitUrl, { ...this.submitParams, carDriverIds: data }).subscribe((rs: any) => { + if (rs) { + this.service.msgSrv.success('指派成功'); + this.modal.destroy(true); + } + }); + } + + carChange(event: any, item: STData) { + + } + + /** +* 验证车辆的状态 +*/ + verifyVechicleStatus(_record: STData) { + const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record; + const carInfo: any = { carId, driverId, carCaptainId }; + const goodsInfoList = this.submitParams?.goodsInfoList; + this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => { + if (res) { + const { title, alert, subContent, content } = res; + switch (alert) { + case 'Error': + this.error(title, content, subContent); + break; + case 'Warn': + this.showConfirm(_record, title, content, subContent); + break; + case 'Success': + this.choose(_record); + break; + } + } + }); + + } + + error(title: string, content: string, subContent: string): void { + this.modalService.error({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '知道了' + }); + } + + showConfirm(_record: STData, title: string, content: string, subContent: string): void { + this.modalService.confirm({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.choose(_record); + } + }); + } + + /** +* 发送邀请司机注册短信 +*/ + sendMsg(phoneNumber: string) { + return this.service.request(this.service.$api_send_msg_code, phoneNumber) + } +} diff --git a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.html b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.html new file mode 100644 index 00000000..b33e4119 --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.html @@ -0,0 +1,6 @@ + + +
    + + +
    diff --git a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts new file mode 100644 index 00000000..395a7514 --- /dev/null +++ b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts @@ -0,0 +1,53 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-06 15:17:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-02 14:29:12 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\set-captain\\set-captain.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'app-choose-famifiar-set-captain', + templateUrl: './set-captain.component.html' +}) +export class PublishchooseFamifiarSetCaptainComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema!: SFSchema; + ui!: SFUISchema; + + i: any; + + constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute, private modal: NzModalRef,) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + captainPhone: { + type: 'string', + title: '车队长手机号' + } + }, + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + } + + close() {this.modal.close()} + save() {this.modal.close(this.sf.value.captainPhone)} +} diff --git a/src/app/routes/supply-management/components/index/index.component.html b/src/app/routes/supply-management/components/index/index.component.html new file mode 100644 index 00000000..5d61d68b --- /dev/null +++ b/src/app/routes/supply-management/components/index/index.component.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/supply-management/components/index/index.component.spec.ts b/src/app/routes/supply-management/components/index/index.component.spec.ts new file mode 100644 index 00000000..9601ea0c --- /dev/null +++ b/src/app/routes/supply-management/components/index/index.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementIndexComponent } from './index.component'; + +describe('SupplyManagementIndexComponent', () => { + let component: SupplyManagementIndexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementIndexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementIndexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/index/index.component.ts b/src/app/routes/supply-management/components/index/index.component.ts new file mode 100644 index 00000000..1cb8ec9c --- /dev/null +++ b/src/app/routes/supply-management/components/index/index.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-supply-management-index', + templateUrl: './index.component.html', +}) +export class SupplyManagementIndexComponent implements OnInit { + selectedIndex = 0; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + +} diff --git a/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.html b/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.html new file mode 100644 index 00000000..cb2e8122 --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.html @@ -0,0 +1,25 @@ + + + + {{ item.province }}-{{ item.city }}-{{ item.area }} + diff --git a/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.ts b/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.ts new file mode 100644 index 00000000..9dcc4ec0 --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/address-list/address-list.component.ts @@ -0,0 +1,87 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-14 20:08:17 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:28:07 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\onecar-publish\\address-list\\address-list.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { processSingleSort } from '@shared'; +import { NzDrawerService } from 'ng-zorro-antd/drawer'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../../services/supply-management.service'; +@Component({ + selector: 'app-publish-address-list', + templateUrl: './address-list.component.html' +}) +export class PublishAddressListComponent implements OnInit { + columns!: STColumn[]; + @ViewChild('st', { static: false }) + st!: STComponent; + + seleteData: any; + + spuStatus = '1'; // '1'客户地址,'2'收回单地址 + + constructor( + public router: Router, + public ar: ActivatedRoute, + private drawerService: NzDrawerService, + public service: SupplyManagementService, + private modalService: NzModalService + ) {} + + /** + * 查询参数 + */ + get reqParams() { + return { + type: this.spuStatus + }; + } + ngOnInit() { + this.initST(); + } + + initST() { + this.columns = [ + { title: '', index: 'id', type: 'radio', width: 70 }, + { + title: '省市区', + render: 'region' + }, + { + title: '详细地址', + index: 'detailedAddress' + }, + { + title: '联系人', + index: 'contactName' + }, + { + title: '联系电话', + index: 'contactTelephone' + }, + { + title: '更新时间', + index: 'modifyTime' + } + ]; + } + + // 排序 + reqProcess(requestOptions: STRequestOptions): STRequestOptions { + return processSingleSort(requestOptions); + } + + change(ret: STChange): void { + console.log('change', ret); + this.seleteData = { ...ret.radio }; + } +} diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html new file mode 100644 index 00000000..7eb10959 --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -0,0 +1,304 @@ + + + + + + +
    货源单设置
    + +
    + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    + +
    +
    +
    +
    + + 装货地 + +
    + + + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + 装货时间 + + + + +
    +
    +
    + + 卸货时间 + + + + +
    +
    + +
    +
    + + +
    货物信息
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    + + +
    服务信息
    +
    +
    + + +  货源曝光率 +10   +  车源匹配率 +10 + + +  货源曝光率 +20   +  车源匹配率 +20 + + + + + + + + ①香港、澳门、台湾、西藏、新疆不予承保,②单次运输保额仅限200万元以内,③保险详细内容及注意事项请见《保险告知函》 + +
    +
    +
    + + + +
    补充信息
    +
    +
    + +
    +
    +
    + + +
    运费信息
    +
    +
    + + + + + + + + + + + + + + {{ i.value | currency }} + {{ i.value | currency }}(费率:{{ currentRate | number: + '0.2-4' }}%) + {{ i.value | currency }} + +
    +
    + +
    +
    +  天内支付运费 +
    +
    +
    +
    +
    +
    +
    + +
    + + + + +
    +
    diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less new file mode 100644 index 00000000..35b08935 --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less @@ -0,0 +1,56 @@ +:host { + ::ng-deep { + nz-input-number { + width: 100%; + } + nz-date-picker { + width: 94.3%; + } + } + i { + cursor: pointer; + } +} + +.tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; +} + +.card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; +} + +.align-center { + display: flex; + align-items: center; + justify-content: center; +} + +.swap-icon { + padding: 24px; + color: #7d7d7d; + font-size: 30px; + :hover{color: #52acff;} +} + +#container { + width: 300px; + height: 180px; +} + +input[type='number'] { + -moz-appearance: textfield; +} +input[type='number']::-webkit-inner-spin-button, +input[type='number']::-webkit-outer-spin-button { + margin: 0; + -webkit-appearance: none; +} +.hides { + margin-left: 10px; + color: aqua; +} diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts new file mode 100644 index 00000000..3c8848cd --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -0,0 +1,1446 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { Subject } from 'rxjs'; +import { ActivatedRoute, Router } from '@angular/router'; +import { + SFCheckboxWidgetSchema, + SFComponent, + SFNumberWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { AmapPoiPickerComponent, AmapService, EACacheService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; +import { PublishAddressListComponent } from './address-list/address-list.component'; +import { PublishSuccessComponent } from './publish-success/publish-success.component'; +import { cacheConf } from '@conf/cache.conf'; + +@Component({ + selector: 'app-publish-goods-onecar-publish', + templateUrl: './onecar-publish.component.html', + styleUrls: ['./onecar-publish.component.less'] +}) +export class SupplyManagementOnecarPublishComponent implements OnInit { + // 环境信息 appId、tenantId + envInfo = this.eaCacheSrv.get(cacheConf.env); + validateForm1: FormGroup; + limitValues = { + maxWeight: 99999, + maxVolume: 99999, + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 5 + }; + sf1data: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + sf5data: any; // 货源单设置回显 + sf55data: any; // 货源单设置回显 + sf6data: any; // 货源单设置回显 + sf7data: any; // 货源单设置回显 + creatTime: any; // 货源单设置回显 + loadingTime: any; // 货源单设置回显 + unloadingTime: any; // 货源单设置回显 + totalFees: any; // 总数信息 + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + currentRate = 0; //实时计算的费率 + id = this.route.snapshot.params.id; + startInfo: any = []; // 发货地数据 + endInfo: any = []; // 卸货地数据 + PageStatus = ''; + shipperName = ''; + changeSub = new Subject(); + envCache: any; + enterpriseProjectIds: any; + constructor( + private http: _HttpClient, + fb: FormBuilder, + private router: Router, + private route: ActivatedRoute, + private modalService: NzModalService, + public service: SupplyManagementService, + private amapService: AmapService, + public shipperSrv: ShipperBaseService, + private eaCacheSrv: EACacheService + ) { + this.validateForm1 = fb.group({ + loadingTime: [null, [Validators.required]], + unloadingTime: [null, [Validators.required]] + }); + this.envCache = this.eaCacheSrv.get(cacheConf.env); + } + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + schema1: SFSchema = {}; + ui1!: SFUISchema; + + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + schema2: SFSchema = {}; + ui2!: SFUISchema; + + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + ui4!: SFUISchema; + + @ViewChild('sf5', { static: false }) sf5!: SFComponent; + schema5: SFSchema = {}; + ui5!: SFUISchema; + + @ViewChild('sf55', { static: false }) sf55!: SFComponent; + schema55: SFSchema = {}; + ui55!: SFUISchema; + + @ViewChild('sf6', { static: false }) sf6!: SFComponent; + schema6: SFSchema = {}; + ui6!: SFUISchema; + + @ViewChild('sf7', { static: false }) sf7!: SFComponent; + schema7: SFSchema = {}; + ui7!: SFUISchema; + + formatterRmb = (value: number): string => { + if (value === null || value === undefined) { + return ''; + } else { + let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + return `¥${value2}`; + } + }; + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); + + // 页面初始化 + ngOnInit(): void { + if (this.route.snapshot?.queryParams?.sta === '1') { + this.PageStatus = '整车修改'; + } else if (this.route.snapshot?.queryParams?.sta === '2') { + this.PageStatus = '整车下一单'; + } + this.initSF1(); + this.initSF3(); + this.initSF4(); + this.initSF5(); + this.initSF6(); + this.initSF7(); + this.getLimitvalue(); + this.initdata(); + } + initSF1() { + this.schema1 = { + properties: { + resourceCode: { + type: 'string', + title: '', + ui: { hidden: true } + }, + shipperAppUserId: { + title: '货主', + type: 'string', + maxLength: 30, + readOnly: this.PageStatus == '整车修改' ? true : false, + ui: { + widget: 'select', + // serverSearch: true, + allowClear: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any, qs: any) => { + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + this.getRegionCode(str); + this.shipperName = qs?.label; + this.payChange(); + } + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '项目', + readOnly: this.PageStatus == '整车修改' ? true : false, + ui: { + widget: 'select', + placeholder: '请选择' + } as SFSelectWidgetSchema + }, + enterpriseInfoName: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'text' + } + }, + + externalResourceCode: { + type: 'string', + title: '外部货源号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + dispatchName: { + type: 'string', + title: '调度员姓名', + maxLength: 30, + ui: { + optionalHelp: '选若未填写,司机直接联系您', + placeholder: '请输入' + } + }, + dispatchPhone: { + type: 'string', + title: '调度员手机号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + } + // dispatchId: { + // type: 'string', + // title: '调度员', + // ui: { + // widget: 'select', + // placeholder: '请选择', + // allowClear: true, + // optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您', + // change: (_value: any, data: any) => { + // if (data.label) { + // const dat = data.label.split('/'); + // this.sf1.setValue('/dispatchName', dat[0]); + // this.sf1.setValue('/dispatchPhone', dat[1]); + // } + // }, + // asyncData: () => this.shipperSrv.getStaffList2() + // } as SFSelectWidgetSchema + // }, + }, + required: ['shipperAppUserId', 'enterpriseProjectId'] + }; + this.ui1 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + }, + $enterpriseInfoName: { + grid: { span: 12 } + }, + $shipperAppUserId: { + grid: { span: 12 } + }, + $enterpriseProjectId: { + grid: { span: 12 } + } + }; + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物类型' }, + asyncData: () => + this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (_value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + maxLength: 20, + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 90, + grid: { span: 12 } + } + }; + } + initSF4() { + this.schema4 = { + properties: { + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '必填项' }, + validator: val => this.customValidator(val) + } + }, + volume: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + number: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + carModel: { + type: 'string', + title: '车型/车长', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车型', + errors: { required: '请选择车型' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); + } + } + } + }, + carLength: { + type: 'string', + title: '', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车长', + errors: { required: '请选择车长' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carLength', ['999']); + } + } + } + }, + hidenField: { + type: 'string', + title: '', + default: ' ', + ui: { + widget: 'text' + } + }, + insurancePackagedGoods: { + type: 'string', + title: '货物包装', + ui: { + widget: 'dict-select', + params: { dictKey: 'insure:packaged:goods' }, + containsAllLabel: false, + validator: val => { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) { + return [{ keyword: 'required', message: '必填项' }]; + } else { + return []; + } + } + } as SFSelectWidgetSchema + }, + goodsValue: { + type: 'string', + title: '货物价值', + ui: { + widget: 'custom', + validator: val => { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) { + return [{ keyword: 'required', message: '必填项' }]; + } else { + return []; + } + } + } + } + }, + required: ['weight', 'carModel', 'carLength'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 115, + grid: { span: 8 } + } + }; + } + + + initSF5() { + this.schema5 = { + properties: { + insuranceType: { + type: 'string', + title: '服务包', + ui: { + widget: 'select', + asyncData: () => { + return this.service.request(this.service.$api_getDictValue, { dictKey: 'bill:insurance:type' }).pipe( + map((res: any) => { + return [...res]; + }) + ) + }, + change: (tag: any, org: any) => { + if(tag === '3'){ + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', null); + }else { + this.getInsurersPrice(tag); + } + } + }, + default: '3' + }, + type1: { + type: 'string', + title: '', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '0' } + } , + }, + type2: { + type: 'string', + title: '', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '1' } + } + }, + insurancePremium: { + type: 'string', + title: '服务包费用', + readOnly:true, + ui: { + visibleIf: { insuranceType: (value: string) => value !== '3' } + } + }, + insuranceRate: { + type: 'string', + title: '保险费率', + ui: { + hidden: true + } + }, + freeInsurance1: { + type: 'string', + title: '预投基本险', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '0' } + } + }, + freeInsurance2: { + type: 'string', + title: '预投综合险', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '1' } + } + }, + }, + required: [ 'insurancePremium'] + }; + this.ui5 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + }, + $type1: { + grid: { span: 24 } + }, + $type2: { + grid: { span: 24 } + }, + $freeInsurance1: { + grid: { span: 24 } + }, + $freeInsurance2: { + grid: { span: 24 } + } + }; + } + + /** + * 自定义校验数据 + * @param val + */ + customValidator(val: number) { + if (this.isEmpty(val)) { + return [{ keyword: 'required', message: '不能为空' }]; + } else { + if (val <= 0) { + return [{ keyword: 'required', message: '数值需大于0' }]; + } + return []; + } + } + isEmpty(val: any) { + return val === undefined || val === null || val.toString().trim() === ''; + } + initSF6() { + this.schema6 = { + properties: { + stateReceipt: { + type: 'string', + title: '是否回单', + enum: [ + { label: '需要', value: true }, + { label: '不需要', value: false } + ], + ui: { + widget: 'select', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + receiptType: { + type: 'string', + title: '回单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'receipt:type' }, + containsAllLabel: false, + placeholder: '请选择', + errors: { required: '请选择' }, + visibleIf: { + stateReceipt: value => value === true + } + } + }, + receiptUserName: { + type: 'string', + title: '联系人', + maxLength: 15, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptUserPhone: { + type: 'string', + title: '联系电话', + maxLength: 11, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddressArea: { + type: 'string', + title: '所在地区', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddress: { + type: 'string', + title: '详细地址', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + remarks: { + type: 'string', + title: '备注', + maxLength: 200, + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { minRows: 3, maxRows: 3 } + } as SFTextareaWidgetSchema + } + }, + required: ['stateReceipt', 'receiptType', 'receiptUserName', 'receiptUserPhone', 'receiptAddressArea', 'receiptAddress'] + }; + this.ui6 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + } + }; + } + + initSF7() { + this.schema7 = { + properties: { + prePay: { + type: 'number', + title: '预付', + ui: { widget: 'custom' } + }, + toPay: { + type: 'number', + title: '到付', + ui: { widget: 'custom' } + }, + receiptPay: { + type: 'number', + title: '回单付', + ui: { widget: 'custom' } + }, + subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + total: { type: 'number', title: '总费用', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + paymentDays: { + type: 'string', + title: '到货后', + ui: { + widget: 'custom', + errors: { required: '请输入付款承诺天数' } + } + } + }, + required: ['paymentDays'] + }; + this.ui7 = { + '*': { + spanLabelFixed: 115, + grid: { span: 24 } + } + }; + } + getRegionCode(regionCode: any) { + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); + if (this.enterpriseProjectIds) { + this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + } + }); + } + payChange() { + const prePay = this.sf7.value.prePay || 0; + const toPay = this.sf7.value.toPay || 0; + const receiptPay = this.sf7.value.receiptPay || 0; + const oilCardPay = 0; + const subtotal = prePay + toPay + receiptPay; + const params = { + shipperId: this?.sf1?.value?.shipperAppUserId, + enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '', + totalFreight: subtotal, + fuelCardAmount: oilCardPay, + resourcetype: '1' + }; + this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { + if (res) { + this.sf7.setValue('/appendFee', res.surcharge); + this.sf7.setValue('/subtotal', subtotal); + this.sf7.setValue('/total', subtotal + res.surcharge); + let items = this?.sf1data?.enterpriseInfoId || ''; + this.service + .request( + this.service.$api_getAdditionalRate + + `?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'` + ) + .subscribe(res => { + if (res) { + this.currentRate = res.rate * 100; + } + }); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + addStartInfo() { + if (this.startInfo.length < this.limitValues.maxTimes) { + const controlId = this.startInfo.length; + this.startInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '1' + }); + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + } + } + + getLimitvalue() { + // 货物核载信息最大值 + // 货物运输费(小计)最大值 + const getlimitvaluesParms = [ + this.service?.limitKeys?.weight, + this.service?.limitKeys?.volume, + this.service?.limitKeys?.piece, + this.service?.limitKeys?.maxDays, + this.service?.limitKeys?.intervalDays, + this.service?.limitKeys?.maxTimes + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => { + const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys?.weight)[0].itemValue; + const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys?.volume)[0].itemValue; + const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys?.piece)[0].itemValue; + const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys?.maxDays)[0].itemValue; + const intervalDays = res.filter((item: any) => item.itemKey === this.service.limitKeys?.intervalDays)[0].itemValue; + const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys?.maxTimes)[0].itemValue; + this.limitValues = { + maxWeight: Number(maxWeight), + maxVolume: Number(maxVolume), + maxPiece: Number(maxPiece), + maxDays: Number(maxDays), + intervalDays: Number(intervalDays), + maxTimes: Number(maxTimes) + }; + }); + } + subStartInfo(event: any, index: number) { + this.startInfo.splice(index, 1); + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + } + addEndInfo() { + if (this.endInfo.length < this.limitValues.maxTimes) { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '2' + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl( + `unloadPhone${controlId}`, + new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]) + ); + } + } + subEndInfo(event: any, index: number) { + this.endInfo.splice(index, 1); + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget.reset(res); + if (this.sf3data.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); + } + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + //指派熟车 + chooseFamifiar(item: any) { + const modalRef = this.modalService.create({ + nzTitle: '指派熟车', + nzContent: SupplyManagementVehicleAssignedCarComponent, + nzWidth: 1200, + nzComponentParams: { + status: 'new', + url: this.service.$api_save_assign_whole, + params: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.openFinishPage(result); + } + }); + } + // 打开下单完成页面 + openFinishPage(resourceObj: any = null, change?: any) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'onecar', resourceObj, change: change } + }); + } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: string) { + Object.keys(this.validateForm1.controls).forEach(key => { + this.validateForm1.controls[key].markAsDirty(); + this.validateForm1.controls[key].updateValueAndValidity(); + }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + this.sf5.validator({ emitError: true }); + this.sf6.validator({ emitError: true }); + this.sf7.validator({ emitError: true }); + if ( + this.validateForm1.invalid || + !this.sf3.valid || + !this.sf1.valid || + !this.sf4.valid || + !this.sf5.valid || + !this.sf6.valid || + !this.sf7.valid + ) { + this.service.msgSrv.warning('请完善必填项!'); + return; + } + if (this.totalDistance <= 0) { + this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); + return; + } + if (this.validateForm1.value.loadingTime < new Date()) { + this.service.msgSrv.warning('装货时间必须大于当前时间!'); + return; + } + if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) { + this.service.msgSrv.warning('装货时间不能大于卸货时间!'); + return; + } + if (this.sf7.value.total <= 0) { + this.service.msgSrv.warning('总费用不能为0!'); + return; + } + const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000); + if (num > this.limitValues.maxDays) { + this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues?.maxDays}天】`); + return; + } + if ( + this.sf4.value?.weight > this.limitValues?.maxWeight || + this.sf4.value?.volume > this.limitValues?.maxVolume || + this.sf4.value?.number > this.limitValues?.maxPiece + ) { + this.service.msgSrv.error( + `当前货物核载信息已超出限定值【${this.limitValues?.maxWeight}吨、${this.limitValues?.maxVolume}方、${this.limitValues?.maxPiece}件】` + ); + return; + } + + const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance }; + this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => { + if (this.sf7.value.subtotal > res.maxPrice) { + this.service.msgSrv.error(`运费过高,请调整录入`); + return; + } else if (this.sf7.value.subtotal > res.ewPrice) { + this.modalService.confirm({ + nzTitle: '', + nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.agreementConfirm(submitType); + } + }); + } else { + this.agreementConfirm(submitType); + } + }); + } + // 提交前协议弹窗 + agreementConfirm(submitType?: string) { + //装卸货信息 + const LoadingList = this.startInfo.concat(this.endInfo); + + // 货物信息 + const sf3Values = { ...this.sf3.value }; + if (sf3Values.goodsTypeName === '其它') { + sf3Values.goodsName = sf3Values.goodsName1; + delete sf3Values.goodsName1; + } + if (this.sf4.value.carModel.includes('999')) { + this.sf4.value.carModel = ['999']; + } + if (this.sf4.value.carLength.includes('999')) { + this.sf4.value.carLength = ['999']; + } + const goodsInfoVOList = [ + { + ...sf3Values, + ...this.sf4.value, + carModel: this.sf4.value.carModel.join(','), + carLength: this.sf4.value.carLength.join(',') + } + ]; + // 运费信息 + const expenseList = [ + { expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' ,resourceId: this.sf7data?.PREresourceId || '' }, + { expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' ,resourceId: this.sf7data?.RECEresourceId || ''}, + { expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' ,resourceId: this.sf7data?.BACKresourceId || ''} + ]; + // 从“再下一单”过来,将所有的子参数内的id都删除 + if (this.PageStatus === '整车下一单') { + delete this.sf1.value.resourceCode; + + LoadingList.forEach((ele: any) => { + delete ele.id; + }); + goodsInfoVOList.forEach((ele: any) => { + delete ele.id; + }); + expenseList.forEach((ele: any) => { + delete ele.id; + }); + } + const params = { + id: '', + ...this.sf1.value, + unLoadingPlaceDTOList: LoadingList, + unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'), + loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'), + goodsInfoDTOList: goodsInfoVOList, + ...this.sf5.value, + ...this.sf6.value, + expenseDTOList: expenseList, + paymentDays: this.sf7.value.paymentDays, + estimatedKilometers: this.totalDistance, + estimatedTravelTime: this.totalTime, + subtotal :this.sf7.value.subtotal, + total:this.sf7.value.total, + insurancePackagedGoods: this.sf4.value.insurancePackagedGoods, + goodsValue: this.sf4.value.goodsValue + }; + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' } + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType, params); + } + }); + } + // 提交 + submit(submitType?: string, params?: any): void { + if (submitType) { + if (submitType == 'assign') { + this.chooseFamifiar(params); + return; + } + } + if (this.PageStatus === '整车修改') { + this.requests(this.service.$api_set_WholeModify, params, 1); + } else if (this.PageStatus === '整车下一单') { + this.requests(this.service.$api_set_saveAnotherWholeOrder, params, 2); + } + } + // 补0函数 + addPreZero(num: any) { + if (num < 10) { + return '0' + num; + } else { + return num; + } + } + // 下单成功提示弹窗 + requests(url: any, params: any, change?: any) { + this.service.request(url, params).subscribe((res: any) => { + if (res) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'onecar', change: change } + }); + } + }); + } + // 打开地图 + openMap(type: string, index: number) { + console.log(type); + console.log(index); + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.pois; + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.formattedAddress; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + this.startInfo[index].address = poi.formattedAddress; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.formattedAddress; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + this.endInfo[index].address = poi.formattedAddress; + break; + default: + break; + } + + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); // 计算保费金额 + }); + } + } + }); + } + // 返回上一页 + goBack() { + window.history.go(-1); + } + // 初始化赋值信息 + initdata() { + this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, { id: this.id }).subscribe(res => { + this.dataR(res); + }); + } + // 初始化赋值信息函数 + dataR(res: any) { + if (res?.shipperAppUserName) { + this.shipperName = res?.shipperAppUserName; + const List: any = []; + this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => { + rs?.forEach((element: any) => { + List.push({ label: element.enterpriseName, value: element.id }); + }); + this.sf1.getProperty('/shipperAppUserId')!.schema.enum = List; + this.sf1.getProperty('/shipperAppUserId')!.widget.reset(List); + if (res?.shipperAppUserId) { + this.sf1.setValue('/shipperAppUserId', res?.shipperAppUserId); + this.getRegionCode(res?.shipperAppUserId); + } + }); + } + if (res?.enterpriseProjectId) { + this.enterpriseProjectIds = res.enterpriseProjectId; + } + this.totalDistance = res?.estimatedKilometers; + this.totalTime = res?.estimatedTravelTime; + this.sf1data = { + resourceCode:res?.resourceCode || '', + enterpriseInfoName: res?.enterpriseInfoName, + enterpriseInfoId: res?.enterpriseInfoId, + dispatchPhone: res?.dispatchPhone, + dispatchName: res?.dispatchName, + externalResourceCode: res?.externalResourceCode + }; + if (this.PageStatus === '整车修改') { + this.sf1data.id = res?.id; + } + res?.unLoadingPlaceVOList.forEach((element: any) => { + if (element.type === 1 || element.type === '1') { + const controlId = this.startInfo.length; + if (this.PageStatus === '整车修改') { + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + } else { + this.startInfo.push({ + detailedAddress: element.detailedAddress, + appUserName: element.appUserName, + contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type + }); + } + + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); + } else if (element.type === 2 || element.type === '2') { + const controlId = this.endInfo.length; + if (this.PageStatus === '整车修改') { + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type, + id: element.id + }); + } else { + this.endInfo.push({ + detailedAddress: element?.detailedAddress, + appUserName: element?.appUserName, + contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, + type: element.type + }); + } + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } + + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } + }); + + this.sf3data = { + goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '', + goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '', + goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '', + goodsName: res?.goodsInfoVOList[0]?.goodsName || '' + }; + if (this.sf3data.goodsTypeName === '其它') { + this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || ''; + } + this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId }); + + if (res?.loadingTime) { + this.loadingTime = res?.loadingTime; + } + if (res?.unloadingTime) { + this.unloadingTime = res?.unloadingTime; + } + this.validateForm1.patchValue( + { + loadingTime: new Date(Date.parse(res?.loadingTime.replace(/-/g, '/'))), + unloadingTime: new Date(Date.parse(res?.unloadingTime.replace(/-/g, '/'))) + }, + { onlySelf: true } + ); + this.sf4data = { + weight: res?.goodsInfoVOList[0]?.weight || '', + volume: res?.goodsInfoVOList[0]?.volume || '', + number: res?.goodsInfoVOList[0]?.number || '', + carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || [], + carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || [], + goodsValue: res?.goodsValue || '', + insurancePackagedGoods: res?.insurancePackagedGoods || '' + }; + if (this.PageStatus === '整车修改') { + this.sf4data.id = res?.goodsInfoVOList[0]?.id; + } + this.totalFees = res?.shippingInformationVO?.totalFee || '0'; + this.sf5data = { + insuranceType: res?.insuranceType || '', + insurancePremium: res?.insurancePremium || '', + insuranceRate: res?.insuranceRate || '' + }; + this.sf6data = { + stateReceipt: res?.stateReceipt, + receiptType: res?.receiptType || '', + receiptUserName: res?.supplementaryInformationVO?.receiptUserName || '', + receiptAddressArea: res?.supplementaryInformationVO?.area || '', + receiptUserPhone: res?.supplementaryInformationVO?.phon || '', + receiptAddress: res?.supplementaryInformationVO.address || '', + remarks: res?.supplementaryInformationVO?.remarks || '' + }; + // this.sf7data = { + // prePay: res?.shippingInformationVO?.prePay, + // toPay: res?.shippingInformationVO?.toPay, + // // oilCardPay: 0, + // receiptPay: res?.shippingInformationVO?.receiptPay, + // total: res?.shippingInformationVO?.totalFee, + // appendFee: res?.shippingInformationVO?.appendFee, + // paymentDays: res?.paymentDays + // }; + this.sf7data = { + prePay: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'PRE')[0]?.price || null, + toPay: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'RECE')[0]?.price || null, + receiptPay: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'BACK')[0]?.price || null, + appendFee: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'ATT')[0]?.price || 0, + paymentDays: res?.paymentDays || '', + prePayId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'PRE')[0]?.id || '', + PREresourceId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'PRE')[0]?.resourceId || '', + RECEresourceId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'RECE')[0]?.resourceId || '', + BACKresourceId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'BACK')[0]?.resourceId || '', + toPayId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'RECE')[0]?.id || '', + receiptPayId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'BACK')[0]?.id || '', + appendFeeId: res?.expenseVOList?.filter((data: any) => data.expenseCode === 'ATT')[0]?.id || '' + }; + this.sf7.setValue('/prePay', this.sf7data.prePay); + this.sf7.setValue('/toPay', this.sf7data.toPay); + this.sf7.setValue('/receiptPay', this.sf7data.receiptPay); + this.payChange(); + } + + // 选择地址 + chooseAddress(index: number, type: string) { + const modalRef = this.modalService.create({ + nzTitle: '选择地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '1' }, + nzOnOk: item => { + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + switch (type) { + case 'start': + this.startInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '1' + }; + break; + case 'end': + this.endInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '2' + }; + break; + default: + break; + } + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } + } + }); + } + // 不可选择的时间 + disabledDateStart = (current: Date): boolean => { + let d = new Date(); + let year = d.getFullYear(); + let month = d.getMonth(); + let date = d.getDate(); + let hours = d.getHours(); + let mydate = new Date(year, month, date + this.limitValues.maxDays, hours + 1); + return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate; + }; + // 装卸货地址互换 + swapAddress() { + this.startInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + }); + this.endInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + }); + + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any, index: any) => { + element.type = '1'; + this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + this.endInfo.forEach((element: any, index: any) => { + element.type = '2'; + this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } + } + // 计算保价费金额 + getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { + console.log(this.totalDistance); + if (insuranceType !== '3' && this.totalDistance > 0) { + const params = { + insuranceType, + goodsValue: this.sf4.value.goodsValue, + km: this.totalDistance + }; + this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { + if (res) { + this.sf5.setValue('/insurancePremium', res.insurancePremium); + this.sf5.setValue('/insuranceRate', res.insuranceRate); + } else { + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', null); + } + }); + } + } + // 运费信息价格变更 + priceChange(event:any, i:any){ + i.setValue(event); + if(event>=99999){ + this.modalService.warning({ + nzTitle: '可输入的最大金额为99999元', + }); + } + this.payChange() + } +} diff --git a/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.html b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.html new file mode 100644 index 00000000..96ce805b --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.html @@ -0,0 +1,19 @@ + + +
    + +
    + + +
    +
    +
    diff --git a/src/app/routes/passport/register/register.component.less b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.less similarity index 56% rename from src/app/routes/passport/register/register.component.less rename to src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.less index 6836413b..a33ce26d 100644 --- a/src/app/routes/passport/register/register.component.less +++ b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.less @@ -1,8 +1,6 @@ @import '~@delon/theme/index'; :host { - display: block; - width: 368px; - margin: 0 auto; + ::ng-deep { h3 { margin-bottom: 20px; @@ -40,3 +38,51 @@ } } } + +.form-box{ + display: block; + width: 368px; + margin: 0 auto; +} + +.content { + background-color: #f0f3f7; +} +.main { + max-width: 1200px; + margin: 0 auto; +} +.header { + background: #fff; +} +.layout { + min-height: 100vh; +} + +.logo { + display: flex; + margin: 16px 0; + line-height: 32px; + dt { + width: 95px; + height: 32px; + img { + vertical-align: top; + } + } + dd { + flex: 1; + margin-bottom: 0; + padding: 0 10px; + color: #1890ff; + font-weight: 500; + font-size: 24px; + } +} +.footer { + text-align: center; + background-color: #f0f3f7; +} + + + diff --git a/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.ts b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.ts new file mode 100644 index 00000000..e04e3858 --- /dev/null +++ b/src/app/routes/supply-management/components/onecar-publish/publish-success/publish-success.component.ts @@ -0,0 +1,44 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-14 20:39:34 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:28:26 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\onecar-publish\\publish-success\\publish-success.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { NzMessageService } from 'ng-zorro-antd/message'; + +@Component({ + selector: 'publish-goods-publish-success', + templateUrl: './publish-success.component.html', + styleUrls: ['./publish-success.component.less'] +}) +export class PublishSuccessComponent { + type = 'onecar'; + title = '下单成功!'; + change: any = 0; + resourceObj: any = null; + constructor(private route: ActivatedRoute, private router: Router, public msg: NzMessageService) { + this.type = route.snapshot.queryParams.type || 'onecar'; + } + ngOnInit() { + console.log(this.change); + if (this.change == 1) { + this.title = '保存成功!'; + } else if (this.change == 2) { + this.title = '下单成功!'; + } + } + continue() { + window.location.reload(); + } + + view() { + this.router.navigate(['/supply-management/index'], { queryParams: { type: this.type } }); + } +} diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html new file mode 100644 index 00000000..449b496a --- /dev/null +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html @@ -0,0 +1,18 @@ + +
    + +
    +
    + +

    {{i?.shipperAppUserName}}

    + +
    卸货地 : {{address}}
    +
    装货地 : {{address}}
    +
    截止时间 : {{i?.deadlineTime}}
    +
    + +
    + +
    diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts new file mode 100644 index 00000000..fc268d02 --- /dev/null +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 11:10:14 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-28 20:00:20 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementQrcodePageComponent } from './qrcode-page.component'; + +describe('SupplyManagementQrcodePageComponent', () => { + let component: SupplyManagementQrcodePageComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementQrcodePageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementQrcodePageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts new file mode 100644 index 00000000..f1681253 --- /dev/null +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts @@ -0,0 +1,103 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 11:10:14 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-01 14:19:47 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Component, OnInit, ViewChild } from '@angular/core'; +import { QRComponent } from '@delon/abc/qr'; +import { SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import html2canvas from 'html2canvas'; + +@Component({ + selector: 'app-supply-management-qrcode-page', + templateUrl: './qrcode-page.component.html' +}) +export class SupplyManagementQrcodePageComponent implements OnInit { + @ViewChild('qr') qr!: QRComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + qrCodeValue = ''; + ui: SFUISchema = { + '*': { + spanLabelFixed: 100, + grid: { span: 12 }, + }, + $no: { + widget: 'text' + }, + $href: { + widget: 'string', + }, + $description: { + widget: 'textarea', + grid: { span: 24 }, + }, + }; + + constructor( + private modal: NzModalRef, + ) { } + + ngOnInit(): void { + this.qrCodeValue = `rid:${this.i?.id}`; + } + + + /** + * 下载二维码 + * @param downloadName 文件名 + * @param contents 内容 + */ + downLoadQrcode(downloadName: any, contents: any): void { + let aLink = document.createElement('a'); + const content = contents; + let blob = this.base64ToBlob(content); //new Blob([content]); + let evt = document.createEvent("HTMLEvents"); + evt.initEvent("click", true, true);//initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为 + aLink.download = downloadName; + aLink.href = URL.createObjectURL(blob); + // aLink.dispatchEvent(evt); + aLink.click(); + + + } + + //base64转blob + base64ToBlob(code: any) { + let parts = code.split(';base64,'); + let contentType = parts[0].split(':')[1]; + let raw = window.atob(parts[1]); + let rawLength = raw.length; + let uInt8Array = new Uint8Array(rawLength); + for (let i = 0; i < rawLength; ++i) { + uInt8Array[i] = raw.charCodeAt(i); + } + return new Blob([uInt8Array], { type: contentType }); + } + + close(): void { + this.modal.destroy(); + } + + /** + * 把页面装成canvas + */ + toCanvasPhoto() { + let aLink = document.createElement('a'); + html2canvas(document.getElementById('qr_page')!, { height: 340 }).then((canvas:any) => { + let url = canvas.toDataURL("image/jpeg"); + this.downLoadQrcode('二维码', url); + + }) + } + + +} diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html new file mode 100644 index 00000000..b3be726e --- /dev/null +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -0,0 +1,299 @@ + + + + + + +
    货源单设置
    + + {{ i.value }} + +
    + + +
    装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
    + +
    +
    +
    +
    + + 装货地 + +
    + + + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + 卸货地 + +
    + + + + + +
    +
    +
    + + 联系人 +
    + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + 装货时间 + + + + +
    +
    +
    + + 卸货时间 + + + + +
    +
    + +
    +
    + + +
    货物信息
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    + + +
    服务信息
    +
    +
    + + +  货源曝光率 +10   +  车源匹配率 +10 + + +  货源曝光率 +20   +  车源匹配率 +20 + + + + + + + + ①香港、澳门、台湾、西藏、新疆不予承保,②单次运输保额仅限200万元以内,③保险详细内容及注意事项请见《保险告知函》 + +
    +
    +
    + +
    补充信息
    +
    +
    + + +
    +
    +
    + + +
    运费信息
    +
    +
    + + + + + + + + + + + + + + {{ i.value | currency }} + {{ i.value | currency }}(费率:{{ currentRate | number: + '0.2-4' }}%) + {{ i.value | currency }} + +
    +
    + +
    +
    +  天内支付运费 +
    +
    +
    +
    +
    +
    +
    + +
    + + +
    +
    diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.less b/src/app/routes/supply-management/components/release-publish/release-publish.component.less new file mode 100644 index 00000000..f6d4bb4f --- /dev/null +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.less @@ -0,0 +1,52 @@ +:host { + ::ng-deep { + nz-input-number { + width: 100%; + } + nz-date-picker { + width: 94.3%; + } + } + i { + cursor: pointer; + } +} + +.tip-font { + margin-left: 16px; + font-weight: 500; + font-size: 12px; +} + +.card-title { + margin-bottom: 24px; + font-weight: bold; + font-size: 16px; +} + +.align-center { + display: flex; + align-items: center; + justify-content: center; +} + +.swap-icon { + padding: 24px; + color: #7d7d7d; + font-size: 30px; + :hover{color: #52acff;} +} + +#container { + width: 300px; + height: 180px; +} + +input[type='number'] { + -moz-appearance: textfield; +} +input[type='number']::-webkit-inner-spin-button, +input[type='number']::-webkit-outer-spin-button { + margin: 0; + -webkit-appearance: none; +} diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts new file mode 100644 index 00000000..0f607efa --- /dev/null +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -0,0 +1,1217 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { cacheConf } from '@conf/cache.conf'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import { + SFCheckboxWidgetSchema, + SFComponent, + SFNumberWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFTextareaWidgetSchema, + SFUISchema +} from '@delon/form'; +import { SettingsService, _HttpClient } from '@delon/theme'; +import { EACacheService, ShipperBaseService } from '@shared'; +import format from 'date-fns/format'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; +import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component'; +import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component'; +import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; + +@Component({ + selector: 'app-publish-goods-onecar-publish', + templateUrl: './release-publish.component.html', + styleUrls: ['./release-publish.component.less'] +}) +export class SupplyManagementReleasePublishComponent implements OnInit { + // 环境信息 appId、tenantId + envInfo = this.eaCacheSrv.get(cacheConf.env); + validateForm1: FormGroup; + sf1data: any; // 货源单设置回显 + sf3data: any; // 货源单设置回显 + sf4data: any; // 货源单设置回显 + sf5data: any; // 货源单设置回显 + sf55data: any; // 货源单设置回显 + sf6data: any; // 货源单设置回显 + sf7data: any; // 货源单设置回显 + id = ''; + envCache: any; + type = 'add'; + // // 单位 + startInfo: any[] = []; + endInfo: any[] = []; + totalDistance = 0.0; //总里程 + totalTime = 0.0; //路程总时间 + currentRate = 0; //实时计算的费率 + shipperName = ''; + constructor( + private http: _HttpClient, + fb: FormBuilder, + private modalService: NzModalService, + private settingSrv: SettingsService, + public service: SupplyManagementService, + private router: Router, + private route: ActivatedRoute, + private eaCacheSrv: EACacheService, + private amapService: AmapService, + public shipperSrv: ShipperBaseService + ) { + this.validateForm1 = fb.group({ + loadAddress0: [null, [Validators.required]], + loadName0: [null, [Validators.required]], + loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], + unloadAddress0: [null, [Validators.required]], + unloadName0: [null, [Validators.required]], + unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], + loadingTime: [null, []], + unloadingTime: [null, []] + }); + } + + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + schema1: SFSchema = {}; + ui1!: SFUISchema; + + @ViewChild('sf3', { static: false }) sf3!: SFComponent; + schema3: SFSchema = {}; + ui3!: SFUISchema; + + @ViewChild('sf4', { static: false }) sf4!: SFComponent; + schema4: SFSchema = {}; + ui4!: SFUISchema; + + @ViewChild('sf5', { static: false }) sf5!: SFComponent; + schema5: SFSchema = {}; + ui5!: SFUISchema; + + @ViewChild('sf55', { static: false }) sf55!: SFComponent; + schema55: SFSchema = {}; + ui55!: SFUISchema; + + @ViewChild('sf6', { static: false }) sf6!: SFComponent; + schema6: SFSchema = {}; + ui6!: SFUISchema; + + @ViewChild('sf7', { static: false }) sf7!: SFComponent; + schema7: SFSchema = {}; + ui7!: SFUISchema; + limitValues = { + maxWeight: 99999, + maxVolume: 99999, + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 5 + }; + + formatterRmb = (value: number): string => { + if (value === null || value === undefined) { + return ''; + } else { + let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + return `¥${value2}`; + } + }; + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); + // 页面初始化 + ngOnInit(): void { + this.initSF1(); + this.initSF3(); + this.initSF4(); + this.initSF5(); + this.initSF6(); + this.initSF7(); + this.addStartInfo(); + this.addEndInfo(); + this.getLimitvalue(); + } + initSF1() { + this.schema1 = { + properties: { + shipperAppUserId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + allowClear: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + console.log(q === ' '); + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any, qs: any) => { + let str = q?.replace(/^\s+|\s+$/g, ''); + if (str) { + this.getRegionCode(str); + this.shipperName = qs?.label; + this.payChange(); + } + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '项目', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true + } as SFSelectWidgetSchema + }, + enterpriseInfoName: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperSrv.getNetworkFreightForwarder(), + change: () => this.payChange() + } + }, + externalResourceCode: { + type: 'string', + title: '外部货源号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + dispatchName: { + type: 'string', + title: '调度员姓名', + maxLength: 30, + ui: { + optionalHelp: '选若未填写,司机直接联系您', + placeholder: '请输入' + } + }, + dispatchPhone: { + type: 'string', + title: '调度员手机号', + maxLength: 30, + ui: { + placeholder: '请输入' + } + } + }, + required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName'] + }; + this.ui1 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + }, + $enterpriseInfoName: { + grid: { span: 12 } + }, + $shipperAppUserId: { + grid: { span: 12 } + }, + $enterpriseProjectId: { + grid: { span: 12 } + }, + $dispatchId: { + grid: { span: 12 } + } + }; + } + initSF3() { + this.schema3 = { + properties: { + goodsTypeId: { + type: 'string', + title: '货物名称', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请选择货物名称' }, + asyncData: () => + this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( + map((data: any) => { + return data[0].children?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ), + change: (value, data: any) => { + this.changeGoodsType(value, data); + this.sf3.setValue('/goodsTypeName', data.label); + } + } as SFSelectWidgetSchema + }, + goodsTypeName: { + type: 'string', + title: '', + ui: { + hidden: true + } + }, + goodsNameId: { + type: 'string', + title: '', + ui: { + widget: 'select', + placeholder: '请选择', + errors: { required: '请填写货物名称' }, + change: (value: any, data: any) => { + this.sf3.setValue('/goodsName', data.label); + }, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName: { + type: 'string', + title: '', + ui: { + hidden: true, + visibleIf: { + goodsTypeName: (value: any) => value && value !== '其它' + } + } + }, + goodsName1: { + type: 'string', + title: '', + maxLength: 20, + ui: { + errors: { required: '请填写货物名称' }, + visibleIf: { + goodsTypeName: (value: any) => value && value === '其它' + } + } + } + }, + required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] + }; + this.ui3 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + } + }; + } + initSF4() { + this.schema4 = { + properties: { + weight: { + type: 'string', + title: '货物数量', + ui: { + widget: 'custom', + placeholder: '请输入', + errors: { required: '必填项' }, + validator: val => this.customValidator(val) + } + }, + volume: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + number: { + type: 'string', + title: '', + ui: { + widget: 'custom', + placeholder: '请输入' + } + }, + carModel: { + type: 'string', + title: '车型/车长', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车型', + errors: { required: '请选择车型' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); + } + } + } + }, + carLength: { + type: 'string', + title: '', + ui: { + widget: 'select', + mode: 'multiple', + maxMultipleCount: 3, + placeholder: '请选择车长', + errors: { required: '请选择车长' }, + asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carLength', ['999']); + } + } + } + }, + hidenField: { + type: 'string', + title: '', + default: ' ', + ui: { + widget: 'text' + } + }, + insurancePackagedGoods: { + type: 'string', + title: '货物包装', + ui: { + widget: 'dict-select', + params: { dictKey: 'insure:packaged:goods' }, + containsAllLabel: false, + validator: val => { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) { + return [{ keyword: 'required', message: '必填项' }]; + } else { + return []; + } + } + } as SFSelectWidgetSchema + }, + goodsValue: { + type: 'string', + title: '货物价值', + ui: { + widget: 'custom', + validator: val => { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !== '3' && this.isEmpty(val)) { + return [{ keyword: 'required', message: '必填项' }]; + } else { + return []; + } + } + } + } + }, + required: ['weight', 'carModel', 'carLength'] + }; + this.ui4 = { + '*': { + spanLabelFixed: 115, + grid: { span: 8 } + } + }; + } + + initSF5() { + this.schema5 = { + properties: { + insuranceType: { + type: 'string', + title: '服务包', + ui: { + widget: 'select', + asyncData: () => { + return this.service.request(this.service.$api_getDictValue, { dictKey: 'bill:insurance:type' }).pipe( + map((res: any) => { + return [...res]; + }) + ) + }, + change: (tag: any, org: any) => { + if(tag === '3'){ + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', null); + }else { + this.getInsurersPrice(tag); + } + } + }, + default: '3' + }, + type1: { + type: 'string', + title: '', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '0' } + } , + }, + type2: { + type: 'string', + title: '', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '1' } + } + }, + insurancePremium: { + type: 'string', + title: '服务包费用', + readOnly:true, + ui: { + visibleIf: { insuranceType: (value: string) => value !== '3' } + } + }, + insuranceRate: { + type: 'string', + title: '保险费率', + ui: { + hidden: true + } + }, + freeInsurance1: { + type: 'string', + title: '预投基本险', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '0' } + } + }, + freeInsurance2: { + type: 'string', + title: '预投综合险', + ui: { + widget: 'custom', + visibleIf: { insuranceType: (value: string) => value === '1' } + } + }, + }, + required: [ 'insurancePremium'] + }; + this.ui5 = { + '*': { + spanLabelFixed: 115, + grid: { span: 12 } + }, + $type1: { + grid: { span: 24 } + }, + $type2: { + grid: { span: 24 } + }, + $freeInsurance1: { + grid: { span: 24 } + }, + $freeInsurance2: { + grid: { span: 24 } + } + }; + } + + initSF6() { + this.schema6 = { + properties: { + stateReceipt: { + type: 'string', + title: '是否回单', + enum: [ + { label: '需要', value: true }, + { label: '不需要', value: false } + ], + ui: { + widget: 'select', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + receiptType: { + type: 'string', + title: '回单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'receipt:type' }, + containsAllLabel: false, + placeholder: '请选择', + errors: { required: '请选择' }, + visibleIf: { + stateReceipt: value => value === true + } + } + }, + receiptUserName: { + type: 'string', + title: '联系人', + maxLength: 15, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptUserPhone: { + type: 'string', + title: '联系电话', + maxLength: 11, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddressArea: { + type: 'string', + title: '所在地区', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + receiptAddress: { + type: 'string', + title: '详细地址', + maxLength: 30, + ui: { + visibleIf: { + receiptType: value => value === '2' + } + } + }, + remarks: { + type: 'string', + title: '备注', + maxLength: 200, + ui: { + widget: 'textarea', + placeholder: '请输入', + autosize: { minRows: 3, maxRows: 3 } + } as SFTextareaWidgetSchema + } + }, + required: ['stateReceipt', 'receiptType', 'receiptUserName', 'receiptUserPhone', 'receiptAddressArea', 'receiptAddress'] + }; + this.ui6 = { + '*': { + spanLabelFixed: 90, + grid: { span: 24 } + } + }; + } + + initSF7() { + this.schema7 = { + properties: { + prePay: { + type: 'number', + title: '预付', + ui: { widget: 'custom' } + }, + toPay: { + type: 'number', + title: '到付', + ui: { widget: 'custom' } + }, + receiptPay: { + type: 'number', + title: '回单付', + ui: { widget: 'custom' } + }, + subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + total: { type: 'number', title: '总费用', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, + paymentDays: { + type: 'string', + title: '到货后', + ui: { + widget: 'custom', + errors: { required: '请输入付款承诺天数' } + } + } + }, + required: ['paymentDays'] + }; + this.ui7 = { + '*': { + spanLabelFixed: 115, + grid: { span: 24 } + } + }; + } + getLimitvalue() { + // 货物核载信息最大值 + // 货物运输费(小计)最大值 + const getlimitvaluesParms = [ + this.service.limitKeys?.weight, + this.service.limitKeys?.volume, + this.service.limitKeys?.piece, + this.service.limitKeys?.maxDays, + this.service.limitKeys?.intervalDays, + this.service.limitKeys?.maxTimes + ]; + this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => { + const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys?.weight)[0].itemValue; + const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys?.volume)[0].itemValue; + const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys?.piece)[0].itemValue; + const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys?.maxDays)[0].itemValue; + const intervalDays = res.filter((item: any) => item.itemKey === this.service?.limitKeys?.intervalDays)[0].itemValue; + const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxTimes)[0]?.itemValue; + this.limitValues = { + maxWeight: Number(maxWeight), + maxVolume: Number(maxVolume), + maxPiece: Number(maxPiece), + maxDays: Number(maxDays), + intervalDays: Number(intervalDays), + maxTimes: Number(maxTimes) + }; + }); + } + // 不可选择的时间 + disabledDateStart = (current: Date): boolean => { + return differenceInCalendarDays(new Date(), current) > 0; + }; + + /** + * 自定义校验数据 + * @param val + */ + customValidator(val: number) { + if (this.isEmpty(val)) { + return [{ keyword: 'required', message: '不能为空' }]; + } else { + if (val <= 0) { + return [{ keyword: 'required', message: '数值需大于0' }]; + } + return []; + } + } + + isEmpty(val: any) { + return val === undefined || val === null || val.toString().trim() === ''; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res); + }); + } + payChange() { + const prePay = this.sf7.value.prePay || 0; + const toPay = this.sf7.value.toPay || 0; + const receiptPay = this.sf7.value.receiptPay || 0; + const oilCardPay = 0; + const subtotal = prePay + toPay + receiptPay; + const params = { + shipperId: this?.sf1.value?.shipperAppUserId, + enterpriseInfoId: this?.sf1.value?.enterpriseInfoName || '', + totalFreight: subtotal, + fuelCardAmount: oilCardPay, + resourcetype: '1' + }; + this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { + console.log('999'); + console.log(this?.sf1.value); + if (res) { + this.sf7.setValue('/appendFee', res.surcharge); + this.sf7.setValue('/subtotal', subtotal); + this.sf7.setValue('/total', subtotal + res.surcharge); + this.service + .request( + this.service.$api_getAdditionalRate + + `?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${ + this?.sf1.value?.enterpriseInfoName || '' + }&resourcetype='1'` + ) + .subscribe(res => { + if (res) { + this.currentRate = res.rate * 100; + } + }); + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + // 添加 删除发货卸货地址 + addStartInfo() { + console.log(this.startInfo.length); + console.log(this.limitValues.maxTimes); + + if (this.startInfo.length < this.limitValues.maxTimes) { + const controlId = this.startInfo.length; + this.startInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '1' + }); + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + } + } + // 添加 删除发货卸货地址 + subStartInfo(event: any, index: number) { + this.startInfo.splice(index, 1); + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + } + // 添加 删除发货卸货地址 + addEndInfo() { + if (this.endInfo.length < this.limitValues.maxTimes) { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: '2' + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl( + `unloadPhone${controlId}`, + new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]) + ); + } + } + // 添加 删除发货卸货地址 + subEndInfo(event: any, index: number) { + this.endInfo.splice(index, 1); + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + } + //指派熟车 + chooseFamifiar(item: any) { + console.log('999'); + const modalRef = this.modalService.create({ + nzTitle: '指派熟车', + nzContent: SupplyManagementVehicleAssignedCarComponent, + nzWidth: 1200, + nzComponentParams: { + status: 'new', + url: this.service.$api_save_consignWholeAssign, + params: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.openFinishPage(result); + } + }); + } + // 提交前确认,委托运输协议弹窗 + submitConfirm(submitType?: any) { + Object.keys(this.validateForm1.controls).forEach(key => { + this.validateForm1.controls[key].markAsDirty(); + this.validateForm1.controls[key].updateValueAndValidity(); + }); + this.sf1.validator({ emitError: true }); + this.sf3.validator({ emitError: true }); + this.sf4.validator({ emitError: true }); + this.sf5.validator({ emitError: true }); + this.sf6.validator({ emitError: true }); + this.sf7.validator({ emitError: true }); + console.log(!this.sf1.valid); + console.log(this.sf1.value); + if ( + this.validateForm1.invalid || + !this.sf3.valid || + !this.sf1.valid || + !this.sf4.valid || + !this.sf5.valid || + !this.sf6.valid || + !this.sf7.valid + ) { + this.service.msgSrv.warning('请完善必填项!'); + return; + } + if (this.totalDistance <= 0) { + this.service.msgSrv.warning('起终点相同,请重新选择装卸货地址!'); + return; + } + if (this.validateForm1.value.loadingTime < new Date()) { + this.service.msgSrv.warning('装货时间必须大于当前时间!'); + return; + } + if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) { + this.service.msgSrv.warning('装货时间不能大于卸货时间!'); + return; + } + if (this.sf7.value.total <= 0) { + this.service.msgSrv.warning('总费用不能为0!'); + return; + } + const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000); + if (num > this.limitValues.maxDays) { + this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`); + return; + } + if ( + this.sf4.value?.weight > this.limitValues?.maxWeight || + this.sf4.value?.volume > this.limitValues?.maxVolume || + this.sf4.value?.number > this.limitValues?.maxPiece + ) { + this.service.msgSrv.error( + `当前货物核载信息已超出限定值【${this.limitValues?.maxWeight}吨、${this.limitValues?.maxVolume}方、${this.limitValues?.maxPiece}件】` + ); + return; + } + + const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance }; + this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => { + if (this.sf7.value?.subtotal > res?.maxPrice) { + this.service.msgSrv.error(`运费过高,请调整录入`); + return; + } else if (this.sf7.value?.subtotal > res?.ewPrice) { + this.modalService.confirm({ + nzTitle: '', + nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.agreementConfirm(submitType); + } + }); + } else { + this.agreementConfirm(submitType); + } + }); + } + // 提交前协议弹窗 + agreementConfirm(submitType?: string) { + //装卸货信息 + const LoadingList = this.startInfo.concat(this.endInfo); + + // 货物信息 + const sf3Values = { ...this.sf3.value }; + if (sf3Values.goodsTypeName === '其它') { + sf3Values.goodsName = sf3Values.goodsName1; + delete sf3Values.goodsName1; + } + if (this.sf4.value.carModel.includes('999')) { + this.sf4.value.carModel = ['999']; + } + if (this.sf4.value.carLength.includes('999')) { + this.sf4.value.carLength = ['999']; + } + const goodsInfoVOList = [ + { + ...sf3Values, + ...this.sf4.value, + carModel: this.sf4.value.carModel.join(','), + carLength: this.sf4.value.carLength.join(',') + } + ]; + // 运费信息 + const expenseList = [ + { expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' }, + { expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' }, + { expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' } + ]; + const params = { + id: '', + ...this.sf1.value, + unLoadingPlaceDTOList: LoadingList, + unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'), + loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'), + goodsInfoDTOList: goodsInfoVOList, + ...this.sf5.value, + ...this.sf6.value, + expenseDTOList: expenseList, + paymentDays: this.sf7.value.paymentDays, + subtotal :this.sf7.value.subtotal, + total:this.sf7.value.total, + estimatedKilometers: this.totalDistance, + estimatedTravelTime: this.totalTime, + insurancePackagedGoods: this.sf4.value.insurancePackagedGoods, + goodsValue: this.sf4.value.goodsValue + }; + console.log(params); + const modalRef = this.modalService.create({ + nzTitle: '运输协议', + nzContent: TranAgreementComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { object: params, shipperName: this.shipperName, type: 'onecar' } + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.submit(submitType, params); + } + }); + } + // 提交 + submit(submitType?: string, params?: any): void { + let reqUrl = this.service.$api_consignWhole; + if (submitType) { + if (submitType == 'assign') { + this.chooseFamifiar(params); + return; + } + } + + this.service.request(reqUrl, params).subscribe((res: any) => { + if (res) { + this.openFinishPage(); + } + }); + } + // 打开地图 + openMap(type: string, index: number) { + const modalRef = this.modalService.create({ + nzTitle: '', + nzContent: AmapPoiPickerComponent, + nzWidth: 900, + nzOnOk: item => { + const poi = item.poi; + const locList = poi.pois; + switch (type) { + case 'start': + this.startInfo[index].detailedAddress = poi.formattedAddress; + this.startInfo[index].longitude = locList[0]; + this.startInfo[index].latitude = locList[1]; + this.startInfo[index].province = poi.addressComponent.province; + this.startInfo[index].city = poi.addressComponent.city; + this.startInfo[index].area = poi.addressComponent.district; + break; + case 'end': + this.endInfo[index].detailedAddress = poi.formattedAddress; + this.endInfo[index].longitude = locList[0]; + this.endInfo[index].latitude = locList[1]; + this.endInfo[index].province = poi.addressComponent.province; + this.endInfo[index].city = poi.addressComponent.city; + this.endInfo[index].area = poi.addressComponent.district; + break; + default: + break; + } + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); // 计算保费金额 + }); + } + } + }); + } + // 选择收回单地址 + backBillChange() { + const modalRef = this.modalService.create({ + nzTitle: '选择收回单地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '2' }, + nzOnOk: item => { + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + this.sf6.setValue('/receiptAddressId', data.id); + this.sf6.setValue('/receiptUserName', data.contactName); + this.sf6.setValue('/phon', data.contactTelephone); + this.sf6.setValue('/area', `${data.province}-${data.city}-${data.area}`); + this.sf6.setValue('/address', data.detailedAddress); + } + }); + } + // 选择地址 + chooseAddress(index: number, type: string) { + const modalRef = this.modalService.create({ + nzTitle: '选择地址', + nzContent: PublishAddressListComponent, + nzWidth: 900, + nzComponentParams: { spuStatus: '1' }, + nzOnOk: item => { + console.log(item); + console.log(type); + const data = item.seleteData; + if (JSON.stringify(data) === '{}') return; + switch (type) { + case 'start': + this.startInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '1' + }; + break; + case 'end': + this.endInfo[index] = { + detailedAddress: data.detailedAddress, + appUserName: data.contactName, + contractTelephone: data.contactTelephone, + latitude: data.contactTelephone, + longitude: data.latitude, + province: data.province, + city: data.city, + area: data.area, + type: '2' + }; + break; + default: + break; + } + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } + } + }); + } + // 打开下单完成页面 + openFinishPage(resourceObj: any = null) { + this.modalService.create({ + nzTitle: '', + nzContent: PublishSuccessComponent, + nzWidth: 900, + nzFooter: null, + nzComponentParams: { type: 'onecar', resourceObj } + }); + } + changeGoodsType(value: string, data: any) { + if (data.label === '其它') return; + const params = { + pageIndex: 1, + pageSize: 100, + configId: value + }; + this.service + .request(this.service.$api_get_config_item_page, params) + .pipe( + map(data => { + return data.records?.map((m: any) => { + return { label: m.name, value: m.id }; + }); + }) + ) + .subscribe(res => { + if (res) { + this.sf3.getProperty('/goodsNameId')!.schema.enum = res; + this.sf3.getProperty('/goodsNameId')!.widget.reset(res); + if (this.sf3data?.goodsNameId) { + this.sf3.setValue('/goodsNameId', this.sf3data?.goodsNameId); + } + } else { + this.service.msgSrv.error(res.msg); + } + }); + } + // 返回上一页 + goBack() { + window.history.go(-1); + } + // 装卸货地址互换 + swapAddress() { + this.startInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + }); + this.endInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + }); + + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any, index: any) => { + element.type = '1'; + this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + this.endInfo.forEach((element: any, index: any) => { + element.type = '2'; + this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } + } + // 计算保价费金额 + getInsurersPrice(insuranceType = this.sf5.value?.insuranceType) { + console.log(insuranceType); + console.log(this.totalDistance); + if (insuranceType !== '3' && this.totalDistance > 0) { + const params = { + insuranceType, + goodsValue: this.sf4.value.goodsValue, + km: this.totalDistance + }; + this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { + if (res) { + this.sf5.setValue('/insurancePremium', res.insurancePremium); + this.sf5.setValue('/insuranceRate', res.insuranceRate); + } else { + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', null); + } + }); + } + } + // 运费信息价格变更 + priceChange(event:any, i:any){ + i.setValue(event); + if(event>=99999){ + this.modalService.warning({ + nzTitle: '可输入的最大金额为99999元', + }); + } + this.payChange() + } +} diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html new file mode 100644 index 00000000..bbe21f8f --- /dev/null +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html @@ -0,0 +1,6 @@ + +
    +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.less b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts new file mode 100644 index 00000000..a70664c4 --- /dev/null +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts @@ -0,0 +1,163 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-02-24 20:19:51 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-23 19:57:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-06 15:01:40 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-28 20:55:07 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; + +@Component({ + selector: 'publish-goods-tran-agreement', + templateUrl: './tran-agreement.component.html', + styleUrls: ['./tran-agreement.component.less'] +}) +export class TranAgreementComponent { + enterpriseInfo: any; // 网络货运人 + type: any; + object: any; + agreement: any; + envCache: any; + shipperName: any; + constructor(private modal: NzModalRef, public service: SupplyManagementService) {} + + ngOnInit() { + console.log(this.object); + // 获取托运人承运人信息 + this.service.request(this.service.$api_getContractAtr, { id: this.object?.shipperAppUserId }).subscribe(res => { + if (res) { + this.enterpriseInfo = res; + this.getContent(); + } + }); + } + + getContent() { + let params: any; + if (this.type === 'onecar') { + params = { + contractType: '1', + resourceType: '1', + signingObject: '1', + templateType: 'MX', + parametersDTO: { + contractCode: '', + shipperLegalPersonName: this.enterpriseInfo.legalPersonName || '', //托运法定代表人 + carrierLegalPersonName: this.enterpriseInfo.netLegalPersonName || '', //承运法定代表人 + shipperName: this?.shipperName || '', //托运人 + carrierName: this.object?.enterpriseInfoName || '', //承运人 + consignorInfo: `${this.object?.unLoadingPlaceDTOList[0]?.appUserName || ''} ${ + this.object?.unLoadingPlaceDTOList[0]?.contractTelephone || '' + }`, // 发货信息 + consignorAddress: this.object?.unLoadingPlaceDTOList[0].detailedAddress || '', // 发货地址 + consignorDate: this.object?.loadingTime || '', // 发货时间 + consigneeInfo: `${this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length - 1].appUserName} ${ + this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length - 1].contractTelephone + }`, // 收货信息 + consigneeDate: this.object?.unloadingTime || '', // 收货时间 + consigneeAddress: this.object?.unLoadingPlaceDTOList[this.object?.unLoadingPlaceDTOList.length - 1].detailedAddress || '', // 收货地址 + goodsName: this.object?.goodsInfoDTOList[0].goodsName || '', // 货物名称 + shippingType: '整车运输', + consignmentVolume: `${this.object?.goodsInfoDTOList[0]?.weight || '-'}吨/${this.object?.goodsInfoDTOList[0]?.volume || '-'}方/${ + this.object?.goodsInfoDTOList[0]?.number || '-' + }件`, //托运量 + transporterInfo: '', //运输方信息 + freightAmount: this.object?.total || '', // 订单运费金额(元) + pre: this.object?.expenseDTOList?.filter((item: any) => item.expenseCode === 'PRE')[0].price || '', //预付 + rece: this.object?.expenseDTOList?.filter((item: any) => item.expenseCode === 'RECE')[0].price || '', // 到付 + back: this.object?.expenseDTOList?.filter((item: any) => item.expenseCode === 'BACK')[0].price || '', // 回单付 + lunarKnot: 0, + total: this.object?.subtotal || '', // 合计(元) + paymentTime: `到货后${this.object?.paymentDays || ''}天`, // 承诺支付运费时间 + year: new Date().getFullYear() || '', // 签约年份 + month: new Date().getMonth() + 1 || '', // 签约月份 + day: new Date().getDate() || '' // 签约日期 + } + }; + } else if (this.type === 'bulk') { + params = { + contractType: '1', + resourceType: '2', + signingObject: '1', + templateType: 'MX', + parametersDTO: { + contractCode: '', + shipperName: this?.shipperName || '', //托运人 + carrierName: this.object?.enterpriseInfoName || '', //承运人 + shipperLegalPersonName: this.enterpriseInfo.legalPersonName || '', //托运法定代表人 + carrierLegalPersonName: this.enterpriseInfo.netLegalPersonName || '', //承运法定代表人 + consignorInfo: `${this.object.unLoadingPlaceDTOList[0]?.appUserName || ''} ${ + this.object.unLoadingPlaceDTOList[0]?.contractTelephone || '' + }`, // 发货信息 + consignorAddress: this.object.unLoadingPlaceDTOList[0].detailedAddress, // 发货地址 + consignorDate: '', // 发货时间 + consigneeInfo: `${this.object.unLoadingPlaceDTOList[this.object.unLoadingPlaceDTOList.length - 1]?.appUserName || ''} ${ + this.object.unLoadingPlaceDTOList[this.object.unLoadingPlaceDTOList.length - 1]?.contractTelephone || '' + }`, // 收货信息 + consigneeDate: '', // 收货时间 + consigneeAddress: this.object.unLoadingPlaceDTOList[this.object.unLoadingPlaceDTOList.length - 1]?.detailedAddress || '', // 收货地址 + goodsName: this.object.goodsInfoDTOList[0]?.goodsName || '', // 货物名称 + shippingType: '大宗运输', + consignmentVolume: `${this.object?.goodsInfoDTOList?.[0]?.weight || '-'}吨/${ + this.object?.goodsInfoDTOList?.[0]?.volume || '-' + }方/${this.object.goodsInfoDTOList?.[0]?.number || '-'}车`, //托运量 + transporterInfo: '', //运输方信息 + freightAmount: '', // 订单运费金额(元) + pre: '', //预付 + rece: '', // 到付 + back: '', // 回单付 + lunarKnot: '', + total: '', // 合计(元) + paymentTime: `到货后${this.object?.paymentDays || ''}天`, // 承诺支付运费时间 + year: new Date().getFullYear() || '', // 签约年份 + month: new Date().getMonth() + 1 || '', // 签约月份 + day: new Date().getDate() || '' // 签约日期 + } + }; + } + if (params.parametersDTO.freightAmount) { + params.parametersDTO.freightAmount = this.toThousands(params.parametersDTO.freightAmount); + } + if (params.parametersDTO.pre) { + params.parametersDTO.pre = this.toThousands(params.parametersDTO.pre); + } + if (params.parametersDTO.rece) { + params.parametersDTO.rece = this.toThousands(params.parametersDTO.rece); + } + if (params.parametersDTO.back) { + params.parametersDTO.back = this.toThousands(params.parametersDTO.back); + } + if (params.parametersDTO.total) { + params.parametersDTO.total = this.toThousands(params.parametersDTO.total); + } + console.log(params); + this.service.request(this.service.$api_getContractContent, params).subscribe(res => { + if (res) { + this.agreement = res.contractContent; + } + }); + } + + toThousands(num: any) { + let str = num.toString(); + return '¥' + str.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); + } + handleOk() { + this.modal.close(true); + } +} diff --git a/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.html b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.html new file mode 100644 index 00000000..0adf665b --- /dev/null +++ b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.html @@ -0,0 +1,10 @@ + +
    编辑外部货源号
    + + + \ No newline at end of file diff --git a/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.spec.ts b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.spec.ts new file mode 100644 index 00000000..1f32b568 --- /dev/null +++ b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementUpdateExternalSnComponent } from './update-external-sn.component'; + +describe('SupplyManagementUpdateExternalSnComponent', () => { + let component: SupplyManagementUpdateExternalSnComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementUpdateExternalSnComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementUpdateExternalSnComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.ts b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.ts new file mode 100644 index 00000000..6031e1fa --- /dev/null +++ b/src/app/routes/supply-management/components/update-external-sn/update-external-sn.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit } from '@angular/core'; +import { SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; + +@Component({ + selector: 'app-supply-management-update-external-sn', + templateUrl: './update-external-sn.component.html', +}) +export class SupplyManagementUpdateExternalSnComponent implements OnInit { + record: any = {}; + orderObject: any; + schema: SFSchema = { + properties: { + owner: { + type: 'string', + maxLength: 30, + title: '', + ui: { + placeholder: '不超过30位' + } + }, + }, + required: ['owner'], + }; + ui: SFUISchema = { + '*': { + spanControl: 24 + }, + }; + + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public service: SupplyManagementService + ) { } + + ngOnInit(): void { + + } + + save(value: any): void { + const { id, sn } = value; + this.service.request(`/user/${this.record.id}`, { id, sn }).subscribe(res => { + this.msgSrv.success('保存成功'); + this.modal.close(true); + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/supply-management/components/update-freight/update-freight.component.html b/src/app/routes/supply-management/components/update-freight/update-freight.component.html new file mode 100644 index 00000000..7e3e8f7c --- /dev/null +++ b/src/app/routes/supply-management/components/update-freight/update-freight.component.html @@ -0,0 +1,15 @@ + + + + + 天内支付运费 + + +
    {{sf.value.description1 | currency: 'CNY' }}(费率:5.3%)
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/supply-management/components/update-freight/update-freight.component.spec.ts b/src/app/routes/supply-management/components/update-freight/update-freight.component.spec.ts new file mode 100644 index 00000000..da00ca73 --- /dev/null +++ b/src/app/routes/supply-management/components/update-freight/update-freight.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementUpdateFreightComponent } from './update-freight.component'; + +describe('SupplyManagementUpdateFreightComponent', () => { + let component: SupplyManagementUpdateFreightComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementUpdateFreightComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementUpdateFreightComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/update-freight/update-freight.component.ts b/src/app/routes/supply-management/components/update-freight/update-freight.component.ts new file mode 100644 index 00000000..8e3c4b1d --- /dev/null +++ b/src/app/routes/supply-management/components/update-freight/update-freight.component.ts @@ -0,0 +1,143 @@ +import { Component, OnInit } from '@angular/core'; +import { SFCustomWidgetSchema, SFNumberWidgetSchema, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'app-supply-management-update-freight', + templateUrl: './update-freight.component.html', +}) +export class SupplyManagementUpdateFreightComponent implements OnInit { + record: any = {}; + i: any; + schema: SFSchema = {}; + ui: SFUISchema = {}; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + ) { } + + ngOnInit(): void { + this.initSF(); + + if (this.record.id > 0) + this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res)); + } + initSF() { + this.schema = { + properties: { + no1: { + type: 'string', + title: '是否回单', + enum: [ + { label: '需要', value: 0 }, + { label: '不需要', value: 1 }, + ], + ui: { + widget: 'radio' + } as SFRadioWidgetSchema, + default: 0 + }, + owner1: { + type: 'number', + title: '预付', + minimum: 0, + max: 99999999, + ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal(val, 1) + } as SFNumberWidgetSchema + }, + callNo1: { + type: 'number', + title: '到付', + minimum: 0, + ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal(val, 2) + } as SFNumberWidgetSchema + }, + // href1: { + // type: 'number', + // title: '油卡', + // minimum: 0, + // ui: { + // prefix: '¥', + // widgetWidth: 200, + // precision: 2, + // change: (val: any) => this.changeNumVal(val, 3) + // } as SFNumberWidgetSchema + // }, + description5: { + type: 'number', title: '回单付', minimum: 0, maxLength: 140, ui: { + prefix: '¥', + widgetWidth: 200, + precision: 2, + change: (val: any) => this.changeNumVal(val, 4) + } as SFNumberWidgetSchema + }, + href2: { + type: 'string', + title: '小计', + ui: { + widget: 'text' + } + }, + description1: { + type: 'string', + title: '附加费', + ui: { + widget: 'custom' + } + }, + description2: { + type: 'string', + title: '总费用', + ui: { + widget: 'text' + } + }, + description3: { + type: 'number', + title: '到货后', + maximum: 30, + minimum: 1, + ui: { + widget: 'custom', + } as SFCustomWidgetSchema + }, + }, + required: ['owner', 'callNo', 'href', 'description'], + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 16 }, + }, + }; + } + save(value: any): void { + this.http.post(`/user/${this.record.id}`, value).subscribe(res => { + this.msgSrv.success('保存成功'); + this.modal.close(true); + }); + } + + close(): void { + this.modal.destroy(); + } + /** + * 更新数字框 + * @param value + * @param type + */ + changeNumVal(value: any, type: number) { + + } +} diff --git a/src/app/routes/supply-management/components/update-price/update-price.component.html b/src/app/routes/supply-management/components/update-price/update-price.component.html new file mode 100644 index 00000000..490015a8 --- /dev/null +++ b/src/app/routes/supply-management/components/update-price/update-price.component.html @@ -0,0 +1,40 @@ + +
    + + + + + + + + +
    +
    +

    变更日志

    + + + {{item?.operator}}/{{item.telephone}} + + +
    + + {{ freightType[i?.freightType] }} + diff --git a/src/app/routes/supply-management/components/update-price/update-price.component.spec.ts b/src/app/routes/supply-management/components/update-price/update-price.component.spec.ts new file mode 100644 index 00000000..213a77a0 --- /dev/null +++ b/src/app/routes/supply-management/components/update-price/update-price.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementUpdatePriceComponent } from './update-price.component'; + +describe('SupplyManagementUpdatePriceComponent', () => { + let component: SupplyManagementUpdatePriceComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementUpdatePriceComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementUpdatePriceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/update-price/update-price.component.ts b/src/app/routes/supply-management/components/update-price/update-price.component.ts new file mode 100644 index 00000000..0c41962e --- /dev/null +++ b/src/app/routes/supply-management/components/update-price/update-price.component.ts @@ -0,0 +1,121 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; + +@Component({ + selector: 'app-supply-management-update-price', + templateUrl: './update-price.component.html', +}) +export class SupplyManagementUpdatePriceComponent implements OnInit { + record: any = {}; + i: any; + schema: SFSchema = {}; + ui: SFUISchema = {}; + columns: STColumn[] = []; + @ViewChild('sf', { static: false }) sf!: SFComponent; + freightType: any = { + 1: '元/吨', + 2: '元/方', + 3: '元/车' + } // 运单类型 + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public service: SupplyManagementService + ) { } + + get reqParams() { + return { + operateObject: this.record?.resourceCode, + operateType: 7, + }; + } + ngOnInit(): void { + this.initSF(); + this.initSt(); + console.log(this.record) + if (this.record?.id) this.getGoodsResourceShipperDeatail(this.record?.id); + } + + initSF() { + this.schema = { + properties: { + resourceCode: { + type: 'string', + title: '货源编号', + ui: { + widget: 'text' + }, + }, + freightPrice: { + type: 'string', + title: '运费单价', + ui: { + widget: 'custom' + } + }, + rule: { + type: 'string', + title: '取整规则', + default: '0', + ui: { + widget: 'dict-select', + params: { dictKey: 'goodresource:rounding:rules' }, + optionalHelp: { + text: '例如:付司机运费= 重量*单价 = 999.99;\n 保留小数:即 999.99; \n 抹除小数:即 999.00;\n 抹除个位,即 990.00', + } + } + }, + + }, + required: ['freightPrice', 'rule',], + }; + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 16 }, + }, + '$rule': { + spanLabelFixed: 120, + grid: { span: 16 }, + }, + }; + } + + getGoodsResourceShipperDeatail(id: any) { + this.service.request(this.service.$api_get_goods_resource_shipper, { id }).subscribe(res => { + if (res) { + this.i = res; + } + }) + } + /** + * 初始化数据列表 + */ + initSt() { + this.columns = [ + { title: '日志内容', width: 120, index: 'operationContent', className: 'text-center' }, + { title: '更新时间', index: 'operatorTimestamp', width: 100, className: 'text-center' }, + { title: '操作人', width: 100, render: 'operator', className: 'text-center' }, + ]; + } + save(value: any): void { + console.log(value); + // const { id: resourceId, freightType, freightPrice, resourceCode, rule, goodsID: id } = value; + const { resourceId, freightType, freightPrice, resourceCode, rule, id } = value; + this.service.request(this.service.$api_update_price, { id, freightType, freightPrice, resourceCode, rule, resourceId }).subscribe(res => { + if (res) { + this.msgSrv.success('保存成功'); + this.modal.close(true); + } + }); + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html new file mode 100644 index 00000000..30da689b --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html @@ -0,0 +1,225 @@ +
    + + + + + +
    + +

    货源编码 : {{ i?.resourceCode }}

    +
    +
    +
    网络货运人:{{ i?.enterpriseInfoName }}
    +
    + + + + +
    +
    +
    +
    + 总费用:{{ i?.totalAmount | currency: '¥' }} +
    +
    + +
    + {{ i?.externalResourceCode }} + {{ i?.enterpriseProjectName }} + {{ i?.createUserName }}/{{ i?.createUserPhone }} + {{ i?.dispatchName }}/{{ i?.dispatchPhone }} + {{ i?.serviceTypeLabel }} +
    +
    +
    + +
    +
    + + + + + +
    +
    +
    + + + + 货物信息 + + + {{ item.goodsName }} + + {{ item.weight }}吨,{{ item.volume }}方,{{ item.number }}件 + + + + 承运信息 + + {{ i?.carrierInformationVO?.driverName }} + + + {{ i?.carrierInformationVO?.driverTelephone }} + + + {{ i?.carrierInformationVO?.driverLicensePlate }} + + +
    +

    装货卸货信息 + ( + + + ) + +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

    +

    联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

    +
    +
    +
    +

    装货时间:{{ i?.loadingTime }}

    +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

    +

    联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

    +
    +
    +
    +

    卸货时间:{{ i?.unloadingTime }}

    +
    +
    +
    +
    +
    + + + + + {{ i?.insuranceTypeLabel}} + + + {{i?.goodsValue !==null?(i?.goodsValue|currency)+'元':'-'}} + + + {{i?.insurancePremium!==null?(i?.insurancePremium |currency)+'元':'-'}} + + + + + + +
    + {{ item?.totalAmount | currency }} + (含附加费) +
    +
    + +
    + {{ item?.price | currency }} +
    +
    +
    +
    +
    +

    + + + {{ i?.totalAmount | currency }} + + (运费{{ i?.totalFreight | currency }}含附加运费 {{ i?.totalSurcharge | currency }}) +

    +
    车队长:{{ i?.payeeName }}/{{ i?.payeePhone }}/{{ i?.payeeCardNo }}
    +
    +
    +
    + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + {{ i?.supplementaryInformationVO?.receiptUserName || '-' }} / {{ i?.supplementaryInformationVO?.phon || '-' }} + + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + {{ i?.supplementaryInformationVO?.remarks }} + + + + + + + +
    diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.less b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.less new file mode 100644 index 00000000..e963d1b7 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.less @@ -0,0 +1,84 @@ +:host { + .source-info { + min-height: 210px; + + p { + margin-bottom: .5em; + } + } + + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .title { + font-weight: bold; + font-size: 26; + } + + .freight-info-box { + width: 95%; + + p { + margin-bottom: 5px; + } + } + + .freigth-label { + display: inline-block; + width: 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width: 70%; + margin: 0 auto; + } + } + } + + .handling-info { + min-height: 176px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.spec.ts b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.spec.ts new file mode 100644 index 00000000..cb740ab1 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementVehicleDetailComponent } from './vehicle-detail.component'; + +describe('SupplyManagementVehicleDetailComponent', () => { + let component: SupplyManagementVehicleDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [SupplyManagementVehicleDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementVehicleDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts new file mode 100644 index 00000000..4edb9f14 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts @@ -0,0 +1,181 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; +import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component'; + +@Component({ + selector: 'app-supply-management-vehicle-detail', + templateUrl: './vehicle-detail.component.html', + styleUrls: ['./vehicle-detail.component.less'] +}) +export class SupplyManagementVehicleDetailComponent implements OnInit { + + id = this.route.snapshot.params.id; + i: any; + serviceType: any = { + 1: '抢单', + 2: '指派' + } + logColumns: STColumn[] = [ + { title: '内容', index: 'operationContent' }, + { title: '操作人', index: 'operator' }, + { title: '操作时间', index: 'operatorTimestamp' }, + ]; + totalObj: any; + attObj: any; + status: any = { 1: '待接单', 2: '已接单', 3: '已取消' }; + totalExpensePrice = 0; + expenseColumns: STColumn[] = [ + { + title: '款项', + width: '150px', + className: 'text-center', + index: 'expenseName' + }, + { + title: '总费用(元)', + width: '150px', + className: 'text-center', + render: 'total' + }, + { + title: '协议金额(元)', + width: '150px', + className: 'text-center', + render: 'price' + }, + ]; + get reqParams() { + return { + operateObject: this.i?.resourceCode, + operateTypeList: [4,7], + }; + } + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + public service: SupplyManagementService, + public modal: NzModalService, + public router: Router + ) { + + } + + ngOnInit(): void { + this.getGoodsSourceDetail() + } + + getGoodsSourceDetail() { + this.service.request(this.service.$api_get_getCompleteVehicleDetail, { id: this.id }).subscribe(res => { + console.log('888') + console.log(this.i) + const expenseList = res?.expenseVOList || []; + this.totalExpensePrice = 0; + this.attObj = res?.expenseVOList?.filter((data: any) => data.expenseCode === 'ATT')[0]; + this.totalObj = res?.expenseVOList?.filter((data: any) => data.expenseCode === 'TOTAL')[0]; + console.log(this.attObj) + console.log(this.totalObj) + expenseList.forEach((e: any) => { + this.totalExpensePrice += e?.price * e?.rate; + }); + this.i = { ...res, totalExpensePrice: this.totalExpensePrice }; + + }) + } + /** + * 修改货源 + */ + updateGoodsSource(record: any) { + this.router.navigate(['/supply-management/vehicle-amend', record.id], { + queryParams: { + sta: 1 + } + }); + } + + /** + * 取消货源 + */ + cancleGoodsSource() { + this.modal.confirm({ + nzTitle: '确定取消货源吗?', + nzContent: `取消后不可恢复,谨慎操作`, + nzOnOk: () => + this.service.request(this.service.$api_cancle_goods_source, { id: this.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.getGoodsSourceDetail() + } + }) + }) + } + + /** + *再下一单 + * @param record + */ + placeOrder(record: any) { + this.router.navigate(['./pbg/onecar-publish'], { + queryParams: { + id: record?.id, + type: 'add' + } + }) + } + /** + * 编辑外部货源号 + * @param item st当前行对象 + */ + editEnternalSn(item: any) { + const modalRef = this.modal.create({ + nzWidth: '400px', + nzContent: SupplyManagementUpdateExternalSnComponent, + nzComponentParams: { + orderObject: item, + }, + nzFooter: null, + nzClosable: false + }); + } + + /** + * 重新指派 + */ + assignedCar(item: any) { + const { id } = item; + console.log(id) + const modalRef = this.modal.create({ + nzTitle: '指派熟车', + nzWidth: '1200px', + nzContent: SupplyManagementVehicleAssignedCarComponent, + nzComponentParams: { + i: item, + status: 'anew', + params: { id }, + url: this.service.$api_save_assign_vehicle, + }, + nzFooter: null, + + }); + modalRef.afterClose.subscribe((result) => { + if (result) { + } + }); + } + nextOrder(item: any) { + this.router.navigate(['/supply-management/vehicle-amend', item.id], { + queryParams: { + sta: 2 + } + }); + } + goBack() { + window.history.go(-1); + } + +} diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.html b/src/app/routes/supply-management/components/vehicle/vehicle.component.html new file mode 100644 index 00000000..9ed09a00 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.html @@ -0,0 +1,121 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + +
    + +
    + + +
    + + + + +
    {{ item?.createUserName }}/{{ item?.createUserPhone }}
    +
    + + {{ item?.resourceCode }} +

    {{ item?.resourceTypeLabel }}{{ item?.serviceTypeLabel }}

    +

    {{ item?.resourceStatusLabel }}

    +
    + +
    {{ item?.totalAmount | currency }}
    +
    + +
    {{ item?.freight | currency }}
    +
    + +
    {{ item?.surcharge | currency }}
    +
    + +
    车型: {{ item?.carModelLabel }}
    +
    车长: {{ item?.carLengthLabel }} 米
    +
    +
    +
    +
    + +
    + + + +
    +
    + + + +
    + + +
    + + +
    + + + + +
    diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.less b/src/app/routes/supply-management/components/vehicle/vehicle.component.less new file mode 100644 index 00000000..e3128423 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.less @@ -0,0 +1,25 @@ +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + margin-top: -40px; + max-width : 400px; + position : absolute; + right : 0; + bottom : 30px; + } + +} + +:host::ng-deep { + p { + margin-bottom: 0; + } + + .text-truncate { + white-space: normal; + } +} \ No newline at end of file diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts new file mode 100644 index 00000000..c469dc82 --- /dev/null +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -0,0 +1,690 @@ +import { ActivatedRoute, Router } from '@angular/router'; +import { Component, OnInit, ViewChild, OnChanges } from '@angular/core'; +import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; +import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component'; +import { of } from 'rxjs'; +import { ShipperBaseService } from '@shared'; +import { SupplyManagementImportSupplyComponent } from '../../model/import-supply/import-supply.component'; + +@Component({ + selector: 'app-supply-management-vehicle', + templateUrl: './vehicle.component.html', + styleUrls: ['./vehicle.component.less'] +}) +export class SupplyManagementVehicleComponent implements OnInit { + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + loading: boolean = true; + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + _$expand = false; + tabs = { + totalQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + + isVisible = false; + freightSchema: SFSchema = {}; + auditMany = false; + + resourceStatus: any; + auditID: any; + constructor( + public service: SupplyManagementService, + private modal: NzModalService, + private router: Router, + private ar: ActivatedRoute, + public shipperSrv: ShipperBaseService + ) { } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + const a: any = { + ...params + }; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; + } + this.loading = true; + return { + ...a + }; + } + beforeReq = (requestOptions: STRequestOptions) => { + const params = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + const a: any = { + ...params + }; + if (this.resourceStatus) { + a.resourceStatus = this.resourceStatus; + } + if (this.sf) { + Object.assign(requestOptions.body, { + ...a + }); + } + this.loading = true; + return requestOptions; + }; + afterRes = (data: any[], rawData?: any) => { + this.loading = false; + return data.map(item => ({ + ...item, + disabled: item.auditStatus !== '1' + })); + }; + + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + ngOnInit(): void { + this.initSFFre(); + this.getGoodsSourceStatistical(); + } + /** + * 初始化查询表单 + */ + + initSFFre() { + this.freightSchema = { + properties: { + remarks: { + title: '备注', + type: 'string', + maxLength: 50, + ui: { + placeholder: '请输入备注', + widget: 'textarea' + } + } + }, + require: ['remarks'] + }; + } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + selectChange(e: number) { + this.resourceStatus = e; + setTimeout(() => { + this.st.load(1); + }, 500); + } + /** + * 导入货源 + */ + importGoodsSource() { + const modalRef = this.modal.create({ + nzTitle: '货源导入', + nzWidth: 600, + nzContent: SupplyManagementImportSupplyComponent, + nzComponentParams: { + // i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + const tipsModal = this.modal.create({ + nzTitle: '上传提示', + nzWidth: 600, + nzContent: `
    文件上传完成!成功${result?.successNumber}条,失败${result?.failNumber}条!
    `, + nzFooter: [ + { + label: '取 消', + type: 'default', + onClick: () => { + tipsModal.destroy(); + } + }, + { + label: '下载失败数据', + type: 'primary', + loading: this.service.http.loading, + onClick: () => { + if(!result?.failNumber) { + this.service.msgSrv.error('没有失败数据!'); + tipsModal.destroy(); + return; + } + this.service.downloadFile(this.service.$api_getFailUploadGoodsOperateResource, result.ids) + tipsModal.destroy(); + } + }, + ] + }) + } + }); + } + + /** + * 修改运费 + */ + updateFreight(item: any) { + const modalRef = this.modal.create({ + nzTitle: '货源导入', + nzWidth: 600, + nzContent: SupplyManagementImportSupplyComponent, + nzComponentParams: { + // i: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + const tipsModal = this.modal.create({ + nzTitle: '上传提示', + nzWidth: 600, + nzContent: `
    文件上传完成!成功${result?.successNumber}条,失败${result?.failNumber}条!
    `, + nzFooter: [ + { + label: '取 消', + type: 'default', + onClick: () => { + tipsModal.destroy(); + } + }, + { + label: '下载失败数据', + type: 'primary', + onClick: () => { + this.service.downloadFile(this.service.$api_getFailUploadGoodsOperateResource, result.ids); + // this.service.request(this.service.$api_getFailUploadGoodsOperateResource, result.ids).subscribe((res: any) => { + // if (res) { + // console.log(res); + // } + // }); + console.log(111); + } + } + ] + }); + } + }); + } + + /** + * 重新指派 + */ + /** + * 重新指派 + */ + assignedCar(item: any) { + const { id } = item; + const modalRef = this.modal.create({ + nzTitle: '指派熟车', + nzWidth: '1200px', + nzContent: SupplyManagementVehicleAssignedCarComponent, + nzComponentParams: { + i: item, + status: 'anew', + params: { id }, + url: this.service.$api_save_assign_vehicle + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(result => { + if (result) { + this.st.reload(); + } + }); + } + /** + * 审核 + */ + audit(value: any, status?: any) { + console.log(value); + console.log(status); + if (status === 2) { + if (this.selectedRows.length <= 0) { + this.service.msgSrv.error('未选择货源单!'); + return; + } + let list: any[] = []; + this.selectedRows.forEach(item => { + list.push(item.id); + }); + this.auditID = list; + this.auditMany = true; + } else { + this.auditID = value.id; + this.auditMany = false; + } + this.isVisible = true; + } + /** + * 审核关闭弹窗 + */ + handleCancel(type: any) { + this.isVisible = false; + } + /** + * 审核通过按钮 + */ + handleOK(value: any) { + if (this.auditMany === false) { + const params: any = { + id: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log('999'); + console.log(params); + this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } else { + const params: any = { + ids: this.auditID, + remarks: this.sfFre.value.remarks + }; + if (value == 1) { + params.auditStatus = 2; + } else { + params.auditStatus = 3; + } + console.log(params); + this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('审核成功!'); + this.isVisible = false; + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }); + } + } + /** + * 跳转修改货源 + */ + amend(item: any) { + console.log(item); + this.router.navigate(['/supply-management/vehicle-amend', item.id], { + queryParams: { + sta: 1 + } + }); + } + nextOrder(item: any) { + this.router.navigate(['/supply-management/vehicle-amend', item.id], { + queryParams: { + sta: 2 + } + }); + } + /** + * 代发货源 + */ + releaseGoods() { + this.router.navigate(['/supply-management/vehicle-release']); + } + /** + * 取消货源 + */ + cancleGoodsSource(record: any) { + this.modal.confirm({ + nzTitle: '确定取消货源吗?', + nzContent: `取消后不可恢复,谨慎操作`, + nzOnOk: () => + this.service.request(this.service.$api_cancle_goods_source, { id: record.id }).subscribe(res => { + if (res === true) { + this.service.msgSrv.success('操作成功!'); + this.st?.reload(); + this.getGoodsSourceStatistical(); + } + }) + }); + } + // 获取货源状态统计 + getGoodsSourceStatistical() { + this.tabs = { + totalQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.resourceStatus; + this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 1, ...params }).subscribe(res => { + if (res) { + console.log(res); + this.tabs = res; + } + }); + } + + private initSF(): SFSchema { + return { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + resourceCode: { + type: 'string', + title: '货源编号', + ui: { placeholder: '请输入' } + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + placeholder: '请输入' + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { placeholder: '请输入' } + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + // enterpriseProjectId: { + // type: 'string', + // title: '所属项目', + // ui: { + // widget: 'select', + // visibleIf: { + // _$expand: (value: boolean) => value + // }, + // allowClear: true, + // containsAllLabel: true, + // asyncData: () => this.shipperSrv.getEnterpriseProject(this.sf.value?.shipperAppUserId) + // } as SFSelectWidgetSchema + // }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + serviceType: { + title: '服务类型', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'service:type' }, + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } as SFSelectWidgetSchema + }, + auditStatus: { + title: '审核状态', + type: 'string', + ui: { + widget: 'dict-select', + allowClear: true, + containsAllLabel: true, + params: { dictKey: 'goodresource:audit:status' }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + asyncData: () => this.shipperSrv.getNetworkFreightForwarder(), + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } + } + } + }; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + /** + * 初始化数据列表 + */ + private initST(): STColumn[] { + return [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '货源编号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'resourceCode' + }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { + title: '货主', + index: 'shipperAppUserName', + width: '180px', + className: 'text-left' + }, + + { + title: '项目名称', + index: 'enterpriseProjectName', + width: '180px', + className: 'text-left' + }, + { + title: '装货地', + index: 'loadingAddressArr', + width: '200px', + className: 'text-left' + }, + { + title: '卸货地', + index: 'unloadingAddressArr', + width: '200px', + className: 'text-left' + }, + { + title: '货物名称', + index: 'goodsName', + width: '150px', + className: 'text-left' + }, + { + title: '货物数量', + width: '200px', + index: 'goodsNumber', + className: 'text-left', + format: item => item.goodsNumber.join('/') + }, + { + title: '用车需求', + className: 'text-left', + width: '180px', + render: 'useCarDemand' + }, + { + title: '总费用', + className: 'text-right', + width: '120px', + render: 'total' + }, + { + title: '总运费', + width: '150px', + className: 'text-right', + index: 'totalAmount', + render: 'totalAmount' + }, + { + title: '附加费', + className: 'text-right', + width: '120px', + index: 'surcharge', + render: 'surcharge' + }, + { + title: '货源状态', + className: 'text-left', + index: 'resourceStatusLabel', + width: '120px' + }, + { + title: '创建时间', + width: '200px', + index: 'createTime', + className: 'text-left' + }, + { + title: '审核状态', + className: 'text-left', + index: 'auditStatus', + type: 'badge', + width: '170px', + badge: { + '1': { text: '待审核', color: 'warning' }, + '2': { text: '审核通过', color: 'success' }, + '3': { text: '不通过', color: 'error' }, + '4': { text: '已取消', color: 'default' } + } + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center block-td', + buttons: [ + { + text: '货源审核', + click: _record => this.audit(_record, 1), + iif: item => item.auditStatus === '1', + acl: { ability: ['SUPPLY-INDEX-vehicleBatchAudit'] } + }, + { + text: '修改货源', + click: _record => this.amend(_record), + iif: item => item.resourceStatus === '1' && item.insurancePayment !== 'Y', + acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] } + }, + // { + // text: '修改运费', + // click: _record => this.updateFreight(_record), + // iif: item => item.resourceStatus === '1' && item.serviceType === '2' + // }, + { + text: '取消货源', + click: _record => this.cancleGoodsSource(_record), + iif: item => item.resourceStatus === '1', + acl: { ability: ['SUPPLY-INDEX-vehicleCancelSupply'] } + }, + { + text: '再下一单', + click: _record => this.nextOrder(_record), + acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] } + }, + { + text: '重新指派', + click: _record => this.assignedCar(_record), + iif: item => item.resourceStatus === '1' && item.serviceType === '2', + acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] } + }, + { type: 'divider' } + ] + } + ]; + } + // 导出 + exportFire() { + this.service.asyncExport(this.reqParams, this.service.$api_asyncExportWholeList); + } +} diff --git a/src/app/routes/supply-management/model/import-supply/import-supply.component.html b/src/app/routes/supply-management/model/import-supply/import-supply.component.html new file mode 100644 index 00000000..fd35818d --- /dev/null +++ b/src/app/routes/supply-management/model/import-supply/import-supply.component.html @@ -0,0 +1,55 @@ + +
    + + + + + + + + + + + + +
    + +
    +
    + 下载导入模板 +
    仅支持XLS / XLSX文件格式,最多不能超过100行数据
    +
    +
    +
    +

    注意:

    +

    1、第一次上传请点击下载模板

    +

    2、请不要调整模板顺序

    +

    3、必填字段请务必填写

    +

    4、如果不清楚字段值,请参考货源发布功能

    +

    5、发布成功后,可在货源列表-待接单查看

    +
    +
    +
    + 文件上传成功!成功xx条,失败xx条! +
    + diff --git a/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts b/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts new file mode 100644 index 00000000..65a74b1c --- /dev/null +++ b/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { SupplyManagementImportSupplyComponent } from './import-supply.component'; + +describe('SupplyManagementImportSupplyComponent', () => { + let component: SupplyManagementImportSupplyComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementImportSupplyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementImportSupplyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/model/import-supply/import-supply.component.ts b/src/app/routes/supply-management/model/import-supply/import-supply.component.ts new file mode 100644 index 00000000..3f3a4613 --- /dev/null +++ b/src/app/routes/supply-management/model/import-supply/import-supply.component.ts @@ -0,0 +1,213 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-01 15:13:03 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-11 10:33:44 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SupplyManagementService } from '../../services/supply-management.service'; +import { apiConf } from '@conf/api.conf'; + +@Component({ + selector: 'app-supply-management-import-supply', + templateUrl: './import-supply.component.html', +}) +export class SupplyManagementImportSupplyComponent implements OnInit { + record: any = {}; + files: any; + fileName: any; + status: boolean = true + files2: any; + schema: SFSchema = {}; + ui: SFUISchema = {}; + networkTransporter: any; // 网络货运人id + uploadUrl = apiConf.file_upload_url; + @ViewChild('sf', { static: false }) sf!: SFComponent; + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public service: SupplyManagementService + ) { } + + ngOnInit(): void { + this.initSF(); + console.log(this.record) + } + + initSF() { + this.schema = { + properties: { + shipperAppUserId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + // serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + console.log(q === ' ') + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + this.getRegionCode2(str); + } + } + } as SFSelectWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'text', + }, + default: '确认货主后带出' + }, + enterpriseProjectId: { + type: 'string', + title: '项目', + ui: { + widget: 'select', + placeholder: '请选择' + } as SFSelectWidgetSchema + }, + fileName: { + type: 'string', + title: '导入货源信息', + ui: { + widget: 'custom' + } + }, + file: { + type: 'string', + title: '', + ui: { + widget: 'custom' + } + }, + }, + required: ['shipperAppUserId', 'enterpriseProjectId','enterpriseInfoId','fileName'], + }; + this.ui = { + '*': { + grid: { span: 20 }, + }, + '$fileName': { + spanLabelFixed: 130, + grid: { span: 20 }, + }, + '$file': { + spanLabelFixed: 130, + grid: { span: 20 }, + }, + }; + } + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + }); + } + getRegionCode2(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_getNetworkTransporter, { id: regionCode }).subscribe((res: any) => { + console.log(res) + this.networkTransporter = res.networkTransporter + this.sf.getProperty('/enterpriseInfoId')!.widget.reset(res?.netTranName); + this.sf.setValue('/enterpriseInfoId', res?.netTranName) + }); + } + save(): void { + console.log(this?.networkTransporter) + console.log(this.sf.value) + if(!this.sf.value?.shipperAppUserId || !this?.networkTransporter || !this.sf.value?.enterpriseProjectId || !this.sf.value?.fileName) { + this.service.msgSrv.error('请填写必填项并上传文件!') + return + } + const formData : any= new FormData(); + this.files?.forEach((file: any) => { + formData.append('file', file); + formData.append('shipperAppUserId', this.sf.value?.shipperAppUserId); + formData.append('enterpriseInfoId', this?.networkTransporter); + formData.append('enterpriseProjectId', this.sf.value?.enterpriseProjectId); + }); + + console.log(formData) + this.service.request(this.service.$api_goodsResourceOperateImport, formData).subscribe(res => { + if (res) { + this.service.msgSrv.success('导入成功'); + this.modal.destroy({ ...res }); + } + }); + } + + close(): void { + this.modal.destroy(); + } + handleChange(info: NzUploadChangeParam): void { + switch (info?.file?.status) { + case 'uploading': + break; + case 'done': + console.log(info); + let file = info?.file; + let fileName = file?.response.name; + this.sf?.setValue('/fileName', fileName); + this.sf?.setValue('/file', file?.response?.url); + break; + case 'error': + this.service.msgSrv.error('出错误了'); + break; + } + } + beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => { + let fileName = file?.name; + this.files = []; + this.files.push(file); + this.sf?.setValue('/fileName', fileName); + return false; + }; + downFile() { + this.service.downloadFile(this.service.$api_exportGoodsResourceOperateTemplate); + } + clearFile() { + this.fileName = null; + this.sf?.setValue('/fileName', null); + } +} diff --git a/src/app/routes/supply-management/services/supply-management.service.ts b/src/app/routes/supply-management/services/supply-management.service.ts new file mode 100644 index 00000000..10cbc648 --- /dev/null +++ b/src/app/routes/supply-management/services/supply-management.service.ts @@ -0,0 +1,187 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 11:10:14 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-24 19:35:52 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Injectable, Injector } from '@angular/core'; +import { map } from 'rxjs/operators'; +import { BaseService } from 'src/app/shared/services'; + +@Injectable({ + providedIn: 'root' +}) +export class SupplyManagementService extends BaseService { + $api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表 + // 取消货源 + $api_cancle_goods_source = `/api/sdc/goodsResourceOperate/cancelSource`; + // 整车获取货源表详情 + $api_get_getCompleteVehicleDetail = `/api/sdc/goodsResourceOperate/getWholeDetail`; + // 大宗获取货源表详情 + $api_get_getBulkDetail = `/api/sdc/goodsResourceOperate/getBulkDetail`; + // 查询运营后台大宗货源列表 + $api_get_bulkPage_list = `/api/sdc/goodsResourceOperate/listBulkPage`; + // 查询运营后台整车货源列表 + $api_get_wholePage_list = `/api/sdc/goodsResourceOperate/listWholePage`; + // 整车再下一单 + $api_set_saveAnotherWholeOrder = `/api/sdc/goodsResourceOperate/saveAnotherWholeOrder`; + // 大宗再下一单 + $api_set_saveAnotherBulkOrder = `/api/sdc/goodsResourceOperate/saveAnotherBulkOrder`; + // 编辑整车货源 + $api_set_WholeModify = `/api/sdc/goodsResourceOperate/updateWhole`; + // 编辑大宗货源 + $api_set_bulkModify = `/api/sdc/goodsResourceOperate/updateBulk`; + // 删除装卸货信息 + $api_delete_Wholedeletebatch = `/api/sdc/unLoadingPlace/deletebatch`; + // 删除货物信息 + $api_delete_bulkdeletebatch = `/api/sdc/goodsInfo/deletebatch`; + $api_get_catalogue_member = `/user?_allow_anonymous=true`; + $api_get_listModifyPrice = `/api/sdc/goodsInfo/listModifyPrice`; + $api_update_price = `/api/sdc/goodsResourceShipper/modifyPrice`; // 根据货物ID修改单价 + $api_get_goods_resource_statistical = `/api/sdc/goodsResourceOperate/statisticalStatus`; // 统计整车、大宗货源状态数量 + // 获取货主企业列表 + public $api_getList = '/api/mdc/cuc/enterpriseInfo/cargoOwner/getList?_allow_anonymous=true'; + public $api_commonAddress = '/api/sdc/commonAddress/list/page'; + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + // 取消货源 + public $api_cancelSource = '/api/sdc/goodsResourceOperate/cancelSource'; + // 整车计算附加费 + $api_getCalculatedSurcharge = `/api/sdc/expense/getCalculatedSurcharge`; + // 整车计算附加费率 + $api_getcalculatedServiceRate = `/api/sdc/expense/getAdditionalRate`; + // 整车计算附加费率 + $api_getAdditionalRate = `/api/sdc/expense/getAdditionalRate`; + // 代发整车货源 + $api_consignWhole = `/api/sdc/goodsResourceOperate/consignWhole`; + // 代发大宗货源 + $api_consignBulk = `/api/sdc/goodsResourceOperate/consignBulk`; + + $api_get_practice_car_list = `/api/mdc/cuc/enterpriseVehicle/getPracticeCarList`; // 获取熟车列表 + $api_add_car_caption = `/api/mdc/userDriverExpand/addCarCaptainForShiper`; // 设置为车队长 + $api_get_goods_resource_shipper = `/api/sdc/goodsResourceShipper/modifyPricePre`; // 修改单价页面根据货源ID获取货物表 + $api_get_car_captain_by_mobile = `/api/mdc/userDriverExpand/getCarCaptainByMobile`; // 查询车队长或者司机列表 + $api_save_assign_vehicle = `/api/sdc/goodsResourceShipper/reAssignWhole`; // 整车货源重新指派 + + $api_save_assign_bulk = `/api/sdc/goodsResourceShipper/reAssignBulk`; // 货主端大宗货源指派熟车 + // 整车再下一单指派熟车 + $api_save_assign_whole = `/api/sdc/goodsResourceOperate/saveAnotherWholeOrderAssign`; + // 代发整车货源指派熟车 + $api_save_consignWholeAssign = `/api/sdc/goodsResourceOperate/consignWholeAssign`; + // 货主端大宗货源指派熟车 + $api_save_bulk_assign = `/api/sdc/goodsResourceOperate/saveAnotherBulkOrderAssign`; + // 代发大宗货源指派熟车 + $api_save_consignBulkAssign = `/api/sdc/goodsResourceOperate/consignBulkAssign`; + + $api_get_has_assigned_car_list = `/api/sdc/goodsResourceShipper/getCarDriverIdsByResourceId`; // 大宗货源根据货源id获取司机和车辆的id集合 + + // 根据手机号查询车队长/司机 + $api_getCarCaptainByMobile = `/api/mdc/userDriverExpand/getCarCaptainByMobile`; + // 新增熟车 + $api_enterpriseVehicleSave = `/api/mdc/cuc/enterpriseVehicle/save`; + // 删除熟车 + $api_deletebatch = `/api/mdc/cuc/enterpriseVehicle/deletebatch`; + // 熟车详情 + $api_getMyDriverUserDetail = `/api/mdc/cuc/enterpriseVehicle/getMyDriverUserDetail`; + + // 获取指派熟车列表 + $api_getList_card = '/api/mdc/cuc/enterpriseVehicle/getPracticeCarList'; + + // 根据地区code查询列表 + $api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode'; + // 识别身份证 + $api_checkIdCard = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + // 驾驶证识别 + $api_recognizeDriverLicense = `/api/mdc/pbc/hwc/ocr/recognizeDriverLicense`; + // 查询系统配置项 + public $api_get_config_item_page = '/api/mdc/pbc/sysConfigItem/list/page'; + + // 货源审核 + public $api_goodsResourceAudit = '/api/sdc/goodsResourceOperate/goodsResourceAudit'; + // 货源审核【批量】 + public $api_batchGoodsResourceAudit = '/api/sdc/goodsResourceOperate/batchGoodsResourceAudit'; + + // 大宗再下一单二维码 + $api_saveAnotherBulkOrderQRCode = '/api/sdc/goodsResourceOperate/saveAnotherBulkOrderQRCode'; + // 代发大宗货源二维码 + $api_consignBulkQRCode = '/api/sdc/goodsResourceOperate/consignBulkQRCode'; + // 获取操作日志列表 + public $api_getOperationLogRecordsList = '/api/mdc/pbc/operationLogRecords/getOperationLogRecordsList'; + // 获取数据字典 + $api_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; + // 获取协议信息 + public $api_getAgreementInfoByType = '/api/mdc/pbc/agreementInfo/getAgreementInfoByType'; + // 获取协议信息 + public $api_getContractContent = '/api/sdc/contractTemplate/getContractContent'; + // 获取运价 + public $api_getFreight = '/api/mdc/cuc/freightConfig/getFreight'; + // 从业资格证 + $api_recognizeQualificationCertificate = '/api/mdc/pbc/hwc/ocr/recognizeQualificationCertificate'; + /** + * 获取车型、车长字典数据 + * @returns + */ + getDictOptions(params = {}) { + return this.request(this.$api_getDictValue, params).pipe( + map((res: any) => { + if (!res) { + return []; + } + const obj = []; + obj.push({ label: '不限', value: '999' }); + return [...obj, ...res]; + }) + ); + } + constructor(public injector: Injector) { + super(injector); + } + public limitKeys = { + weight: 'sys.config.goods.approvalCarMaxWeight', //整车-核载重量上限 + volume: 'sys.config.goods.approvalCarMaxVolume', //整车-核载体积上限 + piece: 'sys.config.goods.approvalCarMaxPiece', //整车-核载件数上限 + maxDays: 'sys.config.goods.wholeLoadingMaxDays', //整车-计划装货时间上限 + intervalDays: 'sys.config.goods.wholeUnloadingIntervalDays', //计划装、卸货时间间隔 + maxTimes: 'sys.config.goods.wholeLoadingMaxTimes' //整车-多装多卸地点上限 + }; + public limitKeys2 = { + month: 'sys.config.goods.bulkEndMaxMonth', //大宗-截止时间上限 + weight: 'sys.config.goods.bulkMaxWeight', //大宗-重量上限 + volume: 'sys.config.goods.bulkMaxVolume', //大宗-体积上限 + trainNumber: 'sys.config.goods.bulkMaxTrainNumber', //大宗-车次上限 + freight: 'sys.config.goods.bulkMaxUnitFreight' //大宗-运费单价上限 + }; + // 根据ItemKey获取项值 + public $api_findItemValueByItemKeys = '/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys'; + // 获取保价费信息 + public $api_getWholeInsuranceInfo = '/api/sdc/goodsResourceShipper/getWholeInsuranceInfo'; + // 下载导入货源模板-运营后台 + public $api_exportGoodsResourceOperateTemplate = '/api/sdc/uploadGoodsResource/exportGoodsResourceOperateTemplate'; + // 导入货源-运营后台 + public $api_goodsResourceOperateImport = '/api/sdc/uploadGoodsResource/goodsResourceOperateImport'; + // 下载失败数据-运营后台 + public $api_getFailUploadGoodsOperateResource = '/api/sdc/uploadGoodsResource/getFailUploadGoodsOperateResource'; + // 根据货主ID查询网络货运人信息 + public $api_getNetworkTransporter = '/api/mdc/cuc/enterpriseInfo/operate/getNetworkTransporter'; + $api_verify_vehicle_status = `/api/sdc/goodsResourceShipper/saveVerify`; // 发布货源校验司机/车队长的状态 + $api_get_sys_config = `/api/mdc/pbc/sysConfigItem/findConfigValues`; // 根据项key、业务id获取配置信息 + // 获取指派熟车列表 + $api_getListCars = '/api/mdc/cuc/enterpriseVehicle/getPracticeCarList'; + // 异步导出运营后台大宗货源列表 + $api_asyncExportBulkList = '/api/sdc/goodsResourceOperate/asyncExportBulkList'; + // 异步导出运营后台整车货源列表 + $api_asyncExportWholeList = '/api/sdc/goodsResourceOperate/asyncExportWholeList'; + // 根据货主ID查询合同签署属性 + public $api_getContractAtr = '/api/mdc/cuc/enterpriseInfo/cargoOwner/getContractAtr'; + // 发送邀请司机短信 + $api_send_msg_code = `/api/mdc/pbc/smsSend/sendInviteDriver`; + + getDictByKey(dictKey: string) { + const params = { dictKey: dictKey }; + return this.request(this.$api_getDictValue, params); + } +} diff --git a/src/app/routes/supply-management/supply-management-routing.module.ts b/src/app/routes/supply-management/supply-management-routing.module.ts new file mode 100644 index 00000000..c3eb4ba2 --- /dev/null +++ b/src/app/routes/supply-management/supply-management-routing.module.ts @@ -0,0 +1,38 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-03 11:10:14 + * @LastEditors : Shiming + * @LastEditTime : 2022-02-10 14:39:00 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\supply-management-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { SupplyManagementAddDriversComponent } from './components/add-drivers/add-drivers.component'; +import { SupplyManagementBulkDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { SupplyManagementBulkPublishComponent } from './components/bulk-publish/bulk-publish.component'; +import { SupplyManagementBulkReleasePublishComponent } from './components/bulk-release-publish/bulk-release-publish.component'; +import { SupplyManagementIndexComponent } from './components/index/index.component'; +import { SupplyManagementOnecarPublishComponent } from './components/onecar-publish/onecar-publish.component'; +import { SupplyManagementReleasePublishComponent } from './components/release-publish/release-publish.component'; +import { SupplyManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; + +const routes: Routes = [ + { path: 'index', component: SupplyManagementIndexComponent }, + { path: 'index/bulk-detail/:id', component: SupplyManagementBulkDetailComponent }, + { path: 'index/vehicle-detail/:id', component: SupplyManagementVehicleDetailComponent }, + { path: 'add-drivers', component: SupplyManagementAddDriversComponent }, + { path: 'vehicle-amend/:id', component: SupplyManagementOnecarPublishComponent }, + { path: 'vehicle-release', component: SupplyManagementReleasePublishComponent }, + { path: 'bulk-release', component: SupplyManagementBulkReleasePublishComponent }, + { path: 'bulk-amend/:id', component: SupplyManagementBulkPublishComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SupplyManagementRoutingModule {} diff --git a/src/app/routes/supply-management/supply-management.module.ts b/src/app/routes/supply-management/supply-management.module.ts new file mode 100644 index 00000000..63ee9e26 --- /dev/null +++ b/src/app/routes/supply-management/supply-management.module.ts @@ -0,0 +1,73 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-20 10:13:02 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-07 15:59:05 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\supply-management.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { NgModule, Type } from '@angular/core'; +import { SharedModule } from '@shared'; +import { ParterRebateManageMenRecordDetailComponent } from '../partner/rebate-management/model/record-detail/record-detail.component'; +import { CarAddDriverComponent } from './components/add-driver/add-driver.component'; +import { SupplyManagementAddDriversComponent } from './components/add-drivers/add-drivers.component'; +import { CarAddmodalComponent } from './components/addmodal/addmodal.component'; +import { SupplyManagementVehicleAssignedCarComponent } from './components/assigned-car/assigned-car.component'; +import { SupplyManagementBulkDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { SupplyManagementBulkPublishComponent } from './components/bulk-publish/bulk-publish.component'; +import { SupplyManagementBulkReleasePublishComponent } from './components/bulk-release-publish/bulk-release-publish.component'; +import { SupplyManagementBulkComponent } from './components/bulk/bulk.component'; +import { PublishchooseFamifiarAddComponent } from './components/choose-famifiar/add/add.component'; +import { PublishGoodsChooseFamifiarComponent } from './components/choose-famifiar/choose-famifiar.component'; +import { PublishchooseFamifiarSetCaptainComponent } from './components/choose-famifiar/set-captain/set-captain.component'; +import { SupplyManagementIndexComponent } from './components/index/index.component'; +import { PublishAddressListComponent } from './components/onecar-publish/address-list/address-list.component'; +import { SupplyManagementOnecarPublishComponent } from './components/onecar-publish/onecar-publish.component'; +import { PublishSuccessComponent } from './components/onecar-publish/publish-success/publish-success.component'; +import { SupplyManagementQrcodePageComponent } from './components/qrcode-page/qrcode-page.component'; +import { SupplyManagementReleasePublishComponent } from './components/release-publish/release-publish.component'; +import { TranAgreementComponent } from './components/tran-agreement/tran-agreement.component'; +import { SupplyManagementUpdateExternalSnComponent } from './components/update-external-sn/update-external-sn.component'; +import { SupplyManagementUpdateFreightComponent } from './components/update-freight/update-freight.component'; +import { SupplyManagementUpdatePriceComponent } from './components/update-price/update-price.component'; +import { SupplyManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; +import { SupplyManagementVehicleComponent } from './components/vehicle/vehicle.component'; +import { SupplyManagementImportSupplyComponent } from './model/import-supply/import-supply.component'; +import { SupplyManagementRoutingModule } from './supply-management-routing.module'; + +const COMPONENTS: Type[] = [ + SupplyManagementIndexComponent, + SupplyManagementBulkComponent, + SupplyManagementVehicleComponent, + SupplyManagementUpdatePriceComponent, + SupplyManagementUpdateFreightComponent, + SupplyManagementVehicleAssignedCarComponent, + SupplyManagementQrcodePageComponent, + SupplyManagementUpdateExternalSnComponent, + SupplyManagementVehicleDetailComponent, + SupplyManagementAddDriversComponent, + SupplyManagementOnecarPublishComponent, + PublishGoodsChooseFamifiarComponent, + PublishchooseFamifiarSetCaptainComponent, + PublishchooseFamifiarAddComponent, + SupplyManagementBulkPublishComponent, + PublishAddressListComponent, + PublishSuccessComponent, + CarAddDriverComponent, + CarAddmodalComponent, + SupplyManagementBulkDetailComponent, + SupplyManagementReleasePublishComponent, + SupplyManagementBulkReleasePublishComponent, + TranAgreementComponent, + SupplyManagementImportSupplyComponent, + ParterRebateManageMenRecordDetailComponent +]; + +@NgModule({ + imports: [SharedModule, SupplyManagementRoutingModule], + declarations: COMPONENTS +}) +export class SupplyManagementModule {} diff --git a/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.html b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.html new file mode 100644 index 00000000..17d718f0 --- /dev/null +++ b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.html @@ -0,0 +1,41 @@ + + + +
    +
    +
      +
    • + {{ item.agreementName }} +
    • +
    +
    +
    + +
    + {{ tabItem.agreementName }} + +
    +
    + 更新时间: {{ tabItem.modifyTime }} + 预览 + +
    +
    +
    + + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.less b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.less new file mode 100644 index 00000000..0e059770 --- /dev/null +++ b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.less @@ -0,0 +1,90 @@ +:host { + // [nz-menu] { + // float: left; + // width: 254px; + // min-height: 810px; + // } + ::ng-deep { + .ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title { + font-weight: 500; + } + + .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { + // background: transparent; + } + .ant-menu-inline .ant-menu-item::after { + border-right: none; + } + .ant-menu-item-selected { + background: transparent; + } + .ant-menu-inline .ant-menu-submenu-title { + margin: 0; + } + .console-menu-icon { + width: 20px; + } + .console-menu-title { + margin-left: 9px; + vertical-align: middle; + } + .ant-menu-item:focus { + outline: none !important; + } + .tabset-container { + height: 450px; + margin-top: 16px; + overflow-y: auto; + } + } + h3 { + margin-left: 15px; + padding: 8px 15px; + font-weight: 700; + } + .times { + display: inline-block; + padding-right: 15px; + } + .width100 { + width: 100px; + margin: 0 5px; + } + .width200 { + width: 200px; + margin: 0 5px; + } + .sales-order { + margin-left: 15px; + padding: 8px 40px; + font-size: 18px; + } + .general-box { + height: 750px; + overflow: auto; + } + .card-height { + height: 800px; + } + .btn-right { + float: right; + } + .save-btn { + width: 100%; + text-align: right; + } + .ant-menu-vertical .ant-menu-item::after, + .ant-menu-vertical-left .ant-menu-item::after, + .ant-menu-vertical-right .ant-menu-item::after, + .ant-menu-inline .ant-menu-item::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + border-right: 3px solid #202886; + content: ''; + } + .but_rigth { + margin-left: 16% !important; + } +} diff --git a/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.ts b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.ts new file mode 100644 index 00000000..8f0ff5b8 --- /dev/null +++ b/src/app/routes/sys-setting/components/agreement-config/agreement-config.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { SystemService } from '../../services/system.service'; +@Component({ + selector: 'app-agreement-config-components-base', + styleUrls: ['./agreement-config.component.less'], + templateUrl: './agreement-config.component.html' +}) +export class AgreementConfigComponentsBaseComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema1!: SFSchema; + isUpdate = false; + tabItem: any = {}; + tabs: any[] = []; + + constructor(private service: SystemService) {} + + ngOnInit() { + this.loadAgreement(); + this.initSF(); + } + + initSF(data?: any) { + this.schema1 = { + properties: { + content: { + type: 'string', + title: '', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 650 + } + }, + default: data?.agreementContent || '' + } + } + }; + } + + changeType(item: any): void { + this.isUpdate = false; + this.tabItem = item; + } + + loadAgreement(type?: number) { + this.service.request(`${this.service.$api_get_agreement_page}`, { pageIndex: 1, pageSize: 99 }).subscribe(res => { + if (res) { + res.records = res.records.map((item: any) => ({ ...item, agreementContent: decodeURIComponent(item.agreementContent) })); + this.tabs = res.records; + if (type) { + this.tabItem = res.records.find((i: any) => i.type === type); + } else { + this.tabItem = res.records?.[0]; + } + } + }); + } + + update() { + this.isUpdate = true; + this.initSF(this.tabItem); + } + save() { + const params = { + id: this.tabItem.id, + agreementContent: encodeURIComponent(this.sf?.value.content), + type: this.tabItem.type, + agreementName: this.tabItem.agreementName + }; + this.isUpdate = false; + this.service.request(`${this.service.$api_update_agreement}`, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.isUpdate = false; + this.loadAgreement(this.tabItem.type); + } + }); + } + + cancel() { + this.isUpdate = false; + } +} diff --git a/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.html b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.html new file mode 100644 index 00000000..e70f7e38 --- /dev/null +++ b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.html @@ -0,0 +1,66 @@ + + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    + 客户 + 供应商 +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.less b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.ts b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.ts new file mode 100644 index 00000000..74ea33fd --- /dev/null +++ b/src/app/routes/sys-setting/components/announcement-message/announcement-message.component.ts @@ -0,0 +1,257 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { EAEnvironmentService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-sys-setting-components-announcement-message', + templateUrl: './announcement-message.component.html', + styleUrls: ['./announcement-message.component.less'] +}) +export class AnnouncementMessageComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '公告标题', index: 'announcementTitle' }, + { title: '创建时间', index: 'createTime' }, + { title: '发送时间', index: 'sendTime' }, + { title: '公告内容', index: 'announcementContent' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2) + }, + { + text: '删除', + click: item => this.deleteAction(item) + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }}; + + constructor( + public service: SystemService, + private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, + private envSrv: EAEnvironmentService, + ) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + announcementTitle: { + type: 'string', + title: '按钮名称', + ui: { placeholder: '请输入' } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + } as SFDateWidgetSchema + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + appIdList: { + type: 'string', + title: '发布平台', + enum: [ + { label: '运营后台', value: this.envSrv.env.appId }, + // { label: '货主后台', value: this.envSrv.env.HzappId }, + // { label: '司机端', value: this.envSrv.env.sjappId } + ], + ui: { + widget: 'select', + mode: 'multiple', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + announcementTitle: { + type: 'string', + title: '公告标题', + ui: { placeholder: '请输入' } + }, + announcementContent: { + type: 'string', + title: '公告内容', + ui: { placeholder: '请输入' } + }, + sendTime: { + title: '发送时间', + type: 'string', + format: 'date-time', + ui: { + allowClear: true, + } + }, + }, + required: ['name', 'i18n', 'text'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editText = '新增'; + this.formData = {}; + } else { + this.service.request(this.service.$api_getAnnouncementInfoById_detail, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editText = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_delete_deleteAnnouncementInfoById, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + var c = new Date(this.sfFre.value.sendTime); + this.sfFre.value.sendTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + console.log(params) + this.service.request(this.service.$api_modifyAnnouncementInfo, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } + }) + } else { + this.service.request(this.service.$api_addAnnouncementInfo, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } + } + )} +} + addPreZero(num: any) { + if (num < 10) { + return '0' + num; + } else { + return num; + } + } +} diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html new file mode 100644 index 00000000..0025c730 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html @@ -0,0 +1,25 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less new file mode 100644 index 00000000..80d9010f --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } +} + +.expend-options { + margin-top: -40px; +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts new file mode 100644 index 00000000..ced52980 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STChange, STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { AuditResonConfigActionModalComponent } from './audit-reson-config-action-modal/audit-reson-config-action-modal.component'; + +@Component({ + selector: 'app-audit-reason-config', + templateUrl: './audit-reason-config.component.html', + styleUrls: ['./audit-reason-config.component.less'] +}) +export class AuditReasonConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + receiveName: { + type: 'string', + title: '审核类型', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.receiveName = i; + this.sf?.setValue('/receiveName', i); + } + } + }, + phone: { + type: 'string', + title: '驳回理由', + ui: { placeholder: '请输入' } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '操作时间', index: 'updatedAt', type: 'date' }, + { title: '操作人', index: 'description' }, + { title: '操作人手机号码', index: 'description' }, + { title: '操作页面', index: 'description' }, + { title: '操作内容', index: 'description' }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.reasonAction(item) + }, + { + text: '删除', + click: item => this.deleteReason(item) + } + ] + } + ]; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void {} + + reasonAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: AuditResonConfigActionModalComponent, + nzComponentParams: item ? { i: { ...item, roleId: 1, name: '车辆审核', phone: 18555555555 } } : { i: { id: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deleteReason(item: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html new file mode 100644 index 00000000..beead4d9 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
    + + +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.less b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts new file mode 100644 index 00000000..ea2449a9 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-audit-reson-config-action-modal', + templateUrl: './audit-reson-config-action-modal.component.html', + styleUrls: ['./audit-reson-config-action-modal.component.less'] +}) +export class AuditResonConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + constructor(private modal: NzModalRef, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '选择审核类型', + type: 'string', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.name = i; + this.sf?.setValue('/name', i); + } + }, + default: staff.name + }, + phone: { + title: '驳回理由', + type: 'string', + ui: { placeholder: '请输入', widget: 'textarea', autosize: { minRows: 2, maxRows: 6 } }, + default: staff.phone + } + }, + required: ['name'] + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleId, + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // console.log(res); + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleId, + telephone: this.i.telephone + }; + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html new file mode 100644 index 00000000..beead4d9 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
    + + +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.less b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts new file mode 100644 index 00000000..0b999760 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-basic-config-action-modal', + templateUrl: './basic-config-action-modal.component.html', + styleUrls: ['./basic-config-action-modal.component.less'] +}) +export class BasicConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + constructor(private modal: NzModalRef,public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '配置类型', + type: 'string', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.name = i; + this.sf?.setValue('/name', i); + } + }, + default: staff.name + }, + phone: { + title: '配置项', + type: 'string', + ui: { placeholder: '请输入' }, + default: staff.phone + }, + roleId: { + type: 'string', + title: '启用状态', + enum: [ + { label: '启用', value: 1 }, + { label: '停用', value: 0 } + ], + ui: { + widget: 'radio' + } as SFRadioWidgetSchema, + default: staff?.roleId || 1 + } + }, + required: ['name', 'phone', 'roleId'] + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleId, + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // console.log(res); + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleId, + telephone: this.i.telephone + }; + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.html b/src/app/routes/sys-setting/components/basic-config/basic-config.component.html new file mode 100644 index 00000000..3840d334 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.html @@ -0,0 +1,26 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.less b/src/app/routes/sys-setting/components/basic-config/basic-config.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts b/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts new file mode 100644 index 00000000..2d1838b5 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts @@ -0,0 +1,129 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { BasicConfigActionModalComponent } from './basic-config-action-modal/basic-config-action-modal.component'; + +@Component({ + selector: 'app-basic-config', + templateUrl: './basic-config.component.html', + styleUrls: ['./basic-config.component.less'] +}) +export class BasicConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + receiveName: { + title: '配置类型', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + // asyncData: () => { + // return this.service.request(this.service.$api_getAppRoleList).pipe( + // map((res: any) => { + // this.roleList = res; + // return res.map((item: any) => { + // return { label: item.roleName, value: item.id }; + // }); + // }), + // ); + // }, + change: (i: any) => { + this.sf.value.receiveName = i; + this.sf?.setValue('/receiveName', i); + } + } + } + } + }; + + columns: STColumn[] = [ + { title: '配置类型', index: 'no' }, + { title: '配置项', index: 'description' }, + { + title: '启用状态', + className: 'text-center', + index: 'status', + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 2: { text: '停用', color: 'error' }, + 3: { text: '停用', color: 'error' }, + 1: { text: '停用', color: 'error' } + } + }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.configAction(item) + }, + { + text: '停用', + click: item => this.deactivateConfig(item) + } + ] + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + configAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: BasicConfigActionModalComponent, + nzComponentParams: item ? { i: { ...item, roleId: 1, name: '车辆审核', phone: 18555555555 } } : { i: { id: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deactivateConfig(item?: any) { + this.nzModalService.error({ + nzTitle: '确认停用?', + nzContent: ``, + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html new file mode 100644 index 00000000..9cd465f6 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less new file mode 100644 index 00000000..8e398b39 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.less @@ -0,0 +1,27 @@ +:host { + ::ng-deep { + .card-height { + min-height: 600px; + } + + .save-btn { + width : 100%; + text-align: right; + } + + .block-radio { + display : flex; + min-height: 32px; + } + + input { + width : 100px; + margin-left: 10px; + } + + .ant-form-item-control-input-content { + display: flex; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts new file mode 100644 index 00000000..e765f3dc --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts @@ -0,0 +1,74 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-01-25 13:10:49 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-26 17:45:11 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\basic-setting\\basic-setting.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-basic-setting', + templateUrl: './basic-setting.component.html', + styleUrls: ['./basic-setting.component.less'] +}) +export class BasicSettingComponent implements OnInit { + tabs: any[] = []; + selectedTab: any = null; + labelWidth = 250; + configList: any = []; + constructor(public service: SystemService) {} + + ngOnInit() { + this.getTypeList(); + } + + getTypeList() { + this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config', extendType: 0 }).subscribe((res: Array) => { + if (res?.length > 0) { + const typeData = res.find(config => config.configFullKey === 'sys.config'); + if (typeData) { + this.tabs = typeData?.children; + this.selectedTab = typeData?.children?.[0]; + this.getConfigList(this.selectedTab); + } + } + }); + } + + getConfigList(selectedTab: any) { + this.selectedTab = selectedTab; + this.service.request(this.service.$api_get_config_by_parent_id, { id: selectedTab?.id }).subscribe((res: Array) => { + if (res?.length > 0) { + res = res.map(item => ({ + ...item, + remark: item.remark ? JSON.parse(item.remark) : null, + itemValue: item?.itemValue ? (item?.itemType !== 8 ? JSON.parse(item?.itemValue) : item?.itemValue) : item?.itemValue, + itemData: item.itemData ? JSON.parse(item.itemData) : item.itemData + })); + const hiddenType = res.find(item => item.itemType === 7 || item.itemType === 999); + this.labelWidth = hiddenType ? 0 : 250; + this.configList = res; + } else { + this.configList = []; + } + }); + } + + saveAction(params: any) { + this.service.request(this.service.$api_update_config_batch, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改配置成功'); + setTimeout(() => { + this.getConfigList(this.selectedTab); + }, 100); + } + }); + } +} diff --git a/src/app/routes/sys-setting/components/btn-management/btn-management.component.html b/src/app/routes/sys-setting/components/btn-management/btn-management.component.html new file mode 100644 index 00000000..ccccdef8 --- /dev/null +++ b/src/app/routes/sys-setting/components/btn-management/btn-management.component.html @@ -0,0 +1,80 @@ + + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    + 客户 + 供应商 +
    +
    +
    +
    + + + + + + + + + + diff --git a/src/app/routes/sys-setting/components/btn-management/btn-management.component.less b/src/app/routes/sys-setting/components/btn-management/btn-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/btn-management/btn-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/btn-management/btn-management.component.ts b/src/app/routes/sys-setting/components/btn-management/btn-management.component.ts new file mode 100644 index 00000000..e2350c92 --- /dev/null +++ b/src/app/routes/sys-setting/components/btn-management/btn-management.component.ts @@ -0,0 +1,200 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-sys-setting-components-btn-management', + templateUrl: './btn-management.component.html', + styleUrls: ['./btn-management.component.less'] +}) +export class BtnManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editcode = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '按钮名称', index: 'name' }, + { title: 'i18n', index: 'i18n' }, + { title: '创建时间', index: 'createTime' }, + { title: '按钮编码', index: 'code' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2) + }, + { + text: '删除', + click: item => this.deleteAction(item) + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + }}; + + constructor( + public service: SystemService, + private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + name: { + type: 'string', + title: '按钮名称', + ui: { placeholder: '请输入' } + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + name: { + type: 'string', + title: '按钮名称', + ui: { placeholder: '请输入' } + }, + i18n: { + type: 'string', + title: 'i18n', + ui: { placeholder: '请输入' } + }, + code: { + title: '按钮编码', + type: 'string', + ui: { + placeholder: '请输入', + } + }, + }, + required: ['name', 'i18n', 'code'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editcode = '新增'; + this.formData = {}; + } else { + this.service.request(this.service.$api_getButtonInfo_one, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editcode = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_deletebatchButton, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + } + this.service.request(this.service.$api_saveButtonInfo, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg) + + } + }) + } +} diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html new file mode 100644 index 00000000..4e4ed373 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
    + + +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.less b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts new file mode 100644 index 00000000..86e436fd --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts @@ -0,0 +1,146 @@ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFStringWidgetSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-cart-config-action-modal', + templateUrl: './cart-config-action-modal.component.html', + styleUrls: ['./cart-config-action-modal.component.less'] +}) +export class CartConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + @Input() + configType: number = 1; + dictKey = ''; + constructor(private modal: NzModalRef, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + let option: any = {}; + switch (this.configType) { + case 1: + option = { + title: '车型', + ui: { + placeholder: '请输入' + } + }; + this.dictKey = 'car:model'; + break; + case 2: + option = { + title: '车长', + ui: { + placeholder: '请输入', + addOnAfter: '米' + } as SFStringWidgetSchema + }; + this.dictKey = 'car:length'; + break; + case 3: + option = { + title: '物品名称', + ui: { + placeholder: '请输入' + } + }; + this.dictKey = 'ban.goods.name'; + break; + + default: + break; + } + this.schema = { + properties: { + itemValue: { + ...option, + type: 'string', + default: staff.itemValue + }, + statePaused: { + type: 'string', + title: '状态', + enum: [ + { label: '启用', value: false }, + { label: '停用', value: true } + ], + ui: { + widget: 'radio', + visibleIf: { + itemValue: (value: number) => this.configType !== 3 + } + } as SFRadioWidgetSchema, + default: staff?.statePaused || false + } + }, + required: ['itemValue'] + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + dictKey: this.dictKey, + itemData: this.sf.value.itemValue + }; + this.service.request(this.service.$api_add_dict, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.modal.close(true); + } + }); + } else { + const params: any = { + ...this.i, + ...this.sf.value + }; + this.service.request(this.service.$api_update_dict, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.modal.close(true); + } + }); + } + } + + configAction() { + if (this.i.id === 0) { + const params: any = { + configFullKey: 'ban.goods.name', + name: this.sf.value.itemValue + }; + this.service.request(this.service.$api_add_config_item, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.modal.close(true); + } + }); + } else { + const params: any = { ...this.sf.value, ...this.i, configFullKey: 'ban.goods.name', name: this.sf.value.itemValue }; + this.service.request(this.service.$api_update_config_item, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.modal.close(true); + } + }); + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.html b/src/app/routes/sys-setting/components/cart-config/cart-config.component.html new file mode 100644 index 00000000..c5cfa144 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.html @@ -0,0 +1,31 @@ + + + + + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.less b/src/app/routes/sys-setting/components/cart-config/cart-config.component.less new file mode 100644 index 00000000..72efc9a9 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + .tabs-wrap>.ant-tabs-nav { + margin-bottom: 0; + } + + h1 { + margin: 0; + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts b/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts new file mode 100644 index 00000000..b7039fb0 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts @@ -0,0 +1,197 @@ +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { CartConfigActionModalComponent } from './cart-config-action-modal/cart-config-action-modal.component'; + +@Component({ + selector: 'app-cart-config', + templateUrl: './cart-config.component.html', + styleUrls: ['./cart-config.component.less'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class CartConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + tabs = [ + { + name: '车型配置', + type: 1, + isActived: false + }, + { + name: '车长配置', + type: 2, + isActived: false + }, + { + name: '禁限物品名单', + type: 3, + isActived: false + } + ]; + tabType = 1; + + searchSchema: SFSchema = { + properties: { + tabType: { + type: 'number', + ui: { + hidden: true + } + }, + params1: { + title: '车型', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 1 + } + } + }, + params2: { + title: '车长', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 2 + } + } + }, + params3: { + title: '物品名称', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 3 + } + } + } + } + }; + + columns: STColumn[] = [ + { title: '车型', index: 'itemValue', iif: () => this.tabType === 1 }, + { title: '车长', index: 'itemValue', iif: () => this.tabType === 2 }, + { title: '物品名称', index: 'name', iif: () => this.tabType === 3 }, + { + title: '启用状态', + className: 'text-center', + iif: () => this.tabType !== 3, + index: 'statePaused', + type: 'badge', + badge: { + false: { text: '启用', color: 'success' }, + true: { text: '禁用', color: 'error' } + } + }, + { + title: '创建时间', + index: 'modifyTime', + type: 'date' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.configAction(item) + }, + { + text: '删除', + click: item => this.deleteAction(item) + } + ] + } + ]; + + loading = true; + constructor(public service: SystemService, private nzModalService: NzModalService, private cdr: ChangeDetectorRef) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + let params = {}; + switch (this.tabType) { + case 1: + Object.assign(params, { dictKey: 'car:model', itemValue: this.sf?.value.params1 }); + break; + case 2: + Object.assign(params, { dictKey: 'car:length', itemValue: this.sf?.value.params2 }); + break; + case 3: + Object.assign(params, { configFullKey: 'ban.goods.name', name: this.sf?.value.params3 }); + break; + + default: + break; + } + Object.assign(requestOptions.body, params); + this.loading = true; + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + this.loading = false; + return data; + }; + + // 切换Tab + changeTab(item: any) { + this.tabType = item.type; + this.sf?.setValue('/tabType', item.type); + this.sf?.reset(); + // this.tabs.forEach(i => (i.isActived = false)); + // item.isActived = !item.isActived; + this.st.load(1); + this.st.resetColumns(); + // this.cdr.detectChanges(); + } + + configAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: CartConfigActionModalComponent, + nzComponentParams: item + ? { i: { ...item, itemValue: item.name }, configType: this.tabType } + : { i: { id: 0 }, configType: this.tabType }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + this.cdr.detectChanges(); + } + }); + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service + .request(this.tabType === 3 ? this.service.$api_remove_config_item : this.service.$api_delete_dict_by_ids, [item.id]) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('删除配置成功'); + this.st.load(1); + } + }); + } + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.html b/src/app/routes/sys-setting/components/close-account/close-account.component.html new file mode 100644 index 00000000..ac4baf2e --- /dev/null +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.html @@ -0,0 +1,66 @@ + + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + +
    +
    + +
    +
    + + +
    + 客户 + 供应商 +
    +
    +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.less b/src/app/routes/sys-setting/components/close-account/close-account.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.ts b/src/app/routes/sys-setting/components/close-account/close-account.component.ts new file mode 100644 index 00000000..0826ae0c --- /dev/null +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.ts @@ -0,0 +1,248 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-close-account', + templateUrl: './close-account.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class CloseAccountComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '结算客户名称', index: 'customerName' }, + { title: '结算客户编码', index: 'customerCode' }, + { title: '网络货运人', index: 'networkTransporterName' }, + { title: '货主名称', index: 'enterpriseName' }, + { title: '客户编码', index: 'crmCustomerCode' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2) + }, + { + text: '删除', + click: item => this.deleteAction(item) + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + }}; + + constructor( + public service: SystemService, + private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, + ) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + customerName: { + type: 'string', + title: '结算客户名称', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '结算客户编码', + ui: { placeholder: '请输入' } + }, + networkTransporterId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + } + }, + enterpriseName: { + type: 'string', + title: '货主名称', + ui: { placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + } } + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + customerName: { + type: 'string', + title: '结算客户名称', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '结算客户编码', + ui: { placeholder: '请输入' } + }, + networkTransporterId: { + title: '网络货运人', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'select', + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + } + }, + enterpriseId: { + title: '货主', + type: 'string', + maxLength: 30, + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str}) + .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + } as SFSelectWidgetSchema, + }, + }, + required: ['customerName', 'customerCode', 'networkTransporterId', 'enterpriseId'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editText = '新增'; + this.formData = {}; + } else { + this.service.request(this.service.$api_settlementCustomer_get, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editText = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_deletebatchButton, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + } + this.service.request(this.service.$api_settlementCustomer_save, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg) + + } + }) + } +} diff --git a/src/app/routes/sys-setting/components/crm-management/crm-management.component.html b/src/app/routes/sys-setting/components/crm-management/crm-management.component.html new file mode 100644 index 00000000..af91a30c --- /dev/null +++ b/src/app/routes/sys-setting/components/crm-management/crm-management.component.html @@ -0,0 +1,52 @@ + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    + 客户 + 供应商 +
    +
    +
    +
    + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/crm-management/crm-management.component.less b/src/app/routes/sys-setting/components/crm-management/crm-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/crm-management/crm-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/crm-management/crm-management.component.ts b/src/app/routes/sys-setting/components/crm-management/crm-management.component.ts new file mode 100644 index 00000000..7202b549 --- /dev/null +++ b/src/app/routes/sys-setting/components/crm-management/crm-management.component.ts @@ -0,0 +1,205 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-crm-management', + templateUrl: './crm-management.component.html', + styleUrls: ['./crm-management.component.less'] +}) +export class CrmManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '客户名称', index: 'customerName' }, + { title: '客户简称', index: 'customerShortName' }, + { title: '客户编码', index: 'customerCode' }, + { + title: '操作', + className: 'text-left', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2), + acl: { ability: ['SYSTEM-CRM-edit'] }, + }, + { + text: '删除', + click: item => this.deleteAction(item), + acl: { ability: ['SYSTEM-CRM-delete'] }, + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + }}; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + customerName: { + type: 'string', + title: '客户名称', + ui: { placeholder: '请输入' } + }, + customerShortName: { + type: 'string', + title: '客户简称', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '客户编码', + ui: { placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value + } } + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 12, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + customerName: { + type: 'string', + title: '客户名称', + ui: { placeholder: '请输入' } + }, + customerShortName: { + type: 'string', + title: '客户简称', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '客户编码', + ui: { placeholder: '请输入' } + }, + }, + required: ['customerName', 'customerShortName', 'customerCode'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editText = '新增'; + this.formData = {}; + } else { + this.service.request(this.service.$api_get_crmCustomer, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editText = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_deletebatch_crmCustomer, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + } + this.service.request(this.service.$api_save_crmCustomer, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg) + + } + }) + } +} diff --git a/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.html b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.html new file mode 100644 index 00000000..db84f3c8 --- /dev/null +++ b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.html @@ -0,0 +1,75 @@ + + + + +
    +
    + + +
    + + +
    + +
      +
    • 编辑
    • +
    • 上移
    • +
    • 下移
    • +
    • 删除
    • +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    +
    + + + + + + +
    + + +
    +
    + +
    + + + +
    +
    + + + +
    +
    +
    + + +
    +
    + + {{selectedType?.name}} + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.less b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.less new file mode 100644 index 00000000..48111074 --- /dev/null +++ b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.less @@ -0,0 +1,11 @@ +:host::ng-deep { + .ant-list-items { + max-height: 600px; + overflow : auto; + } +} + +.select-type { + color : #1890ff; + background-color: rgb(230 247 255); +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.ts b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.ts new file mode 100644 index 00000000..4806f3d7 --- /dev/null +++ b/src/app/routes/sys-setting/components/goods-name-config/goods-name-config.component.ts @@ -0,0 +1,238 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-goods-name-config', + templateUrl: './goods-name-config.component.html', + styleUrls: ['./goods-name-config.component.less'] +}) +export class GoodsNameConfigComponent implements OnInit { + @ViewChild('configTypeModal', { static: true }) + configTypeModal: any; + @ViewChild('configTypeItemModal', { static: true }) + configTypeItemModal: any; + @ViewChild('st', { static: true }) + st!: STComponent; + typeList: any[] = []; + selectedType: any = null; + parentId = null; + + columns: STColumn[] = [ + { title: '货物名称', index: 'name' }, + { title: '更新时间', index: 'modifyTime' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.typeItemAction(item) + }, + { + text: '上移', + click: item => this.sortTypeItem(item, 3) + }, + { + text: '下移', + click: item => this.sortTypeItem(item, 4) + }, + { + text: '删除', + click: item => this.removeTypeItem(item) + } + ] + } + ]; + + configTypeName = ''; + configTypeItemName = ''; + searchName = ''; + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void { + this.getTypeList(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + configId: this.selectedType?.id + }); + if (this.searchName) { + Object.assign(requestOptions.body, { + name: this.searchName + }); + } + return requestOptions; + }; + + keydownEvent(event: any) { + if (event.keyCode === 13) { + this.st.load(1); + } + } + + getTypeList() { + this.service.request(this.service.$api_get_config_tree, { configFullKey: 'goods.name.config' }).subscribe((res: Array) => { + if (res?.length > 0) { + const typeData = res + .find(config => config.configFullKey === 'goods.name.config') + ?.children.find((type: any) => type.configFullKey === 'goods.name.config.type'); + if (typeData) { + this.typeList = typeData.children; + this.parentId = typeData.id; + this.selectedType = typeData.children[0]; + } + } + }); + } + + selectedTypeAction(item: any) { + this.selectedType = item; + this.st.load(1); + } + + /** + * 货物类型操作 + * @param item + */ + typeAction(item?: any) { + this.configTypeName = item?.name || ''; + this.nzModalService.create({ + nzTitle: item ? '编辑' : '新增', + nzContent: this.configTypeModal, + nzOnOk: () => { + if (!this.configTypeName) { + this.service.msgSrv.warning('请填写货物类型'); + return false; + } + if (item) { + this.service.request(this.service.$api_update_config, { ...item, name: this.configTypeName }).subscribe(res => { + if (res) { + this.service.msgSrv.success('更新货物类型成功'); + this.getTypeList(); + } + }); + } else { + this.service.request(this.service.$api_add_config, { name: this.configTypeName, parentId: this.parentId }).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增货物类型成功'); + this.getTypeList(); + } + }); + } + return true; + } + }); + } + + /** + * 货物名称操作 + * @param item + */ + typeItemAction(item?: any) { + this.configTypeItemName = item?.name || ''; + this.nzModalService.create({ + nzTitle: item ? '编辑' : '新增', + nzContent: this.configTypeItemModal, + nzOnOk: () => { + if (!this.configTypeItemName) { + this.service.msgSrv.warning('请填写货物名称'); + return false; + } + if (item) { + this.service.request(this.service.$api_update_config_item, { ...item, name: this.configTypeItemName }).subscribe(res => { + if (res) { + this.service.msgSrv.success('更新货物名称成功'); + this.st.load(1); + } + }); + } else { + this.service + .request(this.service.$api_add_config_item, { + name: this.configTypeItemName, + configId: this.selectedType.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('新增货物名称成功'); + this.st.load(1); + } + }); + } + return true; + } + }); + } + + /** + * 删除货物类型 + * @param item + */ + removeType(item: any) { + this.nzModalService.warning({ + nzTitle: '确定删除该货物类型吗?', + nzContent: '分类下含有内容则无法删除,请确认', + nzOnOk: () => { + this.service.request(this.service.$api_remove_config, [item.id]).subscribe(res => { + if (res) { + this.getTypeList(); + this.service.msgSrv.success('删除货物类型成功'); + } + }); + } + }); + } + + /** + * 删除货物名称 + * @param item + */ + removeTypeItem(item: any) { + this.nzModalService.warning({ + nzTitle: '确定删除该货物名称吗?', + nzContent: '删除后不可恢复,谨慎操作', + nzOnOk: () => { + this.service.request(this.service.$api_remove_config_item, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除货物名称成功'); + this.st.load(1); + } + }); + } + }); + } + + /** + * 修改类型排序 + * @param item + * @param sortMode + */ + sortType(item: any, sortMode: 1 | 2 | 3 | 4) { + this.service.request(this.service.$api_update_config_sort, { id: item.id, sortMode }).subscribe(res => { + if (res) { + this.service.msgSrv.success('更新排序成功'); + this.getTypeList(); + } else { + this.service.msgSrv.warning('更新排序失败'); + } + }); + } + + /** + * 修改类型详情排序 + * @param item + * @param sortMode + */ + sortTypeItem(item: any, sortMode: 1 | 2 | 3 | 4) { + this.service.request(this.service.$api_update_config_item_sort, { id: item.id, sortMode }).subscribe(res => { + if (res) { + this.service.msgSrv.success('更新排序成功'); + this.st.load(1); + } else { + this.service.msgSrv.warning('更新排序失败'); + } + }); + } +} diff --git a/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.html b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.html new file mode 100644 index 00000000..0d85c142 --- /dev/null +++ b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.html @@ -0,0 +1,66 @@ + + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    + 客户 + 供应商 +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.less b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.ts b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.ts new file mode 100644 index 00000000..56d71921 --- /dev/null +++ b/src/app/routes/sys-setting/components/insurance-set/insurance-set.component.ts @@ -0,0 +1,253 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { EAEnvironmentService, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-sys-setting-components-insurance-set', + templateUrl: './insurance-set.component.html', + styleUrls: ['./insurance-set.component.less'] +}) +export class InsuranceSetComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData :any; + isVisible = false; + edit = false; + editId = false; + + columns: STColumn[] = [ + { title: '公告标题', index: 'announcementTitle' }, + { title: '创建时间', index: 'createTime' }, + { title: '发送时间', index: 'sendTime' }, + { title: '公告内容', index: 'announcementContent' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item, 2) + }, + { + text: '删除', + click: item => this.deleteAction(item) + }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams (){ + return { + ...this.sf?.value, + }}; + + constructor( + public service: SystemService, + private nzModalService: NzModalService, + public shipperservice: ShipperBaseService, + private envSrv: EAEnvironmentService, + ) {} + + ngOnInit(): void { + this.initSF() + this.initSFFre() + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF(){ + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + announcementTitle: { + type: 'string', + title: '按钮名称', + ui: { placeholder: '请输入' } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + } as SFDateWidgetSchema + }, + } + + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + appIdList: { + type: 'string', + title: '发布平台', + enum: [ + { label: '运营后台', value: this.envSrv.env.appId }, + // { label: '货主后台', value: this.envSrv.env.HzappId }, + // { label: '司机端', value: this.envSrv.env.sjappId } + ], + ui: { + widget: 'select', + mode: 'multiple', + errors: { required: '请选择' }, + placeholder: '请选择' + } + }, + announcementTitle: { + type: 'string', + title: '公告标题', + ui: { placeholder: '请输入' } + }, + announcementContent: { + type: 'string', + title: '公告内容', + ui: { placeholder: '请输入' } + }, + sendTime: { + title: '发送时间', + type: 'string', + format: 'date-time', + ui: { + allowClear: true, + } + }, + }, + required: ['name', 'i18n', 'text'] + }; +this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; +} + roleAction(value: any,item?: any) { + if(item === 1) { + this.edit = false; + this.editText = '新增'; + this.formData = {}; + } else { + this.service.request(this.service.$api_getAnnouncementInfoById_detail, {id: value.id}).subscribe((res: any) => { + console.log(res) + if(res) { + this.formData = res; + } + }) + this.edit = true; + this.editId = value.id; + this.editText = '编辑'; + } + this.isVisible = true; + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_delete_deleteAnnouncementInfoById, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功!'); + this.st.reload(1) + } + }) + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + handleCancel() { + this.isVisible = false + } + + handleOK() { + console.log(this.sfFre.value) + if(!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!') + return + } + var c = new Date(this.sfFre.value.sendTime); + this.sfFre.value.sendTime = + c.getFullYear() + + '-' + + this.addPreZero(c.getMonth() + 1) + + '-' + + this.addPreZero(c.getDate()) + + ' ' + + this.addPreZero(c.getHours()) + + ':' + + this.addPreZero(c.getMinutes()) + + ':' + + this.addPreZero(c.getSeconds()); + const params ={ + ...this.sfFre.value + } + if(this.editId) { + params.id = this.editId + console.log(params) + this.service.request(this.service.$api_modifyAnnouncementInfo, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } + }) + } else { + this.service.request(this.service.$api_addAnnouncementInfo, params).subscribe((res:any) => { + if(res) { + this.service.msgSrv.success('保存成功!') + this.isVisible = false + this.st.reload(); + } + } + )} +} + addPreZero(num: any) { + if (num < 10) { + return '0' + num; + } else { + return num; + } + } +} diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html new file mode 100644 index 00000000..50da782f --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html @@ -0,0 +1,132 @@ + + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + +
    + +
    + + +
    {{ item?.costRate ? item?.costRate + '%' : '' }}
    +
    + +
    货源单:{{ item?.goodsSurchargeRatio ? item?.goodsSurchargeRatio + '%' : '' }}
    +
    合同单:{{ item?.contractSurchargeRatio ? item?.contractSurchargeRatio + '%' : '' }}
    +
    + +
    {{ item?.ticketEnable ? '已开启' : '未开启' }}
    +
    + +
    {{ item?.insuranceEnable ? '已开启' : '未开启' }}
    +
    + +
    {{ item?.pinganEnable ? '已开启' : '未开启' }}
    +
    + +
    {{ item?.pufaEnable ? '已开启' : '未开启' }}
    +
    + + {{ item?.pinganAccount || '开通子账户' }} + + + {{ item?.pufaAccount || '开通子账户' }} + + +
    {{ item?.invoiceEnable ? '已开启' : '未开启' }}
    +
    + + 开通子账户 + + + 开通子账户 + +
    +
    + + + + + +
    +
    +
      +
    • + {{ item.name }} +
    • +
    +
    +
    + + + + + +
    +
    +
    + + + + +
    diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.less b/src/app/routes/sys-setting/components/network-freight/network-freight.component.less new file mode 100644 index 00000000..efdf7dd2 --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.less @@ -0,0 +1,31 @@ +:host { + ::ng-deep { + .card-height { + min-height: 600px; + } + + .save-btn { + width : 100%; + text-align: right; + } + + .block-radio { + display : flex; + min-height: 32px; + } + + // input { + // width : 100px; + // margin-left: 10px; + // } + + .ant-form-item-control-input-content { + display: flex; + } + + .text-truncate { + white-space: normal; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts new file mode 100644 index 00000000..72ec17f0 --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts @@ -0,0 +1,706 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { + SFCascaderWidgetSchema, + SFComponent, + SFRadioWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFUISchema +} from '@delon/form'; +import { DynamicSettingModalComponent, SinglepageSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map, takeLast } from 'rxjs/operators'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-network-freight-component', + templateUrl: './network-freight.component.html', + styleUrls: ['./network-freight.component.less'] +}) +export class NetworkFreightComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sfFre', { static: false }) sfFre!: SFComponent; + @ViewChild('sfTicket', { static: false }) sfTicket!: SFComponent; + @ViewChild('sfTax', { static: false }) sfTax!: SFComponent; + @ViewChild('sfNC', { static: false }) sfNC!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + ui3: SFUISchema = {}; + ui4: SFUISchema = {}; + ui5: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + ticketSchema: SFSchema = {}; + TaxSchema: SFSchema = {}; + NCSchema: SFSchema = {}; + _$expand: boolean = false; + taxStatus: boolean = false; + TicketStatus: boolean = true; + NCStatus: boolean = false; + formData: any; + ticketId: any; + ticketItem: any; + formDataTicket: any; + formDataNC: any; + formDataTax: any; + NCID: string = ''; + isVisible = false; + isVisibleTicket = false; + edit = false; + editId = false; + isLoading: boolean = false; + tabs: any[] = [{ name: '开票设置' }, { name: '税务设置' }, { name: 'NC设置' }]; + + columns: STColumn[] = [ + { + title: '公司名称', + width: '180px', + index: 'enterpriseName' + }, + { + title: '纳税人识别号', + width: '180px', + + index: 'taxCode' + }, + { + title: '成立日期', + width: '150px', + index: 'enterpriseRegistrationTime' + }, + { + title: '成本费率', + width: '150px', + render: 'costRate' + }, + { + title: '附加费率', + width: '150px', + render: 'goodsSurchargeRatio' + }, + { + title: '云开票', + width: '150px', + render: 'ticketEnable' + }, + { + title: '保险', + width: '150px', + render: 'insuranceEnable' + }, + { + title: '平安银行', + width: '150px', + render: 'pinganEnable' + }, + { + title: '浦发银行', + width: '150px', + render: 'pufaEnable' + }, + { + title: '平安电子账户', + width: '170px', + render: 'pinganAccountEnable' + }, + { + title: '浦发电子账户', + width: '170px', + render: 'pufaAccountEnable' + }, + { + title: '开票开关', + width: '150px', + render: 'invoiceEnable' + }, + { + title: '操作', + width: '110px', + fixed: 'right', + className: 'text-center', + buttons: [ + { type: 'divider' }, + { + text: '基础设置
    ', + click: item => this.creat(item) + }, + { + text: '财务设置
    ', + click: item => this.ticket(item) + }, + { + text: '充值账户
    ', + click: item => this.settingPay(item) + }, + { + text: '应用设置
    ', + click: item => this.settingApp(item) + }, + + { + text: '系统配置
    ', + click: item => this.settingAction(item) + }, + // { + // text: '合同设置', + // click: item => this.roleAction(item, 2) + // }, + ] + } + ]; + + selectedRows: any[] = []; + + get reqParams() { + return { + ...this.sf?.value + }; + } + + constructor(public service: SystemService, private nzModalService: NzModalService, private router: Router, private ar: ActivatedRoute) {} + + ngOnInit(): void { + this.initSF(); + this.initSFFre(); + // this.initSFTicket(); + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + type: 'string', + title: '公司名称', + ui: { placeholder: '请输入' } + }, + taxCode: { + type: 'string', + title: '纳税人识别号', + ui: { placeholder: '请输入' } + } + } + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + initSFTicket() { + this.ticketSchema = { + properties: { + enterpriseName1: { + type: 'string', + title: '公司名称', + ui: { + widget: 'text' + }, + default: this.ticketItem?.enterpriseName + }, + taxCode2: { + type: 'string', + title: '纳税人识别号', + ui: { + widget: 'text' + }, + default: this.ticketItem?.taxCode + }, + bankName: { + type: 'string', + title: '开户银行', + ui: { placeholder: '请输入' } + }, + bankAccount: { + type: 'string', + title: '银行账号', + ui: { placeholder: '请输入' } + }, + registerAddress: { + type: 'string', + title: '注册地址', + ui: { placeholder: '请输入' } + }, + registerPhone: { + type: 'string', + title: '注册电话', + ui: { placeholder: '请输入' } + }, + taxClassificationVersion: { + type: 'string', + title: '税收分类版本号', + ui: { placeholder: '请输入' } + }, + taxClassificationCode: { + type: 'string', + title: '税收分类编码', + ui: { placeholder: '请输入' } + }, + invoiceTaxRate: { + type: 'number', + title: '发票税率', + ui: { placeholder: '请输入' } + }, + invoiceMaxAmount: { + type: 'number', + title: '发票面额上限', + ui: { placeholder: '请输入' } + }, + payee: { + type: 'string', + title: '收款人', + ui: { placeholder: '请输入' } + }, + reviewer: { + type: 'string', + title: '复核人', + ui: { placeholder: '请输入' } + }, + drawer: { + type: 'string', + title: '开票人', + ui: { placeholder: '请输入' } + }, + senderName: { + type: 'string', + title: '寄件人姓名', + ui: { placeholder: '请输入' } + }, + senderPhone: { + type: 'string', + title: '寄件人电话', + ui: { placeholder: '请输入' } + }, + senderRegionCode: { + type: 'number', + title: '寄件地区', + ui: { + widget: 'cascader', + valueProperty: 'regionCode', + labelProperty: 'name', + asyncData: (node: any, index: any) => { + return new Promise(resolve => { + this.getRegionDetailByCode(node?.regionCode || '').subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 })); + }, + _ => {}, + () => { + resolve(); + } + ); + }); + } + } as SFCascaderWidgetSchema + }, + senderAddress: { + type: 'string', + title: '详细地址', + ui: { placeholder: '请输入' } + } + }, + required: [ + 'enterpriseName', + 'taxCode', + 'bankName', + 'bankAccount', + 'registerAddress', + 'registerPhone', + 'senderName', + 'senderRegionCode', + 'senderPhone', + 'senderAddress', + 'taxClassificationVersion', + 'taxClassificationCode', + 'invoiceTaxRate', + 'invoiceMaxAmount', + 'payee', + 'reviewer', + 'drawer' + ] + }; + this.ui3 = { + '*': { spanLabelFixed: 150, grid: { span: 24 } }, + $taxClassificationVersion: { spanLabelFixed: 150, grid: { span: 24 } } + }; + } + initSFTax() { + this.TaxSchema = { + properties: { + enterpriseName1: { + type: 'string', + title: '公司名称', + ui: { + widget: 'text' + }, + default: this.ticketItem?.enterpriseName + } + }, + required: ['enterpriseName'] + }; + this.ui4 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + } + initSFNC() { + this.NCSchema = { + properties: { + crmCustomerId: { + type: 'string', + title: 'CRM客户编码', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + console.log(str); + + return this.service + .request(this.service.$api_get_crmCustomer_page, { customerName: str }) + .pipe(map((res: any) => (res.records as any[]).map(i => ({ label: i.customerName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + } + } as SFSelectWidgetSchema + } + }, + required: ['crmCustomerId'] + }; + this.ui5 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + } + initSFFre() { + this.addSchema = { + properties: { + enterpriseName: { + type: 'string', + title: '公司名称', + ui: { placeholder: '请输入' } + }, + taxCode: { + type: 'string', + title: '纳税人识别号', + ui: { placeholder: '请输入' } + }, + customerCode: { + type: 'string', + title: '税收分类编码', + ui: { placeholder: '请输入' } + }, + invoiceTaxRate: { + type: 'number', + title: '发票税率', + ui: { placeholder: '请输入' } + }, + surchargeRate: { + type: 'string', + title: '附加费比例', + ui: { placeholder: '请输入' } + } + }, + required: ['enterpriseName', 'taxCode', 'customerType', 'invoiceTaxRate', 'surchargeRate'] + }; + this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + } + roleAction(value: any, item?: any) { + this.service.request(this.service.$api_get_crmCustomer, { id: value.id }).subscribe((res: any) => { + console.log(res); + if (res) { + this.formData = res; + } + }); + this.edit = true; + this.editId = value.id; + this.isVisible = true; + } + // 财务设置 + ticket(value: any) { + this.formDataTicket = []; + this.formDataNC = []; + this.formDataTax = []; + this.ticketItem = value; + this.taxStatus = false; + this.TicketStatus = true; + this.NCStatus = false; + this.initSFTax(); + this.initSFNC(); + this.initSFTicket(); + this.NCID = value.id; + if (this.TicketStatus) { + console.log('9999999'); + + this.service.request(this.service.$api_getTicketByNetworkTransporterId, { id: value.id }).subscribe((res: any) => { + console.log(res); + if (res) { + let List = { + ...res + }; + delete List.senderRegionCode; + (List.senderRegionCode = this.getProvinceData(res?.senderRegionCode)), (this.formDataTicket = List); + this.ticketId = res.id; + } + }); + } + if (this.NCStatus) { + this.getNcSetData(); + } + this.isVisibleTicket = true; + } + getNcSetData() { + const List: any = []; + console.log(99999); + this.service.request(this.service.$api_get_crmCustomer, { id: this.ticketItem.crmCustomerId }).subscribe((res: any) => { + console.log(res); + if (res) { + List.push({ label: res.customerName, value: res.id }); + console.log(List); + + this.sfNC.getProperty('/crmCustomerId')!.schema.enum = List; + this.sfNC.getProperty('/crmCustomerId')!.widget.reset(List); + this.sfNC.setValue('/crmCustomerId', res?.id); + } + }); + } + getProvinceData(value: any) { + this.service.http.post(this.service.$api_getRegionDetailByCode, { regionCode: value }).subscribe(res => { + let enterpriseAddressCode: any = []; + let regioin = res?.data?.regionFullCodes.split(','); + regioin?.forEach((element: any) => { + enterpriseAddressCode.push(Number(element)); + }); + if (this.TicketStatus) { + this.sfTicket.setValue('/senderRegionCode', enterpriseAddressCode); + return enterpriseAddressCode; + } + }); + } + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + // 基础设置 + settingAction(item?: any) { + this.nzModalService.create({ + nzTitle: '系统配置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '1', + businessId: item.id + }, + nzFooter: null + }); + } + // 应用设置 + settingApp(item?: any) { + const modalRef = this.nzModalService.create({ + nzTitle: '应用设置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '1', + businessId: item.id, + configvalue: 'app' + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: boolean) => { + if (res) { + this.resetSF; + this.st.load(); + } + }) + } + // 重置账户 + settingPay(item?: any) { + this.nzModalService.create({ + nzTitle: '充值账户', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '1', + businessId: item.id, + configvalue: 'bankcard' + }, + nzFooter: null + }); + } + + createAccount(item: any, bankType: string, key: string) { + if (item[key]) { + return; + } + const params = { + accountType: 3, + bankType, + clientName: item.enterpriseName, + ctfId: item.taxCode, + ltdId: item.id, + roleId: item.id, + roleName: item.enterpriseName + }; + this.service + .request('/api/fcc/accountBalance/saveByLtd', { + ...params + }) + .subscribe(res => { + if (res) { + this.st.load(1); + this.service.msgSrv.success(bankType === '1' ? res?.paMsg : res?.pfMsg); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.isLoading = false + } + handleCancel() { + this.isVisible = false; + } + handleCancelTicket() { + this.isVisibleTicket = false; + } + handleOKTicket() { + console.log(this.taxStatus, this.TicketStatus, this.NCStatus); + if (this.TicketStatus) { + console.log(this.sfTicket); + console.log(this.sfTicket.value); + + if (!this.sfTicket.valid) { + this.service.msgSrv.warning('请正确填写完整!'); + return; + } + const params = { + ...this.sfTicket.value + }; + if (this.ticketId) { + params.id = this.ticketId; + } + params.senderRegionCode = this.sfTicket.value.senderRegionCode[2]; + console.log(params); + this.service.request(this.service.$api_networkTransporterTicket_save, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.isVisibleTicket = false; + this.st.reload(1); + } + }); + } else if (this.NCStatus) { + console.log(this.sfNC); + console.log(this.formDataNC); + console.log(this.sfNC?.value); + + if (!this.sfNC.valid) { + this.service.msgSrv.warning('请正确填写完整!'); + return; + } + const params = { + ...this.sfNC.value + }; + if (this.NCID) { + params.id = this.NCID; + } + console.log(params); + this.service.request(this.service.$api_setCrmCustomer, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.isVisibleTicket = false; + this.st.reload(1); + } + }); + // api_setCrmCustomer + } + } + + handleOK() { + console.log(this.sfFre.value); + if (!this.sfFre.valid) { + this.service.msgSrv.warning('请正确填写完整!'); + return; + } + const params = { + ...this.sfFre.value + }; + if (this.editId) { + params.id = this.editId; + } + this.service.request(this.service.$api_save_crmCustomer, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.isVisible = false; + this.st.reload(); + } else { + this.service.msgSrv.warning(res?.msg); + } + }); + } + // 云开票 + setMakeInvoice() {} + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + changeType(value: any) { + if (value.name === '税务设置') { + this.taxStatus = true; + this.TicketStatus = false; + this.NCStatus = false; + } else if (value.name === '开票设置') { + this.TicketStatus = true; + this.NCStatus = false; + this.taxStatus = false; + } else if (value.name === 'NC设置') { + this.getNcSetData(); + this.NCStatus = true; + this.TicketStatus = false; + this.taxStatus = false; + } + } + // 新增 + creat(value?: any) { + console.log(value); + this.router.navigate(['./new/' + value?.id], { relativeTo: this.ar }); + } +} diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.html b/src/app/routes/sys-setting/components/network-freight/new/new.component.html new file mode 100644 index 00000000..6b065ba9 --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.html @@ -0,0 +1,76 @@ + + + + + +
    +
    +
    正面照
    +
    示例
    +
    +
    +
    +
    + +
    企业基本信息
    +
    + +
    + 请上传营业执照原件的高清照片,若上传复印件,则需加盖公司印章; +
    上传后系统会自动识别并填写
    +
    +
    + +
    万元
    +
    + + +
    营业执照法人信息
    +
    + + +
    +
    请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
    +
    上传后系统会自动识别并填写
    +
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    +
    + + + +
    其他信息
    +
    +
    + +
    + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.less b/src/app/routes/sys-setting/components/network-freight/new/new.component.less new file mode 100644 index 00000000..b1eab8b6 --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.less @@ -0,0 +1,71 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + .pa { + position: absolute; + top : 50px; + left : 150px; + } + .pa2 { + position: absolute; + top: 28px; + left: 180px; + } + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts new file mode 100644 index 00000000..f5b4d4bf --- /dev/null +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts @@ -0,0 +1,632 @@ +import { query } from '@angular/animations'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { + SFCascaderWidgetSchema, + SFCheckboxWidgetSchema, + SFComponent, + SFDateWidgetSchema, + SFSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of } from 'rxjs'; +import { SystemService } from '../../../services/system.service'; + + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-network-freight-new-component', + templateUrl: './new.component.html', + styleUrls: ['./new.component.less'] +}) +export class NetworkFreightNewComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('sf1', { static: false }) + sf1!: SFComponent; + sf1FormData: any = { + legalPersonIdentityVO: { + certificatePhotoFrontWatermark: '', + certificatePhotoBackWatermark: '', + }, + };; + subText = '确认新增' + TabText = '新增网络货运人' + sf2FormData: any = {}; + schema: SFSchema = this.initOthersSF(); + schema1: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $title1: { + spanLabelFixed: 0 + }, + $title99: { + spanLabelFixed: 0 + }, + $title2: { + spanLabelFixed: 0 + }, + $registrationCapital: { + spanLabelFixed: 180, + grid: { xxl: 13, xl: 18, lg: 22, md: 22 } + }, + $unit: { + grid: { xxl: 6, xl: 6, lg: 2, md: 2 } + }, + $isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + constructor(private router: Router, public service: SystemService, private route: ActivatedRoute) {} + ngOnInit() { + if(this.route.snapshot.params.id !== 'undefined') { + this.dataListInit(this.route.snapshot.params.id) + this.subText = '确认编辑' + this.TabText = '编辑网络货运人' + } + } + dataListInit(id: any) { + this.service.request(this.service.$api_get_networkTransporter_getDetail,{id: id}).subscribe((res) => { + console.log(res); + this.sf2FormData = res + this.sf1FormData = res.enterpriseInfoVO + this.sf1FormData.isLoingDate = this.sf1FormData.operatingEndTime !== null ? false : true; + this.sf1FormData.licensePhotoWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.sf1FormData.licensePhotoWatermark, + response: this.sf1FormData.licensePhotoWatermark + }, + ]; + console.log(this.sf1FormData); + // 营业执照法人信息 + + this.sf1FormData.legalPersonIdentityVO.certificatePhotoFrontWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: res.enterpriseInfoVO.legalPersonIdentityVO.certificatePhotoFrontWatermark, + response: res.enterpriseInfoVO.legalPersonIdentityVO.certificatePhotoFrontWatermark + }, + ]; + this.sf1FormData.legalPersonIdentityVO.certificatePhotoBackWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.sf1FormData.legalPersonIdentityVO.certificatePhotoBackWatermark, + response: this.sf1FormData.legalPersonIdentityVO.certificatePhotoBackWatermark, + }, + ]; + const province = this.sf1FormData.fullRegionVO.provinceCode + const city = this.sf1FormData.fullRegionVO.cityCode + const area = this.sf1FormData.fullRegionVO.areaCode + this.sf1FormData.enterpriseAddressCode = [parseInt(province), parseInt(city), parseInt(area)]; + this.getRegionToThree(); + }) + } + getRegionToThree() { + // 获取一、二、三级地区详情 + this.service.http.post(this.service.$api_getRegionToThree).subscribe((res) => { + if(this.sf1){ + this.sf1.getProperty('/enterpriseAddressCode')!.schema.enum = res.data; + this.sf1?.getProperty('/enterpriseAddressCode')?.widget.reset(res.data); + } + }); + } + submitForm() { + if (!this.sf1.valid || !this.sf.valid) { + this.sf.validator({ emitError: true }); + this.sf1.validator({ emitError: true }); + this.service.msgSrv.warning('请填写必填项!'); + return; + } + const enterpriseRegistrationTime = new Date(this.sf1.value.enterpriseRegistrationTime); + const operatingStartTime = new Date(this.sf1.value.operatingStartTime); + if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) { + this.service.msgSrv.warning('营业期限不能小于成立日期'); + return; + } + if (this.sf1.value.operatingEndTime) { + const operatingEndTime = new Date(this.sf1.value.operatingEndTime); + if (operatingStartTime.getTime() > operatingEndTime.getTime()) { + this.service.msgSrv.warning('营业期限不能小于期限开始日期'); + return; + } + } + if (this.sf1.value.isLoingDate) { + this.sf1.value.operatingEndTime = ''; + } + console.log(this.sf1.value) + console.log(this.sf1.valid) + console.log(this.sf.value) + console.log(this.sf.valid) + const sfVlaue = this.sf1.value; + const params: any = {}; + Object.assign( + params, + { + ...this.sf.value , + enterpriseInfoDTO: { + ...this.sf1.value, + legalPersonIdentityDTO: this.sf1.value.legalPersonIdentityVO + } + } + ); + delete params.enterpriseInfoDTO.legalPersonIdentityVO + console.log(params); + params.enterpriseInfoDTO.enterpriseAddressCode = this.sf1.value?.enterpriseAddressCode?.[2]; + if(this.route.snapshot.params.id !== 'undefined') { + params.id = this.route.snapshot.params.id + } + this.service.request(this.service.$api_networkTransporter_save, params).subscribe(res => { + if (res) { + if(this.route.snapshot.params.id !== 'undefined') { + this.service.msgSrv.success('修改成功'); + } else { + this.service.msgSrv.success('新增成功'); + } + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf1.setValue('/legalPersonIdentityVO/name', res.name); + } + if (res.number) { + this.sf1.setValue('/legalPersonIdentityVO/certificateType', 0); + this.sf1.setValue('/legalPersonIdentityVO/certificateNumber', res.number); + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/name', res.name); + } + if (res.number) { + this.sf.setValue('/certificateNumber', res.number); + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + console.log('触发了识别'); + + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + if (res.registrationNumber) { + this.sf1.setValue('/unifiedSocialCreditCode', res.registrationNumber); + } + if (res.name) { + this.sf1.setValue('/enterpriseName', res.name); + } + if (res.addressRegionCodes) { + this.sf1.setValue('/enterpriseAddressCode', res.addressRegionCodes); + } + if (res.address) { + this.sf1.setValue('/enterpriseAddress', res.address); + } + if (res.registeredCapital) { + this.sf1.setValue('/registrationCapital', res.registeredCapital); + } + if (res.foundDate) { + this.sf1.setValue('/enterpriseRegistrationTime', res.foundDate); + } + if (res.businessTermStartDate) { + this.sf1.setValue('/operatingStartTime', res.businessTermStartDate); + } + if (res.businessTermEndDate) { + this.sf1.setValue('/operatingEndTime', res.businessTermEndDate); + } else { + this.sf1.setValue('/isLoingDate', true); + } + if (res.businessScope) { + this.sf1.setValue('/businessScope', res.businessScope); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + title1: { title: '', type: 'string', ui: { widget: 'custom' } }, + tips: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + licensePhoto: { title: '', type: 'string', ui: { hidden: true } }, + tipsS: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + licensePhotoWatermark: { + type: 'string', + title: '营业执照', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); + this.checkBusinessLicense(args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + + enterpriseName: { + title: '公司名称', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入公司名称', + errors: { + required: '请输入公司名称' + } + } + }, + unifiedSocialCreditCode: { + title: '统一社会信用代码', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + optionalHelp: + '为了企业用户的使用体验,若公司代码即统一社会信用代码已在本应用其他关联平台注册,则此处填写的公司资料将同步更新至对应已注册的平台', + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入18位公司代码' + } + } + }, + certificateType2: { + type: 'string', + title: '行业', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select' + } + }, + enterpriseAddressCode: { + type: 'number', + title: '营业执照所在地', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'cascader', + valueProperty: 'regionCode', + labelProperty: 'name', + asyncData: (node: any, index: any) => { + return new Promise(resolve => { + this.getRegionDetailByCode(node?.regionCode || '').subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 })); + }, + _ => {}, + () => { + resolve(); + } + ); + }); + } + } as SFCascaderWidgetSchema + }, + enterpriseAddress: { + title: '营业执照详细地址', + type: 'string', + minLength: 1, + maxLength: 240, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'textarea', + autosize: { minRows: 2, maxRows: 5 }, + placeholder: '请输入营业执照上的完整详细地址', + errors: { + required: '请输入营业执照上的完整详细地址' + } + } as SFTextareaWidgetSchema + }, + registrationCapital: { + title: '注册资本', + type: 'number', + minimum: 1, + maximum: 99999999999999999999, + ui: { + grid: { xxl: 13, xl: 18, lg: 22, md: 22 }, + placeholder: '请输入营业执照上的注册资本', + errors: { + required: '请输入营业执照上的注册资本' + }, + precision: 0 + } + }, + staffNumber: { + title: '从业人数', + type: 'number', + minimum: 1, + maximum: 99999999999999999999, + ui: { + grid: { xxl: 13, xl: 18, lg: 22, md: 22 }, + placeholder: '请输入从业人数', + errors: { + required: '请输入从业人数' + }, + precision: 0 + } + }, + enterpriseRegistrationTime: { + title: '成立日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + + operatingStartTime: { + title: '营业期限', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + operatingEndTime: { + title: '', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf1?.setValue('/isLoingDate', false); + setTimeout(() => { + console.log(this.sf1.value); + }, 1000); + } + } as SFDateWidgetSchema + }, + isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + class: 'input-back', + widget: 'checkbox', + change: i => this.sf1?.setValue('/operatingEndTime', null) + } as SFCheckboxWidgetSchema + }, + businessScope: { + title: '经营范围', + type: 'string', + minLength: 1, + maxLength: 500, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'textarea', + autosize: { minRows: 3, maxRows: 5 }, + placeholder: '请输入营业执照上的营经营范围', + errors: { + required: '请输入营业执照上的营经营范围' + } + } as SFTextareaWidgetSchema + }, + taxAuthority: { + title: '税务机关', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的税务机关', + errors: { + required: '请输入营业执照上的税务机关' + } + } + }, + taxStatus: { + title: '纳税状态', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入纳税状态', + errors: { + required: '请输入纳税状态' + } + } + }, + + legalPersonIdentityVO: { + type: 'object', + properties: { + title2: { title: '', type: 'string', ui: { widget: 'custom' } }, + tipsC: { title: '法定代表人证件照', type: 'string', ui: { widget: 'custom' } }, + tipsA: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/legalPersonIdentityVO/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1); + } + } + } as SFUploadWidgetSchema + }, + tipsB: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/legalPersonIdentityVO/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '法人姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法人姓名' + } + }, + certificateType: { + type: 'string', + title: '法人证件类型', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select' + } + }, + certificateNumber: { + title: ' 法定代表人证件号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法定代表人证件号' + } + } + }, + required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber','certificatePhotoFrontWatermark','certificatePhotoBackWatermark'] + } + }, + required: [ + 'licensePhotoWatermark', + 'unifiedSocialCreditCode', + 'enterpriseName', + 'enterpriseAddressCode', + 'enterpriseAddress', + 'registrationCapital', + 'enterpriseRegistrationTime', + 'operatingStartTime', + 'businessScope', + 'taxStatus', + 'staffNumber', + 'taxAuthority' + ] + }; + } + + private initOthersSF(): SFSchema { + return { + properties: { + title99: { title: '', type: 'string', ui: { widget: 'custom' } }, + website: { + title: '平台网址', + type: 'string', + maxLength: 70, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入平台网址' + } + }, + costRate: { + title: '成本费率', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入成本费率' + } + } + }, + required: ['website', 'costRate'] + }; + } +} diff --git a/src/app/routes/sys-setting/components/note-management/note-management.component.html b/src/app/routes/sys-setting/components/note-management/note-management.component.html new file mode 100644 index 00000000..edaddc44 --- /dev/null +++ b/src/app/routes/sys-setting/components/note-management/note-management.component.html @@ -0,0 +1,29 @@ + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/note-management/note-management.component.less b/src/app/routes/sys-setting/components/note-management/note-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/note-management/note-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/note-management/note-management.component.ts b/src/app/routes/sys-setting/components/note-management/note-management.component.ts new file mode 100644 index 00000000..f93705dc --- /dev/null +++ b/src/app/routes/sys-setting/components/note-management/note-management.component.ts @@ -0,0 +1,75 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-09 14:05:33 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-09 15:18:38 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\note-management\\note-management.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-note-management', + templateUrl: './note-management.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class NoTeManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + cellphone: { + type: 'string', + title: '手机号', + maxLength: 11, + ui: { placeholder: '请输入' } + } + } + }; + + columns: STColumn[] = [ + { title: '手机号', className: 'text-center', index: 'cellphone' }, + { + title: '发送时间', + index: 'createTime', + type: 'date', + className: 'text-center' + }, + { title: '短信内容', className: 'text-center', index: 'content', + // format: (value) => { + // return JSON.parse(value?.templateParam)?.code + // } + }, + ]; + + constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) { + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + return requestOptions; + }; + + + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/role-management/edit/edit.component.html b/src/app/routes/sys-setting/components/role-management/edit/edit.component.html new file mode 100644 index 00000000..8291cad4 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/edit/edit.component.html @@ -0,0 +1,23 @@ + + +
    + +
    +
    + + + + + + +
    + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts b/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts new file mode 100644 index 00000000..95aba48d --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts @@ -0,0 +1,119 @@ +import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { delay, map } from 'rxjs/operators'; +import { SystemService } from '../../../services/system.service'; +import { SettingMenuComponent } from '../menu/menu.component'; + +@Component({ + selector: 'app-cuc-edit', + templateUrl: './edit.component.html', + styleUrls: ['./edit.less'] +}) +export class SettingRoleEditComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('menu', { static: false }) + menu!: SettingMenuComponent; + roleInfoData: any = {}; + authorityAssistId: any[] = []; + params: any; + schema!: SFSchema; + authority: any[] = []; + constructor(private modal: NzModalRef, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(); + if (this.params.id) { + this.getRoleInfo(); + } + } + initSF() { + this.schema = { + properties: { + roleName: { + title: '角色名称', + type: 'string', + default: this.roleInfoData.roleName, + maxLength: 20, + ui: { + placeholder: '请输入角色名称' + } + }, + roleDescription: { + title: '角色描述', + type: 'string', + maxLength: 50, + default: this.roleInfoData.roleDescription, + ui: { + autosize: { minRows: 3 }, + hidden: this.params.lookType === 'detail', + placeholder: '请输入角色描述', + widget: 'textarea' + } + } + }, + required: ['roleName'] + }; + } + + getRoleInfo() { + const params = { + id: this.params.id + }; + this.service.request(this.params.infoUrl, params).subscribe(res => { + if (res) { + this.roleInfoData = res; + this.initSF(); + } + }); + } + getData(res: { authority: any[]; authorityAssistId: any[] }) { + this.authority = res.authority; + this.authorityAssistId = res.authorityAssistId; + } + close() { + this.modal.destroy(); + } + sure() { + if (!this.sf?.valid) { + this.service.msgSrv.warning('角色名称不能为空'); + return; + } + const auths = this.menu?.washTree(); + if (auths.authorityAssistId.length === 0) { + this.service.msgSrv.warning('请选择权限!'); + return; + } + const params: any = { + id: this.params.id, + ...this.sf.value, + authority: auths.authority, + authorityAssistId: auths.authorityAssistId + }; + if (this.params.id === 0) { + delete params.id; + } + if (this.params?.type === 'freight') { + Object.assign(params, { enterpriseId: 0, enterpriseProjectId: 0 }); + } + if (this.params.id) { + this.service.request(this.params.updateUrl, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('编辑成功'); + this.modal.close(true); + } + }); + } else { + this.service.request(this.params.addUrl, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('新增成功'); + this.modal.close(true); + } + }); + } + } +} diff --git a/src/app/routes/sys-setting/components/role-management/edit/edit.less b/src/app/routes/sys-setting/components/role-management/edit/edit.less new file mode 100644 index 00000000..a902f302 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/edit/edit.less @@ -0,0 +1,17 @@ +:host { + ::ng-deep { + .box { + width: 100%; + margin: 0 auto; + } + + .sv__label { + display: inline-block; + float: left; + width: 120px; + color: #000; + font-size: 13px; + text-align: right; + } + } +} diff --git a/src/app/routes/sys-setting/components/role-management/menu/menu.component.html b/src/app/routes/sys-setting/components/role-management/menu/menu.component.html new file mode 100644 index 00000000..9c6d6e48 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/menu/menu.component.html @@ -0,0 +1,21 @@ +
    +
    + + +
    +
    + + +
    + +
    + + +
    +
    +
    +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts b/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts new file mode 100644 index 00000000..f867aee9 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts @@ -0,0 +1,413 @@ +import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzTreeComponent } from 'ng-zorro-antd/tree'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-cuc-menu', + templateUrl: './menu.component.html', + styleUrls: ['menu.less'] +}) +export class SettingMenuComponent implements OnInit, OnChanges { + @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; + origin: any = { buttonInfoList: [], dictList: [] }; + node: any = {}; + authority: any[] = []; + defaultSelectedKeys: any[] = []; + defaultExpandedKeys: any[] = []; + defaultCheckedKeys: any[] = []; + functionList: any[] = []; + allChecked = false; + indeterminate = true; + @Input() type = 'edit'; + @Input() source = ''; + @Input() appId = this.envSrv.env.appId; + @Input() isAuthorityIdDTOList: any[] = []; + @Input() authorityAssistId: any[] = []; + @Input() roleId: any; + @Output() changeData = new EventEmitter(); + constructor(public service: SystemService, private cdr: ChangeDetectorRef, private envSrv: EAEnvironmentService) {} + ngOnChanges(changes: SimpleChanges): void { + if (changes.isAuthorityIdDTOList) { + if (this.type === 'edit') { + this.authority = this.isAuthorityIdDTOList || []; + } + } + if (changes.authorityAssistId) { + this.defaultCheckedKeys = [...this.authorityAssistId]; + } + } + + ngOnInit() { + this.getAllFunction(); + } + getAllFunction() { + this.service + .request(this.service.$api_getAllFunctionInfoByAppId, { appId: this.appId || this.envSrv.env.appId }, 'POST', true, 'FORM') + .subscribe(res => { + // if (this.source === 'onlyRelationAuth') { + // this.addDisabledTree(res); + // } else { + // // this.addDisabledLeafTree(res); + // } + this.functionList = res; + this.defaultCheckedKeys = this.authorityAssistId; + this.cdr.detectChanges(); + }); + } + addAuthority(origin: { id: any; all: any }, node: { buttonInfoList: any[] }, item?: { checked: any; functionButtonId: any }) { + if (this.authority?.length && this.authority.filter(authItem => authItem.authorityId === origin.id).length) { + // 判断此菜单权限是否已经存在权限列表中 + // 当前操作菜单id存在权限列表里 + this.authority.forEach(menuItem => { + if (menuItem.authorityId === origin.id) { + menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型 + if (item) { + // 单选 + if (item.checked) { + if (menuItem.buttonAuthorityIds.indexOf(item.functionButtonId) === -1) { + // 如果该按钮在数据权限数组中不存在 + menuItem.buttonAuthorityIds.push(item.functionButtonId); + } + } else { + if (menuItem.buttonAuthorityIds && menuItem.buttonAuthorityIds.length) { + menuItem.buttonAuthorityIds.forEach((btnItem: any, index: any) => { + if (btnItem === item.functionButtonId) { + menuItem.buttonAuthorityIds.splice(index, 1); + } + }); + } + } + } else { + // 全选 + if (origin.all) { + node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean }) => { + if (menuItem.buttonAuthorityIds.indexOf(nodeItem.id) === -1) { + menuItem.buttonAuthorityIds.push(nodeItem.id); + nodeItem.checked = true; + } + }); + } else { + if (menuItem.buttonAuthorityIds && menuItem.buttonAuthorityIds.length) { + menuItem.buttonAuthorityIds = []; + node.buttonInfoList.forEach((nodeItem: { checked: boolean }) => { + nodeItem.checked = false; + }); + } + } + } + } + }); + } else { + // 数组为空的时候 + const buttonAuthorityIds = []; + if (item) { + // 全选 + buttonAuthorityIds.push(item.functionButtonId); + } else { + node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean; _isHalfChecked: boolean }) => { + if (origin.all) { + buttonAuthorityIds.push(nodeItem.id); + nodeItem.checked = true; + } + }); + } + const obj: any = { + authorityId: origin.id, + buttonAuthorityIds + }; + this.authority.push(obj); + } + this.checkTreeNode(node, origin); + } + + addDict(item: { checked: any; itemId: any; itemKey: any }, dictItem: { dictId: any }, origin: { id: any }, node: any) { + if (this.authority.length) { + // 判断此菜单权限是否已经存在权限列表中 + if (this.authority.filter(authItem => authItem.authorityId === origin.id).length) { + // 当前操作菜单id存在权限列表里 + this.authority.forEach((menuItem, menuIndex) => { + if (menuItem.authorityId === origin.id) { + menuItem.dataAuthority = menuItem.dataAuthority || []; // 防止属性不存在,给属性指定数据类型 + if (item.checked) { + if (menuItem.dataAuthority.filter((ele: { dictItemId: any }) => ele.dictItemId === item.itemId).length === 0) { + // 如果该按钮在数据权限数组中不存在 + menuItem.dataAuthority.push({ dictItemId: item.itemId, itemKey: item.itemKey, dictId: dictItem.dictId }); + } + } else { + if (menuItem.dataAuthority && menuItem.dataAuthority.length) { + menuItem.dataAuthority.forEach((btnItem: { dictItemId: any }, index: any) => { + if (btnItem.dictItemId === item.itemId) { + menuItem.dataAuthority.splice(index, 1); + } + }); + } + } + } + }); + } else { + // 当前操作菜单id不存在权限列表里 + const dataAuthority = []; + dataAuthority.push({ dictItemId: item.itemId, itemKey: item.itemKey, dictId: dictItem.dictId }); + const obj: any = { + authorityId: origin.id, + dataAuthority + }; + this.authority.push(obj); + } + } else { + // 数组为空的时候 + const dataAuthority = []; + dataAuthority.push({ dictItemId: item.itemId, itemKey: item.itemKey, dictId: dictItem.dictId }); + const obj: any = { + authorityId: origin.id, + dataAuthority + }; + this.authority.push(obj); + } + this.checkTreeNode(node, origin); + } + + checkTreeNode(node: any, origin: { id: any }) { + const checkedNode: any = this.nzTreeComponent.getCheckedNodeList(); + const allCheckedArr: any[] = []; + this.overTree(checkedNode, allCheckedArr); + this.authority.forEach(authItem => { + if (authItem.authorityId === origin.id) { + if ( + (authItem.buttonAuthorityIds && authItem.buttonAuthorityIds.length) || + (authItem.dataAuthority && authItem.dataAuthority.length) + ) { + if (allCheckedArr.indexOf(node.key) === -1) { + allCheckedArr.push(node.key); + } + } else { + if (allCheckedArr.indexOf(node.key) !== -1) { + allCheckedArr.forEach((ele, index) => { + if (ele === origin.id) { + allCheckedArr.splice(index, 1); + } + }); + } + } + } + }); + this.defaultCheckedKeys = allCheckedArr; + } + + overTree(children: any[], a: any[]) { + children.forEach(item => { + a.push(item.key); + if (item.isLeaf) { + return; + } + if (item.children && item.children.length) { + this.overTree(item.children, a); + } + }); + } + + addDisabledTree(arr: any[]) { + arr.forEach((item: any) => { + item.disableCheckbox = true; + if (item.isLeaf) { + return; + } + if (item.children && item.children.length) { + this.addDisabledTree(item.children); + } + }); + } + addDisabledLeafTree(arr: any[]) { + arr.forEach((item: any) => { + if (item.isLeaf) { + return; + } + item.disableCheckbox = true; + if (item.children && item.children.length) { + this.addDisabledLeafTree(item.children); + } + }); + } + nzEvent(event: any): void { + this.origin = event.node.origin; + this.node = event.node.origin; + if (!event.node.origin.isLeaf) { + event.node.isExpanded = !event.node.isExpanded; + } else { + this.initButtonList(event.node.key, event.node.origin); + // this.initDictList(event.node.key, event.node.origin); + } + } + + washTree() { + const authorityMenu: any[] = []; // this.authority + const tempAuthorityIdDTOListMenu: any[] = []; + const checkedNode: any = this.nzTreeComponent.getCheckedNodeList(); + const halfCheckedNode: any = this.nzTreeComponent.getHalfCheckedNodeList(); + this.authorityAssistId = []; + halfCheckedNode.forEach((item: { key: any }) => { + authorityMenu.push({ authorityId: item.key }); + tempAuthorityIdDTOListMenu.push(item.key); + }); + this.overWashTree(checkedNode, tempAuthorityIdDTOListMenu, authorityMenu); + if (this.authority && this.authority.length) { + this.authority.forEach(item => { + if (tempAuthorityIdDTOListMenu.indexOf(item.authorityId) !== -1) { + tempAuthorityIdDTOListMenu.forEach((oldItem, oldIndex) => { + if (oldItem === item.authorityId) { + authorityMenu[oldIndex] = item; + } + }); + } + }); + } + const result = { + authority: authorityMenu, + authorityAssistId: this.authorityAssistId + }; + this.changeData.emit(result); + return result; + } + overWashTree(children: any[], tempAuthorityIdDTOListMenu: any[], authorityMenu: any[]) { + children.forEach((item: any) => { + this.authorityAssistId.push(item.key); + tempAuthorityIdDTOListMenu.push(item.key); + authorityMenu.push({ authorityId: item.key, isUpdateAuthority: 1 }); + if (item.isLeaf) { + return; + } + if (item.children) { + this.overWashTree(item.children, tempAuthorityIdDTOListMenu, authorityMenu); + } + }); + } + + initButtonList(id: any, origin: any) { + if (origin.expanded) { + origin.children.forEach((item: any, index: number) => { + if (item.selected) { + if (origin.checked) { + this.authority.splice(index, 1); + const buttonAuthorityIds: any = []; + item.buttonInfoList.forEach((btnItem: any) => { + btnItem.checked = true; + buttonAuthorityIds.push(btnItem.functionButtonId); + }); + this.authority.push({ authorityId: origin.key, buttonAuthorityIds, isUpdateAuthority: 1 }); + } else { + this.authority.splice(index, 1); + item.buttonInfoList.forEach((btnItem: any) => { + btnItem.checked = false; + }); + } + } + }); + } + const params = { + id + }; + this.service.request(this.service.$api_getFunctionButtonInfo, params).subscribe(res => { + if (res) { + origin.buttonInfoList = res; + origin.all = false; + // 判断此菜单下是否已有此按钮权限 + this.againGetBtn(id, origin); + } + }); + } + // 再次请求,需要判断暂存权限数组是否已有此权限 + againGetBtn(id: any, origin: any) { + if (this.authority && this.authority.length === 0) { + const buttonAuthorityIds: any = []; + if (origin.checked) { + origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { + btnItem.checked = true; + buttonAuthorityIds.push(btnItem.functionButtonId); + }); + this.authority.push({ authorityId: origin.key, buttonAuthorityIds, isUpdateAuthority: 1 }); + } + } else { + if (origin.checked) { + //菜单勾选情况下 + if (this.authority.some(item => item.authorityId === id)) { + this.authority.forEach(item => { + if (item.authorityId === id) { + // 如果当前菜单Id存在权限列表里,并且等于暂存权限数组的Id + if (item.buttonAuthorityIds && item.buttonAuthorityIds.length) { + // 如果当前菜单Id权限数组不为空 + origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { + // 判断已有权限id是否存在 + if (item.buttonAuthorityIds.indexOf(btnItem.functionButtonId) !== -1) { + btnItem.checked = true; + } else { + btnItem.checked = false; + } + }); + } + } + }); + } else { + this.authority.push({ authorityId: origin.key, buttonAuthorityIds: [], isUpdateAuthority: 1 }); + this.authority.forEach(item => { + origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { + btnItem.checked = true; + item.buttonAuthorityIds.push(btnItem.functionButtonId); + }); + }); + } + } else { + // 菜单未勾选,要删除权限 + this.authority.forEach((item, index) => { + if (item.authorityId === id) { + // 如果当前菜单Id存在权限列表里,并且等于暂存权限数组的Id + this.authority.splice(index, 1); + origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { + btnItem.checked = false; + }); + } + }); + } + } + } + + initDictList(id: any, origin: any) { + const params = { + id + }; + this.service.request(this.service.$api_getFunctionDataInfo, params).subscribe(res => { + if (res) { + origin.dictList = res; + // 判断此菜单下是否已有此按钮权限 + this.againGetDict(id, origin); + } + }); + } + // 再次请求,需要判断暂存权限数组是否已有此权限 + againGetDict(id: any, origin: any) { + if (this.authority.length === 0) { + return; + } + this.authority.forEach(item => { + if (item.authorityId === id) { + // 如果当前菜单Id等于暂存权限数组的Id + if (item.dataAuthority && item.dataAuthority.length) { + // 如果当前菜单Id权限数组不为空 + origin.dictList.forEach((ele: { dictItem: any[] }) => { + // 判断已有权限id是否存在 + ele.dictItem.forEach((dictItem: { itemId: any; checked: boolean; cheked: boolean }) => { + item.dataAuthority.forEach((dataItem: { dictItemId: any }) => { + if (dataItem.dictItemId === dictItem.itemId) { + dictItem.checked = true; + } else { + dictItem.cheked = false; + } + }); + }); + }); + } + } + }); + } +} diff --git a/src/app/routes/sys-setting/components/role-management/menu/menu.less b/src/app/routes/sys-setting/components/role-management/menu/menu.less new file mode 100644 index 00000000..ea1914df --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/menu/menu.less @@ -0,0 +1,211 @@ +:host { + .toolbar-btn { + padding-left: 0; + } + + ::ng-deep { + .ant-checkbox-wrapper+.ant-checkbox-wrapper { + margin: 0; + } + + .listDiv { + cdk-virtual-scroll-viewport { + border: 1px solid rgba(242, 242, 240, 1); + } + + .selectedItem { + background: #e6f7ff; + + span { + a { + color: rgba(212, 72, 86, 1); + } + } + + ul>li>a>i { + color: rgba(212, 72, 86, 1); + } + } + + .listBottom { + height : 2.5rem; + overflow : hidden; + text-align : center; + background-color: rgba(245, 245, 245, 0.7); + + &:hover { + background-color: rgba(245, 245, 245, 1); + transition : all 1s; + } + } + } + + .ant-tabs-nav { + width : 100%; + margin: 0 !important; + } + + .buttons { + padding: 0; + + button { + display : block; + max-width: 10rem; + margin : 0.3rem 0.5rem 0 0; + } + + .ant-btn+.ant-btn:not(.ant-btn-link), + .ant-btn+nz-popconfirm, + nz-popconfirm+.ant-btn, + nz-popconfirm+nz-popconfirm, + .ant-btn+nz-button-group, + nz-button-group+.ant-btn, + .ant-btn+nz-dropdown, + nz-dropdown+.ant-btn, + nz-popconfirm+nz-button-group, + nz-button-group+nz-popconfirm { + margin-left: 0; + } + } + + .ant-tabs-bar { + margin: 0; + } + + // .ant-tree-node-selected { + // background: none !important; + // } + // .ant-tree-node-content-wrapper:hover { + // background: none; + // } + .ant-tree-node-content-wrapper { + width: 100%; + } + + .ant-tabs .ant-tabs-tabpane { + padding : 10px 10px 2px 10px; + background : #fdfdfd; + border-right : solid 1px #eee; + border-bottom: solid 1px #eee; + border-left : solid 1px #eee; + } + + // .ant-tabs-tab { + // width: 50%; + // text-align: center; + // } + // .ant-tabs-tab-arrow-show { + // display: none; + // } + ul { + margin : 0; + padding: 0; + } + } +} + +.firstStepBox { + width : 100%; + line-height: 50px; + text-align : center; + background : #f7f7f7; +} + +.itemBox { + width : 100%; + height : 50px; + padding : 0 0 0 60px; + color : #5f5f5f; + line-height: 50px; + cursor : pointer; + + &:hover { + background: #e6f7ff; + } +} + +.twoStepBox { + width : 100%; + line-height: 50px; + text-align : center; + background : #f7f7f7; + + span { + display: inline-block; + margin : 0 auto; + } + + >i { + float : right; + margin: 20px 20px 0 0; + } + + button { + float : right; + margin: 8px 20px 0 0; + } + + .blueFont { + color: #1890ff; + } +} + +.folder-desc i { + margin: 0 5px; +} + +.flexBox { + .titleBox { + display : flex; + justify-content: space-between; + + i { + margin: 0 8px; + } + } +} + +ul { + display: block; +} + +li { + line-height: 30px; + list-style : none; +} + +.dictData { + dl { + margin : 0; + padding: 0; + } + + dt { + margin : 0 0 5px 0; + padding : 3px 0; + color : #999; + font-weight : normal; + font-size : 13px; + border-bottom: solid 1px #eee; + } +} + +label { + color : #666; + font-size: 13px; +} + +.treeWrap { + display: flex; + width : 700px; + + .leftBox { + width : 40%; + // border-right: solid 1px #eee; + } + + .rightBox { + width : 60%; + padding: 0 0 0 20px; + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.html b/src/app/routes/sys-setting/components/role-management/role-management.component.html new file mode 100644 index 00000000..bc117b42 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.html @@ -0,0 +1,25 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.less b/src/app/routes/sys-setting/components/role-management/role-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.ts b/src/app/routes/sys-setting/components/role-management/role-management.component.ts new file mode 100644 index 00000000..c596fe85 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.ts @@ -0,0 +1,141 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { SettingRoleEditComponent } from './edit/edit.component'; + +@Component({ + selector: 'app-role-management', + templateUrl: './role-management.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class RoleManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + roleName: { + type: 'string', + title: '角色名称', + ui: { placeholder: '请输入' } + } + } + }; + + columns: STColumn[] = [ + { title: '角色名称', className: 'text-center', index: 'roleName' }, + { title: '角色描述', className: 'text-center', index: 'roleDescription' }, + { title: '企业数量', className: 'text-center', index: 'userNumber', iif: _ => this.type === 'freight' }, + { title: '创建人手机号', className: 'text-center', index: 'telephone' }, + { + title: '创建时间', + width: 170, + index: 'createTime', + type: 'date', + className: 'text-center' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.roleAction(item), + iif: item => item.roleName !== '超级管理员', + acl: { ability: ['SYSTEM-ROLE-edit'] } + }, + { + text: '删除', + click: item => this.deleteAction(item), + iif: item => item.roleName !== '超级管理员', + acl: { ability: ['SYSTEM-ROLE-delete'] } + } + ] + } + ]; + + type = 'user'; + params: any = { + listUrl: this.service.$api_get_role_page, + deleteUrl: this.service.$api_dalete_role, + infoUrl: this.service.$api_getRoleInfo, + addUrl: this.service.$api_save_role, + updateUrl: this.service.$api_update_role, + title: '角色管理', + type: 'user' + }; + + constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) { + route.params.subscribe(({ type }) => { + if (type) { + this.type = type; + if (type !== 'user') { + this.params = { + listUrl: this.service.$api_get_ent_role_page, + deleteUrl: this.service.$api_dalete_role, + infoUrl: this.service.$api_getRoleInfo, + addUrl: this.service.$api_save_role, + updateUrl: this.service.$api_update_role, + appId: 'A48F72F0A304427F921794BAD86B3522', + title: '企业角色管理', + type: 'freight' + }; + } + } + }); + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + if (requestOptions.body?.createTime) { + Object.assign(requestOptions.body, { sort: 'createTime.' + requestOptions.body.createTime }); + } + return requestOptions; + }; + + roleAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: SettingRoleEditComponent, + nzWidth: 900, + nzComponentParams: item ? { params: { ...item, ...this.params } } : { params: { id: 0, ...this.params } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + deleteAction(item: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.params.deleteUrl, [item.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除角色成功'); + this.st.load(); + } + }); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/staff-management/staff-management.component.html b/src/app/routes/sys-setting/components/staff-management/staff-management.component.html new file mode 100644 index 00000000..73157624 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/staff-management.component.html @@ -0,0 +1,38 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    + +
    + + +
    +
    + +
    + + + 已选择 + {{ selectedRows.length }}项 + + +
    + + +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/staff-management/staff-management.component.less b/src/app/routes/sys-setting/components/staff-management/staff-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/staff-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/staff-management/staff-management.component.ts b/src/app/routes/sys-setting/components/staff-management/staff-management.component.ts new file mode 100644 index 00000000..bcf5ed41 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/staff-management.component.ts @@ -0,0 +1,187 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { SettingsService } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { SystemStaffStaffModalComponent } from './staff-modal/staff-modal.component'; +import { BuyerTranspowerComponent } from './transpower/transpower.component'; + +@Component({ + selector: 'app-staff-management', + templateUrl: './staff-management.component.html', + styleUrls: ['./staff-management.component.less'] +}) +export class StaffManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + searchSchema: SFSchema = { + properties: { + nameOrPhone: { + type: 'string', + title: '输入搜索', + ui: { placeholder: '手机号码 / 成员姓名' } + } + } + }; + + columns: STColumn[] = [ + { title: '', index: 'key', className: 'text-center', type: 'checkbox' }, + { title: '员工姓名', className: 'text-center', index: 'name' }, + { title: '手机号码', className: 'text-center', index: 'telephone' }, + { title: '角色',className: 'text-center', index: 'roleName' }, + { + title: '最后登录时间', + index: 'lastLoginDate', + className: 'text-center', + type: 'date', + format: item => `${item.lastLoginDate || '-'}` + }, + { + title: '成员状态', + className: 'text-center', + index: 'stateLocked', + type: 'badge', + badge: { + 0: { text: '正常', color: 'success' }, + 1: { text: '冻结', color: 'error' } + } + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '编辑', + click: item => this.staffAction(item), + acl: { ability: ['SYSTEM-STAFF-edit'] } + }, + { + text: '恢复', + iif: item => item.stateLocked === 1 && item.telephone !== this.user.phone, + click: item => this.action(item, 2), + acl: { ability: ['SYSTEM-STAFF-lock'] } + }, + { + text: '冻结', + iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone, + click: item => this.action(item, 1), + acl: { ability: ['SYSTEM-STAFF-lock'] } + }, + { + text: '超管转授', + iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1, + click: item => this.transpowerAction(item), + acl: { ability: ['SYSTEM-STAFF-shiftAdmin'] } + }, + { + text: '删除', + iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone, + click: item => this.action(item, 3), + acl: { ability: ['SYSTEM-STAFF-delete'] } + } + ] + } + ]; + + selectedRows: any[] = []; + + actionLabel = { + 1: { title: '确认冻结?', text: '冻结后用户在本系统将无法登录使用,请谨慎操作!' }, + 2: { title: '确认恢复?', text: '恢复后用户在本系统的权限将一并重新开启。' }, + 3: { title: '确认删除?', text: '删除后该用户ID将在本系统中将无法登录使用并删除,请谨慎操作!' } + }; + + user = this.setting.user; + constructor(public service: SystemService, private nzModalService: NzModalService, private setting: SettingsService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + action(item: any, type: 1 | 2 | 3) { + this.nzModalService.error({ + nzTitle: this.actionLabel[type].title, + nzContent: ``, + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + switch (type) { + case 1: + this.freeOrResumStaff({ appUserId: [item.appUserId], freezeOrResume: true }); + break; + case 2: + this.freeOrResumStaff({ appUserId: [item.appUserId], freezeOrResume: false }); + break; + case 3: + this.deleteStaff([item.appUserId]); + break; + + default: + break; + } + } + }); + } + + transpowerAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '超级管理员转授', + nzContent: BuyerTranspowerComponent, + nzComponentParams: { i: { ...item } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + staffAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: SystemStaffStaffModalComponent, + nzComponentParams: item ? { i: { ...item, roleId: item.roleId ? (item.roleId as string)?.split(',') : null } } : { i: { userId: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private deleteStaff(params: any) { + this.service.request(this.service.$api_delete_staff, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + this.st.load(); + } + }); + } + + private freeOrResumStaff(params: any) { + this.service.request(this.service.$api_free_or_resume_staff, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + this.st.load(); + } + }); + } +} diff --git a/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.html b/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.html new file mode 100644 index 00000000..87d7b3b2 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.html @@ -0,0 +1,10 @@ + +
    + +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.ts b/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.ts new file mode 100644 index 00000000..49b2cb27 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-system-add', + templateUrl: './staff-modal.component.html' +}) +export class SystemStaffStaffModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + staffName: { + title: '员工姓名', + type: 'string', + maxLength: 10, + ui: { widget: staff?.appUserId ? 'text' : 'string', placeholder: '请输入员工姓名' }, + default: staff.name + }, + telephone: { + title: '手机号码', + type: 'string', + maxLength: 11, + ui: { widget: staff?.appUserId ? 'text' : 'string', placeholder: '请输入员工手机号' }, + default: staff.telephone + }, + roleId: { + title: '角色', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择员工角色', + mode: 'multiple', + maxMultipleCount: 5, + asyncData: () => { + return this.service.request(this.service.$api_getAppRoleList).pipe( + map((res: any) => { + return res + .filter((role: any) => role.roleCode !== 'Administrator') + .map((item: any) => { + return { label: item.roleName, value: item.id }; + }); + }) + ); + } + }, + default: staff?.roleId || null + } + }, + required: ['staffName', 'telephone', 'roleId'] + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + } + + sure() { + if (!this.sf.value.roleId || this.sf.value.roleId.length === 0) { + this.service.msgSrv.error('员工角色不能为空!'); + return; + } + if (this.i.userId === 0) { + const params: any = { + ...this.sf.value + }; + this.service.request(this.service.$api_add_staff, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功!'); + this.modal.close(true); + } + }); + } else { + const params: any = { + appUserId: this.i.appUserId, + ...this.sf.value + }; + this.service.request(this.service.$api_edit_staff, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('编辑成功!'); + this.modal.close(true); + } + }); + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.html b/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.html new file mode 100644 index 00000000..47c06860 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.html @@ -0,0 +1,22 @@ +
    + {{i.name}}({{i.telephone}}) + +
    为了账户安全,需超管手机验证({{ superPhone }})
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.ts b/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.ts new file mode 100644 index 00000000..ff704a04 --- /dev/null +++ b/src/app/routes/sys-setting/components/staff-management/transpower/transpower.component.ts @@ -0,0 +1,80 @@ +import { ChangeDetectorRef, Component, OnInit, TemplateRef } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { interval } from 'rxjs'; +import { take } from 'rxjs/operators'; +import { DunHelper } from 'src/app/shared/components/captcha/dun.helper'; +import { EACaptchaService } from 'src/app/shared/services/business/captcha.service'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-buyer-transpower', + templateUrl: './transpower.component.html' +}) +export class BuyerTranspowerComponent implements OnInit { + count = 0; + i: any; + smsVerifyCode = ''; + superPhone = ''; + constructor( + private modal: NzModalRef, + public service: SystemService, + public eACaptchaService: EACaptchaService, + private dunHelper: DunHelper, + private cdr: ChangeDetectorRef + ) {} + + ngOnInit(): void { + this.getPhone(); + } + getPhone() { + this.service.request(this.service.$api_get_app_admin_info).subscribe(res => { + if (res) { + this.superPhone = res.telephone; + } + }); + } + sure() { + const params = { + appUserId: this.i.appUserId, + smsVerifyCode: this.smsVerifyCode, + telephone: this.i.telephone + }; + this.service.request(this.service.$api_set_shift_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功!'); + this.modal.close(true); + } + }); + } + close() { + this.modal.destroy(); + } + /** + * 获取手机验证码 + */ + sendCode() { + this.eACaptchaService.request(this.eACaptchaService.$api_getAppLesseeAdminSMVerificationCode).subscribe(res => { + if (res.success && res.data.code === '1') { + this.eACaptchaService.msgSrv.success('发送验证码成功'); + this.createInterval(); + } else if (res.data.code === '503046') { + this.dunHelper.popUp().subscribe(_ => { + this.createInterval(); + this.dunHelper.destory(); + }); + } else { + this.eACaptchaService.msgSrv.warning(res.msg); + } + }); + } + + private createInterval() { + this.count = 59; + interval(1000) + .pipe(take(60)) + .subscribe(x => { + this.count = 59 - (x + 1); + this.cdr.detectChanges(); + }); + } +} diff --git a/src/app/routes/sys-setting/components/system-config/system-config.component.html b/src/app/routes/sys-setting/components/system-config/system-config.component.html new file mode 100644 index 00000000..9606bc20 --- /dev/null +++ b/src/app/routes/sys-setting/components/system-config/system-config.component.html @@ -0,0 +1,187 @@ + +
    +
    +
      +
    • + {{ item.name }} +
    • +
    +
    + +
    + +

    货主端配置

    +

    图片配置

    + + + + + +
    可输入字符
    + +
    +
    +

    短信配置

    +
    +
    + +

    配置用户端登陆页注册帐号、修改密码、修改手机号时的短信内容

    + +
    +
    +
    +

    通知配置

    +
    +
    + + + + +
    +
    +

    客服电话配置

    +
    +
    + + + +
    +
    +
    + + +

    司机端配置

    +

    图片配置

    + + + + + +
    可输入字符
    + +
    +
    +

    短信配置

    +
    +
    + +

    配置用户端登陆页注册帐号、修改密码、修改手机号时的短信内容

    + +
    +
    +
    +

    通知配置

    +
    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    客服电话配置

    +
    +
    + + + +
    +
    +

    证件提醒配置

    +
    +
    + + 距离到期时间 + + 天开始提醒,每隔 + + 天提醒一次 + +
    +
    +
    + +
    + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/system-config/system-config.component.less b/src/app/routes/sys-setting/components/system-config/system-config.component.less new file mode 100644 index 00000000..09e68362 --- /dev/null +++ b/src/app/routes/sys-setting/components/system-config/system-config.component.less @@ -0,0 +1,22 @@ +:host { + ::ng-deep { + .card-height { + min-height: 600px; + } + + .save-btn { + width : 100%; + text-align: right; + } + + .block-radio { + display : flex; + min-height : 32px; + } + + input { + width : 100px; + margin-left: 10px; + } + } + } \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/system-config/system-config.component.ts b/src/app/routes/sys-setting/components/system-config/system-config.component.ts new file mode 100644 index 00000000..f1a42dbf --- /dev/null +++ b/src/app/routes/sys-setting/components/system-config/system-config.component.ts @@ -0,0 +1,258 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUploadWidgetSchema } from '@delon/form'; +import { Observable, Observer } from 'rxjs'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-system-config', + templateUrl: './system-config.component.html', + styleUrls: ['./system-config.component.less'] +}) +export class SystemConfigComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + formDate: any = { + isAudit: false, + isEveryDay: false, + isEveryWeek: false + }; + tabs = [ + { + name: '货主端配置' + }, + { + name: '司机端配置' + } + ]; + selectedTab = 0; + + checkOptionsOne = [ + { label: '周一', value: '周一', checked: true }, + { label: '周二', value: '周二' }, + { label: '周三', value: '周三' }, + { label: '周四', value: '周四' }, + { label: '周五', value: '周五' }, + { label: '周六', value: '周六' }, + { label: '周日', value: '周日' } + ]; + + i: any; + schema!: SFSchema; + schema2!: SFSchema; + + imageConfig = { + widget: 'upload', + action: `/scm/cms/cms/upload/multipartFile/fileModel`, + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + data: { + appId: this.service.envSrv.getEnvironment().appId + }, + multiple: false, + listType: 'picture-card', + showRequired: true + }; + constructor(private service: SystemService) {} + + ngOnInit() { + this.initSF(); + } + + changeType(type: number): void { + this.selectedTab = type; + } + + initSF() { + this.schema = { + properties: { + sysMinLogo: { + type: 'string', + title: '系统LOGO(大)', + // enum: [], + ui: { + ...this.imageConfig, + descriptionI18n: '大尺寸logo,支持JPG、PNG格式,文件小于2M(建议尺寸300*170px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, 'sysMinLogo'); + this.sf?.setValue('/sysMinLogo', avatar); + this.i.sysMinLogo = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo: { + type: 'string', + title: '用户默认头像', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸60*60px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo', avatar); + this.i.sysMaxLogo = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo1: { + type: 'string', + title: '用户默认头像', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于5M(建议尺寸375*773px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo1', avatar); + this.i.sysMaxLogo1 = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + }, + required: ['sysMinLogo', 'sysMaxLogo', 'sysMaxLogo1'] + }; + this.schema2 = { + properties: { + sysMinLogo: { + type: 'string', + title: '系统LOGO(小)', + // enum: [], + ui: { + ...this.imageConfig, + descriptionI18n: '小尺寸logo,支持JPG、PNG格式,文件小于2M(建议尺寸32*32px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, 'sysMinLogo'); + this.sf?.setValue('/sysMinLogo', avatar); + this.i.sysMinLogo = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo: { + type: 'string', + title: '系统LOGO(大)', + ui: { + ...this.imageConfig, + descriptionI18n: '小尺寸logo,支持JPG、PNG格式,文件小于2M(建议尺寸32*32px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo', avatar); + this.i.sysMaxLogo = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo1: { + type: 'string', + title: '用户默认头像', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸60*60px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo1', avatar); + this.i.sysMaxLogo1 = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo2: { + type: 'string', + title: '企业默认头像', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于2M(建议尺寸60*60px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo2', avatar); + this.i.sysMaxLogo2 = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo3: { + type: 'string', + title: '货主PC端登陆页海报', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于5M(建议尺寸1920*630px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo3', avatar); + this.i.sysMaxLogo3 = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + sysMaxLogo4: { + type: 'string', + title: 'APP开屏海报', + ui: { + ...this.imageConfig, + descriptionI18n: '支持JPG、PNG格式,文件小于5M(建议尺寸375*773px)。', + change: args => { + if (args.type === 'success') { + const avatar = this.getImageModel(args, -1); + this.sf?.setValue('/sysMaxLogo4', avatar); + this.i.sysMaxLogo4 = avatar; + } + }, + beforeUpload: this.uploadBefore + } as SFUploadWidgetSchema + }, + }, + required: ['sysMinLogo', 'sysMaxLogo', 'sysMaxLogo1', 'sysMaxLogo2', 'sysMaxLogo3', 'sysMaxLogo4'] + }; + } + + private uploadBefore = (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 2; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + // this.service.msgSrv.warning('图片需小于1M'); + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }; + + private getImageModel(args: any, key: any) { + return [ + { + uid: key, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url + } + } + ]; + } +} diff --git a/src/app/routes/sys-setting/services/system.service.ts b/src/app/routes/sys-setting/services/system.service.ts new file mode 100644 index 00000000..0a698775 --- /dev/null +++ b/src/app/routes/sys-setting/services/system.service.ts @@ -0,0 +1,189 @@ +/* + * @Author: your name + * @Date: 2021-12-20 17:18:43 + * @LastEditTime : 2022-02-18 13:42:49 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\services\\system.service.ts + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from 'src/app/shared/services'; + +@Injectable({ + providedIn: 'root' +}) +export class SystemService extends BaseService { + // 分页查询企业项目员工列表 + $api_get_enterprise_staff_page = '/api/mdc/cuc/userApp/getEnterpriseProjectStaffListPage'; + // 添加员工 + $api_add_staff = '/api/mdc/cuc/userApp/addStaff'; + // 编辑员工 + $api_edit_staff = '/api/mdc/cuc/userApp/editorStaff'; + // 删除应用用户(员工) + $api_delete_staff = '/api/mdc/cuc/userApp/deleteAppUser'; + // 冻结或恢复员工 + $api_free_or_resume_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff'; + // 获取应用企业的管理员用户 + $api_get_app_admin_info = `/api/mdc/cuc/userApp/getAppEnterpriseAdmin`; + // 运营管理后台转授超管角色 + $api_set_shift_admin = `/api/mdc/cuc/userAuthority/shiftAdmin`; + + + // 分页获取应用角色列表 + $api_get_role_page = '/api/mdc/cuc/roleInfo/getAppRoleInfoList'; + // 分页获取配置角色列表 + $api_get_ent_role_page = '/api/mdc/cuc/roleInfo/getConfigurationRoleList'; + // 新增角色 + $api_save_role = '/api/mdc/cuc/roleInfo/saveRoleInfo'; + // 编辑角色 + $api_update_role = '/api/mdc/cuc/roleInfo/updateRoleInfo'; + // 删除角色(含多个) + $api_dalete_role = '/api/mdc/cuc/roleInfo/removeRoleInfo'; + // 获取角色详情 + $api_getRoleInfo = '/api/mdc/cuc/roleInfo/getRoleInfo'; + // 获取角色列表 + $api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList'; + + // 查询字典选项列表 + $api_get_dict_page = '/api/mdc/pbc/dictItems/list/page'; + // 根据id批量删除字典选项 + $api_delete_dict_by_ids = '/api/mdc/pbc/dictItems/deleteBatchByIds'; + // 新增字典选项 + $api_add_dict = '/api/mdc/pbc/dictItems/save'; + // 更新字典选项 + $api_update_dict = '/api/mdc/pbc/dictItems/update'; + + // 获取CRM客户信息表 + $api_get_crmCustomer = '/api/mdc/cuc/crmCustomer/get'; + // 查询CRM客户信息表 + $api_get_crmCustomer_page = '/api/mdc/cuc/crmCustomer/list/page'; + // 保存CRM客户信息表 + $api_save_crmCustomer = '/api/mdc/cuc/crmCustomer/save'; + // 删除CRM客户信息表 + $api_deletebatch_crmCustomer = '/api/mdc/cuc/crmCustomer/deletebatch'; + + // 获取某个应用的所有菜单 + $api_getAllFunctionInfoByAppId: string = '/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId'; + + // 查询网络货运信息表 + $api_networkTransporter_page = '/api/mdc/cuc/networkTransporter/list/page'; + // 获取网络货运信息表(id) + $api_get_networkTransporter = '/api/mdc/cuc/networkTransporter/get'; + // 获取网络货运信息表(id) + $api_get_networkTransporter_getDetail = '/api/mdc/cuc/networkTransporter/getDetail'; + // 批量获取网络货运信息 + $api_findNetworkTransporterByIds = '/api/mdc/cuc/networkTransporter/findNetworkTransporterByIds'; + // 查找所有网络货运信息(下拉) + $api_networkTransporter_findAll = '/api/mdc/cuc/networkTransporter/findAll'; + // 删除网络货运信息表 + $api_networkTransporter_deletebatch = '/api/mdc/cuc/networkTransporter/deletebatch'; + // 保存网络货运信息表 + $api_networkTransporter_save = '/api/mdc/cuc/networkTransporter/save'; + + // 查询结算客户表 + $api_settlementCustomer_page = '/api/mdc/cuc/settlementCustomer/list/page'; + // 获取结算客户表 + $api_settlementCustomer_get = '/api/mdc/cuc/settlementCustomer/get'; + // 保存结算客户表 + $api_settlementCustomer_save = '/api/mdc/cuc/settlementCustomer/save'; + // 删除结算客户表 + $api_settlementCustomer_deletebatch = '/api/mdc/cuc/settlementCustomer/deletebatch'; + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + + // 查询协议列表 + public $api_get_agreement_page = '/api/mdc/pbc/agreementInfo/list/page'; + // 编辑协议 + public $api_update_agreement = '/api/mdc/pbc/agreementInfo/modifyAgreementInfo'; + + // 根据FullKey获取系统子配置(树) + public $api_get_config_tree = '/api/mdc/pbc/sysConfig/getSysConfigTreeByParentFullKey'; + // 查找系统配置项列表 + public $api_get_config_by_parent_id = '/api/mdc/pbc/sysConfigItem/findSysConfigItemBySysConfigId'; + // 新增系统配置 + public $api_add_config = '/api/mdc/pbc/sysConfig/save'; + // 更新系统配置 + public $api_update_config = '/api/mdc/pbc/sysConfig/update'; + // 更新系统配置排序 + public $api_update_config_sort = '/api/mdc/pbc/sysConfig/updateSort'; + // 删除系统配置 + public $api_remove_config = '/api/mdc/pbc/sysConfig/deletebatch'; + // 查询系统配置项 + public $api_get_config_item_page = '/api/mdc/pbc/sysConfigItem/list/page'; + // 新增系统配置项 + public $api_add_config_item = '/api/mdc/pbc/sysConfigItem/save'; + // 更新系统配置项 + public $api_update_config_item = '/api/mdc/pbc/sysConfigItem/update'; + // 批量更新系统配置项 + public $api_update_config_batch = '/api/mdc/pbc/sysConfigItem/updateBatch'; + // 更新系统配置项排序 + public $api_update_config_item_sort = '/api/mdc/pbc/sysConfigItem/updateSort'; + // 删除系统配置项 + public $api_remove_config_item = '/api/mdc/pbc/sysConfigItem/deletebatch'; + + + // 根据网络货运人ID获取票务信息 + public $api_getTicketByNetworkTransporterId = '/api/mdc/cuc/networkTransporterTicket/getTicketByNetworkTransporterId'; + // 保存票务信息 + public $api_networkTransporterTicket_save = '/api/mdc/cuc/networkTransporterTicket/save'; + // 根据地区code查询列表 + $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; + // 根据地区code查询地区详情 + $api_getRegionDetailByCode = '/api/mdc/pbc/region/getRegionDetailByCode'; + + + // 分页查询按钮列表 + $api_getButtonInfoPage = '/api/mdc/cuc/buttonInfo/getButtonInfoPage'; + // 新增编辑按钮信息 + $api_saveButtonInfo = '/api/mdc/cuc/buttonInfo/saveButtonInfo'; + // 获取按钮信息表(id) + $api_getButtonInfo_one = '/api/mdc/cuc/buttonInfo/getButtonInfo'; + // 删除按钮信息(id) + $api_deletebatchButton = '/api/mdc/cuc/buttonInfo/deletebatchButton'; + + + // 根据条件获取公告列表 + $api_getAnnouncementInfoList_page = '/api/mdc/pbc/announcementInfo/getAnnouncementInfoList'; + // 获取公告信息详情 + $api_getAnnouncementInfoById_detail = '/api/mdc/pbc/announcementInfo/getAnnouncementInfoById'; + // 删除公告信息 + $api_delete_deleteAnnouncementInfoById = '/api/mdc/pbc/announcementInfo/deleteAnnouncementInfoById'; + // 编辑公告信息 + $api_modifyAnnouncementInfo = '/api/mdc/pbc/announcementInfo/modifyAnnouncementInfo'; + // 新增公告信息 + $api_addAnnouncementInfo = '/api/mdc/pbc/announcementInfo/addAnnouncementInfo'; + + + // 查询保险配置 + $api_insuranceConfig_list = '/api/mdc/cuc/insuranceConfig/list'; + // 获取保险配置费率 + $api_getInsuranceRate = '/api/mdc/cuc/insuranceConfig/getInsuranceRate'; + // 获取保险配置(id) + $api_getInsuranceRate_get = '/api/mdc/cuc/insuranceConfig/get'; + // 删除保险配置(id) + $api_getInsuranceRate_deletebatch = '/api/mdc/cuc/insuranceConfig/deletebatch'; + // 批量保存保险配置 + $api_getInsuranceRate_saveBatch = '/api/mdc/cuc/insuranceConfig/saveBatch'; + + // 营业执照识别 + $api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense'; + // 短信发送列表 + $api_listSmsSendLog = '/api/mdc/pbc/smsSend/listSmsSendLog'; + // 身份证识别 + $api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + // 获取字典 + $api_getDictValue = '/api/mdc/pbc/dictItems/getDictValue'; + // 设置crm客户 + $api_setCrmCustomer = '/api/mdc/cuc/networkTransporter/setCrmCustomer'; + // 获取一、二、三级地区详情 + $api_getRegionToThree = '/api/mdc/pbc/region/getRegionToThree'; + $api_getRoleTemplateInfo: string = ''; + $api_getFunctionButtonInfo: string = '/api/mdc/cuc/functionButton/getFunctionButtonByFunctionId'; + $api_getFunctionDataInfo: string = ''; + $api_getAppList: string = ''; + $api_getRoleTemplateListByAppId: string = ''; + $api_updateRoleInfo: string = ''; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/sys-setting/sys-setting-routing.module.ts b/src/app/routes/sys-setting/sys-setting-routing.module.ts new file mode 100644 index 00000000..7be49b35 --- /dev/null +++ b/src/app/routes/sys-setting/sys-setting-routing.module.ts @@ -0,0 +1,54 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:23:05 + * @LastEditTime : 2022-02-23 17:17:53 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\sys-setting-routing.module.ts + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { AgreementConfigComponentsBaseComponent } from './components/agreement-config/agreement-config.component'; +import { AuditReasonConfigComponent } from './components/audit-reason-config/audit-reason-config.component'; +import { BasicConfigComponent } from './components/basic-config/basic-config.component'; +import { BasicSettingComponent } from './components/basic-setting/basic-setting.component'; +import { CartConfigComponent } from './components/cart-config/cart-config.component'; +import { CloseAccountComponent } from './components/close-account/close-account.component'; +import { CrmManagementComponent } from './components/crm-management/crm-management.component'; +import { GoodsNameConfigComponent } from './components/goods-name-config/goods-name-config.component'; +import { NetworkFreightComponent } from './components/network-freight/network-freight.component'; +import { RoleManagementComponent } from './components/role-management/role-management.component'; +import { StaffManagementComponent } from './components/staff-management/staff-management.component'; +import { SystemConfigComponent } from './components/system-config/system-config.component'; + +import { AnnouncementMessageComponent } from './components/announcement-message/announcement-message.component'; +import { InsuranceSetComponent } from './components/insurance-set/insurance-set.component'; +import { NetworkFreightNewComponent } from './components/network-freight/new/new.component'; +import { NoTeManagementComponent } from './components/note-management/note-management.component'; + +const routes: Routes = [ + { path: 'staff-management', component: StaffManagementComponent }, + { path: 'role-management/user/:type', component: RoleManagementComponent }, + { path: 'role-management/freight/:type', component: RoleManagementComponent }, + { path: 'basic-setting', component: BasicSettingComponent }, + { path: 'note-management', component: NoTeManagementComponent }, + { path: 'basic-config', component: BasicConfigComponent }, + { path: 'audit-reason-config', component: AuditReasonConfigComponent }, + { path: 'cart-config', component: CartConfigComponent }, + { path: 'agreement-config', component: AgreementConfigComponentsBaseComponent }, + { path: 'system-config', component: SystemConfigComponent }, + { path: 'goods-name-config', component: GoodsNameConfigComponent }, + { path: 'crm-management', component: CrmManagementComponent }, + { path: 'network-freight', component: NetworkFreightComponent }, + { path: 'network-freight/new/:id', component: NetworkFreightNewComponent }, + { path: 'close-account', component: CloseAccountComponent }, + // { path: 'btn-management', component: BtnManagementComponent }, + { path: 'announcement-message', component: AnnouncementMessageComponent }, + { path: 'insurance-set', component: InsuranceSetComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SysSettingRoutingModule {} diff --git a/src/app/routes/sys-setting/sys-setting.module.ts b/src/app/routes/sys-setting/sys-setting.module.ts new file mode 100644 index 00000000..ecb6d87a --- /dev/null +++ b/src/app/routes/sys-setting/sys-setting.module.ts @@ -0,0 +1,68 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:23:05 + * @LastEditTime : 2022-03-09 14:08:38 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\sys-setting.module.ts + */ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { DynamicSettingModule, SharedModule } from '@shared'; +import { StaffManagementComponent } from './components/staff-management/staff-management.component'; +import { SysSettingRoutingModule } from './sys-setting-routing.module'; +import { BuyerTranspowerComponent } from './components/staff-management/transpower/transpower.component'; +import { SystemStaffStaffModalComponent } from './components/staff-management/staff-modal/staff-modal.component'; +import { RoleManagementComponent } from './components/role-management/role-management.component'; +import { BasicConfigComponent } from './components/basic-config/basic-config.component'; +import { AuditReasonConfigComponent } from './components/audit-reason-config/audit-reason-config.component'; +import { BasicConfigActionModalComponent } from './components/basic-config/basic-config-action-modal/basic-config-action-modal.component'; +import { AuditResonConfigActionModalComponent } from './components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component'; +import { CartConfigComponent } from './components/cart-config/cart-config.component'; +import { CartConfigActionModalComponent } from './components/cart-config/cart-config-action-modal/cart-config-action-modal.component'; +import { AgreementConfigComponentsBaseComponent } from './components/agreement-config/agreement-config.component'; +import { BasicSettingComponent } from './components/basic-setting/basic-setting.component'; +import { SystemConfigComponent } from './components/system-config/system-config.component'; +import { SettingRoleEditComponent } from './components/role-management/edit/edit.component'; +import { SettingMenuComponent } from './components/role-management/menu/menu.component'; +import { GoodsNameConfigComponent } from './components/goods-name-config/goods-name-config.component'; +import { CrmManagementComponent } from './components/crm-management/crm-management.component'; +import { NetworkFreightComponent } from './components/network-freight/network-freight.component'; +import { CloseAccountComponent } from './components/close-account/close-account.component'; +import { AnnouncementMessageComponent } from './components/announcement-message/announcement-message.component'; +import { InsuranceSetComponent } from './components/insurance-set/insurance-set.component'; +import { NetworkFreightNewComponent } from './components/network-freight/new/new.component'; +import { NoTeManagementComponent } from './components/note-management/note-management.component'; + +const COMPONENTS = [ + StaffManagementComponent, + RoleManagementComponent, + BasicConfigComponent, + AuditReasonConfigComponent, + CartConfigComponent, + AgreementConfigComponentsBaseComponent, + BasicSettingComponent, + SystemConfigComponent, + GoodsNameConfigComponent, + CrmManagementComponent, + NetworkFreightComponent, + CloseAccountComponent, + NetworkFreightNewComponent, + AnnouncementMessageComponent, + InsuranceSetComponent, + NoTeManagementComponent +]; +const NOTROUTECOMPONENTS = [ + BuyerTranspowerComponent, + SystemStaffStaffModalComponent, + BasicConfigActionModalComponent, + AuditResonConfigActionModalComponent, + CartConfigActionModalComponent, + SettingRoleEditComponent, + SettingMenuComponent +]; +@NgModule({ + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, SysSettingRoutingModule, SharedModule, DynamicSettingModule] +}) +export class SysSettingModule {} diff --git a/src/app/routes/tax-management/components/individual-collect/individual-collect.component.html b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.html new file mode 100644 index 00000000..17ea49f8 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.html @@ -0,0 +1,51 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts new file mode 100644 index 00000000..c4f25510 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-collect/individual-collect.component.ts @@ -0,0 +1,317 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TaxManagementService } from '../../services/tax-management.service'; + +@Component({ + selector: 'app-tax-management-individual-collect', + templateUrl: './individual-collect.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class TaxManagementIndividualCollectComponent implements OnInit { + _$expand = false; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabs: any[] = [ + { name: '待申报', value: '0' }, + { name: '待审核', value: '1' }, + { name: '已通过', value: '2' }, + { name: '不通过', value: '3' }, + { name: '全部', value: '' } + ]; + selectedIndex = '0'; + + selectedRows: any[] = []; + constructor(public service: TaxManagementService, private router: Router, private ar: ActivatedRoute, private modal: NzModalService) {} + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + declareStatus: this.selectedIndex + }); + delete params._$expand; + return { ...params }; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + declareStatus: { + title: '申报状态', + type: 'string', + enum: [ + { value: '', label: '全部' }, + { value: '0', label: '待申报' }, + { value: '1', label: '待审核' }, + { value: '2', label: '已通过' }, + { value: '3', label: '不通过' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + containsAllLabel: true + }, + default: '' + }, + declareResult: { + type: 'string', + title: '申报结果', + ui: { + placeholder: '请选择', + widget: 'select', + } + }, + overdueStatus: { + title: '是否逾期', + type: 'string', + enum: [ + { value: '', label: '全部' }, + { value: false, label: '否' }, + { value: true, label: '是' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + containsAllLabel: true + }, + default: '' + }, + taxMonth: { + title: '税款所属期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + sbrq: { + title: '申报日期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + } + } + } + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px' }, + { + title: '申报状态', + index: 'declareStatus', + className: 'text-center', + width: '120px', + type: 'badge', + badge: { + '0': { text: '待申报', color: 'default' }, + '1': { text: '待审核', color: 'processing' }, + '2': { text: '已通过', color: 'success' }, + '3': { text: '不通过', color: 'error' } + } + }, + { + title: '是否逾期', + index: 'overdueStatus', + className: 'text-center', + width: '120px', + type: 'enum', + enum: { false: '否', true: '是' } + }, + { + title: '税款所属期起', + index: 'skssqq', + className: 'text-center', + width: '150px' + }, + { title: '税款所属期止', index: 'skssqz', className: 'text-center', width: '150px' }, + { + title: '纳税人名称', + index: 'nsrmc', + className: 'text-center', + width: '180px' + }, + { title: '纳税人识别号', index: 'nsrsbh', className: 'text-center', width: '200px' }, + { + title: '税率', + index: 'sl', + className: 'text-right', + width: '150px', + format: item => `${item.sl ? ((item.sl as number) * 100).toFixed(2) : 0}%` + }, + { title: '申报人数', index: 'sbrs', className: 'text-right', width: '150px' }, + { + title: '应税收入', + index: 'yssr', + className: 'text-right', + width: '150px', + type: 'widget', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yssr }) } + }, + { + title: '应纳税额', + index: 'ynse', + className: 'text-right', + width: '180px', + type: 'widget', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ynse }) } + }, + { + title: '累计已缴纳税额', + index: 'ljyjnse', + className: 'text-center', + width: '150px', + type: 'widget', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ljyjnse }) } + }, + { + title: '本期应补退税额', + index: 'bqybtse', + className: 'text-center', + width: '150px', + type: 'widget', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.bqybtse }) } + }, + { title: '申报日期', index: 'sbrq', className: 'text-center', width: '150px' } + ]; + } + + /** + *更正 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.service.msgSrv.warning('请选择需要更正的数据'); + return; + } + // this.modal.confirm({ + // nzTitle: '撤回提示', + // nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + // nzOkText: '确定', + // nzCancelText: '取消', + // nzOnOk: () => { + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('撤销成功'); + // this.search(); + // } + // }); + // } + // }); + } + + selectChange(item: any) { + this.selectedIndex = item?.value || ''; + setTimeout(() => { + this.st.load(1); + }); + } + + /** + * 申报 + */ + upload() { + if (this.selectedRows.length === 0) { + this.service.msgSrv.warning('请选择需要上传的数据'); + return; + } + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('申报成功'); + // this.search(); + // } + // }) + } + + /** + * + * @param params 更新数据 + */ + uploadSetting() { + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('更新成功'); + // this.search(); + // } + // }) + } + + search() { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } +} diff --git a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.html b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.html new file mode 100644 index 00000000..60f67739 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.html @@ -0,0 +1,91 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + {{ item?.billStatusLabel }} + {{ item?.billStatusLabel }} + 异常 + + + + {{ item?.billStatusLabel }} + {{ item?.billStatusLabel }} + + +
    {{ item?.amount | currency: ' ' }}
    +
    +
    +
    + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + + +
    +
    + + + +
    司机姓名:张三/13812345678
    +
    是否确认要将该司机的起征点同步调整为超过15万?
    +
    + + + + +
    diff --git a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.less b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.less new file mode 100644 index 00000000..43a47df4 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.less @@ -0,0 +1,5 @@ +:host { + .text-black { + color: #000; + } +} diff --git a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.spec.ts b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.spec.ts new file mode 100644 index 00000000..23f9fc25 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.spec.ts @@ -0,0 +1,34 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-30 14:45:52 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-31 10:36:54 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\tax-management\\components\\individual-declare\\individual-declare.component.spec.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { TaxManagementIndividualDeclareComponent } from './individual-declare.component'; + +describe('TaxManagementIndividualDeclareComponent', () => { + let component: TaxManagementIndividualDeclareComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ TaxManagementIndividualDeclareComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TaxManagementIndividualDeclareComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts new file mode 100644 index 00000000..aabc62f5 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-declare/individual-declare.component.ts @@ -0,0 +1,431 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { TaxManagementService } from '../../services/tax-management.service'; +// import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; +// import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component'; + +@Component({ + selector: 'app-tax-management-individual-declare', + templateUrl: './individual-declare.component.html', + styleUrls: ['./individual-declare.component.less'] +}) +export class TaxManagementIndividualDeclareComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType!: string; + tabs: any[] = [ + { name: '待申报', value: '1' }, + { name: '待审核', value: '2' }, + { name: '已通过', value: '3' }, + { name: '不通过', value: '4' }, + { name: '全部', value: '' } + ]; + selectedIndex = ''; //选择的项目 + serviceTel = ''; + isVisible : boolean = false + constructor( + public service: TaxManagementService, + private router: Router, + private ar: ActivatedRoute, + public shipperservice: ShipperBaseService, + private modal: NzModalService, + public shipperSrv: ShipperBaseService + ) {} + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + representationsStatus: this.selectedIndex + }); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item: any) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + const object1 : any = {}; + const object2 : any = {}; + Object.defineProperty(object1, 'name',{ writable: false ,value: 'wang'}); + Object.defineProperty(object2, 'xxoo',{ writable: false ,value: 'wang'}); + console.log(object1); + console.log(object1.name); + console.log(object2); + console.log(object2.xxoo); + object1.name = 'ming' + object2.xxoo = 'ming' + console.log(object1); + console.log(object2); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { title: '司机姓名', type: 'string', ui: { placeholder: '请输入' } }, + resourceCode: { + type: 'string', + title: '联系电话', + ui: { + placeholder: '请输入' + } + }, + driverName: { + title: '证件号码', + type: 'string', + ui: { + placeholder: '请输入证件号码' + } + }, + serviceType2: { + title: '申报状态', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + serviceType3: { + title: '申报结果', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + serviceType1: { + title: '是否逾期', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + createTime: { + title: '税款所属期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTime3: { + title: '申报日期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + } + } + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() }, + $time: { grid: { span: 24 } } + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px' }, + { title: '申报状态', render: 'orderStatus', className: 'text-center', width: '120px' }, + { title: '是否逾期', render: 'localValid', className: 'text-center', width: '120px' }, + { + title: '税款所属期起', + render: 'billComplianceVOS', + className: 'text-center', + width: '150px' + }, + { title: '税款所属期止', render: 'freightDetails', className: 'text-center', width: '150px' }, + { + title: '纳税人名称', + render: 'serviceType', + className: 'text-center', + width: '180px' + }, + { title: '纳税人识别号', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '姓名', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '证件类型', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '证件号码', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '联系电话', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '国家(地区)', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '所属行业', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '征收项目', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '征收品目', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '计税依据', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '税率', index: 'loadingPlace', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '应纳税额', render: 'transportInfo', className: 'text-center', width: '180px' }, + { title: '减免税额', render: 'transportInfo', className: 'text-center', width: '180px' }, + { title: '已缴纳税额', render: 'transportInfo', className: 'text-center', width: '180px' }, + { title: '应代征税额', render: 'transportInfo', className: 'text-center', width: '180px' }, + { title: '已代征税额', render: 'payeeName', className: 'text-center', width: '150px' }, + { title: '申报日期', render: 'payeeName', className: 'text-center', width: '150px' }, + ]; + } + + /** + *撤销 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要撤回的数据'); + return; + } + this.modal.confirm({ + nzTitle: '撤回提示', + nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + this.search(); + } + }); + } + }); + } + /** + *撤销 + * @param record 记录实例 + */ + resetData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据!'); + return; + } + this.isVisible = true + + } + /** + *撤销 + * @param record 记录实例 + */ + unnormal(value: any) { + this.modal.confirm({ + nzTitle: '税务审核结果', + nzContent: '订单结算时间所在月份与申报月份不一致', + nzOkText: '确定', + nzCancelText: '', + nzOnOk: () => { + this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + this.search(); + } + }); + } + }); + } + + selectChange(item: any) { + this.selectedIndex = item?.representationsStatus || ''; + setTimeout(() => { + this.st.load(1); + }); + } + + /** + * 查看当行数据 + */ + view(record: STData) { + // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar }); + this.router.navigate(['../detail'], { + queryParams: { + id: record.id + }, + relativeTo: this.ar + }); + } + + // appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzWidth: '40%', + // nzContent: CtcAppealComponent, + // nzComponentParams: { + // i: item, + // status: 'add' + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // if (res) { + // this.search({ representationsStatus: '' }); + // } + // }) + // } + + /** + * 申报 + */ + upload() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('申报成功'); + // this.search(); + // } + // }) + } + + /** + * + * @param params 更新数据 + */ + uploadSetting() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('更新成功'); + // this.search(); + // } + // }) + } + + /** + * 查看校验结果 + */ + viewResult(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '本地校验结果', + // nzWidth: 1200, + // nzContent: TaxManagementOrderVerifyResultComponent, + // nzComponentParams: { + // record: item + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // }) + } + + /** + * 查看监管审核结果 + */ + viewAuditResult(record: any) { + if (record?.billStatus !== '2') { + return; + } + this.openWainingModal('监管审核结果', record?.result); + } + + search() { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + openWainingModal(content: string, title = '提示') { + this.modal.warning({ + nzMask: false, + nzTitle: title, + nzContent: content + }); + } + handleOK() { + + } + handleCancel() { + this.isVisible = false; + } +} diff --git a/src/app/routes/tax-management/components/individual-income/individual-income.component.html b/src/app/routes/tax-management/components/individual-income/individual-income.component.html new file mode 100644 index 00000000..44f45d7f --- /dev/null +++ b/src/app/routes/tax-management/components/individual-income/individual-income.component.html @@ -0,0 +1,65 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + + +
    +
    + + + +
    司机姓名:张三/13812345678
    +
    是否确认要将该司机的起征点同步调整为超过15万?
    +
    + + + + +
    \ No newline at end of file diff --git a/src/app/routes/tax-management/components/individual-income/individual-income.component.ts b/src/app/routes/tax-management/components/individual-income/individual-income.component.ts new file mode 100644 index 00000000..315d5f47 --- /dev/null +++ b/src/app/routes/tax-management/components/individual-income/individual-income.component.ts @@ -0,0 +1,377 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TaxManagementService } from '../../services/tax-management.service'; + +@Component({ + selector: 'app-tax-management-individual-income', + templateUrl: './individual-income.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class TaxManagementIndividualIncomeComponent implements OnInit { + _$expand = false; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + isLoading: boolean = false; + tabs: any[] = [ + { name: '待申报', value: '0' }, + { name: '待审核', value: '1' }, + { name: '已通过', value: '2' }, + { name: '不通过', value: '3' }, + { name: '全部', value: '' } + ]; + selectedIndex = '0'; //选择的项目 + isVisible: boolean = false; + + selectedRows: any[] = []; + + constructor(public service: TaxManagementService) {} + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + declareStatus: this.selectedIndex + }); + delete params._$expand; + return { ...params }; + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + driverName: { title: '司机姓名', type: 'string', ui: { placeholder: '请输入' } }, + telephone: { + type: 'string', + title: '联系电话', + ui: { + placeholder: '请输入' + } + }, + cardNumber: { + title: '证件号码', + type: 'string', + ui: { + placeholder: '请输入证件号码' + } + }, + declareStatus: { + title: '申报状态', + type: 'string', + enum: [ + { value: '', label: '全部' }, + { value: '0', label: '待申报' }, + { value: '1', label: '待审核' }, + { value: '2', label: '已通过' }, + { value: '3', label: '不通过' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + }, + default: '' + }, + // declareStatu1s: { + // title: '申报结果', + // type: 'string', + // ui: { + // placeholder: '请选择', + // widget: 'dict-select', + // params: { dictKey: 'service:type' }, + // containsAllLabel: true, + // visibleIf: { + // _$expand: (value: boolean) => value + // } + // } + // }, + isOvertime: { + title: '是否逾期', + type: 'string', + enum: [ + { value: '', label: '全部' }, + { value: '0', label: '否' }, + { value: '1', label: '是' } + ], + ui: { + placeholder: '请选择', + widget: 'select', + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + }, + default: '' + }, + taxDate: { + title: '税款所属期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + declareDate: { + title: '申报日期', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + } + } + } + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px' }, + { + title: '申报状态', + index: 'declareStatus', + className: 'text-center', + width: '120px', + type: 'badge', + badge: { + '0': { text: '待申报', color: 'default' }, + '1': { text: '待审核', color: 'processing' }, + '2': { text: '已通过', color: 'success' }, + '3': { text: '不通过', color: 'error' } + } + }, + { title: '是否逾期', index: 'overtime', className: 'text-center', width: '120px', type: 'enum', enum: { '0': '否', '1': '是' } }, + { title: '税款所属期起', index: 'skssqq', className: 'text-center', width: '150px' }, + { title: '税款所属期止', index: 'skssqz', className: 'text-center', width: '150px' }, + { title: '纳税人名称', index: 'nsrmc', className: 'text-center', width: '180px' }, + { title: '纳税人识别号', index: 'nsrsbh', className: 'text-center', width: '200px' }, + { title: '行业', index: 'hy', className: 'text-center', width: '200px' }, + { title: '行政区划', index: 'xzqh', className: 'text-center', width: '120px' }, + { title: '街道乡镇', index: 'jdxz', className: 'text-center', width: '350px' }, + { title: '税务机关', index: 'swjg', className: 'text-center', width: '180px' }, + { title: '姓名', index: 'xm', className: 'text-center', width: '180px' }, + { title: '证件类型', index: 'sfzjlx', className: 'text-center', width: '250px' }, + { title: '证件号码', index: 'sfzjhm', className: 'text-center', width: '200px' }, + { title: '联系电话', index: 'lxdh', className: 'text-center', width: '200px' }, + { title: '国籍(地区)', index: 'gjdq', className: 'text-center', width: '150px' }, + { title: '生产经营地行政区划', index: 'scjydxzqh', className: 'text-center', width: '180px' }, + { + title: '当月应税收入', + index: 'dyyssr', + width: '150px', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.dyyssr }) } + }, + { + title: '应税收入', + index: 'yssr', + width: '150px', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yssr }) } + }, + { + title: '应税所得率', + index: 'yssdl', + className: 'text-right', + width: '250px', + format: item => `${item.yssdl ? ((item.yssdl as number) * 100).toFixed(2) : 0}%` + }, + { title: '计税依据', index: 'jsyj', className: 'text-right', width: '150px' }, + { + title: '税率', + index: 'sl', + className: 'text-right', + width: '150px', + format: item => `${item.sl ? ((item.sl as number) * 100).toFixed(2) : 0}%` + }, + { title: '速算扣除数', index: 'sskcs', className: 'text-right', width: '150px' }, + { + title: '应纳税额', + index: 'ynse', + width: '150px', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ynse }) } + }, + { + title: '累计已缴纳税额', + index: 'ljyjnse', + width: '150px', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ljyjnse }) } + }, + { + title: '本期应补退税额', + index: 'bqybtse', + width: '150px', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.bqybtse }) } + }, + { title: '申报日期', index: 'sbrq', className: 'text-center', width: '150px' } + ]; + } + + /** + *更正 + * @param record 记录实例 + */ + corrections() { + // if (this.selectedRows.length === 0) { + // this.openWainingModal('请选择需要撤回的数据'); + // return; + // } + // this.modal.confirm({ + // nzTitle: '撤回提示', + // nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + // nzOkText: '确定', + // nzCancelText: '取消', + // nzOnOk: () => { + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('撤销成功'); + // this.search(); + // } + // }); + // } + // }); + } + /** + *修改起征点 + * @param record 记录实例 + */ + resetData() { + // if (this.selectedRows.length === 0) { + // this.openWainingModal('请选择需要更新的数据!'); + // return; + // } + // this.isVisible = true; + } + + selectChange(item: any) { + this.selectedIndex = item?.value || ''; + setTimeout(() => { + this.st.load(1); + }); + } + + /** + * 申报 + */ + upload() { + if (this.selectedRows.length === 0) { + this.service.msgSrv.warning('请选择需要申报的数据'); + return; + } + // this.modal.warning({ + // nzTitle: '申报提示', + // nzContent: '订单结算时间所在月份与申报月份不一致......' + // }); + // this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + // if (res) { + // this.service.msgSrv.success('申报成功'); + // this.search(); + // } + // }) + } + + /** + * + * @param params 更新数据 + */ + uploadSetting() { + this.service.request(this.service.$api_update_individual_income_page).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('更新成功'); + this.search(); + } + }); + } + + search() { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + handleOK() {} + handleCancel() { + this.isVisible = false; + } +} diff --git a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.html b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.html new file mode 100644 index 00000000..3d46b927 --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.html @@ -0,0 +1,109 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + 待上传 + 已上传 + 上传中 + 上传异常 + + + + + 校验中 + 通过 + + 不通过 + + + +
    {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : '' }}
    +
    + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    {{item?.orderAmount | currency :' '}}
    +
    +
    +
    + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据 +
    + + + + +
    +
    diff --git a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.less b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.less new file mode 100644 index 00000000..94ec07e0 --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.less @@ -0,0 +1,22 @@ +:host { + .text-black { + color: #000; + } + .icon { + display: inline-block; + width: 1em; + height: 1em; + stroke-width: 0; + stroke: currentColor; + /* stylelint-disable-next-line order/properties-order */ + fill: currentColor; + } + ::ng-deep { + .imgBox { + display: flex; + img { + width: 60px !important; + } + } + } +} diff --git a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.spec.ts b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.spec.ts new file mode 100644 index 00000000..2c07610f --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOrderReportingComponent } from './order-reporting.component'; + +describe('DatatableOrderReportingComponent', () => { + let component: DatatableOrderReportingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOrderReportingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOrderReportingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts new file mode 100644 index 00000000..3ea3973e --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/order-reporting.component.ts @@ -0,0 +1,503 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { TaxManagementService } from '../../services/tax-management.service'; +import { TaxManagementUploadSettingComponent } from './upload-setting/upload-setting.component'; +import { TaxManagementOrderVerifyResultComponent } from './verify-result/verify-result.component'; +// import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; +// import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component'; + +@Component({ + selector: 'app-tax-management-order-reporting', + templateUrl: './order-reporting.component.html', + styleUrls: ['./order-reporting.component.less'] +}) +export class TaxManagementOrderReportingComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType!: string; + isLoading: boolean = false; + tabs: any[] = [ + { name: '待上传', value: '0' }, + { name: '上传中', value: '3' }, + { name: '已上传', value: '1' }, + { name: '异常', value: '2' }, + { name: '全部', value: '' } + ]; + selectedIndex = ''; //选择的项目 + serviceTel = ''; + constructor( + public service: TaxManagementService, + private router: Router, + private ar: ActivatedRoute, + public shipperservice: ShipperBaseService, + private modal: NzModalService, + public shipperSrv: ShipperBaseService + ) { + } + + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const params = Object.assign({}, this.sf?.value || {}, { + putStatus: this.selectedIndex, + }); + delete params._$expand; + return { ...params }; + } + + /** + * 选中行 + */ + get selectedRows() { + return this.st?.list.filter((item: any) => item.checked) || []; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.isLoading = true + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.initSF(); + this.initST(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billCode: { title: '订单号', type: 'string', ui: { placeholder: '请输入' } }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入', + }, + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + + } as SFSelectWidgetSchema + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + placeholder: '请输入司机姓名/手机号', visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + carNo: { + title: '车牌号', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + collectionUserName: { + title: '收款人', + type: 'string', + maxLength: 9, + ui: { + placeholder: '请输入', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + putStatus: { + title: '上传状态', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + checkStatus: { + title: '精准', + type: 'string', + ui: { + placeholder: '请选择', + widget: 'dict-select', + params: { dictKey: 'service:type' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + networkTransporter: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + recentlyPutTime: { + title: '上传时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + orderPayTime: { + title: '结束时间', + type: 'string', + ui: { + widget: 'sl-from-to', + type: 'date', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + }, + }; + this.ui = { + '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.search() }, + $time: { grid: { span: 24 } }, + }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', className: 'text-center', width: '60px', }, + { title: '上传状态', render: 'putStatus', className: 'text-center', width: '120px', }, + { title: '精准', render: 'checkStatus', className: 'text-center', width: '120px', }, + { + title: '订单号', + index: 'billCode', + className: 'text-center', + width: '150px', + }, + { title: '运单号', index: 'wayBillCode', className: 'text-center', width: '150px', }, + { + title: '网络货运人', + render: 'shipperName', + className: 'text-center', + width: '180px', + }, + { title: '装货地', index: 'loadingAddress', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '装货地详细地址', index: 'loadingDetailedAddress', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '卸货地', index: 'unloadAddress', render: 'dischargePlace', className: 'text-center', width: '120px' }, + { title: '卸货地详细地址', index: 'unloadDetailedAddress', className: 'text-center', width: '180px' }, + { title: '货主名称', index: 'shipperName', className: 'text-center', width: '180px' }, + { title: '货主纳税人识别号', index: 'shipperProvinceCode', className: 'text-center', width: '180px' }, + { title: '录单时间', index: 'billCreateTime', className: 'text-center', width: '250px' }, + { title: '接单时间', index: 'wayBillCreateTime', className: 'text-center', width: '200px' }, + { title: '发车时间', index: 'loadTime', className: 'text-center', width: '200px' }, + { title: '到车时间', index: 'unloadTime', className: 'text-center', width: '150px' }, + { title: '结束时间', index: 'payeeName', className: 'text-center', width: '150px' }, + { title: '订单金额', render: 'orderAmount', className: 'text-center', width: '120px' }, + { title: '司机姓名', render: 'driverName', className: 'text-center', width: '150px' }, + { title: '司机身份证号', index: 'transpdriverCertificateNumberortInfo', className: 'text-center', width: '180px' }, + { title: '车牌号', index: 'carNo', className: 'text-center', width: '100px' }, + { title: '货物信息', render: 'transportInfo', className: 'text-center', width: '200px' }, + { title: '运费金额', render: 'payeeName', className: 'text-center', width: '100px' }, + { title: '装卸方式', index: 'loadingUnloadWay', className: 'text-center', width: '180px' }, + { title: '支付方式', index: 'payMent', className: 'text-center', width: '150px' }, + { title: '支付账号', index: 'paymentAccount', className: 'text-center', width: '200px' }, + { title: '银行流水号', index: 'bankSerialNumber', className: 'text-center', width: '150px' }, + { title: '收款人姓名', index: 'collectionUserName', className: 'text-center', width: '250px' }, + { title: '收款人身份证号码', index: 'collectionUserCertificateNumber', className: 'text-center', width: '180px' }, + { title: '装货照片', render: 'loadingPicture', className: 'text-center', width: '100px' }, + { title: '卸货照片', render: 'unloadPicture', className: 'text-center', width: '100px' }, + { title: '提货单', render: 'loadingLadingBill', className: 'text-center', width: '100px' }, + { title: '签收单', render: 'signatureForm', className: 'text-center', width: '100px' }, + { title: '上传次数', index: 'putNumber', className: 'text-center', width: '100px' }, + { title: '最近上传时间', index: 'recentlyPutTime', className: 'text-center', width: '180px' }, + ]; + } + + + + /** + *撤回 + * @param record 记录实例 + */ + recall() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要撤回的数据'); + return; + } + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + this.modal.confirm({ + nzTitle: '撤回提示', + nzContent: ' 撤回后可以重新上传,重新上传会覆盖已上传数据,确定要撤回?', + nzOkText: '确定', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_get_recessionTaxOrder,params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + this.search(); + } + }) + } + }); + + } + /** + *撤销 + * @param record 记录实例 + */ + resetData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据!'); + return; + } + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + this.service.request(this.service.$api_get_renewalOrderById, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('更新成功'); + this.st.load(1); + } + }) + } + /** + *撤销 + * @param record 记录实例 + */ + unnormal(value: any) { + // if (this.selectedRows.length === 0) { + // this.openWainingModal('请选择需要更新的数据!'); + // return; + // } + console.log(this.selectedRows); + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + this.modal.confirm({ + nzTitle: '税务审核结果', + nzContent: '订单结算时间所在月份与申报月份不一致', + nzOkText: '确定', + nzCancelText: '', + nzOnOk: () => { + this.service.request(this.service.$api_get_recessionTaxOrder, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('撤销成功'); + this.search(); + } + }) + } + }); + + } + + selectChange(item: any) { + console.log(item); + + this.selectedIndex = item?.value || ''; + setTimeout(() => { + this.st.load(); + }) + } + + /** + * 查看当行数据 + */ + view(record: STData) { + // this.router.navigate(['../view', record.uuid], { relativeTo: this.ar }); + this.router.navigate(['../detail'], { + queryParams: { + id: record.id, + }, + relativeTo: this.ar + }); + } + + // appeal(item: any) { + // const modalRef = this.modal.create({ + // nzTitle: '申诉', + // nzWidth: '40%', + // nzContent: CtcAppealComponent, + // nzComponentParams: { + // i: item, + // status: 'add' + // }, + // nzFooter: null + // }); + // modalRef.afterClose.subscribe(res => { + // if (res) { + // this.search({ representationsStatus: '' }); + // } + // }) + // } + + /** + * 上传 + */ + upload() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要上传的数据'); + return; + } + let params: any[] = []; + this.selectedRows.forEach(item => { + params.push(item.id); + }); + this.service.request(this.service.$api_get_uploadingTaxOrder, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('上传成功'); + this.st.load(); + } + }) + } + + + /** + * + * @param params 上传设置 + */ + uploadSetting() { + const modalRef = this.modal.create({ + nzTitle: '税务上传设置', + nzWidth: 600, + nzContent: TaxManagementUploadSettingComponent, + nzComponentParams: {}, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }) + } + + /** + * 查看校验结果 + */ + viewResult(item: any) { + const modalRef = this.modal.create({ + nzTitle: '本地校验结果', + nzWidth: 1200, + nzContent: TaxManagementOrderVerifyResultComponent, + nzComponentParams: { + record: item + }, + nzFooter: null + }); + modalRef.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }) + } + + /** + * 查看监管审核结果 + */ + viewAuditResult(record: any) { + if (record?.billStatus !== '2') { + return; + } + this.openWainingModal('监管审核结果', record?.result) + } + + + search() { + this.st.load(1); + } + + /** + * 异步导出 + */ + export() { + this.service.exportStart(this.sf?.value, this.service.$api_async_export_order_reporting_list); + } + + openWainingModal(content: string, title = '提示') { + this.modal.warning({ + nzMask: false, + nzTitle: title, + nzContent: content, + }) + } + + +} diff --git a/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.html b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.html new file mode 100644 index 00000000..a4f5ae6e --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.html @@ -0,0 +1,8 @@ + + + + diff --git a/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.spec.ts b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.spec.ts new file mode 100644 index 00000000..aeb5cf2c --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingUploadSettingComponent } from './upload-setting.component'; + +describe('DatatableReportingUploadSettingComponent', () => { + let component: DatatableReportingUploadSettingComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingUploadSettingComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingUploadSettingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.ts b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.ts new file mode 100644 index 00000000..f171259e --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/upload-setting/upload-setting.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit } from '@angular/core'; +import { SFSchema, SFUISchema } from '@delon/form'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { TaxManagementService } from '../../../services/tax-management.service'; + + +@Component({ + selector: 'app-datatable-upload-setting', + templateUrl: './upload-setting.component.html', +}) +export class TaxManagementUploadSettingComponent implements OnInit { + record: any = {}; + i: any = {}; + schema!: SFSchema; + ui!: SFUISchema; + + constructor( + private modal: NzModalRef, + public service: TaxManagementService + ) { } + + ngOnInit(): void { + this.initSF(); + // this.loadData(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + no: { + type: 'string', + title: '订单数据', + enum: [ + { + label: '手动上传', + value: '1' + }, + { + label: '自动上传', + value: '2' + } + ], + description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', + ui: { + widget: 'radio', + + } + }, + owner: { + type: 'string', + title: '资金数据', + enum: [ + { + label: '手动上传', + value: '1' + }, + { + label: '自动上传', + value: '2' + } + ], + description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', + ui: { + widget: 'radio', + + } + }, + }, + required: ['owner', 'no'], + } + this.ui = { + '*': { + spanLabelFixed: 100, + grid: { span: 24 }, + }, + }; + } + + /** + * 获取设置数据 + */ + loadData() { + this.service.request(this.service.$api_get_upload_setting, {}).subscribe(res => { + if (res) { + this.i = res; + + } + }) + } + + /** + * 修改 + * @param value + */ + save(value: any): void { + this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + }) + } + + close(): void { + this.modal.destroy(); + } +} diff --git a/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.html b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.html new file mode 100644 index 00000000..73c52e88 --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.html @@ -0,0 +1,33 @@ + +
    +
    + + + +
    +
    + + +
    +
    {{item.expenseName}}:{{item.price | currency}}
    +
    +
    +
    +
    +
    + diff --git a/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.spec.ts b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.spec.ts new file mode 100644 index 00000000..48b1e9e5 --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableReportingVerifyResultComponent } from './verify-result.component'; + +describe('DatatableReportingVerifyResultComponent', () => { + let component: DatatableReportingVerifyResultComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [DatatableReportingVerifyResultComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableReportingVerifyResultComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts new file mode 100644 index 00000000..de01a2c0 --- /dev/null +++ b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts @@ -0,0 +1,103 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-30 14:26:01 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-08 15:36:04 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\tax-management\\components\\order-reporting\\verify-result\\verify-result.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { TaxManagementService } from '../../../services/tax-management.service'; + +@Component({ + selector: 'app-tax-management-order-reporting-verify-result', + templateUrl: './verify-result.component.html', +}) +export class TaxManagementOrderVerifyResultComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = []; + record: any = {} + subjectType: string = '0'; + tabs: any[] = [ + { name: '平台信息', value: '0' }, + { name: '货主信息', value: '1' }, + { name: '司机信息', value: '2' }, + { name: '订单信息', value: '3' }, + ]; + + get reqParams() { + const params ={ + subjectId: this.record?.shipperId, + subjectType: this.subjectType || '0' + } + return params; + } + constructor(public service: TaxManagementService, private modalRef: NzModalRef, public router: Router) { + } + + ngOnInit(): void { + console.log(this.record); + + this.initST(); + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '序号', type: 'no', className: 'text-center', width: '60px', }, + { title: '校验字段', index: 'orderStatus', className: 'text-center', width: '120px', }, + { title: '是否必填', index: 'orderStatus', className: 'text-center', width: '100px', }, + { title: '上传值', index: 'orderStatus', className: 'text-center', width: '120px', }, + { title: '本地校验', index: 'orderStatus', className: 'text-center', width: '100px', }, + { title: '错误内容', index: 'orderStatus', className: 'text-center', width: '150px', }, + ] + } + + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + + selectTab(e: any) { + setTimeout(() => { + this.subjectType = e?.value; + this.st.load(1); + }) + } + + update() { + if (this.record?.billType === '1') { + window.open(location.origin + `/#/order-management/vehicle-detailChange/${this.record?.id}`) + + } else if (this.record.billType === '2') { + window.open(location.origin + `/#/order-management/bulk-detailChange/${this.record?.id}`); + } + + + } + close(): void { + this.modalRef.destroy(); + } + + +} diff --git a/src/app/routes/tax-management/services/tax-management.service.ts b/src/app/routes/tax-management/services/tax-management.service.ts new file mode 100644 index 00000000..edd6d18e --- /dev/null +++ b/src/app/routes/tax-management/services/tax-management.service.ts @@ -0,0 +1,55 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 10:30:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-04-08 15:28:39 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\tax-management\\services\\tax-management.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class TaxManagementService extends ShipperBaseService { + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + // + public $api_order_reporting_page = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + + // 查询运营报表 + $api_listOperationalReportPage = `/api/sdc/report/listOperationalReportPage`; + + // 查询个税申报明细 + $api_get_individual_income_page = `/api/sdc/taxIncome/list/page`; + // 更新所有数据个税申报明细 + $api_update_individual_income_page = `/api/sdc/taxIncome/updateAll`; + + // 查询个税汇总 + $api_get_individual_collect_page = `/api/sdc/taxSummary/list/page`; + // 更新所有数据个税汇总 + $api_update_individual_collect_page = `/api/sdc/taxIncome/updateAll`; + + // 订单上报列表 + $api_getTaxOrderPage_page = `/api/sdc/taxOrder/getTaxOrderPage`; + // 根据订单Id更新税务订单 + $api_get_renewalOrderById = `/api/sdc/taxOrder/renewalOrderById`; + // 撤回税务订单 + $api_get_recessionTaxOrder = `/api/sdc/tax/recessionTaxOrder`; + // 上传税务订单 + $api_get_uploadingTaxOrder = `/api/sdc/tax/uploadingTaxOrder`; + // 上传税务订单 + $api_get_getTaxFieldCheckList = `/api/sdc/taxFieldCheck/getTaxFieldCheckList`; + $api_recall_reporting = ``; // 撤回 + $api_async_export_order_reporting_list = ``; // 导出订单上报 + $api_get_upload_setting = ``; // 修改上传设置 + $api_upload_setting_save = ``; // 修改上传设置 + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/tax-management/tax-management-routing.module.ts b/src/app/routes/tax-management/tax-management-routing.module.ts new file mode 100644 index 00000000..84b09d08 --- /dev/null +++ b/src/app/routes/tax-management/tax-management-routing.module.ts @@ -0,0 +1,31 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-30 13:58:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-31 10:37:24 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\tax-management\\tax-management-routing.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { TaxManagementIndividualCollectComponent } from './components/individual-collect/individual-collect.component'; +import { TaxManagementIndividualDeclareComponent } from './components/individual-declare/individual-declare.component'; +import { TaxManagementIndividualIncomeComponent } from './components/individual-income/individual-income.component'; +import { TaxManagementOrderReportingComponent } from './components/order-reporting/order-reporting.component'; + + +const routes: Routes = [ + { path: 'orderReport', component: TaxManagementOrderReportingComponent }, + { path: 'income', component: TaxManagementIndividualIncomeComponent }, + { path: 'collect', component: TaxManagementIndividualCollectComponent }, + { path: 'declare', component: TaxManagementIndividualDeclareComponent }, +]; + + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TaxManagementModuleRoutingModule { } diff --git a/src/app/routes/tax-management/taxmanagement.module.ts b/src/app/routes/tax-management/taxmanagement.module.ts new file mode 100644 index 00000000..92dbda10 --- /dev/null +++ b/src/app/routes/tax-management/taxmanagement.module.ts @@ -0,0 +1,40 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-30 13:58:28 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-30 14:35:17 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\tax-management\\taxmanagement.module.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ +import { NgModule, Type } from '@angular/core'; +import { SharedModule, SHARED_G2_MODULES } from '@shared'; +import { TaxManagementIndividualCollectComponent } from './components/individual-collect/individual-collect.component'; +import { TaxManagementIndividualDeclareComponent } from './components/individual-declare/individual-declare.component'; +import { TaxManagementIndividualIncomeComponent } from './components/individual-income/individual-income.component'; +import { TaxManagementOrderReportingComponent } from './components/order-reporting/order-reporting.component'; +import { TaxManagementUploadSettingComponent } from './components/order-reporting/upload-setting/upload-setting.component'; +import { TaxManagementOrderVerifyResultComponent } from './components/order-reporting/verify-result/verify-result.component'; +import { TaxManagementModuleRoutingModule } from './tax-management-routing.module'; + + +const COMPONENTS: Type[] = [ + TaxManagementOrderReportingComponent, + TaxManagementOrderVerifyResultComponent, + TaxManagementUploadSettingComponent, + TaxManagementIndividualIncomeComponent, + TaxManagementIndividualCollectComponent, + TaxManagementIndividualDeclareComponent +] + + +@NgModule({ + imports: [ + SharedModule, + TaxManagementModuleRoutingModule, + SHARED_G2_MODULES + ], + declarations: COMPONENTS, +}) +export class TaxManagementModule { } diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.html b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.html new file mode 100644 index 00000000..84bf6e93 --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.html @@ -0,0 +1,94 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 张发票   发票金额总计 + {{totalCallNo }} + 清空 +
    + + +
    +
    + + + + + {{ item.vatinvcode }}
    + +
    +
    +
    + + +
    +
    + +

    公司名: {{openInfo?.artoname}}

    +

    税号: {{openInfo?.artotaxno}}

    +

    注册地址: {{openInfo?.artoadd}}

    +

    注册电话: {{openInfo?.artotel}}

    +

    开户行: {{openInfo?.artobank}}

    +
    + + {{openInfo?.vatnameLabel}} + + + {{openInfo?.vatremarks}} + + + {{openInfo?.otherremarks}} + + + {{openInfo?.isdetail?'需要':'不需要'}} + + + {{openInfo?.vatmoney | currency}} + + + + + + + + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.less b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.less new file mode 100644 index 00000000..40095399 --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.less @@ -0,0 +1,26 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 0; + } + } + + nz-range-picker { + width: 100%; + } + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } + + .text-truncate { + white-space: normal; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts new file mode 100644 index 00000000..0429894f --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts @@ -0,0 +1,427 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form'; +import { dateTimePickerUtil } from '@delon/util'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { TicketService } from '../../services/ticket.service'; +import { RequestedInvoiceModalComponent } from '../invoice-requested/requested-invoice-modal/requested-invoice-modal.component'; +import { PushInvoiceComponent } from './push-invoice/push-invoice.component'; + +@Component({ + selector: 'app-cancellation-invoice', + templateUrl: './cancellation-invoice.component.html', + styleUrls: ['./cancellation-invoice.component.less'] +}) +export class CancellationInvoiceComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('requestedModal', { static: false }) + requestedModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + resourceStatus: any = ''; + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + + openInfo: any = { invoicedate: null, invoiceno: null, invoiceno2: null }; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + if (this.resourceStatus) { + Object.assign(requestOptions.body, { + sts: this.resourceStatus + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + return data.map(node => ({ ...node, disabled: node.sts === '3' })); + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.vatmoney, 0).toFixed(2); + break; + } + } + + selectChange(e: any) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + + /** + * 手工开票 + * @param item + */ + requestedAction(item: any) { + this.openInfo = { invoicedate: null, invoiceno: null, invoiceno2: null }; + this.service.request(this.service.$api_get_apply_fico_info, { id: item.vatappHId }).subscribe(info => { + if (info) { + console.log(info); + Object.assign(this.openInfo, { ...info }); + const modal = this.nzModalService.create({ + nzTitle: '发票确认', + nzContent: this.requestedModal, + nzOnOk: () => { + if (!this.openInfo?.invoicedate || !this.openInfo?.invoiceno) { + this.service.msgSrv.warning('请填开票信息'); + return false; + } + const params = { + invoiceno: this.openInfo.invoiceno, + invoicedate: dateTimePickerUtil.format(this.openInfo.invoicedate), + invoiceno2: this.openInfo.invoiceno2 + }; + this.service + .request(this.service.$api_apply_fico_invoic, { + id: item.id, + vatinvcode: item.vatinvcode, + ...params + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('开票成功'); + this.st.load(1); + modal.destroy(); + } + }); + + return false; + } + }); + } + }); + } + + /** + * 批量推送发票 + */ + batchPush() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择推送开票单'); + return; + } + if (this.selectedRows.find(item => item.sts !== '1')) { + this.service.msgSrv.warning('请勿选择非待处理申请'); + return; + } + this.nzModalService.warning({ + nzTitle: '确定将所选待处理开票申请推送开票?', + nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果', + nzOnOk: () => { + this.service + .request( + this.service.$api_batch_push_invoic, + this.selectedRows.map(row => row.id) + ) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('推送开票成功'); + this.st.load(1); + } + }); + } + }); + } + + /** + * 撤回 + * @param item + * @returns + */ + batchWithdraw(item?: any) { + if (this.selectedRows?.length <= 0 && !item) { + this.service.msgSrv.warning('请选择开票申请'); + return; + } + this.nzModalService.warning({ + nzTitle: '确定将所选待确认开票申请撤回?', + nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果', + nzOnOk: () => {} + }); + } + + /** + * 移除 + * @returns + */ + batchRemove() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择开票申请'); + return; + } + this.nzModalService.warning({ + nzTitle: '确定将所选待确认开票申请撤回?', + nzContent: '提交税控后发票信息不可修改,待税控开票完成后返回开票结果', + nzOnOk: () => {} + }); + } + + /** + * 作废发票 + * @param item + * @returns + */ + removeInvocie(item?: any) { + const modal = this.nzModalService.warning({ + nzTitle: '确定将所选已确认开票申请作废?', + nzContent: '作废后发票信息不可修改', + nzOnOk: () => { + this.service.request(this.service.$api_cancel_invoic, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('发票作废成功'); + this.st.load(1); + modal.destroy(); + } + }); + return false; + } + }); + } + + downLoadDetail(item: any) { + this.service.exportStart({ id: item.id }, this.service.$api_export_invoic_detail); + } + + /** + * 推送发票 + * @param item + */ + pushInvoiceAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '推送开票', + nzContent: PushInvoiceComponent, + nzComponentParams: { id: item.vatappHId }, + nzWidth: 1200, + nzOnOk: () => { + this.service.request(this.service.$api_push_invoic, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('推送开票成功'); + this.st.load(1); + } + }); + return false; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + vatappHId: { + type: 'string', + title: '申请编号', + ui: { + placeholder: '请输入' + } + }, + arto: { + type: 'string', + title: '购买人', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }) + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + sts: { + title: '发票状态', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'vatinv:status' }, + containAllLable: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + // or2derSn: { + // type: 'string', + // title: '订单号', + // ui: { + // placeholder: '请输入', + // visibleIf: { + // expand: (value: boolean) => value + // } + // } + // }, + createTime: { + title: '申请时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', fixed: 'left', width: 50, className: 'text-center' }, + { title: '分票编号', render: 'vatinvcode', width: 200 }, + { + title: '申请编号', + index: 'vatappHCode', + width: 150, + type: 'link', + click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.vatappHId]) + }, + { title: '申请时间', index: 'createTime', type: 'date', width: 150 }, + { title: '发票类型', index: 'vatapptypeLabel', width: 150 }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '购买人', index: 'artoname', width: 160 }, + { title: '订单数', index: 'ordlines', width: 90, className: 'text-right' }, + { + title: '价税合计', + index: 'vatmoney', + width: 140, + type: 'widget', + className: 'text-right font-weight-bold', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) } + }, + { + title: '金额', + index: 'vatnotax', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } + }, + // { + // title: '税率', + // index: 'billvatrate', + // width: 120, + // className: 'text-right', + // format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` + // }, + { + title: '税额', + index: 'vattax', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) } + }, + { title: '服务名称', index: 'vatname', width: 120 }, + { title: '销货清单', index: 'isdetail', width: 120, type: 'enum', enum: { 1: '是', 0: '否' }, className: 'text-center' }, + { title: '票面备注', index: 'remarks', width: 250 }, + { title: '其他要求', index: 'otherremarks', width: 100 }, + { + title: '操作', + width: '120px', + fixed: 'right', + className: 'text-center', + buttons: [ + { type: 'divider' }, + { + text: '查看明细
    ', + click: item => + this.router.navigate(['ticket/cancellation-invoice/detail/' + item.id], { + queryParams: { type: 1, expressno: item.expressno, ltdId: item.shipperId } + }) + }, + { + text: '销货清单
    ', + iif: item => item.isdetail, + click: item => this.downLoadDetail(item) + }, + { + text: '手工开票
    ', + iif: item => item.sts != '3', + click: item => this.requestedAction(item) + }, + // { + // text: '推送开票
    ', + // iif: item => item.sts === '1', + // click: item => this.pushInvoiceAction(item) + // } + // { + // text: '作废发票', + // iif: item => item.sts === '3', + // click: item => this.removeInvocie(item) + // } + // { + // text: '确认' + // // click: item => this.rejectAction(item) + // }, + // { + // text: '撤回', + // click: item => this.batchWithdraw(item) + // } + ] + } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html new file mode 100644 index 00000000..b0c00a7b --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html @@ -0,0 +1,56 @@ +
    +
    + + {{info?.artoName}} + + + {{info?.taxNumber}} + + + {{info?.registerAddr}} + + + {{info?.registerPhone}} + + + {{info?.bankName}} + + + {{info?.bankAccount}} + + + {{info?.vatremarks}} + +
    +
    + + {{info?.ltdidName}} + + + {{info?.vatappcode}} + + + {{info?.vatinvBillNum}}笔 + + + {{info?.vatinvHNumAmount | currency}}元 + + + {{info?.vatnameLabel}} + + + {{info?.isdetail?'是':'否'}} + + + {{info?.otherremarks}} + + +
    +
    + + + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.less b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.less new file mode 100644 index 00000000..41a8c3bb --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.less @@ -0,0 +1,16 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + + .text-truncate { + white-space: normal; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts new file mode 100644 index 00000000..dec8b28f --- /dev/null +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts @@ -0,0 +1,62 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-push-invoice', + templateUrl: './push-invoice.component.html', + styleUrls: ['./push-invoice.component.less'], + providers: [CurrencyPipe] +}) +export class PushInvoiceComponent implements OnInit { + @ViewChild('st', { static: false }) + st!: STComponent; + columns!: STColumn[]; + + info: any = {}; + id!: number; + + constructor(public service: TicketService, private nzModalService: NzModalService, private currencyPipe: CurrencyPipe) {} + + ngOnInit(): void { + this.loadHeader(this.id); + setTimeout(() => { + this.columns = this.initST(); + }, 100); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { vatinvHId: this.id }); + return requestOptions; + }; + + loadHeader(id: number) { + this.service.request(this.service.$api_ficoVatinv_header, { id }).subscribe(res => { + console.log(res); + + if (res) { + this.info = res; + } + }); + } + + private initST(): STColumn[] { + return [ + { title: '服务名称', index: 'vatname', width: 100 }, + { title: '规格型号', index: 'vatmodel', width: 150 }, + { title: '单位', index: 'vatunit', width: 90, className: 'text-center' }, + { title: '数量', index: 'vatqty', width: 90, className: 'text-right' }, + { title: '金额', index: 'vatnotax', width: 90, type: 'currency', format: item => `${this.currencyPipe.transform(item.vatnotax)}` }, + { + title: '税率', + index: 'vatrate', + width: 90, + className: 'text-right', + format: item => `${item.vatrate ? ((item.vatrate as number) * 100).toFixed(2) : 0}%` + }, + { title: '税额', index: 'vattax', width: 90, type: 'currency', format: item => `${this.currencyPipe.transform(item.vattax)}` } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.html b/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.html new file mode 100644 index 00000000..c2cae6ac --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.html @@ -0,0 +1,15 @@ +
    +
    + +
    +
    + + +
    + + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.ts b/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.ts new file mode 100644 index 00000000..2910a0ab --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-cart/add-cart.component.ts @@ -0,0 +1,74 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-add-cart', + templateUrl: './add-cart.component.html' +}) +export class AddCartComponent implements OnInit { + data = []; + selectedData: any[] = []; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '车牌号', index: 'carNo' }, + { title: '车辆所有人', index: 'carOwner' } + ]; + searchSchema: SFSchema = { + properties: { + carNo: { + title: '', + type: 'string', + ui: { + placeholder: '请输入车牌号' + } + }, + carOwner: { + title: '', + type: 'string', + ui: { + placeholder: '请输入车辆所有人' + } + } + } + }; + + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + return data.map(item => ({ ...item, disabled: item.isWhiteList })); + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedData = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html new file mode 100644 index 00000000..c1bc3d77 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html @@ -0,0 +1,15 @@ +
    +
    + +
    +
    + + +
    +
    + + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts new file mode 100644 index 00000000..02136e3a --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-add-owner', + templateUrl: './add-owner.component.html' +}) +export class AddOwnerComponent implements OnInit { + data = []; + selectedData: any[] = []; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '企业名称', index: 'enterpriseName' }, + { title: '联系人姓名', index: 'contacter' }, + { title: '联系人手机号', index: 'mobile' }, + { + title: '认证状态', + index: 'approvalStatus', + type: 'enum', + enum: { 1: '未上传', 0: '草稿', 10: '待审核', 20: '已审核', 30: '已驳回', 40: '证件过期' } + } + ]; + searchSchema: SFSchema = { + properties: { + enterpriseName: { + title: '', + type: 'string', + ui: { + placeholder: '请输入企业名称' + } + }, + contactName: { + title: '', + type: 'string', + ui: { + placeholder: '请输入姓名' + } + }, + mobile: { + title: '', + type: 'string', + ui: { + placeholder: '请输入手机号' + } + } + } + }; + + constructor(public service: TicketService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { + listSource: 2, + approvalStatus: '20' + }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedData = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html new file mode 100644 index 00000000..007c85c4 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html @@ -0,0 +1,36 @@ + + + + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + +
    + + +
    + 已选择 + {{ selectedRows.length }} 条数据 + 清空 +
    +
    + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.less b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.less new file mode 100644 index 00000000..20e631b8 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.less @@ -0,0 +1,10 @@ +:host::ng-deep { + + .tabs-wrap>.ant-tabs-nav { + margin-bottom: 0; + } + + h1 { + margin: 0; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.ts b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.ts new file mode 100644 index 00000000..ed60003b --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.ts @@ -0,0 +1,297 @@ +import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; +import { TicketService } from '../../services/ticket.service'; +import { AddCartComponent } from './add-cart/add-cart.component'; +import { AddOwnerComponent } from './add-owner/add-owner.component'; + +@Component({ + selector: 'app-etc-blacklist', + templateUrl: './etc-blacklist.component.html', + styleUrls: ['../../../commom/less/box.less', './etc-blacklist.component.less'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ETCBlacklistComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + tabs = [ + { + name: '货主', + type: 1, + isActived: false + }, + { + name: '车辆', + type: 2, + isActived: false + } + ]; + tabType = 1; + + searchSchema: SFSchema = this.initSF(); + + columns: STColumn[] = this.initST(); + + selectedRows: any[] = []; + + constructor(public service: TicketService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + // 切换Tab + changeTab(item: any) { + this.tabType = item.type; + this.sf?.setValue('/tabType', item.type); + this.sf?.reset(); + this.selectedRows = []; + setTimeout(() => { + this.tabs.forEach(i => (i.isActived = false)); + item.isActived = !item.isActived; + // this.st.load(1); + this.st.resetColumns(); + }, 500); + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + configAction(item?: any) { + if (this.tabType === 1) { + this.addOwnerAction(item); + } else { + this.addCartAction(item); + } + } + + addOwnerAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '选择货主', + nzContent: AddOwnerComponent, + nzWidth: 850, + nzComponentParams: { data: [] }, + nzOnOk: com => { + if (com.selectedData?.length <= 0) { + this.service.msgSrv.warning('请选择货主'); + return false; + } + const ids = com.selectedData.map(node => node.id); + this.service.request(this.service.$api_save_etc_shipper, { shipperAppUserIdList: ids }).subscribe(res => { + if (res) { + this.service.msgSrv.success('添加成功'); + modal.destroy(); + this.st.load(1); + } + }); + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + addCartAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '选择车辆', + nzContent: AddCartComponent, + nzWidth: 700, + nzComponentParams: { data: [] }, + nzOnOk: com => { + if (com.selectedData?.length <= 0) { + this.service.msgSrv.warning('请选择车辆'); + return false; + } + const ids = com.selectedData.map(node => node.carId); + this.service.request(this.service.$api_save_etc_cart, { carIds: ids }).subscribe(res => { + if (res) { + this.service.msgSrv.success('添加成功'); + modal.destroy(); + this.st.load(1); + } + }); + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + deleteAction(item?: any) { + let ids: Array = []; + if (item) { + ids = [item.id]; + } else { + ids = this.selectedRows.map(node => node.id); + } + if (ids?.length <= 0) { + this.service.msgSrv.warning('请选择ETC白名单'); + return; + } + + const modal = this.nzModalService.warning({ + nzTitle: this.tabType === 1 ? '确定将所选货主从ETC白名单中剔除?' : '确定将所选车辆从ETC白名单中剔除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + if (this.tabType === 1) { + this.service.request(this.service.$api_delete_etc_shipper, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.load(1); + this.selectedRows = []; + modal.destroy(); + } + }); + } else { + this.service.request(this.service.$api_delete_etc_cart, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除成功'); + this.st.load(1); + this.selectedRows = []; + modal.destroy(); + } + }); + } + return false; + }, + nzOkText: '确定' + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private initSF(): SFSchema { + return { + properties: { + tabType: { + type: 'number', + ui: { + hidden: true + } + }, + shipperAppUserName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 1 + } + } + }, + contactName: { + title: '联系人姓名', + type: 'string', + ui: { + placeholder: '姓名/手机/车牌号', + visibleIf: { + tabType: (value: number) => this.tabType === 1 + } + } + }, + contactPhoneNumber: { + title: '联系人手机号', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 1 + } + } + }, + params4: { + title: '车牌号', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 2 + } + } + }, + params5: { + title: '司机姓名', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 2 + } + } + }, + params6: { + title: '手机号', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 2 + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '企业名称', index: 'shipperAppUserName', iif: () => this.tabType === 1 }, + { title: '联系人姓名', index: 'contactName', iif: () => this.tabType === 1 }, + { title: '联系人手机号', index: 'contactPhoneNumber', iif: () => this.tabType === 1 }, + { + title: '认证状态', + className: 'text-center', + index: 'certificationStatus', + type: 'enum', + enum: { 1: '未上传', 0: '草稿', 10: '待审核', 20: '已审核', 30: '已驳回', 40: '证件过期' }, + iif: () => this.tabType === 1 + }, + { title: '车牌号', index: 'carNo', iif: () => this.tabType === 2 }, + { title: '车辆所有人', index: 'carOwner', iif: () => this.tabType === 2 }, + { title: '创建者', index: 'createUserIdLabel' }, + { + title: '创建时间', + index: 'createTime', + type: 'date' + }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '删除', + click: item => this.deleteAction(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.html b/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.html new file mode 100644 index 00000000..4b44ba4a --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.html @@ -0,0 +1,34 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + {{item.driverName}}
    {{item.driverTelephone}} +
    + + {{item.licenseCarNo}}
    {{item.licenseBelonging}} +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.ts b/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.ts new file mode 100644 index 00000000..e7bf1e89 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-list/etc-invoiced-list.component.ts @@ -0,0 +1,187 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; +import { TransactionDetailsComponent } from './transaction-details/transaction-details.component'; + +@Component({ + selector: 'app-etc-invoiced-list', + templateUrl: './etc-invoiced-list.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class ETCInvoicedListComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + showDetail(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '运单交易明细', + nzContent: TransactionDetailsComponent, + nzWidth: 900, + nzComponentParams: { data: [] }, + nzOnOk: com => { + console.log(com.selectedData); + }, + nzOkText: '导出' + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + autocomplete: 'off' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + autocomplete: 'off' + } + }, + billType: { + type: 'string', + title: '订单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + }, + invoicingStatus: { + type: 'string', + title: '开票状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'etc:invoicing:status' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + shipperId: { + type: 'string', + title: '托运人', + enum: [{ label: '全部', value: '' }], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '运单号', index: 'wayBillCode' }, + { title: '订单号', index: 'billCode' }, + { title: '开票状态', index: 'invoicingStatus', type: 'enum', enum: { '0': '待开票', '1': '开票中', '2': '已开票', '3': '开票失败' } }, + { title: '订单类型', index: 'billType' }, + { title: '装货地', index: 'loadingPlace' }, + { title: '卸货地', index: 'dischargePlace' }, + { title: '司机信息', render: 'call1No' }, + { title: '车辆信息', render: 'call12No' }, + { title: '托运人', index: 'shipperAppUserName' }, + { title: '网络货运人', index: 'enterpriseInfoName' }, + { + title: '开票金额', + index: 'invoicingAmount', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoicingAmount }) } + }, + { + title: '开票张数', + index: 'invoicingNumber', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoicingNumber }) } + }, + { title: '申请时间', index: 'orderReceivingTime', type: 'date' }, + { + title: '操作', + className: 'text-center', + buttons: [ + { + text: '交易明细', + click: item => this.showDetail(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.html b/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.html new file mode 100644 index 00000000..2dbe9ec4 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.html @@ -0,0 +1,16 @@ +
    +
    + +
    +
    + + +
    + + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.less b/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.ts b/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.ts new file mode 100644 index 00000000..9af44778 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-list/transaction-details/transaction-details.component.ts @@ -0,0 +1,81 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-transaction-details', + templateUrl: './transaction-details.component.html' +}) +export class TransactionDetailsComponent implements OnInit { + data = []; + selectedData = []; + url = `/api/fcc/ficoEtcInvoiceH/list/page`; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = [ + { title: '交易id', index: 'id' }, + { title: '交易流水号', index: 'tradeFlowNo' }, + { title: '交易金额', index: 'fee' }, + { title: '开票状态', index: 'state', type: 'enum', enum: { '0': '待开具', '1': '开具中', '2': '已开具', '3': '开票失败' } }, + { title: '交易时间', index: 'exTime', type: 'date' } + ]; + searchSchema: SFSchema = { + properties: { + state: { + type: 'string', + title: '开票状态', + enum: [ + { label: '全部', value: '' }, + { label: '待开具', value: '1' }, + { label: '开具中', value: '2' }, + { label: '已开具', value: '3' }, + { label: '交易异常', value: '4' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + exTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + + reqParams = {}; + + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + exTime: { + start: this.sf.value.exTime?.[0] || null, + end: this.sf.value.exTime?.[1] || null + } + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.html b/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.html new file mode 100644 index 00000000..9384773b --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.html @@ -0,0 +1,32 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + {{item.driverName}}
    {{item.driverCellphone}} +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.ts b/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.ts new file mode 100644 index 00000000..e3c0a747 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-logs/etc-invoiced-logs.component.ts @@ -0,0 +1,217 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; + +@Component({ + selector: 'app-etc-invoiced-logs', + templateUrl: './etc-invoiced-logs.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class ETCInvoicedLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + exTime: { + start: this.sf.value.exTime?.[0] || '', + end: this.sf.value.exTime?.[1] || '' + }, + invoiceMakeTime: { + start: this.sf.value.invoiceMakeTime?.[0] || '', + end: this.sf.value.invoiceMakeTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + routeTo(item: any) { + return; + this.router.navigate(['/ticket/invoice-requested-detail/1']); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + exportList() { + const params = { listSource: 1, pageSize: -1 }; + if (this.sf) { + Object.assign(params, { + ...this.sf.value + }); + } + this.service.downloadFile(this.service.$api_export_invoice_logs_page, params); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + invoiceNum: { + type: 'string', + title: '发票号码', + ui: { + placeholder: '请输入', + autocomplete: 'off' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + waybillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '请输入' + } + }, + carNo: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + exTime: { + title: '交易时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + invoiceMakeTime: { + title: '开票日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + sellerName: { + type: 'string', + title: '销售方', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '发票号码', index: 'invoiceNum', width: 100, type: 'link', click: item => this.routeTo(item) }, + { title: '发票代码', index: 'invoiceCode', width: 130 }, + { title: '订单号', index: 'billCode', width: 140 }, + { title: '运单号', index: 'waybillCode', width: 140 }, + { title: '入站口', index: 'enStationName', width: 100 }, + { title: '出站口', index: 'exStationName', width: 100 }, + { title: '司机', render: 'call3No', width: 140 }, + { title: '车牌号', index: 'carNo', width: 100 }, + { title: '里程(km)', index: 'mileage', width: 120 }, + { title: '交易id', index: 'tradeId', width: 200 }, + { + title: '交易金额(元)', + index: 'fee', + width: 130, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fee }) } + }, + { title: '税率', index: 'taxRate', width: 90, format: item => `${item.taxRate ? ((item.taxRate as number) * 100).toFixed(2) : 0}%` }, + { + title: '金额(元)', + index: 'invoiceAmount', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoiceAmount }) } + }, + { + title: '税额(元)', + index: 'totalTaxAmount', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.totalTaxAmount }) } + }, + { + title: '价税合计(元)', + index: 'totalAmount', + width: 130, + type: 'widget', + className: 'text-right font-weight-bold', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.totalAmount }) } + }, + { title: '交易时间', index: 'exTime', type: 'date', width: 150 }, + { title: '开票日期', index: 'invoiceMakeTime', type: 'date', width: 150 }, + { title: '销售方', index: 'sellerName', width: 90 }, + { title: '网络货运人', index: 'enterpriseInfoName', width: 120 } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.html b/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.html new file mode 100644 index 00000000..774444c3 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.html @@ -0,0 +1,44 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + +
    + +
    + 已选择 + {{ selectedRows.length }} 条运单 + 清空 +
    +
    + + + + {{item.driverName}}
    {{item.driverTelephone}} +
    + + {{item.licenseCarNo}}
    {{item.licenseBelonging}} +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.ts b/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.ts new file mode 100644 index 00000000..989fd892 --- /dev/null +++ b/src/app/routes/ticket-management/components/etc-invoiced-requested/etc-invoiced-requested.component.ts @@ -0,0 +1,230 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; + +@Component({ + selector: 'app-etc-invoiced-requested', + templateUrl: './etc-invoiced-requested.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class ETCInvoicedRequestedComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + auditAction() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择申请记录'); + return; + } + const modal = this.nzModalService.warning({ + nzTitle: '确定对已选运单批量申请开票?', + nzOnOk: () => { + this.service + .request(this.service.$api_get_apply_invoice, { wayBillIds: this.selectedRows.map(item => item.id) }, 'POST', false) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('申请开票成功'); + modal.destroy(); + this.st.load(1); + } + }); + + return false; + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + billType: { + type: 'string', + title: '订单类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bill:type' }, + placeholder: '请选择' + } + }, + driverName: { + type: 'string', + title: '司机姓名', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + driverPhone: { + type: 'string', + title: '司机手机', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + licenseCarNo: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + licenseBelonging: { + type: 'string', + title: '车辆所有人', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + autocomplete: 'off', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + autocomplete: 'off', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + shipperId: { + type: 'string', + title: '托运人', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '运单号', index: 'wayBillCode' }, + { title: '订单号', index: 'billCode' }, + { title: '订单类型', index: 'billType' }, + { title: '装货地', index: 'loadingPlace' }, + { title: '卸货地', index: 'dischargePlace' }, + { title: '司机信息', render: 'call1No' }, + { title: '车辆信息', render: 'call1N2o' }, + { title: '托运人', index: 'shipperAppUserName' }, + { title: '网络货运人', index: 'enterpriseInfoName' }, + { title: '接单时间', index: 'orderReceivingTime', type: 'date' }, + { title: '装货时间', index: 'shipperAppUserName', type: 'date' }, + { title: '卸货时间', index: 'unloadingTime', type: 'date' }, + { title: '签收时间', index: 'submissionTime', type: 'date' } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.html b/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.html new file mode 100644 index 00000000..5d9aec99 --- /dev/null +++ b/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.html @@ -0,0 +1,16 @@ +
    +
    + +
    +
    + + +
    + +
    + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.less b/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.ts b/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.ts new file mode 100644 index 00000000..22e0f733 --- /dev/null +++ b/src/app/routes/ticket-management/components/express-info/express-detail-modal/express-detail-modal.component.ts @@ -0,0 +1,113 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-express-detail-modal', + templateUrl: './express-detail-modal.component.html', + styleUrls: ['./express-detail-modal.component.less'] +}) +export class ExpressDetailModalComponent implements OnInit { + data = []; + selectedData = []; + url = `/api/fcc/ficoExpressH/getFicoVatinvHByExpress`; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = [ + { title: '发票号码', index: 'invoiceno', width: 160, className: 'text-left' }, + { title: '发票代码', index: 'invoiceno2', width: 160, className: 'text-left' }, + { title: '申请编号', index: 'vatinvcode', width: 160, className: 'text-left' }, + { title: '网络货运人', index: 'ltdName', width: 120, className: 'text-left' }, + { title: '购买人', index: 'artoname', width: 120, className: 'text-left' }, + { + title: '价税合计', + index: 'vatmoney', + width: 120, + type: 'widget', + className: 'text-right font-weight-bold', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } + }, + { + title: '金额', + index: 'vatmoney', + width: 90, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) } + }, + { + title: '税率', + index: 'tax', + width: 90, + className: 'text-right', + format: item => `${item.tax ? ((item.tax as number) * 100).toFixed(2) : 0}%` + }, + { + title: '税额', + index: 'vattax', + width: 90, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) } + }, + { title: '开票日期', index: 'invoicedate', type: 'date', width: 150, className: 'text-center' } + ]; + searchSchema: SFSchema = { + properties: { + invoiceno: { + title: '', + type: 'string', + ui: { + placeholder: '发票号码' + } + }, + expressno: { + title: '', + type: 'string', + ui: { + placeholder: '申请编号' + } + }, + createTime: { + title: '', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + + expressCode!: any; + + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { expressno: this.expressCode }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || null, + end: this.sf.value.createTime?.[1] || null + } + }); + } + return requestOptions; + }; + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/ticket-management/components/express-info/express-info.component.html b/src/app/routes/ticket-management/components/express-info/express-info.component.html new file mode 100644 index 00000000..e19f3d85 --- /dev/null +++ b/src/app/routes/ticket-management/components/express-info/express-info.component.html @@ -0,0 +1,24 @@ + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + +
    + +
    + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/express-info/express-info.component.less b/src/app/routes/ticket-management/components/express-info/express-info.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/ticket-management/components/express-info/express-info.component.ts b/src/app/routes/ticket-management/components/express-info/express-info.component.ts new file mode 100644 index 00000000..6277ed0a --- /dev/null +++ b/src/app/routes/ticket-management/components/express-info/express-info.component.ts @@ -0,0 +1,160 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; +import { ExpressDetailModalComponent } from './express-detail-modal/express-detail-modal.component'; + +@Component({ + selector: 'app-express-info', + templateUrl: './express-info.component.html', + styleUrls: ['../../../commom/less/box.less'] +}) +export class ExpressInfoComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/api/fcc/ficoExpressH/getListPage`; + + searchSchema: SFSchema = { + properties: { + expressCode: { + title: '快递单号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '', index: 'key', type: 'checkbox', width: 50 }, + { title: '快递单号', index: 'expressCode', width: 170 }, + { title: '快递公司', index: 'expresscompany', width: 120 }, + { title: '快递费用', index: 'description', width: 120 }, + { + title: '发票数量', + index: 'quantity', + width: 120, + type: 'link', + click: (record: any) => this.showDetail(record.expressCode), + className: 'text-right' + }, + { title: '寄件人姓名', index: 'sname', width: 150 }, + { title: '寄件人电话', index: 'stel', width: 150 }, + { + title: '寄件人地址', + index: 'saddress', + width: 150, + format: item => `${item.sprovince}${item.scity}${item.scounty || ''}${item.saddress}` + }, + { title: '收件人姓名', index: 'rname', width: 150 }, + { title: '收件人电话', index: 'rtel', width: 150 }, + { + title: '收件人地址', + index: 'raddress', + width: 150, + format: item => `${item.rprovince}${item.rcity}${item.rcounty || ''}${item.raddress}` + }, + { + title: '下单时间', + index: 'createTime', + type: 'date', + width: 180 + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: TicketService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createtime: { + start: this.sf.value.createtime?.[0] || null, + end: this.sf.value.createtime?.[1] || null + } + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + showDetail(expressCode: any) { + const modal = this.nzModalService.create({ + nzTitle: '发票明细', + nzContent: ExpressDetailModalComponent, + nzNoAnimation: true, + nzWidth: 1100, + nzComponentParams: { expressCode }, + nzOnOk: com => { + console.log(com.selectedData); + }, + nzOkText: '导出' + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + printOrder() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择快递单'); + return; + } + this.nzModalService.warning({ + nzTitle: '确认打印面单所选快递单?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => { + this.service + .request( + this.service.$api_get_print_pdf, + this.selectedRows.map(item => item.expressCode) + ) + .subscribe(res => { + if (res?.pdfUrl) { + this.service.reviewPDF(res.pdfUrl); + } else { + this.service.msgSrv.warning('下载失败'); + } + }); + } + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.html b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.html new file mode 100644 index 00000000..d5bac178 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.html @@ -0,0 +1,7 @@ +
    + +
    + \ No newline at end of file diff --git a/src/app/routes/demo/components/alian-demo/alian-demo.component.less b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.less similarity index 65% rename from src/app/routes/demo/components/alian-demo/alian-demo.component.less rename to src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.less index 73710dfa..7b4dbb78 100644 --- a/src/app/routes/demo/components/alian-demo/alian-demo.component.less +++ b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.less @@ -1,5 +1,5 @@ :host::ng-deep { - nz-range-picker { + nz-date-picker { width: 100%; } } \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.ts b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.ts new file mode 100644 index 00000000..422930cd --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component.ts @@ -0,0 +1,102 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-add-collection-invoice-modal', + templateUrl: './add-collection-invoice-modal.component.html', + styleUrls: ['./add-collection-invoice-modal.component.less'] +}) +export class AddCollectionInvoiceModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: TicketService) {} + + ngOnInit(): void { + this.initSF(); + } + initSF() { + this.schema = { + properties: { + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + ltd2Id: { + type: 'string', + title: '销售方', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + ltd2I1d: { + type: 'string', + title: '收票类型', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + createTime: { + title: '发票日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + vatinvcode: { + type: 'string', + title: '发票号', + ui: { + placeholder: '请输入' + } + }, + vatinvc2ode: { + type: 'string', + title: '收票备注', + ui: { + placeholder: '请输入' + } + } + }, + required: ['ltdId', 'ltd2Id', 'createTime', 'ltd2I1d', 'vatinvcode'] + }; + } + + sure() { + const params: any = { + ...this.sf.value + }; + // this.service.request(this.service.$api_add_staff, params).subscribe(res => { + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // }); + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html new file mode 100644 index 00000000..9963406c --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.html @@ -0,0 +1,22 @@ +
    +
    + +
    +
    + + +
    +
    + + + + {{index+1}} + + + + + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less new file mode 100644 index 00000000..36315a59 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.less @@ -0,0 +1,6 @@ +.expend-options { + max-width: 400px; + position : absolute; + right : 20px; + top : 160px; +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts new file mode 100644 index 00000000..3ca21dbf --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/add-cost-detail/add-cost-detail.component.ts @@ -0,0 +1,111 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-add-cost-detail', + templateUrl: './add-cost-detail.component.html', + styleUrls: ['./add-cost-detail.component.less'] +}) +export class AddCostDetailComponent implements OnInit { + selectedData: any[] = []; + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + constructor(public service: TicketService) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedData = e.checkbox!; + break; + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + private initSF(): SFSchema { + return { + properties: { + enterpriseName: { + title: '费用单号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + enterprise2Name: { + title: '订单号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + contactName: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + contac2tName: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + }, + mobile: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60 }, + { title: '序号', render: 'no', width: 60 }, + { title: '费用号', index: 'enterpriseName', width: 120 }, + { title: '费用日期', index: 'contacter', width: 120 }, + { title: '订单号', index: 'mobile', width: 120 }, + { title: '订单日期', index: 'mobile', width: 120 }, + { title: '结算客户', index: 'mobile', width: 120 }, + { title: '费用科目', index: 'mobile', width: 120 }, + { title: '费用金额', index: 'mobile', width: 120 }, + { title: '已收金额', index: 'mobile', width: 120 }, + { title: '未收金额', index: 'mobile', width: 120 }, + { title: '收票金额', render: 'mo1bile', width: 150, fixed: 'right' } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html new file mode 100644 index 00000000..bf66f00c --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.html @@ -0,0 +1,55 @@ + + + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    + + +
    + + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.less b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.less new file mode 100644 index 00000000..7b4dbb78 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.less @@ -0,0 +1,5 @@ +:host::ng-deep { + nz-date-picker { + width: 100%; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts new file mode 100644 index 00000000..e91458f6 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/edit-collection-invoice/edit-collection-invoice.component.ts @@ -0,0 +1,210 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; +import { AddCostDetailComponent } from '../add-cost-detail/add-cost-detail.component'; + +@Component({ + selector: 'app-edit-collection-invoice', + templateUrl: './edit-collection-invoice.component.html', + styleUrls: ['./edit-collection-invoice.component.less', '../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class EditCollectionInvoiceComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('infoSf', { static: false }) + infoSf!: SFComponent; + infoSchema: SFSchema = this.initInfoSF(); + @ViewChild('searchSf', { static: false }) + searchSf!: SFComponent; + searchSchema: SFSchema = this.initSearchSF(); + columns: STColumn[] = this.initST(); + + selectedRows: any[] = []; + _$expand = false; + + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.searchSf) { + Object.assign(requestOptions.body, { ...this.searchSf.value }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addCostDetailAction() { + const modal = this.nzModalService.create({ + nzTitle: '添加核销明细', + nzContent: AddCostDetailComponent, + nzWidth: 850, + nzOkText: '保存', + nzOnOk: com => { + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + goBack() { + history.go(-1); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.searchSf?.setValue('/expand', this._$expand); + } + + private initInfoSF(): SFSchema { + return { + properties: { + orderSn: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'text' + }, + default: '天津怡亚通物流科技有限公司' + }, + orde1rSn: { + type: 'string', + title: '销售方', + ui: { + widget: 'text' + }, + default: '天津怡亚通物流科技有限公司' + }, + ord0erSn1: { + type: 'string', + title: '收票类型', + enum: [{ label: '全部', value: '全部' }], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + orderSn2: { + title: '发票日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + orderS3: { + type: 'string', + title: '发票号', + ui: { + placeholder: '请输入' + } + }, + orderSn4: { + type: 'string', + title: '收票备注', + ui: { + placeholder: '请输入' + } + } + }, + required: [''] + }; + } + + private initSearchSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + orderSn: { + type: 'string', + title: '费用单号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + orderS2n: { + type: 'string', + title: '订单号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + } + }, + createTime: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + createTi2me: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '序号', index: 'no', type: 'link' }, + { title: '费用号', index: 'no' }, + { title: '费用日期', index: 'no', type: 'date' }, + { title: '订单号', index: 'callNo' }, + { title: '订单日期', index: 'callNo' }, + { title: '结算客户', render: 'call1No' }, + { title: '费用科目', render: 'call1N2o' }, + { title: '费用金额', index: 'callNo' }, + { title: '收票金额', index: 'updatedAt', type: 'date' }, + { title: '收票税额', index: 'updatedAt' } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.html b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.html new file mode 100644 index 00000000..4d858c37 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.html @@ -0,0 +1,67 @@ + + + + + + + +
    +
    + + {{headerInfo?.ltdid}} + + + {{headerInfo?.invdate}} + +
    +
    + + {{headerInfo?.hrtoName}} + + + {{headerInfo?.invoiceno}} + +
    +
    + + {{headerInfo?.invtype}} + + + {{headerInfo?.remarks}} + +
    +
    +
    + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + {{index+1}} + + + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.less b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.less new file mode 100644 index 00000000..aebf12ee --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.ts b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.ts new file mode 100644 index 00000000..384fa720 --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/input-invoice-detail/input-invoice-detail.component.ts @@ -0,0 +1,151 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; +import { RequestedDetailComponent } from '../../invoice-requested/requested-detail/requested-detail.component'; + +@Component({ + selector: 'app-input-invoice-detail', + templateUrl: './input-invoice-detail.component.html', + styleUrls: ['./input-invoice-detail.component.less', '../../../../commom/less/expend-but.less', '../../../../commom/less/box.less'] +}) +export class InputInvoiceDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + id = null; + headerInfo: any = {}; + constructor(public service: TicketService, private route: ActivatedRoute) { + this.id = route.snapshot.params.id; + this.loadHeadInfo(); + } + + ngOnInit(): void {} + + loadHeadInfo() { + this.service.request(this.service.$api_get_input_invoice_header, { id: this.id }).subscribe(res => { + console.log(res); + if (res) { + this.headerInfo = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + billTime: { + start: this.sf.value.billTime?.[0] || null, + end: this.sf.value.billTime?.[1] || null + }, + feedate: { + start: this.sf.value.feedate?.[0] || null, + end: this.sf.value.feedate?.[1] || null + } + }); + } + return requestOptions; + }; + + goBack() { + history.go(-1); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + feecode: { + type: 'string', + title: '费用单', + ui: { + placeholder: '请输入' + } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + cno: { + type: 'string', + title: '结算客户', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getCloseAccount(), + }, + default: '' + }, + feedate: { + title: '费用日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + billTime: { + title: '订单日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '序号', render: 'billHCode', width: 80 }, + { title: '费用号', index: 'feecode', width: 100 }, + { title: '费用日期', index: 'feedate', type: 'date', width: 150 }, + { title: '订单号', index: 'billHCode', width: 100 }, + { title: '订单日期', index: 'billTime', width: 150 }, + { title: '结算客户', index: 'cnoName', width: 90 }, + { title: '费用科目', index: 'feesubname', width: 100 }, + { title: '收票金额', index: 'invmoney', width: 140 }, + { title: '收票税额', index: 'invtax', width: 100 } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.html b/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.html new file mode 100644 index 00000000..3c1b49fd --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.html @@ -0,0 +1,38 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + +
    + +
    + 已选择 + {{ selectedRows.length }} 张发票 + 清空 +
    +
    + + + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.ts b/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.ts new file mode 100644 index 00000000..d45bd8eb --- /dev/null +++ b/src/app/routes/ticket-management/components/input-invoice/input-invoice.component.ts @@ -0,0 +1,262 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; +import { AddCollectionInvoiceModalComponent } from './add-collection-invoice-modal/add-collection-invoice-modal.component'; + +@Component({ + selector: 'app-input-invoice', + templateUrl: './input-invoice.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class InputInvoiceComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createtime: { + start: this.sf.value.createtime?.[0] || '', + end: this.sf.value.createtime?.[1] || '' + }, + invdate: { + start: this.sf.value.invdate?.[0] || '', + end: this.sf.value.invdate?.[1] || '' + } + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + addInvoice() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择申请记录'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '收票信息', + nzContent: AddCollectionInvoiceModalComponent, + nzComponentParams: { i: { userId: 0 } }, + nzFooter: null + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + inpinvcode: { + type: 'string', + title: '收票单号', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + ltdid: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + invoiceno: { + type: 'string', + title: '发票号码', + ui: { + autocomplete: 'off', + placeholder: '请输入' + } + }, + invtype: { + type: 'string', + title: '发票类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'invoice:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + hrto: { + type: 'string', + title: '销售方', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createtime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + sts: { + type: 'string', + title: '收票状态', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '是' }, + { value: 0, label: '否' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + invdate: { + type: 'string', + title: '发票日期', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + remarks: { + type: 'string', + title: '收票备注', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + feecode: { + type: 'string', + title: '费用号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' }, + { title: '收票单号', index: 'inpinvcode', type: 'link', width: 170 }, + { title: '网络货运人', index: 'ltdName', width: 150 }, + { title: '发票日期', index: 'invdate', type: 'date', width: 150, className: 'text-center' }, + { title: '发票号', index: 'invoiceno', width: 130 }, + { + title: '发票金额', + index: 'invmoney', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invmoney }) } + }, + { + title: '税额', + index: 'invtax', + width: 100, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invtax }) } + }, + { title: '发票类型', index: 'invtype', width: 150, className: 'text-center' }, + { title: '销售方', index: 'hrtoName', width: 150 }, + { title: '创建时间', index: 'createtime', type: 'date', width: 150, className: 'text-center' }, + { title: '创建人', index: 'createbyname', width: 120 }, + { title: '收票状态', index: 'stsLabel', width: 120, className: 'text-center' }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { + text: '浏览', + click: item => this.router.navigate(['/ticket/input-invoice/detail/' + item.id]) + }, + { + text: '修改', + click: item => this.router.navigate(['/ticket/input-invoice/edit/1']) + } + ] + } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html new file mode 100644 index 00000000..88dd0af1 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html @@ -0,0 +1,146 @@ + + + + + + + +
    +
    + + {{ headerInfo?.ltdName }} + + + {{ headerInfo?.vatappHCode }} + + + {{ headerInfo?.invoiceno }} + + + {{ headerInfo?.invoiceno2 }} + + + {{ headerInfo?.invoicedate }} + + + {{ headerInfo?.vatmoney | currency }} + + + {{ headerInfo?.vattax | currency }} + + + {{ headerInfo?.remarks }} + +
    +
    + + {{ headerInfo?.artoname }} + + + {{ headerInfo?.artotaxno }} + + + {{ headerInfo?.artoadd }} + + + {{ headerInfo?.artotel }} + + + {{ headerInfo?.artobank }} + + + {{ headerInfo?.artoacc }} + + + {{headerInfo?.otherremarks || '-'}} + +
    +
    + + + + + + + +
    +
    +
    + + + + +
    +
    + +
    +
    + + + +
    +
    + + +
    + +
    +
    + +
    +
    + + + +
    +
    + + + + {{ item.billLType }}: {{ item.vatmoney |currency }} + + +
    + + + + + + {{ item.vatname }} + + + + {{ item.vatmodel }} + + + + {{ item.vatunit }} + + + + {{ item.vatqty }} + + + + +

    顺丰快递: {{ routesInfo?.mailNo }} 已签收 + +

    + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.less b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.less new file mode 100644 index 00000000..23fd589a --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.less @@ -0,0 +1,39 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 8px; + padding-top : 8px; + } + } + + + .statistics-box { + .ant-card-body { + padding-bottom: 8px; + padding-top : 8px; + } + + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + + .text-truncate { + white-space: normal; + } +} + +.expend-options { + margin-top: 0px; +} + +@media (min-width: 990px) { + .expend-options { + margin-top: -40px; + } + +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts new file mode 100644 index 00000000..ce250896 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts @@ -0,0 +1,274 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; + +@Component({ + selector: 'app-invoice-detail', + templateUrl: './invoice-detail.component.html', + styleUrls: ['./invoice-detail.component.less'] +}) +export class InvoiceDetailComponent implements OnInit { + @ViewChild('orderST', { static: true }) + orderST!: STComponent; + @ViewChild('orderSf', { static: false }) + orderSf!: SFComponent; + orderColumns: STColumn[] = this.initOrderST(); + orderSchema: SFSchema = this.initOrderSF(); + + @ViewChild('costST', { static: true }) + costST!: STComponent; + @ViewChild('costSf', { static: false }) + costSf!: SFComponent; + costColumns: STColumn[] = this.initCostST(); + costSchema: SFSchema = this.initCostSF(); + + @ViewChild('invoiceST', { static: true }) + invoiceST!: STComponent; + invoiceColumns: STColumn[] = this.initInvoiceST(); + + isCanEdit = false; + isEdit = false; + + headerInfo: any = {}; + routesInfo: any = { + mailNo: '', + routes: [] + }; + id: any = null; + ltdId: any = null; + type: any = 1; + + selectedIndex = 0; + constructor(public service: TicketService, private route: ActivatedRoute) { + this.isCanEdit = route.snapshot.queryParams.type === '1'; + const expressno = route.snapshot.queryParams.expressno; + this.type = route.snapshot.queryParams.type; + this.id = route.snapshot.params.id; + this.ltdId = route.snapshot.queryParams.ltdId; + this.loadInvoiceHeader(this.id); + if (expressno) { + this.loadRoutes(expressno); + } + } + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { vatinvHId: this.id }); + if (this.orderSf) { + Object.assign(requestOptions.body, { ...this.orderSf.value }); + } + if (this.costSf) { + Object.assign(requestOptions.body, { ...this.costSf.value }); + } + return requestOptions; + }; + + loadInvoiceHeader(id: string) { + this.service.request(this.service.$api_get_invoice_header_detail, { id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + loadRoutes(expressno: string) { + this.service.request(this.service.$api_get_express_routes, expressno).subscribe(res => { + if (res) { + res.routes = res.routes.map((route: any) => ({ time: route.acceptTime, value: route.remark + route.acceptAddress, color: 'gray' })); + this.routesInfo = res; + } + }); + } + goBack() { + history.go(-1); + } + + saveInvoices() { + this.isEdit = false; + } + + /** + * 重置表单 + */ + resetSF(tab: number) { + switch (tab) { + case 1: + this.orderSf.reset(); + break; + case 2: + this.costSf.reset(); + break; + + default: + break; + } + } + + private initOrderSF(): SFSchema { + return { + properties: { + billHCode: { + type: 'string', + title: '订单号', + ui: { + autocomplete: 'off' + } + }, + billType: { + type: 'string', + title: '订单类型', + enum: [ + { label: '全部', value: '' }, + { label: '整车', value: 1 }, + { label: '大宗', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + projectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getEnterpriseProject({ id: this.ltdId }) + }, + default: '' + } + } + }; + } + + private initOrderST(): STColumn[] { + return [ + { title: '订单号', index: 'billHCode', width: 180 }, + { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '所属项目', index: 'projectIdName', width: 180 }, + { title: '订单类型', index: 'billTypeLabel', width: 120 }, + { title: '装货地', index: 'loadingfrom', width: 200 }, + { title: '卸货地', index: 'loadingto', width: 220 }, + { title: '货物信息', index: 'goodsinfo', width: 140 }, + { title: '承运司机', index: 'driverinfo', width: 280 }, + // { + // title: '税额', + // index: 'billvatrate', + // width: 120, + // className: 'text-right', + // format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` + // }, + { + title: '申请金额', + index: 'billkpnotax', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: this.type === '2' ? record.billkpmoney : record.billkpnotax }) } + }, + { + title: '运输费', + index: 'fjfmoney2', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney2 }) } + }, + { + title: '附加费', + index: 'fjfmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney }) } + }, + { + title: '开票金额', + index: 'billkpmoney', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) } + } + ]; + } + + private initCostSF(): SFSchema { + return { + properties: { + billHCode: { + type: 'string', + title: '订单号', + ui: { + autocomplete: 'off' + } + }, + feeHId: { + type: 'string', + title: '费用号', + ui: { + autocomplete: 'off' + } + } + } + }; + } + + private initCostST(): STColumn[] { + return [ + { title: '费用号', index: 'feeHId' }, + { title: '订单号', index: 'billHCode' }, + { title: '订单日期', index: 'createTime', type: 'date' }, + { title: '计费日期', index: 'feeDate', type: 'date' }, + { title: '税率', index: 'vatrate', format: item => `${item.vatrate ? ((item.vatrate as number) * 100).toFixed(2) : 0}%` }, + { + title: '申请金额', + render: 'vatmoney' + }, + { + title: '开票金额', + index: 'vatnotax', + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } + } + ]; + } + + private initInvoiceST(): STColumn[] { + return [ + { title: '服务名称', render: 'vatname', width: 350 }, + { title: '规格型号', render: 'vatmodel' }, + { title: '单位', render: 'vatunit', width: 100 }, + { title: '数量', render: 'vatqty', width: 140, className: 'text-right' }, + { + title: '金额', + index: 'vatnotax', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } + }, + { + title: '税率', + index: 'vatrate', + width: 140, + className: 'text-right', + format: item => `${item.vatrate ? ((item.vatrate as number) * 100).toFixed(2) : 0}%` + }, + { + title: '税额', + index: 'vattax', + width: 140, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) } + } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html new file mode 100644 index 00000000..65c60264 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html @@ -0,0 +1,116 @@ + + + + + + + +
    +
    + + {{headerInfo?.ltdidName}} + + + {{headerInfo?.vatappcode}} + + + {{headerInfo?.vatinvHNum}} / {{headerInfo?.vatinvBillNum}} + + + {{headerInfo?.vatinvHAmount |currency}} / {{headerInfo?.vatinvHNumAmount |currency}} + + + {{headerInfo?.vatinvHNum}} + + + {{headerInfo?.reciname}}/{{headerInfo?.recitel}} + + + {{headerInfo?.provinceName}}{{headerInfo?.cityName}}{{headerInfo?.areaName}}{{headerInfo?.reciaddr}} + +
    +
    + + {{headerInfo?.artoName}} + + + {{headerInfo?.taxNumber}} + + + {{headerInfo?.registerAddr}} + + + {{headerInfo?.registerPhone}} + + + {{headerInfo?.bankName}} + + + {{headerInfo?.bankAccount}} + +
    +
    + + {{headerInfo?.vatnameLabel}} + + + {{headerInfo?.isdetail?'是':'否'}} + + + {{headerInfo?.otherremarks}} + + + {{headerInfo?.vatremarks}} + + +
    +
    +
    + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    + + + +
    + 已选择 + {{ selectedRows.length }} 条数据   开票金额总计 {{ + totalCallNo |currency }} + 清空 +
    +
    + + + + {{ item.billHCode }} + + +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.less b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.less new file mode 100644 index 00000000..aebf12ee --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts new file mode 100644 index 00000000..3453d2cb --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts @@ -0,0 +1,350 @@ +import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { ActivatedRoute, Router, Params } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFTextWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../../services/ticket.service'; +import { RequestedDetailComponent } from '../requested-detail/requested-detail.component'; + +@Component({ + selector: 'app-invoice-requested-detail', + templateUrl: './invoice-requested-detail.component.html', + styleUrls: ['./invoice-requested-detail.component.less', '../../../../commom/less/expend-but.less', '../../../../commom/less/box.less'] +}) +export class InvoiceRequestedDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + detail: any = {}; + + selectedRows: any[] = []; + totalCallNo = '0'; + _$expand = false; + + id = null; + sts = null; + headerInfo: any = {}; + constructor( + public service: TicketService, + private nzModalService: NzModalService, + private route: ActivatedRoute, + private router: Router + ) { + this.id = route.snapshot.params.id; + this.sts = route.snapshot.queryParams.sts; + this.loadHeadInfo(); + } + + ngOnInit(): void {} + + loadHeadInfo() { + this.service.request(this.service.$api_get_invoice_requested_header_detail, { id: this.id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + this.totalCallNo = '0'; + this.selectedRows = []; + Object.assign(requestOptions.body, { vatappHId: this.id }); + if (this.sf) { + Object.assign(requestOptions.body, { ...this.sf.value }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + // this.totalCallNo = data.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2); + return data.map(item => ({ + ...item + })); + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + if (this.selectedRows?.length > 0) { + this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2); + } else { + this.totalCallNo = this.st._data.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2); + } + break; + case 'filter': + this.st.load(); + break; + } + } + + openRequestedModal(status: any) { + if (status === '2' && this.selectedRows.length == 0) { + this.service.msgSrv.warning('请选择订单!'); + return; + } + let rows: any[] = []; + if (status === '1') { + rows = this.st._data.map(item => { + const rs = Object.assign({}, { ...item }); + delete rs._values; + return rs; + }); + } else { + rows = [...this.selectedRows]; + } + const modal = this.nzModalService.create({ + nzTitle: '开票', + nzContent: RequestedDetailComponent, + nzWidth: 800, + nzComponentParams: { + i: rows, + status: status, + Id: this.id + }, + nzFooter: [ + { + type: 'default', + label: '手工处理', + onClick: () => { + const params = { + ficoVatappBillVOList: rows, + id: this.id + }; + this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { + if (res) { + this.loadHeadInfo(); + this.st.load(1); + this.service.msgSrv.success('提交成功'); + modal.destroy(); + } + }); + } + }, + { + type: 'primary', + label: '自动开票', + onClick: () => { + const params = { + ficoVatappBillVOList: rows, + id: this.id + }; + this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { + if (res) { + this.loadHeadInfo(); + this.st.load(1); + this.service.msgSrv.success('提交成功'); + modal.destroy(); + } + }); + } + } + ] + }); + } + + /** + * 移除订单 + * @returns + */ + removeOrder() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择订单'); + return; + } + this.nzModalService.warning({ + nzTitle: '确定从当前批次中移除所选订单?', + nzContent: '移除后相关订单可以重新提交开票申请', + nzOnOk: () => { + const ids = this.selectedRows.map(order => order.billHId); + this.service.request(this.service.$api_remove_bill, ids).subscribe(res => { + if (res) { + this.service.msgSrv.success('移除成功'); + this.loadHeadInfo(); + this.st.reload(); + } + }); + } + }); + } + + goBack() { + history.go(-1); + } + + routeToOrder(item: any) { + if (item.billType === 1) { + this.router.navigate(['/order-management/vehicle/vehicle-detail/' + item.billHId]); + } else { + this.router.navigate(['/order-management/bulk/bulk-detail/' + item.billHId]); + } + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + vatappSts: { + type: 'string', + title: '开票状态', + enum: [ + { label: '全部', value: '' }, + { label: '待受理', value: '待受理' }, + { label: '待开票', value: '待开票' }, + { label: '开票中', value: '开票中' }, + { label: '已开票', value: '已开票' }, + { label: '已撤销', value: '已撤销' }, + { label: '已拒绝', value: '已拒绝' } + ], + ui: { + widget: 'select', + placeholder: '请选择' + }, + default: '' + }, + vatinvcode: { + type: 'string', + title: '发票号码', + ui: { + placeholder: '请输入' + } + }, + billType: { + type: 'string', + title: '订单类型', + enum: [ + { label: '全部', value: '' }, + { label: '整车', value: '1' }, + { label: '大宗', value: '2' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + driverinfo: { + type: 'string', + title: '承运司机', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + orderS22n2: { + type: 'string', + title: '车牌号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + projectId: { + title: '所属项目', + type: 'string', + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getEnterpriseProject() + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '订单号', render: 'billHCode', width: 170 }, + { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '开票状态', index: 'vatappStsLabel', width: 100 }, + { title: '所属项目', index: 'projectIdName', width: 140 }, + { title: '订单类型', index: 'billType', width: 100, type: 'enum', enum: { 1: '整车', 2: '大宗' } }, + { title: '装货地', index: 'loadingfrom', width: 220 }, + { title: '卸货地', index: 'loadingto', width: 220 }, + { title: '货物信息', index: 'goodsinfo', width: 150 }, + { title: '承运司机', index: 'driverinfo', width: 140 }, + { + title: '申请金额', + index: 'billkpmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) } + }, + { + title: '运输费', + index: 'fjfmoney2', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney2 }) } + }, + { + title: '附加费', + index: 'fjfmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney }) } + }, + { + title: '开票金额', + index: 'billkpmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) } + }, + { + title: '税率', + index: 'billvatrate', + width: 90, + format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` + }, + { title: '发票号码', index: 'vatinvcode', width: 100 }, + { title: '开票日期', index: 'vatinvtime', type: 'date', width: 150 } + ]; + } +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html new file mode 100644 index 00000000..f7fb8a20 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html @@ -0,0 +1,77 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + +
    +
    + 已选择 + {{ selectedRows.length }} 条数据   开票金额总计 + {{ totalCallNo }} + 清空 +
    + + + + +
    +
    + + + + {{ item.vatappcode }}
    + +
    +
    +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.less b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.less new file mode 100644 index 00000000..370d3cae --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.less @@ -0,0 +1,7 @@ +:host::ng-deep { + + .ant-tabs-tab-btn { + padding-left : 16px; + padding-right: 16px; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts new file mode 100644 index 00000000..1978a0f9 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts @@ -0,0 +1,529 @@ +import { query } from '@angular/animations'; +import { CurrencyPipe } from '@angular/common'; +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { isTemplateRef } from 'ng-zorro-antd/core/util'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; + +import { TicketService } from '../../services/ticket.service'; +import { PrintOrderModalComponent } from './print-order-modal/print-order-modal.component'; +import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component'; +import { UpdateAddressModalComponent } from './update-address-modal/update-address-modal.component'; + +@Component({ + selector: 'app-invoice-requested', + templateUrl: './invoice-requested.component.html', + styleUrls: ['./invoice-requested.component.less', '../../../commom/less/box.less'] +}) +export class InvoiceRequestedComponent { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('rejectModal', { static: false }) + rejectModal!: any; + resourceStatus: any = '1'; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + totalCallNo = 0; + selectedRows: any[] = []; + + rejectReason = ''; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.resourceStatus) { + Object.assign(requestOptions.body, { sts: this.resourceStatus }); + } + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + this.totalCallNo = 0; + this.selectedRows = []; + return data.map(item => ({ + ...item, + disabled: item.expressHSts + })); + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.applyAmount, 0).toFixed(2); + break; + } + } + + rejectAction(item: any[]) { + this.rejectReason = ''; + if (item.length <= 0) { + this.service.msgSrv.warning('请选择开票申请'); + return; + } + if (item.find(item => item.sts !== '1')) { + this.service.msgSrv.warning('请勿选择非待处理订单'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '驳回', + nzContent: this.rejectModal, + nzOkLoading: this.service.http.loading, + nzOnOk: () => { + if (!this.rejectReason) { + this.service.msgSrv.warning('请填写驳回原因'); + return false; + } + let ids = item.map(row => row.id); + this.service.request(this.service.$api_reject_invoice, { id: ids, rejectContent: this.rejectReason }).subscribe(res => { + if (res) { + this.service.msgSrv.success('驳回成功'); + modal.destroy(true); + } + }); + + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + /** + * 修改地址 + * @param item + */ + changeAddress(item: any[]) { + this.rejectReason = ''; + if (item.length <= 0) { + this.service.msgSrv.warning('请选择开票申请'); + return; + } + // if (item.find(item => item.sts !== '1')) { + // this.service.msgSrv.warning('请勿选择非待处理订单'); + // return; + // } + const modal = this.nzModalService.create({ + nzTitle: '修改地址', + nzContent: UpdateAddressModalComponent, + nzOkLoading: this.service.http.loading, + nzOnOk: component => { + if (!component.sf.valid) { + component.sf.validator({ emitError: true }); + // this.service.msgSrv.warning('表单校验错误'); + return false; + } + this.service + .request(this.service.$api_update_invoice_address, { + ...component.sf.value, + ids: item.map(i => i.id) + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + modal.destroy(true); + } + }); + + return false; + } + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + printOrder(item: any[]) { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择订单'); + return; + } + if (this.selectedRows.find(item => item.sts !== '3')) { + this.service.msgSrv.warning('请勿选择非已完成订单'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '打印面单', + nzContent: PrintOrderModalComponent, + nzWidth: 650, + nzComponentParams: { vatappcodes: this.selectedRows.map(item => item.vatappcode) }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(); + } + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + batchRequested() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择订单'); + return; + } + if (this.selectedRows.find(item => item.sts !== '1')) { + this.service.msgSrv.warning('请勿选择非待处理订单'); + return; + } + const modal = this.nzModalService.create({ + nzTitle: '开票', + nzContent: '确认对所有申请单进行批量开票?', + nzFooter: [ + { + type: 'default', + label: '手工处理', + onClick: () => { + const params = { + ficoVatappBillVOList: this.selectedRows.map(item => { + const i = Object.assign({}, { ...item }); + delete i._values; + delete i._rowClassName; + delete i.checked; + delete i.disabled; + return i; + }) + // id: this.id + }; + this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('提交成功!'); + modal.destroy(); + this.st.load(1); + } + }); + } + }, + { + type: 'primary', + label: '自动开票', + onClick: () => { + const params = { + ficoVatappBillVOList: this.selectedRows.map(item => { + const i = Object.assign({}, { ...item }); + delete i._values; + delete i._rowClassName; + delete i.checked; + delete i.disabled; + return i; + }) + // id: this.id + }; + this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('提交成功!'); + modal.destroy(); + this.st.load(1); + } + }); + } + } + ] + }); + } + + requestedInvoiceAction(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '开票受理', + nzContent: RequestedInvoiceModalComponent, + nzWidth: 1200, + nzComponentParams: { + id: item.id + }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(1); + } + }); + } + + downloadPdf(item: any) { + this.service.request(this.service.$api_downloadPdf, { vatappHId: item.id }).subscribe(res => { + if (res?.reconciliationUrl) { + this.service.reviewPDF(res.reconciliationUrl); + } else { + this.service.msgSrv.warning('获取对账单失败'); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + vatappcode: { + type: 'string', + title: '申请编号', + ui: { + placeholder: '请输入' + } + }, + billHCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '请输入' + } + }, + feeHCode: { + type: 'string', + title: '费用号', + ui: { + placeholder: '请输入' + } + }, + projectId: { + title: '项目', + type: 'string', + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getEnterpriseProject() + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + }, + otherremarks: { + type: 'string', + title: '其他需求', + ui: { + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '申请时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + isdetail: { + type: 'string', + title: '销货清单', + enum: [ + { label: '全部', value: '' }, + { label: '需要', value: 1 }, + { label: '不需要', value: 0 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + }, + default: '' + }, + arto: { + type: 'string', + title: '货主名称', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }), + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '申请编号', render: 'vatappcode', width: 190 }, + { title: '发票类型', index: 'vatapptypeLable', width: 140 }, + { title: '网络货运人', index: 'ltdName', width: 170 }, + { title: '货主名称', index: 'artoName', width: 170 }, + { title: '订单数', index: 'ordlines', width: 90 }, + { + title: '申请金额', + index: 'applyAmount', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.applyAmount }) } + }, + { + title: '运输费', + index: 'fjfmoney2', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney2 }) } + }, + { + title: '附加费', + index: 'fjfmoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney }) } + }, + { + title: '已开票金额', + index: 'invoicedMoney', + width: 150, + type: 'widget', + className: 'text-right', + widget: { + type: 'currency-chy', + params: ({ record }) => ({ value: record.invoicedMoney }) + } + }, + { title: '已开票张数', index: 'invoicedNum', width: 160 }, + { title: '开户行', index: 'bankName', width: 160 }, + { title: '银行账户', index: 'bankAccount', width: 140 }, + { title: '注册地址', index: 'registerAddr', width: 140 }, + { title: '注册电话', index: 'registerPhone', width: 130 }, + { title: '服务名称', index: 'vatnameLabel', width: 150 }, + { + title: '销货清单', + index: 'isdetail', + width: 100, + format: item => { + return item.isdetail === 0 ? '不需要' : '需要'; + } + }, + { title: '其他要求', index: 'otherremarks', width: 100 }, + { title: '申请人', index: 'applyName', width: 90 }, + { title: '申请时间', index: 'applyTime', type: 'date', width: 150 }, + { + title: '快递是否下单成功', + index: 'expressHSts', + width: 170, + className: 'text-center', + type: 'enum', + enum: { true: '是', false: '否' } + }, + { + title: '操作', + width: 125, + fixed: 'right', + className: 'text-center', + buttons: [ + { type: 'divider' }, + { + text: '开票受理
    ', + click: item => this.requestedInvoiceAction(item), + iif: item => item.sts === '1' + }, + { + text: '驳回申请
    ', + click: item => this.rejectAction([item]), + iif: item => item.sts === '1' + }, + { + text: '订单明细
    ', + click: item => this.router.navigate([`/ticket/invoice-requested/detail/${item?.id}`], { queryParams: { sts: item.sts } }) + }, + { + text: '查看原因
    ', + click: item => this.showReason(item), + iif: item => item.sts === '4' + }, + { + text: '下载对账单', + iif: item => item.sts === '3', + click: item => this.downloadPdf(item) + } + ] + } + ]; + } + selectChange(e: any) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.html b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.html new file mode 100644 index 00000000..119c6269 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.html @@ -0,0 +1,48 @@ +
    +
    + + + + + + + + {{type===1?'分批下单系统会根据网络货运人、货主以及收件地址自动拆分成多个包裹下单':'汇总下单系统会将所选申请单汇总成一个包裹下单'}} + + + + + + {{item.contact}}      {{item.tel}}
    + {{item.province}} {{item.city}} {{item.county}} {{item.address}} +
    +
    + + {{data.rcontactInfo.contact}}      {{data.rcontactInfo.tel}}
    + {{data.rcontactInfo.province}} {{data.rcontactInfo.city}} {{data.rcontactInfo.county}} + {{data.rcontactInfo.address}} +
    +
    + + + + {{item.contact}}      {{item.tel}}
    + {{item.province}} {{item.city}} {{item.county}} {{item.address}} +
    +
    + + {{data.scontactInfo.contact}}      {{data.scontactInfo.tel}}
    + {{data.scontactInfo.province}} {{data.scontactInfo.city}} {{data.scontactInfo.county}} + {{data.scontactInfo.address}} +
    +
    +
    + +
    +
    + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less new file mode 100644 index 00000000..a9a87774 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.less @@ -0,0 +1,10 @@ + +app-print-order-modal{ + nz-select-top-control { + height: 65px !important; + } + + cdk-virtual-scroll-viewport { + height: 100px !important; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts new file mode 100644 index 00000000..49e4d2a7 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/print-order-modal/print-order-modal.component.ts @@ -0,0 +1,94 @@ +import { Component, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-print-order-modal', + templateUrl: './print-order-modal.component.html', + styleUrls: ['./print-order-modal.component.less'], + encapsulation: ViewEncapsulation.None +}) +export class PrintOrderModalComponent implements OnInit { + data: any = {}; + + type = 1; + + rcontactInfos: any[] = []; + scontactInfos: any[] = []; + + @Input() + vatappcodes: string[] = []; + + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: TicketService) {} + + ngOnInit(): void { + this.loadAddress(); + } + + loadAddress() { + this.service.request(this.service.$api_get_order_summary_path, this.vatappcodes).subscribe(res => { + if (res) { + this.rcontactInfos = res.rcontactInfos || []; + this.scontactInfos = res.scontactInfos || []; + } + }); + } + + sure() { + if (this.type === 1) { + this.service.request(this.service.$api_create_express, this.vatappcodes).subscribe(res => { + if (res?.length > 0) { + this.getPDF(res); + } else { + this.service.msgSrv.warning('请到快递信息页面打印'); + this.modal.destroy(true); + } + }); + } else { + if (!this.data.rcontactInfo || !this.data.scontactInfo) { + this.service.msgSrv.warning('请选择收件地址和寄件地'); + return; + } + const params = { + rcontactInfo: this.data.rcontactInfo, + ltdId: this.data.scontactInfo.ltdId, + shipperId: this.data.scontactInfo.shipperId, + vatappcodes: this.vatappcodes, + scontactInfo: this.data.scontactInfo + }; + delete this.data.scontactInfo.ltdId; + delete this.data.scontactInfo.shipperId; + delete this.data.scontactInfo.id; + this.service.request(this.service.$api_get_order_summary, params).subscribe(res => { + if (res?.length > 0) { + this.service.reviewPDF(res); + } else { + this.service.msgSrv.warning('请到快递信息页面打印'); + this.modal.destroy(true); + } + }); + } + } + + getPDF(ids: Array) { + this.service.request(this.service.$api_get_print_pdf, ids).subscribe(res => { + if (res?.pdfUrl) { + this.service.msgSrv.success('操作成功'); + this.modal.destroy(true); + this.service.reviewPDF(res.pdfUrl); + } else { + this.service.msgSrv.warning('下载失败'); + this.modal.destroy(true); + } + }); + } + + + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.html b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.html new file mode 100644 index 00000000..737e5eef --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.html @@ -0,0 +1,54 @@ + +
    +
    + + {{headerInfo?.artoName}} + + + {{headerInfo?.taxNumber}} + + + {{headerInfo?.registerAddr}} + + + {{headerInfo?.registerPhone}} + + + {{headerInfo?.bankName}} + + + {{headerInfo?.bankAccount}} + + + {{headerInfo?.vatremarks}} + +
    +
    + + {{headerInfo?.ltdidName}} + + + {{headerInfo?.ordlines}} + + + {{headerInfo?.vatinvHNumAmount | currency}} + + + {{headerInfo?.vatnameLabel}} + + + {{headerInfo?.isdetail?'是':'否'}} + + + {{headerInfo?.otherremarks}} + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.less b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.less new file mode 100644 index 00000000..aebf12ee --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.less @@ -0,0 +1,13 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.ts b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.ts new file mode 100644 index 00000000..675783d0 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-detail/requested-detail.component.ts @@ -0,0 +1,50 @@ +import { Input } from '@angular/core'; +/* + * @Author: your name + * @Date: 2021-12-23 16:50:17 + * @LastEditTime: 2021-12-31 13:15:13 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\ticket-management\components\invoice-requested\requested-detail\requested-detail.component.ts + */ +import { Component, OnInit } from '@angular/core'; +import { TicketService } from '../../../services/ticket.service'; + + +@Component({ + selector: 'app-requested-detail', + templateUrl: './requested-detail.component.html', + styleUrls: ['./requested-detail.component.less'] +}) +export class RequestedDetailComponent implements OnInit { + i: any; + status: any; + Id: any; + @Input() id: any; + headerInfo: any; + constructor( + public service: TicketService, + ) { } + + ngOnInit(): void { + this.initData(); + } + initData() { + if(this.id) { + this.service.request(this.service.$api_get_invoice_requested_header_detail, { id: this.id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + if(this.Id) { + this.service.request(this.service.$api_get_invoice_requested_header_detail, { id: this.Id }).subscribe(res => { + if (res) { + this.headerInfo = res; + } + }); + } + + } + +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html new file mode 100644 index 00000000..adfc2118 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.html @@ -0,0 +1,36 @@ + + + + + + + {{ item.billHCode }} + + + diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.less b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.less new file mode 100644 index 00000000..41a8c3bb --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.less @@ -0,0 +1,16 @@ +:host::ng-deep { + + .statistics-box { + .ant-form-item { + margin-bottom: 0; + + .ant-form-item-control-input-content { + color: #f5222d; + } + } + } + + .text-truncate { + white-space: normal; + } +} \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts new file mode 100644 index 00000000..6c411bc0 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts @@ -0,0 +1,147 @@ +/* + * @Author: your name + * @Date: 2021-12-23 16:50:17 + * @LastEditTime : 2022-01-26 10:36:10 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.ts + */ +import { Component, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; + +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-requested-invoice-modal', + templateUrl: './requested-invoice-modal.component.html', + styleUrls: ['./requested-invoice-modal.component.less'] +}) +export class RequestedInvoiceModalComponent { + @ViewChild('st1', { static: false }) + st1!: STComponent; + columns: STColumn[] = this.initST(); + id: any; + selectedRows: any[] = []; + constructor(public service: TicketService, private nzModalService: NzModalService, private modal: NzModalRef, private router: Router) {} + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { vatappHId: this.id }); + return requestOptions; + }; + + /** + * 移除订单 + * + * @returns + */ + removeOrder(item: any[]) { + console.log(item); + this.nzModalService.warning({ + nzTitle: '确定从当前批次中移除所选订单?', + nzContent: '移除后相关订单可以重新提交开票申请', + nzOnOk: () => { + const ids = item.map(order => order.billHId); + this.service.request(this.service.$api_remove_bill, { billHIds: ids }).subscribe(res => { + if (res) { + this.service.msgSrv.success('移除成功'); + this.modal.destroy(true); + } else { + this.service.msgSrv.warning('移除失败'); + } + }); + } + }); + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st1.load(); + break; + } + } + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '订单号', index: 'billHCode', width: 150 }, + { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '所属项目', index: 'projectIdName', width: 250 }, + { title: '订单类型', index: 'billTypeName', width: 90 }, + { title: '装货地', index: 'loadingfrom', width: 250 }, + { title: '卸货地', index: 'loadingto', width: 250 }, + { title: '货物信息', index: 'goodsinfo', width: 170 }, + { title: '承运司机', index: 'driverinfo', width: 280 }, + { + title: '总费用', + index: 'billkpmoney', + width: 90, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.billkpmoney }) } + }, + { + title: '运输费', + index: 'fjfmoney2', + width: 90, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney2 }) } + }, + { + title: '附加费', + index: 'fjfmoney', + width: 90, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney }) } + }, + { + title: '操作', + width: 80, + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '移除', + click: (item: any) => this.removeOrder([item]) + } + ] + } + ]; + } + saveManage() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择订单'); + return; + } + const selectedRows = this.selectedRows.map(item => { + return { ...item }; + }); + const params = { + ficoVatappBillVOList: selectedRows.map(item => { + delete item._values; + return item; + }), + id: this.id + }; + this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { + if (res) { + this.nzModalService.confirm({ + nzTitle: '是否进入销票处理页面完成开票', + nzOnOk: () => { + this.service.msgSrv.success('提交成功'); + this.modal.destroy(true); + this.router.navigate(['/ticket/cancellation-invoice']); + }, + nzOnCancel: () => { + this.modal.destroy(true); + } + }); + } + }); + } +} diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html new file mode 100644 index 00000000..c31df344 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.less b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts new file mode 100644 index 00000000..ce376d0b --- /dev/null +++ b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts @@ -0,0 +1,102 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFCascaderWidgetSchema, SFComponent, SFSchema } from '@delon/form'; +import { TicketService } from '../../../services/ticket.service'; + +@Component({ + selector: 'app-update-address-modal', + templateUrl: './update-address-modal.component.html', + styleUrls: ['./update-address-modal.component.less'] +}) +export class UpdateAddressModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + schema: SFSchema = this.initSF(); + + constructor(public service: TicketService) {} + + ngOnInit(): void {} + + private initSF(): SFSchema { + return { + properties: { + reciname: { + type: 'string', + title: '收件人姓名', + ui: { + placeholder: '请输入' + } + }, + recitel: { + type: 'string', + title: '联系电话', + format: 'mobile', + minLength: 1, + maxLength: 11, + ui: { + placeholder: '请输入', + errors: { required: '请输入注册电话', format: '手机号格式错误' } + } + }, + provinceCode: { type: 'string', ui: { hidden: true } }, + provinceName: { type: 'string', ui: { hidden: true } }, + cityCode: { type: 'string', ui: { hidden: true } }, + cityName: { type: 'string', ui: { hidden: true } }, + areaCode: { type: 'string', ui: { hidden: true } }, + areaName: { type: 'string', ui: { hidden: true } }, + enterpriseAddressCode: { + type: 'number', + title: '收件人地区', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'cascader', + valueProperty: 'regionCode', + placeholder: '请选择', + labelProperty: 'name', + asyncData: (node: any, index: any) => { + return new Promise(resolve => { + this.getRegionDetailByCode(node?.regionCode || '').subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 })); + }, + _ => {}, + () => { + resolve(); + } + ); + }); + }, + selectionChange: (node: any[]) => { + console.log(node); + + if (node?.length > 0) { + this.sf.setValue('/provinceCode', node[0]?.regionCode); + this.sf.setValue('/provinceName', node[0]?.name); + this.sf.setValue('/cityCode', node[1]?.regionCode); + this.sf.setValue('/cityName', node[1]?.name); + this.sf.setValue('/areaCode', node[2]?.regionCode); + this.sf.setValue('/areaName', node[2]?.name); + } + } + } as SFCascaderWidgetSchema + }, + reciaddr: { + type: 'string', + title: '详细地址', + ui: { + visibleIf: { + expand: (value: boolean) => value + } + } + } + }, + required: ['reciname', 'recitel', 'reciaddr', 'enterpriseAddressCode'] + }; + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } +} diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html new file mode 100644 index 00000000..1dff8e97 --- /dev/null +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html @@ -0,0 +1,75 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + +
    + + +
    + + + + {{ item.no }} + 预览发票 + + + {{ item.expresscompany }}
    + {{ item.expressno }} +
    +
    +
    + + +

    + 顺丰快递: {{ routesInfo?.mailNo }} + 已签收 +

    + +
    + + +
    +
    + + + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts new file mode 100644 index 00000000..ddc9df8a --- /dev/null +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts @@ -0,0 +1,367 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/ticket.service'; + +@Component({ + selector: 'app-invoiced-list', + templateUrl: './invoiced-list.component.html', + styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'] +}) +export class InvoicedListComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('logosticsLogsModal', { static: false }) + logosticsLogsModal!: any; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + + routesInfo: any = { + mailNo: '', + routes: [] + }; + + @ViewChild('requestedModal', { static: false }) + requestedModal!: any; + openInfo: any = { expresscompany: null, expressno: null }; + constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {} + + ngOnInit(): void {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + invoicedate: { + start: this.sf.value.invoicedate?.[0] || '', + end: this.sf.value.invoicedate?.[1] || '' + } + }); + } + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.vatnotax, 0).toFixed(2); + break; + } + } + + deletedInvoice(item: any) { + // if (this.selectedRows?.length <= 0) { + // this.service.msgSrv.warning('请选择发票'); + // return; + // } + const modal = this.nzModalService.warning({ + nzTitle: '确定将所选发票作废?', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_delete_invoice, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('发票作废成功'); + } + modal.destroy(); + this.st.load(1); + }); + return false; + } + }); + } + + canceInvoice(item: any) { + // if (this.selectedRows?.length <= 0) { + // this.service.msgSrv.warning('请选择发票'); + // return; + // } + const modal = this.nzModalService.warning({ + nzTitle: '确定取消所选发票?', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_cancel_invoice, { id: item.id }).subscribe(res => { + if (res) { + this.service.msgSrv.success('取消发票成功'); + } + modal.destroy(); + this.st.load(1); + }); + return false; + } + }); + } + + /** + * 填写物流/修改物流 + * @param item + */ + requestedAction(item: any) { + this.openInfo = { expresscompany: item.expresscompany || null, expressno: item.expressno || null }; + const modal = this.nzModalService.create({ + nzTitle: item.expresscompany ? '修改物流' : '填写物流', + nzContent: this.requestedModal, + nzOnOk: () => { + if (!this.openInfo?.expresscompany || !this.openInfo?.expressno) { + this.service.msgSrv.warning('请填快递信息'); + return false; + } + const params = { + expresscompany: this.openInfo.expresscompany, + expressno: this.openInfo.expressno + }; + this.service + .request(this.service.$api_update_Express, { + id: item.id, + ...params + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(item.expresscompany ? '修改成功' : '填写成功'); + this.st.load(1); + modal.destroy(); + } + }); + + return false; + } + }); + } + + invoiceHongChong() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择发票'); + return; + } + this.nzModalService.warning({ + nzTitle: '确定将所选发票红冲?', + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + + showlogosticsLogs(item: any) { + this.service.request(this.service.$api_get_express_routes, item.expressno).subscribe(res => { + console.log(res); + if (res) { + res.routes = res.routes.map((route: any) => ({ time: route.acceptTime, value: route.remark + route.acceptAddress, color: 'gray' })); + this.routesInfo = res; + this.nzModalService.create({ + nzTitle: '查看物流', + nzWidth: 600, + nzContent: this.logosticsLogsModal, + nzFooter: [] + }); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + invoiceno: { + type: 'string', + title: '发票号码', + ui: { + autocomplete: 'off' + } + }, + invoiceno2: { + type: 'string', + title: '发票代码', + ui: { + autocomplete: 'off' + } + }, + vatappHCode: { + type: 'string', + title: '申请编号', + ui: { + autocomplete: 'off' + } + }, + invoicedate: { + title: '开票日期', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + artoname: { + type: 'string', + title: '购买人', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + }, + asyncData: () => this.service.getNetworkFreightForwarder({}, true) + }, + default: '' + }, + vatinvcode: { + type: 'string', + title: '分票编号', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '发票号码', index: 'invoiceno', width: 150 }, + { title: '发票代码', index: 'invoiceno2', width: 150 }, + { + title: '申请编号', + index: 'vatappHCode', + width: 190, + type: 'link', + click: item => + this.router.navigate(['/ticket/invoice-list/detail/' + item.id], { + queryParams: { type: 1, expressno: item.expressno } + }) + }, + { title: '申请时间', index: 'createTime', type: 'date', width: 150 }, + { title: '发票类型', index: 'invoicetypeLabel', className: 'text-center', width: 140 }, + { title: '网络货运人', index: 'ltdName', width: 170 }, + { title: '购买人', index: 'artoname', width: 170 }, + { title: '订单数', index: 'ordlines', className: 'text-right', width: 90 }, + { + title: '价税合计', + index: 'vatmoney', + width: 130, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) } + }, + { + title: '金额', + index: 'vatnotax', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } + }, + { + title: '税率', + index: 'billvatrate', + className: 'text-right', + width: 90, + format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` + }, + { + title: '税额', + index: 'vattax', + width: 120, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) } + }, + { title: '开票日期', index: 'invoicedate', type: 'date', width: 150 }, + { + title: '快递信息', + render: 'expresscompany', + width: 180 + }, + { title: '状态', index: 'stsLabel', width: 90 }, + { + title: '操作', + fixed: 'right', + className: 'text-center', + width: 120, + buttons: [ + { type: 'divider' }, + { + text: '查看明细
    ', + click: item => + this.router.navigate(['/ticket/invoice-list/detail/' + item.id], { + queryParams: { expressno: item.expressno, type: 2, ltdId: item.shipperId } + }) + }, + { + text: '取消开票
    ', + click: item => this.canceInvoice(item), + iif: item => item.sts === '1' + }, + { + text: '发票作废
    ', + click: item => this.deletedInvoice(item), + iif: item => item.sts === '3' + }, + { + text: '查看物流
    ', + click: item => this.showlogosticsLogs(item), + iif: item => item.expresscompany + }, + { + text: '填写物流
    ', + click: item => this.requestedAction(item), + iif: item => !item.expresscompany + }, + { + text: '修改物流
    ', + click: item => this.requestedAction(item), + iif: item => item.expresscompany + } + ] + } + ]; + } +} diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts new file mode 100644 index 00000000..23e50119 --- /dev/null +++ b/src/app/routes/ticket-management/services/ticket.service.ts @@ -0,0 +1,157 @@ +/* + * @Author: your name + * @Date: 2021-12-29 13:12:35 + * @LastEditTime: 2022-01-04 10:36:02 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\ticket-management\services\ticket.service.ts + */ +import { Injectable, Injector } from '@angular/core'; +import { EACacheService, ShipperBaseService } from '@shared'; + +@Injectable({ + providedIn: 'root' +}) +export class TicketService extends ShipperBaseService { + $mock_url = '/rule?_allow_anonymous=true'; + + // 运营端查询发票申请记录 + $api_get_invoice_requested_page = '/api/fcc/ficoVatappH/queryOperateVatappHList'; + // 获取开票申请订单明细头部信息 + $api_get_invoice_requested_header_detail = '/api/fcc/ficoVatappBill/getDetailHeadByVatappHId'; + // 货主/运营端获取开票申请订单明细 + $api_get_invoice_requested_order_detail = '/api/fcc/ficoVatappBill/getDetailByVatapp'; + // 删除开票申请订单明细 + // $api_remove_bill = '/api/fcc/ficoVatappBill/deletebatch'; + $api_remove_bill = '/api/fcc/ficoVatappH/remove'; + // 运营端单个/批量驳回 + $api_reject_invoice = '/api/fcc/ficoVatappH/rejectInvoiceApple'; + // 运营端修改开票地址 + $api_update_invoice_address = '/api/fcc/ficoVatappH/updateInvoiceAddr'; + + // 运营端销票处理-订单明细页面 + $api_ficoVatinvHList = '/api/fcc/ficoVatinvH/ficoVatinvHList'; + // 获取开票申请订单明细头部信息 + $api_ficoVatinv_header = '/api/fcc/ficoVatappBill/getDetailHeadByVatappHId'; + // 获取分票发票明细 + $api_ficoVatinv_Detail = '/api/fcc/ficoVatinvL/getDetailByVatinvHId'; + // 运营端订单明细开票处理 + $api_apply_fico = '/api/fcc/ficoVatinvH/crmPushInvo'; + // 手工开票获取开票申请信息展示 + $api_get_apply_fico_info = '/api/fcc/ficoVatappH/get'; + // 运营端手工开票/确认/E税云开票成功后的回调 + $api_apply_fico_invoic = '/api/fcc/ficoVatinvH/operateAffirmVatinv'; + // 运营端推送开票-E税云开票 + $api_push_invoic = '/api/fcc/ficoVatinvH/crmPushInvo'; + // 运营端批量推送开票-E税云开票 + $api_batch_push_invoic = '/api/fcc/ficoVatinvH/crmPushInvoBath'; + // 发票作废 + $api_cancel_invoic = '/api/fcc/ficoVatinvH/inpinvHCancel'; + // 运营端销票处理导出销售清单 + $api_export_invoic_detail = '/api/fcc/ficoVatinvH/reportVatinvHByOperator'; + + // 获取汇总下单路径 + $api_get_order_summary_path = '/api/fcc/ficoExpressH/getSummaryOrderAddress'; + // 新建快递单 + $api_create_express = '/api/fcc/ficoExpressH/save'; + // 获取汇总下单 + $api_get_order_summary = '/api/fcc/ficoExpressH/summaryOrder'; + // 打印快递面单 + $api_get_print_pdf = '/api/fcc/ficoExpressH/printData'; + + // 已开发票查询 + $api_get_invoice_page = '/api/fcc/ficoVatinvH/list/page'; + + // 更新快递信息 + $api_update_Express = '/api/fcc/ficoVatinvH/updateExpress'; + + // 发票作废 + $api_delete_invoice = '/api/fcc/ficoVatinvH/inpinvHCancel'; + // 发票取消 + $api_cancel_invoice = '/api/fcc/ficoVatinvH/cancel'; + // 获取销项发票抬头 + $api_get_invoice_header_detail = '/api/fcc/ficoVatinvH/get'; + // 获取分票发票抬头开票申请订单明细 + $api_get_invoice_order_detail = '/api/fcc/ficoVatappBill/getDetailByVatinvHId'; + // 获取分票发票抬头开票申请费用明细 + $api_get_invoice_cost_detail = '/api/fcc/ficoVatappFee/getDetailByVatinvHId'; + // 获取分票发票明细 + $api_get_invoice_details = '/api/fcc/ficoVatinvL/getDetailByVatinvHId'; + // 运营端订单明细开票处理 + $api_get_applyFicoVatinv = '/api/fcc/ficoVatinvH/applyFicoVatinv'; + // 开票申请列表批量开票 + $api_get_applyBatchFicoVatinv = '/api/fcc/ficoVatinvH/applyBatchFicoVatinv'; + // 删除销项发票抬头 + $api_delete_deletebatch = '/api/fcc/ficoVatinvH/deletebatch'; + // 保存开票申请费用明细 + $api_ficoVatappFee_save = '/api/fcc/ficoVatappFee/save'; + + // 查询ETC白名单(货主) + $api_get_etc_shipper_list = '/api/fcc/ficoShipperWhiteList/list/page'; + // 删除ETC白名单(货主) + $api_delete_etc_shipper = '/api/fcc/ficoShipperWhiteList/deleteBatch'; + // 保存ETC白名单(货主) + $api_save_etc_shipper = '/api/fcc/ficoShipperWhiteList/save'; + // 查询ETC企业列表 + $api_get_etc_list = '/api/mdc/cuc/enterpriseInfo/operate/etcList'; + // 查询ETC认证车辆信息筛选 + $api_get_etc_cart_list = '/api/mdc/cuc/carLicense/operate/findCarLicenseScreenList'; + // 查询ETC认证车辆信息筛选 + $api_get_etc_cart_page = '/api/fcc/ficoCarWhiteList/list/page'; + // 保存ETC白名单(车辆) + $api_save_etc_cart = '/api/fcc/ficoCarWhiteList/save'; + // 删除ETC白名单(车辆) + $api_delete_etc_cart = '/api/fcc/ficoCarWhiteList/deleteBatch'; + + // ETC申请开票界面查询 + $api_get_apply_invoice_page = '/api/sdc/invoiceEtcOperate/list/listEtcApplyPageList'; + // ETC开票申请 + $api_get_apply_invoice = '/api/sdc/invoiceEtcOperate/applyForInvoicingBatch'; + // ETC开票记录界面查询 + $api_get_invoice_record_page = '/api/sdc/invoiceEtcOperate/list/listEtcRecordPageList'; + // 查询ETC发票明细表 + $api_get_invoice_logs_page = '/api/fcc/ficoEtcInvoiceL/list/page'; + // 导出ETC发票明细表 + $api_export_invoice_logs_page = '/api/fcc/ficoEtcInvoiceL/asyncExport'; + + // 进项发票查询 + $api_get_input_invoice_page = '/api/fcc/ficoInpinvH/getListPage'; + // 根据ID获取进项发票详情 + $api_get_input_invoice_header = '/api/fcc/ficoInpinvH/getFicoInpinvHByid'; + // 查询进项发票明细 + $api_get_input_invoice_detail_page = '/api/fcc/ficoInpinvL/list/page'; + + // 查询快递轨迹 + $api_get_express_routes = '/api/fcc/ficoExpressH/searchRoutes'; + // 下载对账单文件 + $api_downloadPdf = '/api/fcc/ficoVatappBill/downloadPdf'; + + // 根据地区code查询列表 + $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; + + constructor(public injector: Injector) { + super(injector); + } + + reviewPDF(url: string) { + if (!url) { + return; + } + const uA = window.navigator.userAgent; // 判断浏览器内核 + const isIE = + /msie\s|trident\/|edge\//i.test(uA) && + !!('uniqueID' in document || 'documentMode' in document || 'ActiveXObject' in window || 'MSInputMethodContext' in window); + const objectUrl = url; + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = objectUrl; + a.download = '面单.pdf'; + if (isIE) { + // 兼容IE11无法触发下载的问题 + (navigator as any).msSaveBlob(url, a.download); + } else { + a.click(); + } + a.remove(); + } +} diff --git a/src/app/routes/ticket-management/ticket-management-routing.module.ts b/src/app/routes/ticket-management/ticket-management-routing.module.ts new file mode 100644 index 00000000..5cbcd7d0 --- /dev/null +++ b/src/app/routes/ticket-management/ticket-management-routing.module.ts @@ -0,0 +1,38 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { CancellationInvoiceComponent } from './components/cancellation-invoice/cancellation-invoice.component'; +import { ETCBlacklistComponent } from './components/etc-blacklist/etc-blacklist.component'; +import { ETCInvoicedListComponent } from './components/etc-invoiced-list/etc-invoiced-list.component'; +import { ETCInvoicedLogsComponent } from './components/etc-invoiced-logs/etc-invoiced-logs.component'; +import { ETCInvoicedRequestedComponent } from './components/etc-invoiced-requested/etc-invoiced-requested.component'; +import { ExpressInfoComponent } from './components/express-info/express-info.component'; +import { EditCollectionInvoiceComponent } from './components/input-invoice/edit-collection-invoice/edit-collection-invoice.component'; +import { InputInvoiceDetailComponent } from './components/input-invoice/input-invoice-detail/input-invoice-detail.component'; +import { InputInvoiceComponent } from './components/input-invoice/input-invoice.component'; +import { InvoiceDetailComponent } from './components/invoice-detail/invoice-detail.component'; +import { InvoiceRequestedDetailComponent } from './components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component'; +import { InvoiceRequestedComponent } from './components/invoice-requested/invoice-requested.component'; +import { InvoicedListComponent } from './components/invoiced-list/invoiced-list.component'; + +const routes: Routes = [ + { path: 'invoice-requested', component: InvoiceRequestedComponent }, + { path: 'invoice-requested/detail/:id', component: InvoiceRequestedDetailComponent }, + { path: 'invoice-list', component: InvoicedListComponent }, + { path: 'invoice-list/detail/:id', component: InvoiceDetailComponent }, + { path: 'cancellation-invoice', component: CancellationInvoiceComponent }, + { path: 'cancellation-invoice/detail/:id', component: InvoiceDetailComponent }, + { path: 'etc-invoice-requested', component: ETCInvoicedRequestedComponent }, + { path: 'etc-invoice-list', component: ETCInvoicedListComponent }, + { path: 'etc-invoiced-logs', component: ETCInvoicedLogsComponent }, + { path: 'etc-blacklist', component: ETCBlacklistComponent }, + { path: 'input-invoice', component: InputInvoiceComponent }, + { path: 'input-invoice/detail/:id', component: InputInvoiceDetailComponent }, + { path: 'input-invoice/edit/:id', component: EditCollectionInvoiceComponent }, + { path: 'express-info', component: ExpressInfoComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TicketManagementRoutingModule {} diff --git a/src/app/routes/ticket-management/ticket-management.module.ts b/src/app/routes/ticket-management/ticket-management.module.ts new file mode 100644 index 00000000..e0d47e51 --- /dev/null +++ b/src/app/routes/ticket-management/ticket-management.module.ts @@ -0,0 +1,62 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '@shared'; +import { TicketManagementRoutingModule } from './ticket-management-routing.module'; +import { ETCInvoicedListComponent } from './components/etc-invoiced-list/etc-invoiced-list.component'; +import { ETCInvoicedRequestedComponent } from './components/etc-invoiced-requested/etc-invoiced-requested.component'; +import { ETCInvoicedLogsComponent } from './components/etc-invoiced-logs/etc-invoiced-logs.component'; +import { ETCBlacklistComponent } from './components/etc-blacklist/etc-blacklist.component'; +import { InvoicedListComponent } from './components/invoiced-list/invoiced-list.component'; +import { InvoiceRequestedComponent } from './components/invoice-requested/invoice-requested.component'; +import { InvoiceRequestedDetailComponent } from './components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component'; +import { TransactionDetailsComponent } from './components/etc-invoiced-list/transaction-details/transaction-details.component'; +import { RequestedInvoiceModalComponent } from './components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component'; +import { RequestedDetailComponent } from './components/invoice-requested/requested-detail/requested-detail.component'; +import { InvoiceDetailComponent } from './components/invoice-detail/invoice-detail.component'; +import { CancellationInvoiceComponent } from './components/cancellation-invoice/cancellation-invoice.component'; +import { PushInvoiceComponent } from './components/cancellation-invoice/push-invoice/push-invoice.component'; +import { AddOwnerComponent } from './components/etc-blacklist/add-owner/add-owner.component'; +import { AddCartComponent } from './components/etc-blacklist/add-cart/add-cart.component'; +import { InputInvoiceComponent } from './components/input-invoice/input-invoice.component'; +import { InputInvoiceDetailComponent } from './components/input-invoice/input-invoice-detail/input-invoice-detail.component'; +import { AddCollectionInvoiceModalComponent } from './components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; +import { EditCollectionInvoiceComponent } from './components/input-invoice/edit-collection-invoice/edit-collection-invoice.component'; +import { AddCostDetailComponent } from './components/input-invoice/add-cost-detail/add-cost-detail.component'; +import { PrintOrderModalComponent } from './components/invoice-requested/print-order-modal/print-order-modal.component'; +import { ExpressInfoComponent } from './components/express-info/express-info.component'; +import { ExpressDetailModalComponent } from './components/express-info/express-detail-modal/express-detail-modal.component'; +import { UpdateAddressModalComponent } from './components/invoice-requested/update-address-modal/update-address-modal.component'; + +const COMPONENTS: any = [ + ETCInvoicedListComponent, + ETCInvoicedRequestedComponent, + ETCInvoicedLogsComponent, + ETCBlacklistComponent, + InvoiceRequestedComponent, + InvoicedListComponent, + InvoiceRequestedDetailComponent, + InvoiceDetailComponent, + CancellationInvoiceComponent, + PushInvoiceComponent, + InputInvoiceComponent, + InputInvoiceDetailComponent, + EditCollectionInvoiceComponent, + ExpressInfoComponent +]; +const NOTROUTECOMPONENTS: any = [ + TransactionDetailsComponent, + RequestedInvoiceModalComponent, + RequestedDetailComponent, + AddOwnerComponent, + AddCartComponent, + AddCollectionInvoiceModalComponent, + AddCostDetailComponent, + PrintOrderModalComponent, + ExpressDetailModalComponent, + UpdateAddressModalComponent +]; +@NgModule({ + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], + imports: [CommonModule, TicketManagementRoutingModule, SharedModule] +}) +export class TicketManagementModule {} diff --git a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.html b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.html new file mode 100644 index 00000000..e5021ee6 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.html @@ -0,0 +1,52 @@ + + +
    + + +
    +
    +
    正面照
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照
    +
    示例
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.less b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.less new file mode 100644 index 00000000..856acdf9 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.less @@ -0,0 +1,57 @@ +.sfBox{ + position: relative; +} +.pr { + position: relative; +} + +.pa { + position: absolute; + top: 35px; + left: 150px; + img{border: solid 1px #ebf0fb;} +} + +.tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } +} +.drivercard{ + position: absolute; + top: 710px; + left: 330px; + border: solid 1px #ebf0fb; +} +.jopcard{ + position: absolute; + top: 1115px; + left: 330px; + border: solid 1px #ebf0fb; +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + .setCustom .ant-form-item-control{ + margin-left: -100px !important + } + .borderImg{ + border: solid 1px #ebf0fb; + } + } +} diff --git a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.spec.ts b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.spec.ts new file mode 100644 index 00000000..7c61267f --- /dev/null +++ b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarSettleAddDriverComponent } from './add-driver.component'; + +describe('CarSettleAddDriverComponent', () => { + let component: CarSettleAddDriverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarSettleAddDriverComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarSettleAddDriverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts new file mode 100644 index 00000000..ed202b46 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts @@ -0,0 +1,715 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFComponent, SFUISchema, SFSchema, SFUploadWidgetSchema, SFDateWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { UsermanageService } from '../../../services/usercenter.service'; + +@Component({ + selector: 'app-car-add-driver', + templateUrl: './add-driver.component.html', + styleUrls: ['./add-driver.component.less'] +}) +export class CarSettleAddDriverComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + @ViewChild('sf2', { static: false }) sf2!: SFComponent; + record: any = {}; + i: any; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + ui3: SFUISchema = {}; + schema: SFSchema = {}; + schema1: SFSchema = {}; + schema2: SFSchema = {}; + showCardFlag = false; + showJopFlag = false; + detailData: any = { + identityInfoDTO: {}, + userDriverLicenseDTO: {}, + userPracticeSeniorityDTO: {} + }; + companyData: any = {}; + constructor( + private modal: NzModalRef, + public service: UsermanageService, + private envSrv: EAEnvironmentService, + private eaCacheSrv: EACacheService + ) {} + + ngOnInit(): void { + this.companyData = this.eaCacheSrv.get(cacheConf.env); + this.initSF(); + } + initSF() { + this.schema = { + properties: { + titleA: { + title: '司机信息(必填)', + type: 'string', + ui: { + widget: 'text' + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + mobile: { + title: '手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + widget: '' + } + }, + showName: { + title: '身份证照片', + type: 'string', + readOnly: true, + ui: { + widget: 'textarea', + borderless: true, + showRequired: true + }, + default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写' + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoFrontWatermark', avatar); + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath; + this.checkIdCard(args.file.response.data.fullFilePath, 'front', 0); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoBackWatermark', avatar); + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath; + this.checkIdCard(args.file.response.data.fullFilePath, 'back', 0); + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + } + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + name: { + title: '姓名', + type: 'string', + maxLength: 32, + ui: { + widget: '', + placeholder: '请输入姓名' + } + }, + certificateNumber: { + title: '身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + widget: '', + placeholder: '请输入法定代表人证件号', + errors: { + required: '请输入18位身份证号码' + } + } + }, + bankCardNo: { + title: '银行卡号', + type: 'string', + maxLength: 18, + ui: { + widget: '', + placeholder: '请输入银行卡号' + // change: (val: any) =>{ + // const value = val.replace(/\D/g,'') + // this.sf.setValue('/bankCardNo', value) + // }, + }, + default: '' + }, + bankName: { + title: '开户行', + type: 'string', + ui: { + widget: '' + }, + default: '' + } + }, + required: ['mobile','certificatePhotoFrontWatermark', 'certificatePhotoBackWatermark', 'name', 'certificateNumber', 'bankCardNo'] + }; + this.schema1 = { + properties: { + titleB: { + title: '驾驶证信息(必填)', + type: 'string', + ui: { + widget: 'text' + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + certificatePhotoWatermark: { + type: 'string', + title: '驾驶证照片', + ui: { + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传驾驶证照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf1?.setValue('/certificatePhotoWatermark', avatar); + this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath; + this.checkDriverCard(args.file.response.data.fullFilePath, 'front', 0); + } else { + this.detailData.userDriverLicenseDTO.certificatePhoto = ''; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt4M = file.size / 1024 / 1024 < 4; + if (!isLt4M) { + this.service.msgSrv.warning('图片大小超过4M!'); + observer.complete(); + return; + } + observer.next(isLt4M); + observer.complete(); + }); + } + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + roadImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + licenseNo: { + title: '驾驶证号', + type: 'string', + ui: { + // widget: 'text', + placeholder: '请输入' + } + // default: this.ar.snapshot.queryParams.licenseNo + }, + driverModel: { + title: '准驾车型', + type: 'string', + ui: { + widget: 'select', + mode: 'multiple', + containsAllLabel: false, + placeholder: '请选择准驾车型', + asyncData: () => + this.service.request(this.service.$api_getDictValue, { dictKey: 'driverModel' }).pipe( + map(data => { + return data.map((m: any) => { + return { label: m.label, value: m.label }; + }); + }) + ) + } + }, + validStartTime: { + title: '有效期起', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期' + }, + change: i => {} + } as SFDateWidgetSchema + }, + validEndTime: { + title: '有效期止', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择终止日期' + }, + change: i => {} + } as SFDateWidgetSchema + }, + signingOrganization: { + title: '签发机关', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入' + } + } + }, + required: ['certificatePhotoWatermark', 'licenseNo', 'driverModel', 'validStartTime', 'validEndTime'] + }; + this.schema2 = { + properties: { + titleC: { + title: '从业资格证(选填)', + type: 'string', + ui: { + widget: 'text' + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + certificatePhotoWatermark: { + type: 'string', + title: '', + ui: { + offsetControl: 6, + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFilePath', + urlReName: 'data.fullFilePath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf2?.setValue('/certificatePhotoWatermark', avatar); + this.detailData.userPracticeSeniorityDTO.certificatePhoto = args.file.response.data.fullFilePath; + this.checkQualificationCertificate(args.file.response.data.fullFilePath); + } else { + this.detailData.userPracticeSeniorityDTO.certificatePhoto = ''; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of() + } + }, + agreeImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + licenseNo: { + title: '从业资格证号', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入' + } + }, + regionCode: { + title: '签发省份', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + asyncData: () => this.getProvinceData() + } as SFDateWidgetSchema + }, + validStartTime: { + title: '发证日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择起始日期' + }, + change: i => {} + } as SFDateWidgetSchema + }, + validEndTime: { + title: '有效期止', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择终止日期' + }, + change: i => {} + } as SFDateWidgetSchema + } + }, + required: [] + }; + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 }, + width: 700 + }, + $title1: { + spanLabelFixed: 0 + }, + $title2: { + spanLabelFixed: 0 + }, + $title3: { + spanLabelFixed: 0 + }, + $title4: { + spanLabelFixed: 0 + }, + $enterpriseRegistrationTime: { + width: 680 + }, + $operatingEndTime: { + grid: { span: 9 } + }, + $dateType: { + grid: { span: 4 } + }, + $validEndTime: { + grid: { span: 9 } + }, + $dateType01: { + grid: { span: 4 } + }, + $registrationCapital: { + grid: { span: 12 } + }, + $unit: { + spanLabelFixed: 20, + grid: { span: 3 } + } + }; + this.ui2 = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $titleB:{ + grid: { span: 24 }, + }, + $certificatePhotoWatermark: { + grid: { span: 12 }, + }, + $roadImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + }; + this.ui3 = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $titleC:{ + grid: { span: 24 }, + }, + $certificatePhotoWatermark: { + grid: { span: 12 }, + }, + $agreeImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + }; + } + getRegionToThree() { + // 获取一、二、三级地区详情 + this.service.http.post(this.service.$api_getRegionToThree).subscribe((res) => { + if(this.sf1){ + this.sf1.getProperty('/enterpriseAddressCode')!.schema.enum = res.data; + this.sf1?.getProperty('/enterpriseAddressCode')?.widget.reset(res.data); + } + }); + } + getProvinceData() { + return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe( + map(res => { + const result: any = []; + if (res) { + res.map((m: any) => { + const item = { label: m.name, value: m.regionCode }; + result.push(item); + }); + } + return result; + }) + ); + } + checkIdCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + idCardUrl: imgurl, + side + }; + this.service.request(this.service.$api_checkIdCard, params).subscribe(res => { + if (res) { + if (type === 0) { + // 法定代表人身份证 + if (side === 'front') { + // 正面 + this.sf.setValue('/name', res.name); + this.sf.setValue('/certificateNumber', res.number); + } + } + } + }); + } + checkQualificationCertificate(imgurl: any) { + // 识别从业资格证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + qualificationCertificateUrl: imgurl + }; + this.service.request(this.service.$api_recognizeQualificationCertificate, params).subscribe(res => { + console.log(res); + + if (res) { + this.sf2.setValue('/licenseNo', res.certificateNumber); + this.sf2.setValue('/regionCode', res.addressRegionCodes?.[0]); + } + }); + } + + checkDriverCard(imgurl: any, side: any, type: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + driverLicenseUrl: imgurl, + side + }; + this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe(res => { + if (res) { + if (type === 0) { + // 法定代表人身份证 + if (side === 'front') { + // 正面 + this.sf1.setValue('/licenseNo', res.number); + this.sf1.setValue('/driverModel', [res.classType?.toUpperCase()]); + this.sf1.setValue('/validStartTime', res.validFrom); + this.sf1.setValue('/validEndTime', res.validTo); + this.sf1.setValue('/signingOrganization', res.issuingAuthority); + } + } + } + }); + } + close(): void { + this.modal.destroy(); + } + showExample() { + this.showCardFlag = !this.showCardFlag; + } + showJopExample() { + this.showJopFlag = !this.showJopFlag; + } + submitForm() { + const items: any = this.sf.value; + items.certificatePhotoFrontWatermark = this.sf.value?.certificatePhotoFrontWatermark?.data?.fullFilePath || this.sf.value?.certificatePhotoFrontWatermark; + items.certificatePhotoBackWatermark = this.sf.value?.certificatePhotoBackWatermark?.data?.fullFilePath || this.sf.value?.certificatePhotoBackWatermark; + const items2: any = this.sf1.value; + items2.certificatePhotoWatermark = this.sf1.value?.certificatePhotoWatermark?.data?.fullFilePath || this.sf1.value?.certificatePhotoWatermark; + const items3: any = this.sf2.value; + items3.certificatePhotoWatermark = this.sf2.value?.certificatePhotoWatermark?.data?.fullFilePath || this.sf2.value?.certificatePhotoWatermark; + const params: any = { + source: 2, + mobile: this.sf.value.mobile, + bankCardNo: this.sf.value.bankCardNo, + bankName: this.sf.value.bankName, + identityInfoDTO: { + ...items, + certificatePhotoFront: this.detailData.certificatePhotoFront, + certificatePhotoBack: this.detailData.certificatePhotoBack + }, + userDriverLicenseDTO: { + ...items2, + certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto + }, + userPracticeSeniorityDTO: { + ...items3, + certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto + } + }; + if (params.userPracticeSeniorityDTO.certificatePhoto === '' || params.userPracticeSeniorityDTO.certificatePhotoWatermark === '') { + delete params.userPracticeSeniorityDTO.certificatePhotoWatermark; + delete params.userPracticeSeniorityDTO.certificatePhoto; + } + params.userDriverLicenseDTO.driverModel = params.userDriverLicenseDTO.driverModel.join(','); + delete params.identityInfoDTO.showName; + delete params.identityInfoDTO.titleA; + delete params.userDriverLicenseDTO.titleB; + delete params.userPracticeSeniorityDTO.titleC; + delete params.userDriverLicenseDTO.tipsA; + delete params.userPracticeSeniorityDTO.tipsC; + if (JSON.stringify(params.userPracticeSeniorityDTO) === '{}') { + params.userPracticeSeniorityDTO = null; + } + this.service.request(this.service.$api_driver_add, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('添加成功'); + this.modal.close(true); + } + }); + } +} diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.html b/src/app/routes/usercenter/components/driver/captain/add/add.component.html new file mode 100644 index 00000000..fdc58217 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.html @@ -0,0 +1,39 @@ + + +
    + + +
    +
    +
    正面照
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照
    +
    示例
    +
    +
    +
    +
    +
    +
    + diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.less b/src/app/routes/usercenter/components/driver/captain/add/add.component.less new file mode 100644 index 00000000..fd19d3c9 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.less @@ -0,0 +1,41 @@ +.pr { + position: relative; +} + +.pa { + position: absolute; + top: 35px; + left: 150px; + img{border: solid 1px #ebf0fb;} +} + +.tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + .hideBtn .ant-upload-list-item-actions button{ + &:last-child{ + display: none; + } + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts b/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts new file mode 100644 index 00000000..763d7784 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CtcCaptatinAddComponent } from './add.component'; + +describe('CtcCaptatinAddComponent', () => { + let component: CtcCaptatinAddComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CtcCaptatinAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CtcCaptatinAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.ts b/src/app/routes/usercenter/components/driver/captain/add/add.component.ts new file mode 100644 index 00000000..8a477dc9 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.ts @@ -0,0 +1,409 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { SFComponent, SFSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer, Subject } from 'rxjs'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { debounceTime } from 'rxjs/operators'; + + +@Component({ + selector: 'app-ctc-add', + templateUrl: './add.component.html', + styleUrls: ['./add.component.less'] +}) +export class CtcCaptatinAddComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + record: any = {}; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + readFlag = false; + changeSub = new Subject(); + detailData: any = { + bankCardNo: '', + bankName: '', + mobile: '', + remark: '', + identityInfoDTO: { + certificatePhotoBackWatermark: '', + certificatePhotoFrontWatermark: '', + certificatePhotoFront: '', + certificatePhotoBack: '', + certificateNumber: '', + name: '', + } + } + + constructor( + private modal: NzModalRef, + private envSrv: EAEnvironmentService, + public service: UsermanageService + ) { } + + ngOnInit(): void { + this.initData() + this.initSF(); + this.changeEndKmAction(); + } + initData() { + if (this.i && this.i.id) { + this.service.request(this.service.$api_captainrDetail, { id: this.i.id }).subscribe(res => { + if (res) { + this.detailData = res + this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark, + response: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark, + }, + ]; + this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.identityInfoDTO.certificatePhotoBackWatermark, + response: this.detailData.identityInfoDTO.certificatePhotoBackWatermark, + }, + ]; + this.initSF(); + } + }) + } + + } + initSF() { + this.schema = { + properties: { + mobile: { + title: '手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入手机号', + blur: () => { + if(!this.sf.value.mobile) { + return + } + this.service.request(this.service.$api_getByMobile, { mobile: this.sf.value.mobile }).subscribe(res => { + if (res.certificateNumber) { + this.readFlag = true + this.detailData = { + mobile: this.sf.value.mobile, + bankName: this.sf.value.bankName, + bankCardNo: this.sf.value.bankCardNo, + remark: this.sf.value.remark, + identityInfoDTO: { + certificatePhotoFrontWatermark: [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: res.certificatePhotoFrontWatermark, + response: res.certificatePhotoFrontWatermark, + }], + certificatePhotoBackWatermark: [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: res.certificatePhotoBackWatermark, + response: res.certificatePhotoBackWatermark, + }], + name: res.name, + certificateNumber: res.certificateNumber, + certificatePhotoFront: res.certificatePhotoFront, + certificatePhotoBack: res.certificatePhotoBack, + } + } + this.initSF() + } else { + this.readFlag = false + this.detailData = { + mobile: this.sf.value.mobile, + bankName: this.sf.value.bankName, + bankCardNo: this.sf.value.bankCardNo, + remark: this.sf.value.remark, + identityInfoDTO: { + certificatePhotoFrontWatermark: '', + certificatePhotoBackWatermark: '', + name: '', + certificateNumber: '', + certificatePhotoFront: '', + certificatePhotoBack: '', + } + } + this.initSF() + } + }) + } + }, + default: this.detailData.mobile + }, + name: { + title: '姓名', + type: 'string', + ui: { + widget: this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20) ? 'text' : '', + placeholder: '请输入姓名', + }, + readOnly: this.readFlag, + default: this.detailData.identityInfoDTO.name + }, + bankCardNo: { + title: '银行卡号', + type: 'string', + ui: { + widget: '', + placeholder: '请输入银行卡号', + change: (val: any) => { + const value = val.replace(/\D/g, '') + this.sf.setValue('/bankCardNo', value) + }, + errors: { + required: '请输入银行账号', + }, + }, + default: this.detailData.bankCardNo + }, + bankName: { + title: '开户行', + type: 'string', + ui: { + widget: '', + placeholder: '请输入开户行', + }, + default: this.detailData.bankName + }, + showName: { + title: '身份证照片', + type: 'string', + readOnly: true, + ui: { + widget: 'textarea', + showRequired: true, + borderless: true, + }, + default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写', + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag, + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.identityInfoDTO.certificatePhotoFront = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'front'); + } else { + this.detailData.identityInfoDTO.certificatePhotoFront = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: any) => { } + }, + default: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag, + ui: { + offsetControl: 6, + action: apiConf.fileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.identityInfoDTO.certificatePhotoBack = args.file.response.data.fullFilePath + } else { + this.detailData.identityInfoDTO.certificatePhotoBack = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: any) => { } + }, + default: this.detailData.identityInfoDTO.certificatePhotoBackWatermark + }, + certificateNumber: { + title: '身份证号', + type: 'string', + readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag, + ui: { + widget: this.i.id && (this.i.driverLicenseStatus !== 10 && this.i.driverLicenseStatus !== 20) ? 'text' : '', + placeholder: '请输入身份证号', + }, + default: this.detailData.identityInfoDTO.certificateNumber + }, + remark: { + title: '备注', + type: 'string', + maxLength: 100, + ui: { + widget: 'textarea', + placeholder: '请输入备注', + autosize: { minRows: 2, maxRows: 6 }, + }, + default: this.detailData.remark + }, + }, + required: ['name', 'mobile', 'bankCardNo', 'certificateNumber', 'certificatePhotoBackWatermark', 'certificatePhotoFrontWatermark'], + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 }, + }, + }; + // setTimeout(() => { + // if (this.readFlag) { + // this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [ + // { + // uid: -1, + // name: 'LOGO', + // status: 'done', + // url: this.detailData.certificatePhotoFrontWatermark, + // response: this.detailData.certificatePhotoFrontWatermark, + // }, + // ]; + // this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [ + // { + // uid: -1, + // name: 'LOGO', + // status: 'done', + // url: this.detailData.certificatePhotoBackWatermark, + // response: this.detailData.certificatePhotoBackWatermark, + // }, + // ]; + // this.sf.setValue('/mobile', this.detailData.mobile) + // this.sf.setValue('/name', this.detailData.name) + // this.sf.setValue('/certificateNumber', this.detailData.certificateNumber) + // this.sf.setValue('/certificatePhotoFrontWatermark', this.detailData.identityInfoDTO.certificatePhotoFrontWatermark) + // this.sf.setValue('/certificatePhotoBackWatermark', this.detailData.identityInfoDTO.certificatePhotoBackWatermark) + // } + // }, 500) + + } + + checkIdCard(imgurl: any, side: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + idCardUrl: imgurl, + side, + }; + this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => { + if (res) { + this.sf.setValue('/name', res.name); + this.sf.setValue('/certificateNumber', res.number); + } + }); + } + close(): void { + this.modal.destroy(); + } + changeEndKmAction() { + this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => { + if (res) { + const params: any = { + bankCardNo: this.sf.value.bankCardNo, + bankName: this.sf.value.bankName, + mobile: this.sf.value.mobile, + remark: this.sf.value.remark, + identityInfoDTO: { + certificatePhotoBackWatermark: this.sf.value?.certificatePhotoBackWatermark?.data?.fullFilePath || this.sf.value?.certificatePhotoBackWatermark, + certificatePhotoFrontWatermark: this.sf.value?.certificatePhotoFrontWatermark?.data?.fullFilePath ||this.sf.value?.certificatePhotoFrontWatermark, + certificatePhotoFront: this.detailData.certificatePhotoFront, + certificatePhotoBack: this.detailData.certificatePhotoBack, + certificateNumber: this.sf.value.certificateNumber, + name: this.sf.value.name, + } + } + if (this.i.id) { + params.id = this.i.id + } + delete params.showName + this.service.request(this.service.$api_saveCaptainr_new, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功') + this.modal.close(true) + } + }) + } + }); + } + sure() { + this.changeSub.next('500'); + } +} diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html new file mode 100644 index 00000000..0e8b40a9 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html @@ -0,0 +1,150 @@ + + + + + + + + + + + + + +
    + + 个人信息 + + +
    + + + + + + + + + +
    +
    + + + + + + + +
    + + + + +
    +
    +
    +
    + + + 银行结算信息(暂无银行信息) + + + {{ item.bankName }} + + + {{ item?.bankCardNumber }} + + + + +
    + + +
    +
    + + {{ userIdentityDetail?.name }} + + + + +
    +
    +
    + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less new file mode 100644 index 00000000..c0580085 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less @@ -0,0 +1,24 @@ +@import '../../../../less/edit.less'; + +:host { + ::ng-deep { + + .sv__title { + font-weight: 600; + } + + + .user-info { + display : flex; + font-size: 16px; + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts new file mode 100644 index 00000000..b5179dd0 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts @@ -0,0 +1,227 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; + +@Component({ + selector: 'app-captain-detail', + templateUrl: './captain-detail.component.html', + styleUrls: ['./captain-detail.component.less'], + providers: [DatePipe] +}) +export class CaptainDetailComponent implements OnInit { + userDetail: any; + userIdentityDetail: any = {}; + tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + bankList: any[] = []; + + @ViewChild('redectModal', { static: false }) + redectModal!: any; + @ViewChild('rejectedDriverModal', { static: false }) + rejectedDriverModal!: any; + approvalOpinion = ''; + + isEditUser = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + constructor( + private nzModalService: NzModalService, + public service: UsermanageService, + private route: ActivatedRoute, + private datePipe: DatePipe, + private nzImageService: NzImageService + ) {} + + ngOnInit() { + this.initData(); + } + initData() { + // 获取司机头部信息 + this.service + .request(this.service.$api_get_user_detail, { + appUserId: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userDetail = res; + } + }); + // 获取用户个人信息 + this.service + .request(this.service.$api_get_user_identity, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userIdentityDetail = res; + this.tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + } + }); + // 获取用户银行信息 + this.service + .request(this.service.$api_get_user_bank_list, { + roleId: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.bankList = res; + } + }); + } + + /** 启用/冻结司机 */ + userAction(status: number) { + this.nzModalService.warning({ + nzTitle: status === 1 ? '确定启用该司机吗?' : '确定冻结该司机吗?', + nzContent: status === 1 ? '启用后,该司机将恢复正常使用功能,请再次确认!' : '冻结后,司机将被限制使用,无法登陆,请谨慎操作!', + nzOnOk: () => { + this.service + .request(this.service.$api_lock_or_free_user, { + appUserId: [this.userDetail.appUserId], + freezeOrResume: !!!status, + pageName: '司机详情', + telephone: this.userDetail.phone + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + } + this.initData(); + }); + } + }); + } + + /** 审核通过个人信息 */ + approveUser() { + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `是否确认通过(姓名:${this.userIdentityDetail.name})审核`, + nzOnOk: () => { + this.adjuctUser({ auditStatus: 0, auditType: 0, identityId: this.userIdentityDetail?.id }, '审核通过'); + } + }); + } + + /** 驳回个人信息 */ + rejectedUser() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.adjuctUser( + { + auditStatus: 1, + auditType: 0, + identityId: this.userIdentityDetail?.id, + certificationOpinions: this.approvalOpinion + }, + '审核驳回成功' + ); + return; + } + }); + } + + /** 个人信息审核 */ + private adjuctUser(params: any, msg: string) { + this.service.request(this.service.$api_approve_identity, { ...params }).subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + } + this.initData(); + }); + } + + /** + * 开启修改 + */ + ratify() { + this.isEditUser = true; + } + + /** + * 需求修改 + */ + reset() { + this.userIdentityDetail = { ...this.tempalateUserIdentityDetail }; + this.isEditUser = false; + } + + saveUser() { + const userIdentity = this.userIdentityDetail; + const params = { + certificateNumber: userIdentity.certificateNumber, + certificatePhotoBack: userIdentity.certificatePhotoBack, + certificatePhotoBackWatermark: userIdentity.certificatePhotoBackWatermark, + certificatePhotoFront: userIdentity.certificatePhotoFront, + certificatePhotoFrontWatermark: userIdentity.certificatePhotoFrontWatermark, + certificateType: userIdentity.certificateType, + handCertificate: userIdentity.handCertificate, + id: userIdentity.id, + name: userIdentity.name, + souceType: userIdentity.souceType, + sourceAppId: userIdentity.sourceAppId, + tenantId: userIdentity.tenantId, + userId: userIdentity.userId, + validEndTime: + userIdentity.validEndTime?.length === 10 + ? userIdentity.validEndTime + : this.datePipe.transform(userIdentity.validEndTime, 'yyyy-MM-dd'), + validStartTime: + userIdentity.validStartTime?.length === 10 + ? userIdentity.validStartTime + : this.datePipe.transform(userIdentity.validStartTime, 'yyyy-MM-dd') + }; + this.service.request(this.service.$api_update_driver_identity, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.isEditUser = false; + this.initData(); + } + }); + } + + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + } + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.html b/src/app/routes/usercenter/components/driver/captain/captain.component.html new file mode 100644 index 00000000..35a6123f --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.html @@ -0,0 +1,77 @@ + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + +
    + +
    + + + + {{ item.promotersTelephone || '添加' }} + + + +
    + + +
    +
    + + + +
    +
    +
    diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.less b/src/app/routes/usercenter/components/driver/captain/captain.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.ts new file mode 100644 index 00000000..7191198c --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.ts @@ -0,0 +1,243 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { DynamicSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from '../../../services/usercenter.service'; +import { CtcCaptatinAddComponent } from './add/add.component'; +@Component({ + selector: 'app-usercenter-components-driver-captain', + templateUrl: './captain.component.html', + styleUrls: ['./captain.component.less'] +}) +export class UserCenterComponentsDriverCaptainComponent implements OnInit { + _$expand = false; + + ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }; + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + promotersTelephone = ''; + + constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper,) {} + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value) + }; + if (this.sf?.value.effectiveDate) { + params.effectiveDateStart = this.sf?.value.effectiveDate[0]; + params.effectiveDateEnd = this.sf?.value.effectiveDate[1]; + } + delete params.effectiveDate; + delete params.expand; + return params; + } + + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + + ngOnInit() { + this.ar.url.subscribe(params => { + this.st?.load(1); + }); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + + addPromoter(item?: any) { + this.promotersTelephone = item?.promotersTelephone; + const modal = this.modal.create({ + nzTitle: '推广业务员', + nzContent: this.promoterModal, + nzOnOk: () => { + if (!!!this.promotersTelephone) { + return false; + } + if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) { + this.service.msgSrv.error('手机格式错误'); + return false; + } + this.service + .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功'); + } + this.st.load(); + }); + return; + } + }); + } + + settingAction(item?: any) { + this.modal.create({ + nzTitle: '基础设置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '4', + businessId: item.id + }, + nzFooter: null + }); + } + + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + exportList() { + const params = this.reqParams; + this.service.downloadFile(this.service.$api_export_driver_cap, {...params, pageSize: -1}); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + name: { title: '车队长姓名', type: 'string', ui: { placeholder: '请输入', showRequired: false } }, + mobile: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入' + } + }, + identityNo: { + title: '身份证号', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + promotersTelephone: { + title: '业务员手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + identityStatus: { + type: 'string', + title: '实名认证状态', + enum: [ + { label: '全部', value: '' }, + { label: '待审核', value: 0 }, + { label: '审核通过', value: 1 }, + { label: '驳回', value: 2 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + source: { + type: 'string', + title: '注册渠道', + enum: [ + { label: '全部', value: '' }, + { label: '用户注册', value: 1 }, + { label: '货主添加', value: 2 }, + { label: '运营添加', value: 3 }, + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '车队长姓名', className: 'text-center', index: 'name' }, + { title: '手机号', className: 'text-center', index: 'mobile' }, + { title: '身份证号', className: 'text-center', index: 'identityNo' }, + { + title: '实名认证状态', + className: 'text-center', + index: 'identityStatus', + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 0: { text: '待审核', color: 'processing' }, + 1: { text: '审核通过', color: 'success' }, + 2: { text: '驳回', color: 'warning' } + } + }, + { title: '推广业务员', className: 'text-center', render: 'promotersTelephone' }, + { title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加' , 3: '运营添加'} }, + { title: '注册时间', className: 'text-center', index: 'createTime' }, + { + title: '操作', + width: '170px', + className: 'text-center', + buttons: [ + { + text: '查看', + click: item => { + this.router.navigate(['/usercenter/driver/captain/detail', item.appUserId]); + }, + acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] } + }, + // { + // text: '基础设置', + // click: item => this.settingAction(item), + // acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-basicSetting'] } + // } + ] + } + ]; + } + /** + * 新增单个实例 + */ + add() { + this.modalHelper.create(CtcCaptatinAddComponent, { i: { id: '' } }, { size: 900 }).subscribe(res => { + this.st.reload(); + }); + } +} diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.html b/src/app/routes/usercenter/components/driver/detail/detail.component.html new file mode 100644 index 00000000..141ab9bc --- /dev/null +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.html @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + +
    + + 个人信息 + + + + + + + +
    + + + + + + + + + +
    +
    + + + + + + + + + + - + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + + +
    + + 驾驶证信息 + + +
    + + + + + + + + + +
    +
    + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + +
    + + + + 从业资格证信息 + + + + + + + + + + + + + + + + {{licenseDetail?.regionCodeName }} + + + + + + - + + + + + + + + + + + + + + + + +
    + + + + 载具信息 + + + {{ carDatail?.carNo }} + + + {{ carDatail?.carNoColor }} + + + {{ carDatail?.carModel }} + + + {{ carDatail?.carLength }} + + + {{ carDatail?.isDefault?'是':'否' }} + + + {{ carDatail?.isSelf?'否':'是' }} + + + + + + + + + + + + + + + + + + 银行结算信息 (暂无银行信息) + + + + {{ item.bankName }} + + + {{ item?.bankCardNumber }} + + + + + + + 服务评级 + (暂无评级) + + + + + + + + 关联企业 + + + +
    + + + +
    +
    + + {{ userIdentityDetail?.name }} + + + + +
    +
    +
    + + +
    +
    + + {{driverDetail?.licenseNo }} + + + {{ licenseDetail?.licenseNo }} + + + + +
    +
    +
    + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.less b/src/app/routes/usercenter/components/driver/detail/detail.component.less new file mode 100644 index 00000000..3fc40149 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.less @@ -0,0 +1,33 @@ +@import '../../../less/edit.less'; + +:host { + ::ng-deep { + + .sv__title { + font-weight: 600; + } + + + .user-info { + display : flex; + font-size: 16px; + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + } + + .imgBox { + display: flex; + + img { + width : 200px !important; + height: 160px; + } + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.ts b/src/app/routes/usercenter/components/driver/detail/detail.component.ts new file mode 100644 index 00000000..dc7ee992 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/detail/detail.component.ts @@ -0,0 +1,503 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { Subject } from 'rxjs'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { UsermanageService } from '../../../services/usercenter.service'; +import { debounceTime } from 'rxjs/operators'; + +@Component({ + selector: 'app-usercenter-components-driver-detail', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'], + providers: [DatePipe] +}) +export class UserCenterComponentsDriverDetailComponent implements OnInit { + detailData: any; + userDetail: any; + contencarModel: any; + facetext: any; + faceStatus: any = 0; + userIdentityDetail: any = {}; + tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + driverDetail: any = { + licenseNo: '', + driverModel: [], + validStartTime: '', + validEndTime: '', + signingOrganization: '', + certificatePhotoWatermark: '' + }; + tempalateDriverData = { ...this.driverDetail }; + licenseDetail: any = { + licenseNo: '', + validStartTime: '', + validEndTime: '', + certificatePhotoWatermark: '', + regionCode: '' + }; + tempalateLicenseDetail = { ...this.licenseDetail }; + columns: STColumn[] = [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '项目名称', className: 'text-center', index: 'projectName' }, + { title: '角色', className: 'text-center', index: 'roleName' } + ]; + carList: any = []; + + @ViewChild('redectModal', { static: false }) + redectModal!: any; + @ViewChild('rejectedDriverModal', { static: false }) + rejectedDriverModal!: any; + adressCodeList: any = []; + billEvaluateList: any = []; + approvalOpinion = ''; + bankList: any[] = []; + isEditUser = false; + isEditDriver = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + constructor( + private nzModalService: NzModalService, + public service: UsermanageService, + public route: ActivatedRoute, + private datePipe: DatePipe, + private nzImageService: NzImageService + ) {} + + ngOnInit() { + this.initData(); + this.initDetailByCode(); + } + initData() { + // 获取司机头部信息 + this.service.request(this.service.$api_get_user_detail, { appUserId: this.route.snapshot.params.id }).subscribe(res => { + if (res) { + this.userDetail = res; + } + }); + this.service.request(this.service.$api_getDictValue, { dictKey: 'driverModel' }).subscribe(res => { + if (res) { + this.contencarModel = res; + } + }); + // 获取人脸识别结果 + this.service.request(this.service.$api_getFaceFlowQuery, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res) { + this.faceStatus = res.status; + if (res.status == 4) { + this.facetext = res.failReason; + } + } + }); + // 获取用户个人信息 + this.service.request(this.service.$api_get_user_identity, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res) { + this.userIdentityDetail = res; + this.tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + } + }); + // 获取驾驶证信息 + this.service.request(this.service.$api_get_driver_license, { appUserId: this.route.snapshot.params.id }).subscribe(res => { + if (res?.id) { + Object.assign(res, { driverModel: res.driverModel ? res.driverModel.split(',') : [] }); + this.driverDetail = res; + + this.tempalateDriverData = { ...this.driverDetail }; + } + }); + // 获取从业资格证信息 + this.service.request(this.service.$api_get_driver_practice_seniority, { appUserId: this.route.snapshot.params.id }).subscribe(res => { + if (res?.id) { + this.licenseDetail = res; + this.tempalateLicenseDetail = { ...this.licenseDetail }; + } + }); + // 获取载具信息 + this.service.request(this.service.$api_get_driver_car_license, { appUserId: [this.route.snapshot.params.id] }).subscribe(res => { + if (res) { + this.carList = res; + } + }); + // 获取评价信息 + this.service + .request(this.service.$api_get_driver_billEvaluate, { passiveUserId: this.route.snapshot.params.id }, 'POST', false) + .subscribe(res => { + if (res) { + this.billEvaluateList = res; + } + }); + + // 获取用户银行信息 + this.service + .request(this.service.$api_get_user_bank_list, { + roleId: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.bankList = res; + } + }); + } + + /** 启用/冻结司机 */ + userAction(status: number) { + this.nzModalService.warning({ + nzTitle: status === 1 ? '确定启用该司机吗?' : '确定冻结该司机吗?', + nzContent: status === 1 ? '启用后,该司机将恢复正常使用功能,请再次确认!' : '冻结后,司机将被限制使用,无法登陆,请谨慎操作!', + nzOnOk: () => { + this.service + .request(this.service.$api_lock_or_free_user, { + appUserId: [this.userDetail.appUserId], + freezeOrResume: !!!status, + pageName: '司机详情', + telephone: this.userDetail.phone + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + } + this.initData(); + }); + } + }); + } + + /** 审核通过个人信息 */ + approveUser() { + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `是否确认通过(姓名:${this.userIdentityDetail.name})审核`, + nzOnOk: () => { + this.adjuctUser({ auditStatus: 0, auditType: 0, identityId: this.userIdentityDetail?.id }, '审核通过'); + } + }); + } + + /** 驳回个人信息 */ + rejectedUser() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + this.service.msgSrv.warning('请填写备注'); + return false; + } + this.adjuctUser( + { + auditStatus: 1, + auditType: 0, + identityId: this.userIdentityDetail?.id, + certificationOpinions: this.approvalOpinion + }, + '审核驳回成功' + ); + return; + } + }); + } + + /** 审核通过驾驶员信息 */ + approveDriver() { + + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `

    驾驶证号:${this.driverDetail?.licenseNo}

    从业资格证号:${this.licenseDetail?.licenseNo}

    是否确认通过审核`, + nzOnOk: () => { + this.adjuctDriverLicense( + { + approvalStatus: 20, + appUserId: this.userDetail?.appUserId + }, + '审核成功' + ); + } + }); + } + + /** 驳回驾驶员信息 */ + rejectedDriver() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.rejectedDriverModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.adjuctDriverLicense( + { + approvalStatus: 30, + appUserId: this.userDetail?.appUserId, + approvalOpinion: this.approvalOpinion + }, + '审核驳回成功' + ); + return; + } + }); + } + + /** 个人信息审核 */ + private adjuctUser(params: any, msg: string) { + this.service.request(this.service.$api_approve_identity, { ...params }).subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + } + this.initData(); + }); + } + + /** 驾驶员审核 */ + private adjuctDriverLicense(params: any, msg: string) { + this.service.request(this.service.$api_approve_driver_license, { ...params }).subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + } + this.initData(); + }); + } + + /** + * 开启修改 + * @param type 修改类型 + */ + ratify(type: number) { + if (type) { + this.isEditDriver = true; + } else { + this.isEditUser = true; + } + } + + /** + * 需求修改 + * @param type 修改类型 + */ + reset(type: number) { + if (type) { + this.driverDetail = { ...this.tempalateDriverData }; + this.licenseDetail = { ...this.tempalateLicenseDetail }; + this.isEditDriver = false; + } else { + this.userIdentityDetail = { ...this.tempalateUserIdentityDetail }; + this.isEditUser = false; + } + } + /* + * 根据地区code查询地区详情 + * code:请求参数 + * type:参数 name:获取省市区名称,fullcode:获取省市区code + * num:参数 1:第一个地区选择,2:第二个地区选择 + */ + initDetailByCode() { + // 根据地区code查询地区详情 + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe((res: any) => { + this.adressCodeList = res; + }); + } + + /** + * 修改驾驶证,从业资格证信息 + */ + saveDriver() { + const driverDetail = this.driverDetail; + const licenseDetail = this.licenseDetail; + // console.log(this.driverDetail); + if (driverDetail.validStartTime && driverDetail.validEndTime) { + let validStartTime = driverDetail.validStartTime; + let validEndTime = driverDetail.validEndTime; + if (typeof driverDetail.validStartTime === 'string') { + validStartTime = new Date(driverDetail.validStartTime); + } + if (typeof driverDetail.validEndTime === 'string') { + validEndTime = new Date(driverDetail.validEndTime); + } + if (validStartTime?.getTime() >= validEndTime?.getTime()) { + this.service.msgSrv.warning('结束时间必须大于开始时间'); + return; + } + } + if ( + !driverDetail.licenseNo || + !driverDetail.driverModel || + !driverDetail.validStartTime || + !driverDetail.signingOrganization || + !driverDetail.certificatePhotoWatermark + ) { + this.service.msgSrv.warning('请完善驾驶证信息'); + return; + } + + if (!licenseDetail.licenseNo || !licenseDetail.validStartTime || !licenseDetail.certificatePhotoWatermark) { + this.service.msgSrv.warning('请完善从业资格证信息'); + return; + } + + const params: any = { + userId: this.route.snapshot.params.id, + mobile: this.userDetail?.phone, + appUserId: driverDetail.appUserId || this.route.snapshot.params.id, + userDriverLicenseDTO: { + appUserId: driverDetail?.appUserId || this.route.snapshot.params.id, + certificatePhoto: driverDetail.certificatePhoto, + certificatePhotoWatermark: driverDetail.certificatePhotoWatermark, + driverModel: driverDetail.driverModel.join(','), + id: driverDetail.id, + licenseNo: driverDetail.licenseNo, + signingOrganization: driverDetail.signingOrganization, + validEndTime: + driverDetail.validEndTime?.length === 10 + ? driverDetail.validEndTime + : this.datePipe.transform(driverDetail.validEndTime, 'yyyy-MM-dd'), + validStartTime: + driverDetail.validStartTime?.length === 10 + ? driverDetail.validStartTime + : this.datePipe.transform(driverDetail.validStartTime, 'yyyy-MM-dd') + }, + userPracticeSeniorityDTO: { + appUserId: licenseDetail.appUserId || this.route.snapshot.params.id, + approvalStatus: licenseDetail.approvalStatus, + certificatePhoto: licenseDetail.certificatePhoto, + certificatePhotoWatermark: licenseDetail.certificatePhotoWatermark, + id: licenseDetail.id, + licenseNo: licenseDetail.licenseNo, + regionCode: licenseDetail.regionCode, + validEndTime: + licenseDetail.validEndTime?.length === 10 + ? licenseDetail.validEndTime + : this.datePipe.transform(licenseDetail.validEndTime, 'yyyy-MM-dd'), + validStartTime: + licenseDetail.validStartTime?.length === 10 + ? licenseDetail.validStartTime + : this.datePipe.transform(licenseDetail.validStartTime, 'yyyy-MM-dd') + } + }; + // if (licenseDetail.approvalStatus && licenseDetail.licenseNo && licenseDetail.regionCode) { + // params.userPracticeSeniorityDTO = { + // appUserId: licenseDetail.appUserId || this.route.snapshot.params.id, + // approvalStatus: licenseDetail.approvalStatus, + // certificatePhoto: licenseDetail.certificatePhoto, + // certificatePhotoWatermark: licenseDetail.certificatePhotoWatermark, + // id: licenseDetail.id, + // licenseNo: licenseDetail.licenseNo, + // regionCode: licenseDetail.regionCode, + // validEndTime: + // licenseDetail.validEndTime?.length === 10 + // ? licenseDetail.validEndTime + // : this.datePipe.transform(licenseDetail.validEndTime, 'yyyy-MM-dd'), + // validStartTime: + // licenseDetail.validStartTime?.length === 10 + // ? licenseDetail.validStartTime + // : this.datePipe.transform(licenseDetail.validStartTime, 'yyyy-MM-dd') + // }; + // } + console.log(params); + this.service.request(this.service.$api_update_driver_license, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.isEditDriver = false; + this.initData(); + } + }); + } + + saveUser() { + const userIdentity = this?.userIdentityDetail; + const params = { + certificateNumber: userIdentity?.certificateNumber, + certificatePhotoBack: userIdentity?.certificatePhotoBack, + certificatePhotoBackWatermark: userIdentity?.certificatePhotoBackWatermark, + certificatePhotoFront: userIdentity?.certificatePhotoFront, + certificatePhotoFrontWatermark: userIdentity?.certificatePhotoFrontWatermark, + certificateType: userIdentity?.certificateType, + handCertificate: userIdentity?.handCertificate, + id: userIdentity?.id, + name: userIdentity?.name, + souceType: userIdentity?.souceType, + sourceAppId: userIdentity?.sourceAppId, + tenantId: userIdentity?.tenantId, + userId: userIdentity?.userId, + validEndTime: + userIdentity?.validEndTime?.length === 10 + ? userIdentity?.validEndTime + : this.datePipe.transform(userIdentity?.validEndTime, 'yyyy-MM-dd'), + validStartTime: + userIdentity?.validStartTime?.length === 10 + ? userIdentity?.validStartTime + : this.datePipe.transform(userIdentity?.validStartTime, 'yyyy-MM-dd') + }; + this.service.request(this.service.$api_update_driver_identity, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.isEditUser = false; + this.initData(); + } + }); + } + + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'certificateBackFront' || id === 'certificateBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'certificateBackFront' ? 'front' : 'back', 0); + } + } + } + + showImg(url: any) { + this.nzImageService.preview([{ src: url }]); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + goBack() { + window.history.go(-1); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.userIdentityDetail.name = res.name; + } + if (res.number) { + this.userIdentityDetail.certificateNumber = res.number; + } + } + } + } + }); + } +} diff --git a/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.html b/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.html new file mode 100644 index 00000000..b98f1832 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.html @@ -0,0 +1,51 @@ + + + + + + +

    +
    + +
    +
    + + + + +
    +
    + + + + + +
    {{item?.monthFreightAmount | currency}}
    +
    + +
    {{item?.dayWithdrawalAmount | currency}}
    +
    + +
    {{item?.monthWithdrawalAmount | currency}}
    +
    + +
    {{item?.monthReceivableAmount | currency}}
    +
    + +
    {{item?.isCaptain == 1 ? '车队长' : '司机'}}
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.less b/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.ts b/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.ts new file mode 100644 index 00000000..3ae0c418 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/driver-config/driver-config.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { DynamicSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from '../../../services/usercenter.service'; +@Component({ + selector: 'app-usercenter-components-driver-config', + templateUrl: './driver-config.component.html', + styleUrls: ['./driver-config.component.less'] +}) +export class UserCenterComponentsDriverConfigComponent implements OnInit { + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + constructor(public service: UsermanageService, private modal: NzModalService) {} + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + auditStatus: 20, + ...(this.sf && this.sf.value) + }; + delete params.effectiveDate; + delete params.expand; + return params; + } + + ngOnInit() {} + + settingAction(item?: any) { + const modal = this.modal.create({ + nzTitle: '配置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '3', + businessId: item.appUserId, + configvalue: 'sys.config' + }, + nzFooter: null + }); + + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(1); + } + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } + + exportList() { + const params = this.reqParams; + this.service.downloadFile(this.service.$api_export_driver_cap, { ...params, pageSize: -1 }); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + name: { title: '司机姓名', type: 'string', ui: { placeholder: '请输入', showRequired: false } }, + mobile: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入' + } + }, + isCaptain: { + type: 'string', + title: '类型', + enum: [ + { label: '全部', value: '' }, + { label: '车队长', value: 1 }, + { label: '司机', value: 0 } + ], + default: '', + ui: { + widget: 'select' + } + } + } + }; + } + + private initST(): STColumn[] { + return [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '司机姓名', className: 'text-center', width: '170px', index: 'name' }, + { title: '手机号', className: 'text-center', width: '170px', index: 'mobile' }, + { title: '类型', className: 'text-center', width: '170px',render: 'isCaptain' }, + { title: '月承运金额上限(元)', className: 'text-center', width: '200px', render: 'monthFreightAmount' }, + { title: '日提现金额上限(元)', className: 'text-center', width: '200px', render: 'dayWithdrawalAmount' }, + { title: '月提现金额上限(元)', className: 'text-center', width: '200px', render: 'monthWithdrawalAmount' }, + { title: '月收款金额上限(元)', className: 'text-center', width: '200px', render: 'monthReceivableAmount' }, + { + title: '操作', + width: '170px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '配置', + click: item => this.settingAction(item), + acl: { ability: ['USERCENTER-DRIVER-CONFIG-config'] } + } + ] + } + ]; + } +} diff --git a/src/app/routes/usercenter/components/driver/driver.component.html b/src/app/routes/usercenter/components/driver/driver.component.html new file mode 100644 index 00000000..32666512 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/driver.component.html @@ -0,0 +1,66 @@ + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + {{ item.promotersTelephone || '添加' }} + + + {{ item?.carNo }} + + + + + +
    +
    + + + +
    +
    +
    + +
    + +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/driver.component.less b/src/app/routes/usercenter/components/driver/driver.component.less new file mode 100644 index 00000000..757a5529 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/driver.component.less @@ -0,0 +1,28 @@ +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 1200px) { + .expend-options { + margin-top: -40px; + max-width : 400px; + position : absolute; + right : 0; + bottom : 30px; + } + +} + +:host::ng-deep { + + nz-range-picker { + width: 100%; + } + + .content-box { + .ant-card-body { + padding-top: 6px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/driver.component.ts b/src/app/routes/usercenter/components/driver/driver.component.ts new file mode 100644 index 00000000..e2e85027 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/driver.component.ts @@ -0,0 +1,352 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { DynamicSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { UsermanageService } from '../../services/usercenter.service'; +import { CarSettleAddDriverComponent } from './add-driver/add-driver.component'; +@Component({ + selector: 'app-usercenter-components-driver', + styleUrls: ['./driver.component.less'], + templateUrl: './driver.component.html' +}) +export class UserCenterComponentsDriverComponent implements OnInit { + _$expand = false; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + promotersTelephone = ''; + + resourceStatus: any = 10; + constructor( + public service: UsermanageService, + private modal: NzModalService, + private router: Router, + private ar: ActivatedRoute, + private modalHelper: ModalHelper + ) {} + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value), + auditStatus: this.resourceStatus + }; + if (this.sf?.value.effectiveDate) { + Object.assign(params, { + createTime: { + start: this.sf?.value.effectiveDate[0], + end: this.sf?.value.effectiveDate[1] + } + }); + // params.effectiveDateStart = this.sf?.value.effectiveDate[0]; + // params.effectiveDateEnd = this.sf?.value.effectiveDate[1]; + } + delete params.effectiveDate; + delete params.expand; + return params; + } + + ngOnInit() { + this.ar.url.subscribe(params => { + this.st?.load(1); + }); + } + + selectChange(e: any) { + this.resourceStatus = e; + setTimeout(() => { + this.st.load(); + }, 200); + } + + addPromoter(item?: any) { + this.promotersTelephone = item?.promotersTelephone; + const modal = this.modal.create({ + nzTitle: '推广业务员', + nzContent: this.promoterModal, + nzOnOk: () => { + if (!!!this.promotersTelephone) { + this.service.msgSrv.error('请填写手机号!'); + return false; + } + if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) { + this.service.msgSrv.error('手机格式错误'); + return false; + } + this.service + .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功'); + } + this.st.load(); + }); + return; + } + }); + } + + settingAction(item?: any) { + this.modal.create({ + nzTitle: '基础设置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '3', + businessId: item.appUserId + }, + nzFooter: null + }); + } + + showAccountDetail(item: any) { + console.log(item); + + this.modal.create({ + nzTitle: '资金账户', + nzContent: AccountDetailComponent, + nzNoAnimation: true, + nzWidth: 600, + nzComponentParams: { + isCanCreate: true, + url: '/api/fcc/accountBalance/getDriverAccountDetailByOperator', + params: { accountType: 2, roleId: item.appUserId, ctfId: item.identityNo, clientName: item.name } + }, + nzFooter: null + }); + } + + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + exportList() { + const params = this.reqParams; + this.service.downloadFile(this.service.$api_export_driver, { ...params, pageSize: -1 }); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + name: { title: '司机姓名', type: 'string', ui: { placeholder: '请输入', showRequired: false } }, + mobile: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入' + } + }, + identityStatus: { + type: 'string', + title: '实名状态', + enum: [ + { label: '全部', value: '' }, + { label: '待审核', value: 0 }, + { label: '通过', value: 1 }, + { label: '驳回', value: 2 } + ], + default: '', + ui: { + widget: 'select' + } + }, + driverLicenseStatus: { + type: 'string', + title: '驾驶证状态', + enum: [ + { label: '全部', value: '' }, + { label: '待审核', value: 10 }, + { label: '审核通过', value: 20 }, + { label: '驳回', value: 30 }, + { label: '证件过期', value: 40 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + practiceSenioritLicenseStatus: { + type: 'string', + title: '从业资格证状态', + enum: [ + { label: '全部', value: '' }, + { label: '待审核', value: 10 }, + { label: '审核通过', value: 20 }, + { label: '驳回', value: 30 }, + { label: '证件过期', value: 40 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + promotersTelephone: { + title: '推广业务员', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + source: { + type: 'string', + title: '注册渠道', + enum: [ + { label: '全部', value: '' }, + { label: '用户注册', value: 1 }, + { label: '货主添加', value: 2 }, + { label: '运营添加', value: 3 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + effectiveDate: { + title: '申请时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + add() { + this.modalHelper.create(CarSettleAddDriverComponent, { size: 900 }).subscribe(res => { + this.st.load(); + }); + } + private initST(): STColumn[] { + return [ + { title: '司机姓名', className: 'text-center', index: 'name', width: 150 }, + { title: '手机号', className: 'text-center', index: 'mobile', width: 150 }, + { title: '身份证号码', className: 'text-center', index: 'identityNo', width: 200 }, + { title: '当前车辆', className: 'text-center', render: 'carNo', width: 200 }, + { title: '驾驶证审核人', className: 'text-center', index: 'approvalUserName', width: 200 }, + { title: '审核时间', className: 'text-center', index: 'approvalTime', width: 200 }, + { + title: '实名认证状态', + className: 'text-center', + index: 'identityStatus', + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 0: { text: '待审核', color: 'default' }, + 1: { text: '通过', color: 'success' }, + 2: { text: '驳回', color: 'warning' } + }, + width: 180 + }, + { + title: '驾驶证状态', + className: 'text-center', + index: 'driverLicenseStatus', + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 10: { text: '待审核', color: 'default' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'warning' }, + 40: { text: '证件过期', color: 'error' } + }, + width: 180 + }, + { + title: '从业资格证状态', + className: 'text-center', + index: 'practiceSenioritLicenseStatus', + type: 'badge', + badge: { + '-1': { text: '未提交', color: 'default' }, + 10: { text: '待审核', color: 'default' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'warning' }, + 40: { text: '证件过期', color: 'error' } + }, + width: 180 + }, + { title: '推广业务员', className: 'text-center', render: 'promotersTelephone', width: 180 }, + { + title: '注册渠道', + className: 'text-center', + index: 'source', + type: 'enum', + enum: { 1: '用户注册', 2: '货主添加', 3: '运营添加' }, + width: 150 + }, + { title: '注册时间', className: 'text-center', index: 'createTime', width: 200 }, + { + title: '操作', + width: '110px', + className: 'text-center', + fixed: 'right', + buttons: [ + { + text: '查看
    ', + click: item => { + this.router.navigate(['./detail', item.appUserId], { relativeTo: this.ar }); + }, + acl: { ability: ['USERCENTER-DRIVER-LIST-view'] } + }, + // { + // text: '基础设置', + // click: item => this.settingAction(item), + // acl: { ability: ['USERCENTER-DRIVER-LIST-basicSetting'] }, + // }, + { + text: '资金账户', + click: item => this.showAccountDetail(item), + acl: { ability: ['USERCENTER-DRIVER-LIST-account'] } + } + ] + } + ]; + } + viewCar(item: any) { + this.router.navigate(['/vehicle/list/detail/' + item.carId]); + } +} diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html new file mode 100644 index 00000000..7fbdaa18 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html @@ -0,0 +1,16 @@ + + + + + +
    + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.less b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts new file mode 100644 index 00000000..39364f6f --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts @@ -0,0 +1,121 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; + +@Component({ + selector: 'app-audit-admin', + templateUrl: './audit-admin.component.html', + styleUrls: ['./audit-admin.component.less'] +}) +export class AuditAdminComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 20 } + } + }; + isReadOnly = false; + constructor(public msgSrv: NzMessageService, private nzModalService: NzModalService, public service: UsermanageService) {} + + ngOnInit(): void { + this.loadUserInfo(); + } + + loadUserInfo() { + this.service.request(this.service.$api_get_enterprise_user_by_id, { id: this.i.id }).subscribe(res => { + if (res) { + this.initSF(res); + } + }); + } + + show(src: string) { + if (!src) { + return; + } + const params = { + imgList: [src], + index: 0 + }; + this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + initSF(user?: any) { + // console.log(user); + + this.schema = { + properties: { + expand: { type: 'boolean', ui: { hidden: true } }, + oldAdminName: { + title: '当前管理员', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminName + }, + oldAdminMobile: { + title: '手机号', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminMobile + }, + oldAdminIdNo: { + title: '身份证号', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminIdNo + }, + newAdminName: { + title: '转授对象', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminName + }, + newAdminMobile: { + title: '手机号', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminMobile + }, + newAdminIdNo: { + title: '身份证号', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminIdNo + }, + newPhotoFrontWatermark: { + title: '身份证照', + type: 'string', + ui: { widget: 'custom' }, + default: user + }, + creditPhoto: { + title: '企业授权函', + type: 'string', + ui: { widget: 'custom' }, + default: user.creditPhoto + }, + approvalOpinion: { + title: this.isReadOnly ? '驳回原因' : '备注', + type: 'string', + maxLength: 100, + ui: { + placeholder: '审核不通过需要说明原因', + widget: this.i?.approvalStatus === 30 && this.isReadOnly ? 'text' : 'textarea', + autosize: { minRows: 3, maxRows: 6 }, + visibleIf: { + expand: (value: boolean) => !this.isReadOnly || this.i?.approvalStatus === 30 + } + }, + default: user.approvalOpinion + } + } + }; + } +} diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html new file mode 100644 index 00000000..707f5bc4 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html @@ -0,0 +1,95 @@ + + + + + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + +
    + +
    + +

    +
    +
    +
    +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less new file mode 100644 index 00000000..52b6737d --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.less @@ -0,0 +1,32 @@ +:host { + ::ng-deep { + .tabs-wrap>.ant-tabs-nav { + margin-bottom: 0; + } + + .myForm .ant-upload.ant-upload-select-picture-card>.ant-upload { + flex-direction: column !important; + } + + span { + word-break: break-all + } + + } +} + +.expend-options { + margin-top: 0px; +} + + +@media (min-width: 990px) { + .expend-options { + margin-top: -40px; + max-width : 400px; + position : absolute; + right : 0; + bottom : 30px; + } + +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts new file mode 100644 index 00000000..5b2aaca8 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts @@ -0,0 +1,546 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from '../../../services/usercenter.service'; +import { AuditAdminComponent } from './audit-admin/audit-admin.component'; + +@Component({ + selector: 'app-Freight-components-enterprise-audit', + templateUrl: './enterprise-audit.component.html', + styleUrls: ['./enterprise-audit.component.less'] +}) +export class FreightComponentsEnterpriseAuditComponent implements OnInit { + _$expand = false; + ui: SFUISchema = { '*': { spanLabelFixed: 90, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }; + schema: SFSchema = this.initSF(); + enterColumns: STColumn[] = this.initEnterST(); + adminColumns: STColumn[] = this.initAdminST(); + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + tabType = 1; + tabs = [ + { + name: '企业审核', + type: 1, + isActived: false + }, + { + name: '企业管理员审核', + type: 2, + isActived: false + } + ]; + + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + ltdId: any = []; + roles: any = []; + customerServices: any = []; + detailData: any = null; + approvalOpinion = ''; + networkTransporter = null; + roleId = null; + customerServiceId = null; + constructor(public service: UsermanageService, private router: Router, private modal: NzModalService) {} + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + } + }); + } + } + Object.assign(requestOptions.body, { flag: this.tabType, listSource: 2 }); + return requestOptions; + }; + + /** + * 伸缩查询条件 + */ + expandToggle(status: boolean) { + this._$expand = status; + this.sf?.setValue('/expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + /** + * 程序初始化入口 + */ + ngOnInit() { + this.loadltdId(); + this.loadRoles(); + this.loadCustomerServices(); + } + + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } + + loadCustomerServices() { + this.service.getStaffList({}, false).subscribe(res => { + if (res) { + this.customerServices = res; + } + }); + } + + /** + * 查看详情 + */ + ViewAdimin(record: any, isReadOnly = false) { + const modal = this.modal.create({ + nzTitle: isReadOnly ? '查看' : '审核', + nzContent: AuditAdminComponent, + nzWidth: 650, + nzComponentParams: { i: { ...record }, isReadOnly }, + nzFooter: isReadOnly + ? [] + : [ + { + label: '驳回', + type: 'primary', + onClick: instance => { + if (!instance?.sf.value.approvalOpinion) { + this.service.msgSrv.warning('请填写备注'); + return false; + } + this.adminAuditUser( + { + id: record.id, + approvalStatus: '30', + approvalOpinion: instance?.sf.value.approvalOpinion + }, + modal + ); + return; + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.adminAuditUser( + { + id: record.id, + approvalStatus: '20' + }, + modal + ); + } + } + ] + }); + modal.afterClose.subscribe(res => { + // this.st.load(1); + }); + } + + auditPass(item: any) { + this.detailData = item; + this.networkTransporter = null; + this.roleId = null; + this.modal.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter || !this.roleId || !this.customerServiceId) { + return false; + } + this.auditEnterprise(20); + return; + } + }); + } + auditNo(item: any) { + this.detailData = item; + this.approvalOpinion = ''; + this.roleId = null; + this.modal.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(30); + return; + } + }); + } + + private auditEnterprise(status: number) { + this.service + .request(this.service.$api_audit_freight, { + approvalStatus: status, + id: this.detailData.id, + approvalOpinion: this.approvalOpinion, + networkTransporter: this.networkTransporter, + customerServiceId: this.customerServiceId, + roleId: this.roleId || null + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + } + this.st.load(1); + }); + } + + View(record: any) { + this.router.navigate([`/usercenter/freight/enterprise/detail/${record.id}`]); + } + + // 切换Tab + changeTab(item: any) { + this.tabType = item.type; + this.expandToggle(false); + this.sf?.reset(); + this.st.data = this.tabType === 1 ? this.service.$api_get_freight_list : this.service.$api_get_enterprise_admin_list; + setTimeout(() => { + this.st.load(1); + }, 100); + } + + private adminAuditUser(params: any, modal: any) { + this.service.request(this.service.$api_audit_enterprise_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('审核成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + + exportList() { + const params = { ...this.sf.value, flag: this.tabType, listSource: 2, pageSize: -1 }; + this.service.downloadFile(this.service.$api_export_enterprise, params); + } + + /** + * 初始化数据列表 + */ + initEnterST(): STColumn[] { + return [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName', width: 350 }, + { title: '统一社会信用代码', className: 'text-center', index: 'unifiedSocialCreditCode', width: 200 }, + { + title: '公司所在地', + className: 'text-center', + index: 'province', + width: 200, + format: item => `${item.provinceName}${item.cityName}${item.areaName}` + }, + { + title: '企业类型', + className: 'text-center', + index: 'enterpriseType', + width: 200, + type: 'enum', + enum: { 1: '物流企业', 2: '货运代理', 3: '生产型企业', 4: '贸易类企业', 5: '科技型企业', 6: '化学化工企业', 7: '其他' } + }, + { title: '管理员', className: 'text-center', index: 'contacter', width: 150, format: item => `${item.contacter}
    /${item.mobile}` }, + { + title: '常用服务', + className: 'text-center', + index: 'oftenUsedServices', + type: 'enum', + enum: { 10: '整车发货', 20: '大宗发货' }, + width: 140 + }, + { title: '业务员', className: 'text-center', index: 'promotersTelephone', width: 150 }, + { + title: '注册渠道', + className: 'text-center', + index: 'source', + type: 'enum', + enum: { 1: '货主注册', 2: '平台添加', 3: '运营添加' }, + width: 130 + }, + { title: '申请时间', className: 'text-center', index: 'createTime', width: 180, type: 'date' }, + { title: '审核时间', className: 'text-center', index: 'approvalTime', width: 180, type: 'date' }, + { title: '审核人', className: 'text-center', index: 'approvalUserName', width: 130 }, + { + title: '审核状态', + className: 'text-center', + render: 'approvalStatus', + width: 160 + }, + { + title: '常用服务', + className: 'text-center', + index: 'oftenUsedServices', + type: 'enum', + enum: { 10: '整车发货', 20: '大宗发货' }, + width: 140 + }, + { title: '推广业务员', className: 'text-center', index: 'promotersTelephone', width: 150 }, + { + title: '操作', + fixed: 'right', + width: '180px', + className: 'text-center', + buttons: [ + { text: '查看', click: _record => this.View(_record), acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] } }, + { + text: '通过', + click: _record => this.auditPass(_record), + acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-D-audit'] }, + iif: item => item.approvalStatus === 10 + }, + { + text: '驳回', + click: _record => this.auditNo(_record), + acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-D-audit'] }, + iif: item => item.approvalStatus === 10 + } + ] + } + ]; + } + + initAdminST(): STColumn[] { + return [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '当前管理员', className: 'text-center', index: 'oldAdminName', width: 140 }, + { title: '当前管理员手机号', className: 'text-center', index: 'oldAdminMobile', width: 170 }, + { title: '转授对象', className: 'text-center', index: 'newAdminName', width: 140 }, + { title: '转授对象手机号', className: 'text-center', index: 'newAdminMobile', width: 150 }, + { title: '申请时间', className: 'text-center', index: 'createTime', width: 170 }, + { + title: '状态', + className: 'text-center', + index: 'approvalStatus', + type: 'badge', + badge: { + 10: { text: '待审核', color: 'processing' }, + 20: { text: '已成功', color: 'success' }, + 30: { text: '已驳回', color: 'warning' } + }, + width: 130 + }, + { + title: '操作', + fixed: 'right', + width: '180px', + className: 'text-center', + buttons: [ + { + text: '审核', + click: _record => this.ViewAdimin(_record), + acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-adminAudit'] }, + iif: (item: any) => item.approvalStatus === 10 + }, + { + text: '查看', + click: _record => this.ViewAdimin(_record, true) + } + ] + } + ]; + } + + /** + * 初始化查询表单 + */ + initSF(): SFSchema { + return { + properties: { + expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + contactName: { + title: '管理员', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + enterpriseType: { + type: 'string', + title: '企业类型', + enum: [ + { label: '全部', value: '' }, + { label: '物流企业', value: 1 }, + { label: '货运代理', value: 2 }, + { label: '生产型企业', value: 3 }, + { label: '贸易类企业', value: 4 }, + { label: '科技型企业', value: 5 }, + { label: '化学化工企业', value: 6 }, + { label: '其他', value: 7 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 + } + } + }, + enterpriseAddressCode: { + type: 'string', + title: '公司所在地', + enum: [{ label: '全部', value: '' }], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } + }, + oftenUsedServices: { + type: 'string', + title: '常用服务', + enum: [ + { label: '全部', value: '' }, + { label: '整车发货', value: 10 }, + { label: '大宗发货', value: 20 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } + }, + // approval11St11atus: { + // type: 'string', + // title: '客户类型', + // enum: [{ label: '全部', value: '' }], + // default: '', + // ui: { + // widget: 'select', + // visibleIf: { + // expand: (value: boolean) => this.tabType === 1 && value + // } + // } + // }, + promotersTelephone: { + title: '业务员', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } + }, + mobile: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => this.tabType === 2 + } + } + }, + approvalUserName: { + title: '审核人', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } + }, + createTime: { + title: '申请时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + approvalTime: { + title: '审核时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } as SFDateWidgetSchema + }, + approvalStatus: { + type: 'string', + title: '审核状态', + enum: [ + { label: '全部', value: '' }, + { label: '待审核', value: 10 }, + { label: '已撤销', value: 15 }, + { label: '已成功', value: 20 }, + { label: '审核失败', value: 30 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + source: { + type: 'string', + title: '注册渠道', + enum: [ + { label: '全部', value: '' }, + { label: '货主注册', value: 1 }, + { label: '平台添加', value: 2 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => this.tabType === 1 && value + } + } + } + } + }; + } +} diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html new file mode 100644 index 00000000..90e39e1c --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html @@ -0,0 +1,269 @@ + + + + + + + + + + + + + 企业管理员信息 + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + {{detailData?.registrationCapital}} + + 万元 + + + + + + + + + +
    + {{ detailData?.operatingStartTime }} 至 {{ detailData?.operatingEndTime }} +
    +
    长期
    +
    {{ detailData?.operatingStartTime + }} 至 长期
    +
    +
    + + + + + + + {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ + detailData?.fullRegionVO?.areaName }} + + + + + +
    + + + + + + + + + + + + + + + 企业法人信息 + + + + + + + + {{ detailData?.legalPersonIdentityVO?.validStartTime }} - + {{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }} + + +
    + + + + +
    +
    +
    + + + 企业开票信息 + + + + + + + + + + + + + +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + + + +
    +
    +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + +
    +
    +
    + + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.less b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.less new file mode 100644 index 00000000..33632d37 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.less @@ -0,0 +1,132 @@ +:host { + ::ng-deep { + sv-title { + font-weight: 700; + } + + .user-info { + display : flex; + font-size: 16px; + + .enterprise-name { + margin-right: 15px; + } + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + .user-info-des { + margin-bottom: 5px; + } + } + + .sv__label, + .sv__detail { + line-height: 30px; + } + + .edit-box { + input { + max-width: 250px; + } + + nz-date-picker { + min-width: 250px; + } + } + + .readOnly-box { + input { + padding-left: 0; + color : #000; + border : 0; + } + + nz-select-top-control { + padding-left: 0px !important; + } + } + + .ant-select { + min-width: 250px; + + nz-select-top-control { + cursor: text !important; + color : #000 !important; + } + } + + // 图片展示工具样式改造 + .ant-upload.ant-upload-disabled { + cursor: pointer; + } + + .ant-upload.ant-upload-select-picture-card { + width : 200px; + height: 160px; + } + + .ant-upload-picture-card-wrapper { + width: auto; + } + } +} + +.image-hover { + .delete-icon { + border-radius : 50%; + color : #F55656; + font-size : 28px; + position : absolute; + top : -15px; + right : -15px; + background-color: #ffffff; + cursor : pointer; + } + + .show-icon { + color : #ffffff; + font-size: 30px; + cursor : pointer; + } +} + +.image-hover:hover .mask { + opacity: 0.8; +} + +.mask { + width : 200px; + height : 160px; + background-color : #4F4F4F; + opacity : 0; + position : absolute; + // top : 6px; + // left : 12px; + border-radius : 6px; + margin-top : -160px; +} + +.mask-over { + width : 200px; + height : 160px; + position : absolute; + // top : 6px; + // left : 12px; + border-radius : 6px; + display : flex; + justify-content : center; + align-items : center; + margin-top : -160px; + + label { + font-size : 20px; + line-height : 24px; + letter-spacing: 0.7px; + color : #FFFFFF; + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts new file mode 100644 index 00000000..891b1f83 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts @@ -0,0 +1,243 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { UsermanageService } from '../../../../services/usercenter.service'; +import { + SFComponent, + SFSchema, + SFDateWidgetSchema, + SFUISchema, + SFUploadWidgetSchema, + SFSelectWidgetSchema, + SFTextWidgetSchema, + SFTagWidgetSchema +} from '@delon/form'; +import { Observable, Observer } from 'rxjs'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { apiConf } from '@conf/api.conf'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { NzCascaderOption } from 'ng-zorro-antd/cascader'; +import { NzImageService } from 'ng-zorro-antd/image'; +@Component({ + selector: 'app-Freight-components-EnterpriseAudit-view', + templateUrl: './view.component.html', + styleUrls: ['./view.component.less'] +}) +export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + + approvalOpinion = ''; + networkTransporter = null; + + detailData: any = this.initDefalutData(); + tempalateData = { ...this.detailData }; + + statusE: any = { + 10: '待审核', + 20: '审核通过', + 30: '审核失败' + }; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + + values: string[] | null = null; + ltdId: any[] = []; + constructor( + private nzModalService: NzModalService, + public service: UsermanageService, + private route: ActivatedRoute, + private nzImageService: NzImageService + ) {} + + ngOnInit() { + this.initData(); + // this.launchSign(); + } + + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_freight_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + this.tempalateData = { ...this.detailData }; + } + }); + } + + auditPass() { + this.networkTransporter = null; + this.nzModalService.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter) { + return false; + } + this.auditEnterprise(20); + return; + } + }); + } + auditNo() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(30); + return; + } + }); + } + + private auditEnterprise(status: number) { + this.service + .request(this.service.$api_audit_freight, { + approvalStatus: status, + id: this.detailData.id, + approvalOpinion: this.approvalOpinion, + networkTransporter: this.networkTransporter + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + } + this.initData(); + }); + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + deleteImg(key: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + this.detailData[key] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + changeUpload({ file, fileList, type }: any, key: string) { + if (type === 'success') { + this.detailData[key] = file.response.data.fullFileWatermarkPath; + } + } + + changeTime(event: any) { + console.log(event); + } + + changeCascader(event: any) { + console.log(event); + } + + /* + * 根据地区code查询地区详情 + * code:请求参数 + * type:参数 name:获取省市区名称,fullcode:获取省市区code + * num:参数 1:第一个地区选择,2:第二个地区选择 + */ + getRegionDetailByCode(regionCode: any) { + // 根据地区code查询地区详情 + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + loadData = (node: any, index: number) => { + return new Promise(resolve => { + this.getRegionDetailByCode(node?.regionCode || '').subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + }, + _ => {}, + () => { + resolve(node); + } + ); + }); + }; + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + this.isEdit = false; + } + + ratify() { + this.isEdit = true; + } + + goBack() { + window.history.go(-1); + } + + private initDefalutData() { + return { + adminUserInfo: { + name: '', + mobile: '', + certificatePhotoFrontWatermark: '', + certificatePhotoBackWatermark: '' + }, + legalPersonIdentityVO: { + certificateNumber: '' + }, + enterpriseName: '', + enterpriseType: '', + unifiedSocialCreditCode: '', + registrationCapital: null, + enterpriseRegistrationTime: '', + + driverLicenseSigningOrg: '', + carDistinguishCode: '', + carLoad: '', + curbWeight: '', + roadTransportNo: '', + roadTransportLicenceNo: '', + carOwner: '', + isTrailer: null, + useNature: null, + driverLicenseRegisterTime: null, + driverLicenseGetTime: null, + driverLicenseEndTime: null, + roadTransportStartTime: null, + roadTransportEndTime: null, + carFrontPhotoWatermark: '' + }; + } +} diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html new file mode 100644 index 00000000..05a199c9 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html @@ -0,0 +1,72 @@ + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + +
    + + +
    + 已选择 + {{ selectedRows.length }} 条数据 + 清空 +
    +
    + + + +
    + + +
    +
    + + + + + +
    +
    +
    + + +
    +
    + + + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts new file mode 100644 index 00000000..1f605413 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts @@ -0,0 +1,322 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent, STRequestOptions, STData, STChange } from '@delon/abc/st'; +import { SFUISchema, SFSchema, SFComponent, SFDateWidgetSchema } from '@delon/form'; +import { ShipperBaseService, DynamicSettingModalComponent } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { UsermanageService } from '../../../services/usercenter.service'; + +@Component({ + selector: 'app-freight-config', + templateUrl: './freight-config.component.html', + styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less'] +}) +export class FreightConfigComponent implements OnInit { + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + selectedRows: any[] = []; + + @ViewChild('IWModal', { static: false }) + IWModal!: any; + @ViewChild('roleModal', { static: false }) + roleModal!: any; + ltdId: any = []; + roles: any = []; + networkTransporter = null; + roleId = null; + _$expand = false; + constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {} + + ngOnInit() { + this.initST(); + this.loadltdId(); + this.loadRoles(); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { listSource: 1 }); + if (this.sf?.value) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf?.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf?.value.createTime[0], + end: this.sf?.value.createTime[1] + } + }); + } + } + this.selectedRows = []; + return requestOptions; + }; + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + } + } + + settingAction(item?: any) { + const modal = this.modal.create({ + nzTitle: '配置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '2', + spareBusinessId: item.networkTransporter, + businessId: item.id, + formatTypeList: (item: any[]) => [ + ...item, + { + name: '权限配置', + configType: 1, + items: [ + { + itemType: 999 + } + ] + }, + { + name: '费率变更记录', + configType: 2, + items: [ + { + itemType: 999 + } + ] + } + ] + }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + if (res) { + this.st.load(1); + } + }); + } + + editRoleBatch() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择企业'); + return; + } + this.roleId = null; + const modal = this.modal.create({ + nzTitle: '修改角色', + nzContent: this.roleModal, + nzOnOk: () => { + if (!this.roleId) { + return false; + } + this.service + .request(this.service.$api_update_enter_role_batch, { + enterpriseIdList: this.selectedRows.map(i => i.id), + roleId: this.roleId + }) + .subscribe((res: Array) => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + modal.destroy(); + } + }); + return false; + } + }); + } + + editIWBatch() { + if (this.selectedRows?.length <= 0) { + this.service.msgSrv.warning('请选择企业'); + return; + } + this.networkTransporter = null; + const modal = this.modal.create({ + nzTitle: '修改网络货运人', + nzContent: this.IWModal, + nzOnOk: () => { + if (!this.networkTransporter) { + return false; + } + this.service + .request(this.service.$api_update_enter_newowork_batch, { + enterpriseIdList: this.selectedRows.map(i => i.id), + networkTransporterId: this.networkTransporter + }) + .subscribe((res: Array) => { + if (res && res.length === 0) { + this.service.msgSrv.success('修改成功'); + this.st.load(1); + modal.destroy(); + } else { + this.service.msgSrv.error(`企业${res?.join(',')}修改失败`); + modal.destroy(); + this.st.load(); + } + }); + return false; + } + }); + } + + exportList() { + const params = { listSource: 1, pageSize: -1 }; + if (this.sf) { + Object.assign(params, { + ...this.sf.value + }); + } + this.service.downloadFile(this.service.$api_export_freight_config, params); + } + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + + private initSF(): SFSchema { + return { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + networkTransporter: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + goodsSurchargeRatio: { + title: '货源单费率', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + contractSurchargeRatio: { + title: '合同单费率', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + createTime: { + title: '注册时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + initST(): STColumn[] { + return [ + { title: '', index: 'key', type: 'checkbox' }, + { title: '企业名称', className: 'text-center', index: 'enterpriseName', width: 350 }, + { title: '网络货运人', className: 'text-center', index: 'netTranName', width: 160 }, + { + title: '货源单费率', + className: 'text-right', + index: 'goodsSurchargeRatio', + width: 130, + format: item => `${item.goodsSurchargeRatio}%` + }, + { + title: '合同单费率', + className: 'text-right', + index: 'contractSurchargeRatio', + width: 130, + format: item => `${item.contractSurchargeRatio}%` + }, + { + title: '合同单业务量(万元)', + index: 'contractQuota', + width: 170, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) } + }, + { + title: '货源单业务量(万元)', + index: 'goodsQuota', + width: 170, + type: 'widget', + className: 'text-right', + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) } + }, + { + title: '注册时间', + index: 'createTime', + width: 180, + className: 'text-right' + }, + { + title: '操作', + width: '90px', + fixed: 'right', + className: 'text-center', + buttons: [ + { + text: '配置', + click: item => this.settingAction(item) + } + ] + } + ]; + } +} diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html new file mode 100644 index 00000000..43c5bfe0 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html @@ -0,0 +1,501 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + 四要素验证: + + + +

    +
    + + + + + + {{detailData.enterpriseName}} + + + + + + + + {{detailData.unifiedSocialCreditCode}} + + + + + + + + + + + + + + + + + + + + {{detailData?.registrationCapital}} + + 万元 + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ + detailData?.fullRegionVO?.areaName }} + + + + + + + + {{detailData.enterpriseAddress}} + + + + + + + + {{detailData.businessScope}} + + + + + + + + + + + + + +
    + + + 法人信息 + + + + + + + + + + + - + + + + + + + + + +
    + + + + +
    +
    +
    + + + 企业管理员信息 + + + + + + + {{detailData.adminUserInfo?.mobile}} + + + + + +
    + + + + +
    +
    +
    + + + + 企业开票信息 + + + + + + + + + + + + + + + + 服务评级 + (暂无评级) + + + + + + + + 合伙人信息 + + {{partnerInfo.partnerEnterpriseName}} + + + + + + + + + + + + + + + + + 渠道销售信息 + + + + + + + + + + +
    + + + + + + {{ item.remark }} + -- + + + + + + + {{ item.remark }} + -- + + + + + + +
    + +
    {{title}} +
    +
    + {{content}} +
    +
    +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + {{ detailData?.enterpriseName }} + + + + +
    +
    +
    + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.less b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less new file mode 100644 index 00000000..6231c9e2 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less @@ -0,0 +1,58 @@ +@import '../../../../less/edit.less'; + +.user-info { + font-size: 16px; + + .enterprise-name { + margin-right: 15px; + } + + img { + width: 64px; + height: 64px; + margin-right: 15px; + border-radius: 50%; + } + + .user-info-des { + margin-bottom: 5px; + } +} + +::ng-deep { + .affix { + position: fixed; + top: 20px !important; + right: 25px; + left: 25px; + z-index: 999 !important; + } + + .alain-pro__menu-side .alain-pro__main { + .affix { + position: fixed; + top: 20px !important; + right: 25px; + left: 250px; + z-index: 999 !important; + } + } + + .aside-collapsed.alain-pro__menu-side .alain-pro__main { + .affix { + left: 106px; + } + } + .overflowText { + display: -webkit-box; + max-width: 155px; + height: 40px; + overflow: hidden; + text-align: left; + text-overflow: -o-ellipsis-lastline; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + } +} diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts new file mode 100644 index 00000000..cd82f249 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts @@ -0,0 +1,538 @@ +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { fromEvent, Subscription } from 'rxjs'; +import { UsermanageService } from '../../../../services/usercenter.service'; + +@Component({ + selector: 'app-supplier-components-list-view', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'], + providers: [DatePipe] +}) +export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('st1') private readonly st1!: STComponent; + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + columns: STColumn[] = []; + recordColumns!: STColumn[]; + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentityVO: { name: '' } }; + tempalateData = { ...this.detailData }; + suppliersData: any = {}; + + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: any = []; + ltdId: any = []; + roles: any = []; + customerServices: any = []; + billEvaluateList: any = []; + approvalOpinion = ''; + networkTransporter = null; + roleId = null; + customerServiceId = null; + partnerInfo: any = {}; + esignCheckStatus: any = { + 0: '不通过', + 1: '通过', + 2: '未认证' + }; + + billEvaluate = null; + scrollTop = 0; + subscribeScoll!: Subscription; + /** + * 查询参数 + */ + get reqParamsCar() { + const params = { + id: this.route.snapshot.params.id, + bindType: 0 + } + return { ...params }; + } + get reqParams() { + const params = { + id: this.route.snapshot.params.id, + } + return { ...params }; + } + constructor( + public service: UsermanageService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private router: Router, + private datePipe: DatePipe + ) { } + ngOnDestroy(): void { + this.subscribeScoll.unsubscribe(); + } + + ngOnInit() { + this.route.params.subscribe(({ params }) => { + this.initData(); + this.loadltdId(); + this.loadRoles(); + this.initST(); + this.initRecordST() + this.loadCustomerServices(); + this.loadPartnerInfo() + }); + this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { + this.scrollTop = document.documentElement.scrollTop; + }); + } + + /** +* 初始化数据列表 +*/ + initST() { + this.columns = [ + { title: '修改后合伙人', index: 'newPartnerName', className: 'text-center' }, + { title: '修改前合伙人', index: 'originalPartnerNamel', className: 'text-center' }, + { title: '备注', render: 'remark', className: 'text-center' }, + { title: '结算起算日', index: 'settStartTime', className: 'text-center' }, + { title: '生效节点', index: 'effectiveNode', className: 'text-center', type: 'enum', enum: { + 1: '立即生效', + 2: 'CRM审核后生效', + 3: '审核通过生效', + } }, + { + title: 'CRM审核状态', index: 'effectiveStatus', + type: 'enum', + enum: { + 0: '已失效', + 1: '未生效', + 2: '已生效', + }, + className: 'text-center' + }, + { title: '修改时间', render: 'modifyTime', className: 'text-center' }, + { title: '生效时间', render: 'effectiveTime', className: 'text-center' }, + { title: '操作人', render: 'approvalUser', className: 'text-center' }, + + ]; + } + /** + * 初始化数据列表 + */ + initRecordST() { + this.recordColumns = [ + { title: '修改后渠道销售', index: 'newChannelName', className: 'text-center' }, + { title: '修改前渠道销售地', index: 'originalChannelName', className: 'text-center' }, + { title: '备注', render: 'remark', className: 'text-center' }, + { title: '生效节点', index: 'effectiveNode', className: 'text-center', type: 'enum', enum: { + 1: '立即生效', + 2: 'CRM审核后生效', + 3: '审核通过生效', + } }, + { + title: 'CRM审核状态', index: 'effectiveStatus', + type: 'enum', + enum: { + 0: '已失效', + 1: '未生效', + 2: '已生效', + }, + className: 'text-center' + }, + { title: '修改时间', render: 'mybidDetailInfo', className: 'text-center' }, + { title: '生效时间', index: 'eeffectiveTime', className: 'text-center' }, + { title: '操作人', index: 'approvalUser', className: 'text-center' } + ]; + } + loadPartnerInfo(){ + this.service.request(this.service.$api_getEnterpriceRel, {id: this.route.snapshot.params.id}).subscribe(res => { + if (res) { + this.partnerInfo = res; + } + }); + } + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } + loadCustomerServices() { + this.service.getStaffList({}, false).subscribe(res => { + if (res) { + this.customerServices = res; + } + }); + } + + initData() { + this.service + .request(this.service.$api_get_freight_detail, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.detailData = res; + this.tempalateData = { ...this.detailData }; + this.enterpriseAddressCode = [ + Number(this.detailData.fullRegionVO?.provinceCode), + Number(this.detailData.fullRegionVO?.cityCode), + Number(this.detailData.fullRegionVO?.areaCode) + ]; + } + }); + + // 获取评价信息 + this.service + .request(this.service.$api_get_driver_billEvaluate, { passiveUserId: this.route.snapshot.params.id }, 'POST', false) + .subscribe(res => { + if (res?.length > 0) { + this.service.request(this.service.$api_get_freight_billEvaluate, res).subscribe(billEvaluate => { + if (billEvaluate) { + this.billEvaluate = billEvaluate.totalScore; + this.billEvaluateList = res; + } + }); + } + }); + } + + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + /** + * 支付权限 + */ + PayOrResume(type: number) { + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 1) { + this.service.msgSrv.success(`开启成功!`); + } else { + this.service.msgSrv.success(`关闭成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + auditPass(isSave: boolean) { + this.networkTransporter = null; + this.roleId = null; + this.customerServiceId = null; + this.nzModalService.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter || !this.roleId || !this.customerServiceId) { + return false; + } + if (isSave) { + this.save({ + passSave: true, + roleId: this.roleId, + networkTransporter: this.networkTransporter + }); + } else { + this.auditEnterprise(20); + } + return; + } + }); + } + auditNo() { + this.approvalOpinion = ''; + this.roleId = null; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(30); + return; + } + }); + } + + private auditEnterprise(status: number) { + this.service + .request(this.service.$api_audit_freight, { + approvalStatus: status, + id: this.detailData.id, + approvalOpinion: this.approvalOpinion, + networkTransporter: this.networkTransporter, + customerServiceId: this.customerServiceId, + roleId: this.roleId || null + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + this.refreshData(status); + } + }); + } + + ratify() { + this.isEdit = true; + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string, id: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + if (id === 'legalFront' || id === 'legalBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'legalFront' ? 'front' : 'back', 1); + } + if (id === 'certificateBackFront' || id === 'certificateBack') { + this.checkIdCard(file.response.data?.fullFilePath, id === 'certificateBackFront' ? 'front' : 'back', 0); + } + if (id === 'detailPhoto') { + this.checkBusinessLicense(file.response.data?.fullFilePath); + } + } + } + + /** + * 级联获取地区数据 + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData = (node: any, index: number) => { + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.regionCode || '' }).subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + }, + _ => { }, + () => { + resolve(node); + } + ); + }); + }; + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save(data: any) { + const dateil = { ...this.detailData }; + Object.assign(dateil.legalPersonIdentityVO, { + validStartTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validEndTime, 'yyyy-MM-dd') + }); + if (!this.detailData?.enterpriseName || !this.detailData?.enterpriseAddress) { + this.service.msgSrv.error('请完善企业基本信息!') + return false; + } + if (!this.detailData.legalPersonIdentityVO.name || !this.detailData.legalPersonIdentityVO.certificateNumber) { + this.service.msgSrv.error('请完善法人信息!') + return false; + } + if (!this.detailData.createBank || !this.detailData.bankAccount) { + this.service.msgSrv.error('请完善企业开票信息!') + return false; + } + const params = {}; + Object.assign(params, { + adminMobile: dateil.adminMobile, + adminAppUserId: dateil.adminAppUserId, + adminUserInfo: { ...dateil.adminUserInfo }, + bankAccount: dateil.bankAccount, + businessScope: dateil.businessScope, + createBank: dateil.createBank, + creditPhoto: dateil.creditPhoto, + creditPhotoWatermark: dateil.creditPhotoWatermark, + enterpriseAddress: dateil.enterpriseAddress, + enterpriseAddressCode: this.enterpriseAddressCode[2], + enterpriseLogo: dateil.enterpriseLogo, + enterpriseName: dateil.enterpriseName, + enterpriseRegistrationTime: this.datePipe.transform(dateil.enterpriseRegistrationTime, 'yyyy-MM-dd'), + enterpriseType: dateil.enterpriseType, + id: dateil.id, + legalPersonIdentityDTO: { ...dateil.legalPersonIdentityVO }, + licensePhoto: dateil.licensePhoto, + licensePhotoWatermark: dateil.licensePhotoWatermark, + networkTransporter: dateil.networkTransporter, + oftenUsedServices: dateil.oftenUsedServices, + operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), + operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd'), + promotersTelephone: dateil.promotersTelephone, + registerAddress: dateil.registerAddress, + registerPhone: dateil.registerPhone, + registrationCapital: dateil.registrationCapital, + taxAuthority: dateil.taxAuthority, + unifiedSocialCreditCode: dateil.unifiedSocialCreditCode + }); + Object.assign(params, { ...data }); + this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业修改成功'); + this.refreshData(data.passSave ? 20 : 10); + this.isEdit = false; + } + }); + return + } + + private refreshData(status: number) { + if (status === 20) { + this.service.request(this.service.$api_get_next_audit_freight, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res?.id) { + this.router.navigate(['/usercenter/freight/enterprise/detail/' + res.id]); + } else { + this.initData(); + } + }); + } else { + this.initData(); + } + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.legalPersonIdentityVO.name = res.name; + } + if (res.number) { + this.detailData.legalPersonIdentityVO.certificateNumber = res.number; + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.detailData.legalPersonIdentityVO.validStartTime = res.validFrom; + } + if (res.validTo) { + this.detailData.legalPersonIdentityVO.validEndTime = res.validTo; + } else { + this.detailData.legalPersonIdentityVO.validEndTime = null; + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.detailData.adminUserInfo.name = res.name; + } + if (res.number) { + this.detailData.adminUserInfo.certificateNumber = res.number; + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + if (res.registrationNumber) { + this.detailData.unifiedSocialCreditCode = res.registrationNumber; + } + if (res.name) { + this.detailData.enterpriseName = res.name; + } + if (res.type) { + this.detailData.enterpriseType = res.type; + } + if (res.addressRegionCodes) { + this.detailData.enterpriseAddressCode = res.addressRegionCodes; + } + if (res.address) { + this.detailData.enterpriseAddress = res.address; + } + if (res.registeredCapital) { + this.detailData.registrationCapital = res.registeredCapital; + } + if (res.foundDate) { + this.detailData.enterpriseRegistrationTime = res.foundDate; + } + if (res.businessTermStartDate) { + this.detailData.operatingStartTime = res.businessTermStartDate; + } + if (res.businessTermEndDate) { + this.detailData.operatingEndTime = res.businessTermEndDate; + } else { + this.detailData.operatingEndTime = null; + } + if (res.businessScope) { + this.detailData.businessScope = res.businessScope; + } + } + }); + } +} diff --git a/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.html b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.html new file mode 100644 index 00000000..8953e1f8 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.html @@ -0,0 +1,9 @@ + +
    + 1.如果修改前后的合伙人不是在同一个渠道销售下,修改后客户的渠道销售会随着修改后的合伙人绑定到新的渠道销售下,系统也会同步发起CRM《客户转移》流程;
    +2.结算起算日:指给合伙人结算佣金的起算时间,如果是修改合伙人,该日期是当前合伙人的结算起算日,同时也是上一个合伙人的结算结束时间。 +
    + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.less b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.less new file mode 100644 index 00000000..b9186e57 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.less @@ -0,0 +1,7 @@ +.info{ + width: 80%; + margin:0 auto; + color: #333; + font-size: 12px; + line-height: 24px;; +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.spec.ts b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.spec.ts new file mode 100644 index 00000000..a77b2be7 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { EditPartnerComponentsAddComponent } from './editPartner.component'; + +describe('EditPartnerComponentsAddComponent', () => { + let component: EditPartnerComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditPartnerComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditPartnerComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.ts b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.ts new file mode 100644 index 00000000..a55f960b --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editPartner/editPartner.component.ts @@ -0,0 +1,122 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { apiConf } from '@conf/api.conf'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'app-ad-components-partner', + templateUrl: './editPartner.component.html', + styleUrls: ['./editPartner.component.less'] +}) +export class EditPartnerComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + detailData: any = {} + ui: SFUISchema = {}; + + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + private route: ActivatedRoute, + private router: Router, + public service: UsermanageService, + private envSrv: EAEnvironmentService, + private modal: NzModalRef, + ) { } + + + ngOnInit(): void { + this.initDetailData() + this.initSF(); + } + initDetailData() { + const params = { + id: this.i.id + } + this.service.request(this.service.$api_partnerChannelUpdateDetaiList, params).subscribe(res => { + if(res) { + this.detailData = res + } else { + this.service.msgSrv.error(res.msg) + } + }) + } + initSF() { + this.schema = { + properties: { + channelId: { + type: 'string', + title: '合伙人修改为', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '全部可见', value: 1 }, + { label: '合伙人可见', value: 2 }, + { label: '销售渠道可见', value: 3 }, + ], + }, + remark: { + type: 'string', + title: '备注', + ui: { + widget: 'textarea', + placeholder: '请不要超过50个字', + maxLength: 50, + autosize: { minRows: 2, maxRows: 6 }, + }, + }, + effectiveNode: { + type: 'string', + title: '生效节点', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '修改成功后立即生效', value: 1 }, + { label: 'CRM流程审核通过后生效', value: 2 } + ], + }, + }, + required: ['channelId', 'remark', 'effectiveNode'], + }; + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + } + }; + } + get reqParams() { + return {}; + } + close(): void { + this.modal.close(true) + } + save() { + const params = { + ...this.sf.value + } + this.service.request(this.service.$api_batchUpdateEnterpricePartner, params).subscribe(res => { + if(res) { + this.service.msgSrv.success('修改成功') + } else { + this.service.msgSrv.error(res.msg) + } + }) + } +} diff --git a/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.html b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.html new file mode 100644 index 00000000..5e45b66a --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.html @@ -0,0 +1,8 @@ + +
    + 修改渠道销售:客户修改渠道销售后,会跟原合伙人解绑,成为新渠道销售的直客。同时系统会同步发起CRM《客户转移》流程。 +
    + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.less b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.less new file mode 100644 index 00000000..0a08567b --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.less @@ -0,0 +1,7 @@ + .info{ + width: 80%; + margin:0 auto; + color: #333; + font-size: 12px; + line-height: 24px;; + } \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.spec.ts b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.spec.ts new file mode 100644 index 00000000..1661b321 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { EditSaleComponentsAddComponent } from './editSale.component'; + +describe('EditSaleComponentsAddComponent', () => { + let component: EditSaleComponentsAddComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditSaleComponentsAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditSaleComponentsAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.ts b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.ts new file mode 100644 index 00000000..d1bab1b8 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/editSale/editSale.component.ts @@ -0,0 +1,130 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import format from 'date-fns/format'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { apiConf } from '@conf/api.conf'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { NzModalRef } from 'ng-zorro-antd/modal'; + +@Component({ + selector: 'app-ad-components-Sale', + templateUrl: './editSale.component.html', + styleUrls: ['./editSale.component.less'] +}) +export class EditSaleComponentsAddComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + schema: SFSchema = {}; + detailData: any = {} + ui: SFUISchema = {}; + + constructor( + public msgSrv: NzMessageService, + public http: _HttpClient, + private route: ActivatedRoute, + private router: Router, + public service: UsermanageService, + private envSrv: EAEnvironmentService, + private modal: NzModalRef, + + ) { } + + + ngOnInit(): void { + this.initDetailData() + this.initSF(); + } + initDetailData() { + const params = { + id: this.i.id + } + this.service.request(this.service.$api_partnerChannelUpdateDetaiList, params).subscribe(res => { + if(res) { + this.detailData = res + } else { + this.service.msgSrv.error(res.msg) + } + }) + } + initSF() { + this.schema = { + properties: { + channelId: { + type: 'string', + title: '渠道销售修改为', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '全部可见', value: 1 }, + { label: '合伙人可见', value: 2 }, + { label: '销售渠道可见', value: 3 }, + ], + }, + remark: { + type: 'string', + title: '备注', + ui: { + widget: 'textarea', + placeholder: '请不要超过50个字', + maxLength: 50, + autosize: { minRows: 2, maxRows: 6 }, + }, + }, + effectiveNode: { + type: 'string', + title: '生效节点', + ui: { + widget: 'radio', + showRequired: true, + } as SFRadioWidgetSchema, + enum: [ + { label: '修改成功后立即生效', value: 1 }, + { label: 'CRM流程审核通过后生效', value: 2 } + ], + }, + }, + required: ['channelId', 'remark', 'effectiveNode'], + }; + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + } + }; + } + get reqParams() { + return {}; + } + save() { + this.service.nzModalService.create({ + nzTitle: '确定提交吗?', + nzClosable: false, + nzOnOk: () => { + const params = { + ...this.sf.value + } + this.service.request(this.service.$api_batchUpdateEnterpriceChannel, params).subscribe(res => { + if(res) { + this.service.msgSrv.success('修改成功') + } else { + this.service.msgSrv.error(res.msg) + } + }) + } + }); + } + + close(): void { + this.modal.close(true) + } +} diff --git a/src/app/routes/usercenter/components/freight/list/list.component.html b/src/app/routes/usercenter/components/freight/list/list.component.html new file mode 100644 index 00000000..a6d0ea7c --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/list.component.html @@ -0,0 +1,75 @@ + + + + + + +
    +
    + +
    +
    + + + + + +
    +
    +
    + + + + + + +
    + + + + +

    暂无评价

    +
    +
    + +
    + + 已过期 + +
    + + {{ item.contacter }}
    /{{item.mobile}} +
    + + {{ item.promotersTelephone + || '添加' }} + +
    +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/list.component.less b/src/app/routes/usercenter/components/freight/list/list.component.less new file mode 100644 index 00000000..07d74cbd --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/list.component.less @@ -0,0 +1,19 @@ +:host{ + ::ng-deep{ + .btnBox { + st-td{ + // display: flex; + // align-items: center; + st-td>span{ + display: inline-block; + width: 95px; + text-align: center; + margin: 0 10px; + } + } + .st__btn-text span{ + white-space: nowrap; + } + } + } +} diff --git a/src/app/routes/usercenter/components/freight/list/list.component.ts b/src/app/routes/usercenter/components/freight/list/list.component.ts new file mode 100644 index 00000000..4df4f161 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/list.component.ts @@ -0,0 +1,541 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STChange, STColumn, STColumnBadge, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { DynamicSettingModalComponent, ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component'; +import { UsermanageService } from '../../../services/usercenter.service'; +import { EditPartnerComponentsAddComponent } from './editPartner/editPartner.component'; +import { EditSaleComponentsAddComponent } from './editSale/editSale.component'; +import { ShowServiceComponent } from './showService/showservice.component'; +@Component({ + selector: 'app-Freight-components-list', + templateUrl: './list.component.html', + styleUrls: ['../../../../commom/less/expend-but.less'] +}) +export class FreightComponentsListComponent implements OnInit { + _$expand = false; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + promotersTelephone = ''; + + loadingList = true; + constructor( + public service: UsermanageService, + private modal: NzModalService, + private router: Router, + private ar: ActivatedRoute, + public shipperservice: ShipperBaseService + ) {} + + ngOnInit() { + this.initSF(); + this.initST(); + this.ar.url.subscribe(params => { + this.st?.load(1); + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { listSource: 1 }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf.value.createTime) { + Object.assign(requestOptions.body, { + createTime: { + start: this.sf.value.createTime[0], + end: this.sf.value.createTime[1] + } + }); + } + if (this.sf.value.approvalTime) { + Object.assign(requestOptions.body, { + approvalTime: { + start: this.sf.value.approvalTime[0], + end: this.sf.value.approvalTime[1] + } + }); + } + } + this.loadingList = true; + return requestOptions; + }; + + dataProcess = (data: STData[]): STData[] => { + this.loadingList = false; + return data; + }; + + settingAction(item?: any) { + this.modal.create({ + nzTitle: '基础设置', + nzContent: DynamicSettingModalComponent, + nzWidth: 900, + nzComponentParams: { + extendType: '2', + businessId: item.id + }, + nzFooter: null + }); + } + + showAccountDetail(item: any) { + this.modal.create({ + nzTitle: '资金账户', + nzContent: AccountDetailComponent, + nzNoAnimation: true, + nzWidth: 600, + nzComponentParams: { + isCanCreate: true, + url: '/api/fcc/accountBalance/getShipperAccountDetailByOperator', + params: { + accountType: 1, + roleId: item.id, + ctfId: item.unifiedSocialCreditCode, + clientName: item.enterpriseName, + projectId: item.mainProjectId, + ltdId: item.networkTransporter + } + }, + nzFooter: null + }); + } + showService(record: any) { + const modalRef = this.modal.create({ + nzTitle: '分配客服人员', + nzContent: ShowServiceComponent, + nzWidth: 600, + nzComponentParams: { + i: record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + editPartner(record: any) { + const modalRef = this.modal.create({ + nzTitle: '修改合伙人', + nzContent: EditPartnerComponentsAddComponent, + nzWidth: 800, + nzComponentParams: { + i: record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + editSale(record: any) { + const modalRef = this.modal.create({ + nzTitle: '修改渠道销售', + nzContent: EditSaleComponentsAddComponent, + nzWidth: 800, + nzComponentParams: { + i: record + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((res: any) => { + if (res) { + this.st.load(1); + } + }); + } + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + contactName: { + title: '管理员', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + enterpriseType: { + type: 'string', + title: '企业类型', + enum: [ + { label: '全部', value: '' }, + { label: '物流企业', value: 1 }, + { label: '货运代理', value: 2 }, + { label: '生产型企业', value: 3 }, + { label: '贸易类企业', value: 4 }, + { label: '科技型企业', value: 5 }, + { label: '化学化工企业', value: 6 }, + { label: '其他', value: 7 } + ], + default: '', + ui: { + widget: 'select' + } + }, + enterpriseAddressCode: { + type: 'string', + title: '公司所在地', + enum: [{ label: '全部', value: '' }], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + oftenUsedServices: { + type: 'string', + title: '常用服务', + enum: [ + { label: '全部', value: '' }, + { label: '整车发货', value: 10 }, + { label: '大宗发货', value: 20 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + customerType: { + type: 'string', + title: '客户类型', + enum: [ + { label: '全部', value: '' }, + { label: '直客', value: 1 }, + { label: '渠道客户', value: 20 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + promotersTelephone: { + title: '业务员', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + partnerNamee: { + title: '合伙人', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + customerServiceId: { + title: '客服人员', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + approvalUserName: { + title: '审核人', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '申请时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + approvalTime: { + title: '审核时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd HH:mm:ss', + nzShowTime: true, + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + lockedStatus: { + type: 'string', + title: '企业状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + source: { + type: 'string', + title: '注册渠道', + enum: [ + { label: '全部', value: '' }, + { label: '货主注册', value: 1 }, + { label: '平台添加', value: 2 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + isExpired: { + type: 'string', + title: '证件是否过期', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: true }, + { label: '否', value: false } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + networkTransporter: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; + } + + initST() { + this.columns = [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '企业名称', render: 'enterpriseName', width: 350 }, + { title: '统一社会信用代码', className: 'text-center', render: 'unifiedSocialCreditCode', width: 200 }, + { + title: '公司所在地', + className: 'text-center', + index: 'province', + width: 200, + format: item => `${item.provinceName}${item.cityName}${item.areaName}` + }, + { + title: '企业类型', + className: 'text-center', + index: 'enterpriseType', + width: 200, + type: 'enum', + enum: { 1: '物流企业', 2: '货运代理', 3: '生产型企业', 4: '贸易类企业', 5: '科技型企业', 6: '化学化工企业', 7: '其他' } + }, + { title: '管理员', className: 'text-center', render: 'contacter', width: 150 }, + { + title: '常用服务', + className: 'text-center', + index: 'oftenUsedServices', + type: 'enum', + enum: { 10: '整车发货', 20: '大宗发货' }, + width: 140 + }, + { title: '业务员', className: 'text-center', render: 'promotersTelephone', width: 150 }, + { title: '合伙人', className: 'text-center', render: 'partnerName', width: 150 }, + { title: '客服人员', className: 'text-center', render: 'customerServiceId', width: 150 }, + { title: '网络货运人', className: 'text-center', index: 'netTranName', width: 180 }, + { + title: '注册渠道', + className: 'text-center', + index: 'source', + type: 'enum', + enum: { 1: '货主注册', 2: '平台添加', 3: '运营添加' }, + width: 130 + }, + { title: '申请时间', className: 'text-center', index: 'createTime', width: 180, type: 'date' }, + { title: '审核时间', className: 'text-center', index: 'approvalTime', width: 180, type: 'date' }, + { title: '审核人', className: 'text-center', index: 'approvalUserName', width: 130 }, + { + title: '保险认证状态', + className: 'text-center', + index: 'insuranceAuthState', + type: 'badge', + badge: { + 10: { text: '成功', color: 'success' }, + 20: { text: '失败', color: 'error' } + }, + width: 130 + }, + { + title: '企业状态', + className: 'text-center', + index: 'lockedStatus', + type: 'badge', + badge: { + 0: { text: '正常', color: 'success' }, + 1: { text: '冻结', color: 'error' } + }, + width: 130 + }, + { + title: '操作', + width: '200px', + className: 'text-center block-td', + fixed: 'right', + buttons: [ + { + text: '查看', + acl: { ability: ['USERCENTER-FREIGHT-LIST-view'] }, + click: item => { + this.router.navigate(['./detail', item.id], { relativeTo: this.ar }); + // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } }); + } + }, + // { + // acl: { ability: ['USERCENTER-FREIGHT-LIST-basicSetting'] }, + // text: '基础设置', + // click: item => this.settingAction(item) + // }, + { + acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] }, + text: '资金账户', + click: item => this.showAccountDetail(item) + }, + { + text: '分配客服人员', + click: item => this.showService(item) + }, + { + text: '修改合伙人', + click: item => this.editPartner(item) + }, + { + text: '修改渠道销售', + click: item => this.editSale(item) + } + ] + } + ]; + } + daoyun(item: any) { + this.router.navigate(['./view', item.tenantId], { relativeTo: this.ar }); + } + + addPromoter(item?: any) { + this.promotersTelephone = item?.promotersTelephone; + const modal = this.modal.create({ + nzTitle: '推广业务员', + nzContent: this.promoterModal, + nzOnOk: () => { + if (!!!this.promotersTelephone) { + return false; + } + if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) { + this.service.msgSrv.error('手机格式错误'); + return false; + } + this.service.request(this.service.$api_add_salesman, { ids: [item.id], salesmanMobile: this.promotersTelephone }).subscribe(res => { + if (res) { + this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功'); + } + this.st.load(); + }); + return; + } + }); + } + + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + creat() { + this.router.navigate(['./new'], { relativeTo: this.ar }); + } + + exportList() { + const params = { listSource: 1, pageSize: -1 }; + if (this.sf) { + Object.assign(params, { + ...this.sf.value + }); + } + this.service.downloadFile(this.service.$api_export_enterprise, params); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + this.st.reload(); + } +} diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.html b/src/app/routes/usercenter/components/freight/list/new/new.component.html new file mode 100644 index 00000000..ccc6cf71 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.html @@ -0,0 +1,95 @@ + + + + +
    企业基本信息
    +
    + +
    + 请上传营业执照原件的高清照片,若上传复印件,则需加盖公司印章; +
    上传后系统会自动识别并填写
    +
    +
    + +
    万元
    +
    + + +
    营业执照法人信息
    +
    + +
    +
    请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
    +
    上传后系统会自动识别并填写
    +
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    +
    + + + +
    企业开票信息
    +
    + +
    企业管理员信息
    +
    + + +
    +
    请上传该企业授权您成为本系统企业管理员的文件的高清照片,需加盖公司印章
    +
    上传后系统会自动识别并填写
    +
    +
    +
    +
    + +
    +
    请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
    +
    上传后系统会自动识别并填写
    +
    +
    + +
    +
    +
    正面照(人像面)
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    背面照(国徽面)
    +
    示例
    +
    +
    +
    +
    +
    + +
    + + +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.less b/src/app/routes/usercenter/components/freight/list/new/new.component.less new file mode 100644 index 00000000..78a0db6d --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.less @@ -0,0 +1,68 @@ +:host { + ::ng-deep { + nz-card { + + .pr { + position: relative; + } + + .pa { + position: absolute; + top : 50px; + left : 150px; + } + + .tips { + display : flex; + margin-bottom: 0; + color : #333; + + dt { + width: 150px; + } + + dd { + width : 190px; + margin-bottom: 0; + text-align : center; + } + } + + .form-title { + margin-bottom: 10px; + padding-left : 8px; + color : #333; + font-weight : 700; + font-size : 18px; + line-height : 20px; + border-left : solid 3px #1890ff; + } + + } + + .ant-form-item { + margin-left: 180px; + } + + nz-date-picker, + nz-input-number { + width: 100% !important; + } + + .input-back { + nz-form-item { + margin-left: 0px; + + .ant-form-item-label { + flex: 0 !important; + } + + .ant-form-item-control { + max-width : 100% !important; + margin-left: 20px !important; + } + } + } + + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.ts b/src/app/routes/usercenter/components/freight/list/new/new.component.ts new file mode 100644 index 00000000..59359454 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.ts @@ -0,0 +1,745 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { + SFCascaderWidgetSchema, + SFCheckboxWidgetSchema, + SFComponent, + SFDateWidgetSchema, + SFSchema, + SFTextareaWidgetSchema, + SFUISchema, + SFUploadWidgetSchema +} from '@delon/form'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { of } from 'rxjs'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; + +const IMAGECONFIG = { + previewFile: (file: NzUploadFile) => of(file.url), + action: apiConf.waterFileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + fileSize: 5120, + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + name: 'multipartFile', + multiple: false, + listType: 'picture-card' +} as SFUploadWidgetSchema; + +const DATECONFIG = { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择' +}; + +@Component({ + selector: 'app-account-components-freight-new', + templateUrl: './new.component.html', + styleUrls: ['./new.component.less'] +}) +export class FreightComponentsListNewComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('sf1', { static: false }) + sf1!: SFComponent; + schema: SFSchema = this.initOthersSF(); + schema1: SFSchema = this.initBasicInfoSF(); + ui: SFUISchema = { + '*': { + spanLabelFixed: 180, + grid: { span: 24 } + }, + $title1: { + spanLabelFixed: 0 + }, + $title99: { + spanLabelFixed: 0 + }, + $title2: { + spanLabelFixed: 0 + }, + $registrationCapital: { + spanLabelFixed: 180, + grid: { xxl: 13, xl: 18, lg: 22, md: 22 } + }, + $unit: { + grid: { xxl: 6, xl: 6, lg: 2, md: 2 } + }, + $isLoingDate: { + spanLabelFixed: 100, + grid: { xxl: 6, xl: 6, lg: 4, md: 6 } + } + }; + + constructor(private router: Router, public service: UsermanageService) {} + ngOnInit() {} + + submitForm() { + if (!this.sf1.valid || !this.sf.valid) { + this.sf.validator({ emitError: true }); + this.sf1.validator({ emitError: true }); + this.service.msgSrv.warning('请修改填写错误信息'); + return; + } + const enterpriseRegistrationTime = new Date(this.sf1.value.enterpriseRegistrationTime); + const operatingStartTime = new Date(this.sf1.value.operatingStartTime); + if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) { + this.service.msgSrv.warning('营业期限不能小于成立日期'); + return; + } + if (this.sf1.value.operatingEndTime) { + const operatingEndTime = new Date(this.sf1.value.operatingEndTime); + if (operatingStartTime.getTime() > operatingEndTime.getTime()) { + this.service.msgSrv.warning('营业期限不能小于期限开始日期'); + return; + } + } + const validStartTime = new Date(this.sf1.value.legalPersonIdentityDTO.validStartTime); + if (this.sf1.value.legalPersonIdentityDTO.validEndTime) { + const validEndTime = new Date(this.sf1.value.legalPersonIdentityDTO.validEndTime); + if (validStartTime.getTime() > validEndTime.getTime()) { + this.service.msgSrv.warning('法人证件有效截止日期小于开始日期'); + return; + } + } + const sfVlaue = this.sf.value; + const params = {}; + Object.assign( + params, + { ...this.sf1.value }, + { ...this.sf.value }, + { + enterpriseAddressCode: this.sf1.value.enterpriseAddressCode[2], + oftenUsedServices: sfVlaue.oftenUsedServices, + registerAddress: sfVlaue.registerAddress, + registerPhone: sfVlaue.registerPhone, + creditPhoto: sfVlaue.creditPhoto, + creditPhotoWatermark: sfVlaue.creditPhotoWatermark, + promotersTelephone: sfVlaue.promotersTelephone, + networkTransporter: sfVlaue.networkTransporter, + adminUserInfo: { + certificateNumber: sfVlaue.certificateNumber, + certificatePhotoBack: sfVlaue.certificatePhotoBack, + certificatePhotoBackWatermark: sfVlaue.certificatePhotoBackWatermark, + certificatePhotoFront: sfVlaue.certificatePhotoFront, + certificatePhotoFrontWatermark: sfVlaue.certificatePhotoFrontWatermark, + name: sfVlaue.name + } + } + ); + this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业新增成功'); + this.goBack(); + } + }); + } + + /* + * 根据地区code查询地区列表 + */ + getRegionDetailByCode(regionCode: any) { + return this.service.request(this.service.$api_get_region_by_code, { regionCode }); + } + + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 + checkIdCard(imgurl: any, isFront: string, type: number) { + const params = { + idCardUrl: imgurl, + side: isFront + }; + this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => { + if (res) { + if (type === 1) { + // 法定代表人证件照 + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf1.setValue('/legalPersonIdentityDTO/name', res.name); + } + if (res.number) { + this.sf1.setValue('/legalPersonIdentityDTO/certificateType', 0); + this.sf1.setValue('/legalPersonIdentityDTO/certificateNumber', res.number); + } + } + if (isFront === 'back') { + // 背面 + if (res.validFrom) { + this.sf1.setValue('/legalPersonIdentityDTO/validStartTime', res.validFrom); + } + if (res.validTo) { + this.sf1.setValue('/legalPersonIdentityDTO/validEndTime', res.validTo); + this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', false); + } else { + this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', true); + } + } + } + // 企业管理员证件照 + if (type === 0) { + if (isFront === 'front') { + // 正面 + if (res.name) { + this.sf.setValue('/name', res.name); + } + if (res.number) { + this.sf.setValue('/certificateNumber', res.number); + } + } + } + } + }); + } + + // 识别营业执照 + checkBusinessLicense(imgurl: any) { + this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => { + if (res) { + if (res.registrationNumber) { + this.sf1.setValue('/unifiedSocialCreditCode', res.registrationNumber); + } + if (res.name) { + this.sf1.setValue('/enterpriseName', res.name); + } + // if (res.type) { + // this.sf1.setValue('/enterpriseType', res.type); + // } + if (res.addressRegionCodes) { + this.sf1.setValue('/enterpriseAddressCode', res.addressRegionCodes); + } + if (res.address) { + this.sf1.setValue('/enterpriseAddress', res.address); + } + if (res.registeredCapital) { + this.sf1.setValue('/registrationCapital', res.registeredCapital); + } + if (res.foundDate) { + this.sf1.setValue('/enterpriseRegistrationTime', res.foundDate); + } + if (res.businessTermStartDate) { + this.sf1.setValue('/operatingStartTime', res.businessTermStartDate); + } + if (res.businessTermEndDate) { + this.sf1.setValue('/operatingEndTime', res.businessTermEndDate); + } else { + this.sf1.setValue('/isLoingDate', true); + } + if (res.businessScope) { + this.sf1.setValue('/businessScope', res.businessScope); + } + } + }); + } + + goBack() { + window.history.go(-1); + } + + private initBasicInfoSF(): SFSchema { + return { + properties: { + title1: { title: '', type: 'string', ui: { widget: 'custom' } }, + tips: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + licensePhoto: { title: '', type: 'string', ui: { hidden: true } }, + licensePhotoWatermark: { + type: 'string', + title: '营业执照', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); + this.checkBusinessLicense(args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + unifiedSocialCreditCode: { + title: '统一社会信用代码', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + optionalHelp: + '为了企业用户的使用体验,若公司代码即统一社会信用代码已在本应用其他关联平台注册,则此处填写的公司资料将同步更新至对应已注册的平台', + placeholder: '请输入营业执照上的统一社会信用代码', + errors: { + required: '请输入18位公司代码' + } + } + }, + enterpriseName: { + title: '公司名称', + type: 'string', + minLength: 1, + maxLength: 100, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入公司名称', + errors: { + required: '请输入公司名称' + } + } + }, + enterpriseType: { + title: '公司类型', + type: 'string', + enum: [ + { label: '物流企业', value: 1 }, + { label: '货运代理', value: 2 }, + { label: '生产型企业', value: 3 }, + { label: '贸易类企业', value: 4 }, + { label: '科技型企业', value: 5 }, + { label: '化学化工企业', value: 6 }, + { label: '其他', value: 7 } + ], + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select', + placeholder: '请选择公司类型', + errors: { + required: '请选择公司类型' + } + } + }, + enterpriseAddressCode: { + type: 'number', + title: '营业执照所在地', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'cascader', + valueProperty: 'regionCode', + labelProperty: 'name', + asyncData: (node: any, index: any) => { + return new Promise(resolve => { + this.getRegionDetailByCode(node?.regionCode || '').subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 })); + }, + _ => {}, + () => { + resolve(); + } + ); + }); + } + } as SFCascaderWidgetSchema + }, + enterpriseAddress: { + title: '营业执照详细地址', + type: 'string', + minLength: 1, + maxLength: 240, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'textarea', + autosize: { minRows: 2, maxRows: 5 }, + placeholder: '请输入营业执照上的完整详细地址', + errors: { + required: '请输入营业执照上的完整详细地址' + } + } as SFTextareaWidgetSchema + }, + registrationCapital: { + title: '注册资本', + type: 'number', + minimum: 1, + maximum: 99999999999999999999, + ui: { + grid: { xxl: 13, xl: 18, lg: 22, md: 22 }, + placeholder: '请输入营业执照上的注册资本', + errors: { + required: '请输入营业执照上的注册资本' + }, + precision: 0 + } + }, + enterpriseRegistrationTime: { + title: '成立日期', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + blank1: { + type: 'string', + ui: { widget: 'text', grid: { xxl: 11, xl: 6, md: 0, sm: 0 }, class: 'input-back' }, + default: ' ' + }, + operatingStartTime: { + title: '营业期限', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + operatingEndTime: { + title: '', + type: 'string', + ui: { + ...DATECONFIG, + grid: { xxl: 13, xl: 18, lg: 20, md: 18 }, + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf1?.setValue('/isLoingDate', false); + setTimeout(() => { + console.log(this.sf1.value); + }, 1000); + } + } as SFDateWidgetSchema + }, + isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + class: 'input-back', + widget: 'checkbox', + change: i => this.sf1?.setValue('/operatingEndTime', null) + } as SFCheckboxWidgetSchema + }, + businessScope: { + title: '经营范围', + type: 'string', + minLength: 1, + maxLength: 500, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'textarea', + autosize: { minRows: 3, maxRows: 5 }, + placeholder: '请输入营业执照上的营经营范围', + errors: { + required: '请输入营业执照上的营经营范围' + } + } as SFTextareaWidgetSchema + }, + taxAuthority: { + title: '税务机关', + type: 'string', + minLength: 1, + maxLength: 30, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入营业执照上的税务机关', + errors: { + required: '请输入营业执照上的税务机关' + } + } + }, + + legalPersonIdentityDTO: { + type: 'object', + properties: { + title2: { title: '', type: 'string', ui: { widget: 'custom' } }, + tipsC: { title: '法定代表人证件照', type: 'string', ui: { widget: 'custom' } }, + tipsA: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1); + } + } + } as SFUploadWidgetSchema + }, + tipsB: { title: '', type: 'string', ui: { widget: 'custom', offsetControl: 6 } }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '法人姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法人姓名' + } + }, + certificateType: { + type: 'string', + title: '法人证件类型', + enum: [ + { label: '大陆身份证', value: 0 }, + { label: '港澳居民通行证', value: 1 }, + { label: '香港居民通行证', value: 2 } + ], + default: 0, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select' + } + }, + certificateNumber: { + title: ' 法定代表人证件号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入法定代表人证件号' + } + }, + validStartTime: { + title: '法人证件有效开始日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择开始日期' + } + } as SFDateWidgetSchema + }, + validEndTime: { + title: '法人证件有效截止日期', + type: 'string', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'date', + format: 'yyyy-MM-dd', + placeholder: '请选择', + errors: { + required: '请选择截止日期' + }, + change: i => { + this.sf1?.setValue('/legalPersonIdentityDTO/isLoingDate', false); + } + } as SFDateWidgetSchema + }, + isLoingDate: { + title: '长期', + type: 'boolean', + ui: { + spanLabelFixed: 100, + grid: { span: 6 }, + class: 'input-back', + widget: 'checkbox', + change: i => this.sf1?.setValue('/legalPersonIdentityDTO/validEndTime', null) + } as SFCheckboxWidgetSchema + } + }, + required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber', 'validStartTime'] + } + }, + required: [ + 'licensePhotoWatermark', + 'unifiedSocialCreditCode', + 'enterpriseName', + 'enterpriseType', + 'enterpriseAddressCode', + 'enterpriseAddress', + 'registrationCapital', + 'enterpriseRegistrationTime', + 'operatingStartTime', + 'businessScope' + ] + }; + } + + private initOthersSF(): SFSchema { + return { + properties: { + title1: { title: '', type: 'string', ui: { widget: 'custom' } }, + createBank: { + title: '开户银行', + type: 'string', + ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入银行账号' } + }, + bankAccount: { + title: '银行账号', + type: 'string', + ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入银行账号' } + }, + registerAddress: { + title: ' 注册地址', + type: 'string', + ui: { grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, placeholder: '请输入注册地址' } + }, + registerPhone: { + title: ' 注册电话', + type: 'string', + format: 'mobile', + minLength: 1, + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入注册电话', + errors: { required: '请输入注册电话', format: '手机号格式错误' } + } + }, + + title99: { title: '', type: 'string', ui: { widget: 'custom' } }, + tipsA: { + title: '企业管理员证件照', + type: 'string', + ui: { + widget: 'custom' + } + }, + certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath); + this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0); + } + } + } as SFUploadWidgetSchema + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + name: { + title: '企业管理员姓名', + type: 'string', + maxLength: 8, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员姓名' + } + }, + adminMobile: { + title: ' 企业管理员手机号', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员手机号', + errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' } + } + }, + certificateNumber: { + title: '企业管理员身份证号', + type: 'string', + format: 'id-card', + minLength: 1, + maxLength: 18, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入企业管理员身份证号' + } + }, + tipsD: { title: '企业授权函', type: 'string', ui: { widget: 'custom' }, default: 1 }, + creditPhoto: { title: '', type: 'string', ui: { hidden: true } }, + creditPhotoWatermark: { + type: 'string', + title: '', + ui: { + ...IMAGECONFIG, + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + change: args => { + if (args.type === 'success') { + this.sf.setValue('/creditPhoto', args.fileList[0].response.data.fullFilePath); + } + } + } as SFUploadWidgetSchema + }, + oftenUsedServices: { + type: 'string', + title: '常用服务', + enum: [ + { label: '整车发货', value: 10 }, + { label: '大宗发货', value: 20 } + ], + default: '', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select', + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + promotersTelephone: { + title: '邀请码', + type: 'string', + minLength: 1, + format: 'mobile', + maxLength: 11, + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + placeholder: '请输入邀请码', + errors: { required: '请输入邀请码', format: '手机号格式错误' } + } + }, + networkTransporter: { + type: 'string', + title: '网络货运人', + ui: { + grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() + }, + default: '' + } + }, + required: ['createBank', 'bankAccount', 'adminMobile', 'name', 'certificateNumber', 'tipsD', 'creditPhoto', 'networkTransporter'] + }; + } +} diff --git a/src/app/routes/usercenter/components/freight/list/showService/showService.component.html b/src/app/routes/usercenter/components/freight/list/showService/showService.component.html new file mode 100644 index 00000000..82ea63f2 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/showService/showService.component.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/showService/showService.component.less b/src/app/routes/usercenter/components/freight/list/showService/showService.component.less new file mode 100644 index 00000000..6b46d577 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/showService/showService.component.less @@ -0,0 +1,129 @@ +.sfBox { + position: relative; + .example { + position: absolute; + top: 215px; + right: 265px; + color: #1890ff; + cursor: pointer; + .popBox { + position: absolute; + top: -170px; + left: -125px; + width: 300px; + padding: 20px; + text-align: center; + background: #fff; + border: solid 1px #eee; + border-radius: 6px; + box-shadow: 0 1px 5px 1px #ececec; + &::before { + position: absolute; + bottom: -5px; + left: 50%; + width: 10px; + height: 10px; + margin-left: -5px; + background: #fff; + box-shadow: 0 1px 5px 1px #ececec; + transform: rotate(45deg); + content: ''; + } + &::after { + position: absolute; + bottom: 0; + left: 0; + z-index: 10; + width: 100%; + height: 10px; + background: #fff; + content: ''; + } + img { + max-width: 100%; + max-height: 200px; + } + } + } + .positionSet{ + top: 356px; + right: 235px; + } + .positionSet01{ + top: 500px; + right: 200px; + } + .positionSet02{ + top: 664px; + right: 265px; + } + .positionSet03{ + top: 808px; + right: 205px; + + } +} +.exaA{ + position: absolute; + top: 0; + left: 300px +} +.pr { + position: relative; +} + +.pa { + position: absolute; + top: 35px; + left: 150px; +} + +.tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } +} +.drivercard{ + position: absolute; + top: 0; + left: 330px; + border: solid 1px #ebf0fb; +} +.jopcard{ + position: absolute; + top: 1356px; + left: 330px; + border: solid 1px #ebf0fb; +} +.agreement{ + position: absolute; + top: 425px; + left: 330px; + border: solid 1px #ebf0fb; +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + } + } +.serviceBox{ + display: flex; + align-items: center; + justify-content: space-between; + width: 350px; +} \ No newline at end of file diff --git a/src/app/routes/demo/components/zorro-demo/edit/edit.component.spec.ts b/src/app/routes/usercenter/components/freight/list/showService/showservice.component.spec.ts similarity index 55% rename from src/app/routes/demo/components/zorro-demo/edit/edit.component.spec.ts rename to src/app/routes/usercenter/components/freight/list/showService/showservice.component.spec.ts index 5fa67a8b..8be64dc5 100644 --- a/src/app/routes/demo/components/zorro-demo/edit/edit.component.spec.ts +++ b/src/app/routes/usercenter/components/freight/list/showService/showservice.component.spec.ts @@ -1,19 +1,19 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { DemoEditComponent } from './edit.component'; +import { CarCarauthComponent } from './carauth.component'; -describe('DemoEditComponent', () => { - let component: DemoEditComponent; - let fixture: ComponentFixture; +describe('CarCarauthComponent', () => { + let component: CarCarauthComponent; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ DemoEditComponent ] + declarations: [ CarCarauthComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(DemoEditComponent); + fixture = TestBed.createComponent(CarCarauthComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/routes/usercenter/components/freight/list/showService/showservice.component.ts b/src/app/routes/usercenter/components/freight/list/showService/showservice.component.ts new file mode 100644 index 00000000..ce6e942a --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/showService/showservice.component.ts @@ -0,0 +1,93 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; + +@Component({ + selector: 'app-car-showService', + templateUrl: './showService.component.html', + styleUrls: ['./showService.component.less'] +}) +export class ShowServiceComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + appUserId = '' + record: any = {}; + i: any; + ui!: SFUISchema; + schema!: SFSchema; + + constructor( + private modal: NzModalRef, + public service: UsermanageService, + ) { } + + ngOnInit(): void { + this.initSF() + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + customerServiceId: { + title: '客服人员', + type: 'string', + ui: { + widget: 'select', + asyncData: () => { + const params = { + // enterpriseId: 1, + // enterpriseProjectId: this.i.mainProjectId, + } + return this.service.request(this.service.$api_getStaffList, params).pipe( + map((res: any) => { + return res.map((i: any) => { + let name = i.name ? `${i.name} / ` : ''; + return { label: `${name}${i.telephone}`, value: i.appUserId }; + }); + }), + ); + // serverSearch: true, + // searchDebounceTime: 300, + // searchLoadingText: '搜索中...', + // onSearch: (q: any) => { + // if (!!q) { + // return this.service + // .request(this.service.$api_getStaffList, { + // nameOrPhone: q + // }) + // .pipe(map((res: any) => (res?.records as any[]).map(i => ({ name: i.name, value: i.appUserId } as SFSchemaEnum)))) + // .toPromise(); + // } else { + // return of([]); + // } + }, + } as SFSelectWidgetSchema + } + }, + required: ['customerServiceId'] + }; + } + close(): void { + this.modal.close(true) + } + submitForm() { + const params: any = { + ...this.sf.value, + enterpriseIdList: [this.i.id] + }; + this.service.request(this.service.$api_distributionCusService, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('分配成功') + this.modal.close(true) + } + }) + } +} diff --git a/src/app/routes/usercenter/components/freight/list/view/view.component.html b/src/app/routes/usercenter/components/freight/list/view/view.component.html new file mode 100644 index 00000000..96d0bc91 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/view/view.component.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + +

    道路运输经营许可证

    + +
    + + +
    +
    +
    + + diff --git a/src/app/routes/usercenter/components/freight/list/view/view.component.less b/src/app/routes/usercenter/components/freight/list/view/view.component.less new file mode 100644 index 00000000..48f605d9 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/view/view.component.less @@ -0,0 +1,46 @@ +@import '~@delon/theme/index'; +:host { + ::ng-deep { + .ant-steps-dot { + .ant-steps-item-content { + width: 200px; + } + .ant-steps-item-icon { + margin-left: 96px; + } + .ant-steps-item-tail::after { + margin-left: 40px; + } + } + .success { + color: @success-color; + } + + .warning { + color: @warning-color; + } + + .error { + color: @error-color; + } + } + .mt16 { + margin-top: 16px; + } + .user-info { + display: flex; + font-size: 16px; + .enterprise-name { + margin-right: 15px; + } + img { + width: 64px; + height: 64px; + margin-right: 15px; + border-radius: 50%; + } + .user-info-des { + margin-bottom: 5px; + } + } +} diff --git a/src/app/routes/usercenter/components/freight/list/view/view.component.spec.ts b/src/app/routes/usercenter/components/freight/list/view/view.component.spec.ts new file mode 100644 index 00000000..6e2a7782 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/view/view.component.spec.ts @@ -0,0 +1,23 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { FreightComponentsListViewComponent } from './view.component'; + +describe('FreightComponentsListViewComponent', () => { + let component: FreightComponentsListViewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [FreightComponentsListViewComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FreightComponentsListViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/freight/list/view/view.component.ts b/src/app/routes/usercenter/components/freight/list/view/view.component.ts new file mode 100644 index 00000000..0874ddda --- /dev/null +++ b/src/app/routes/usercenter/components/freight/list/view/view.component.ts @@ -0,0 +1,257 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { UsermanageService } from '../../../../services/usercenter.service'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { Observable, Observer } from 'rxjs'; +@Component({ + selector: 'app-Freight-components-list-view', + templateUrl: './view.component.html', + styleUrls: ['./view.component.less'], +}) +export class FreightComponentsListViewComponent implements OnInit { + i: any; + url = `/rule?_allow_anonymous=true`; + + @ViewChild('st', { static: false }) st!: STComponent; + detailData: any = { + status: 0 + }; + isShow = false; + isVisible = false; + modalTitle = '有效期'; + modalName = ''; + ui!: SFUISchema; + schema!: SFSchema; + @ViewChild('sf', { static: false }) sf!: SFComponent; + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + validData: any = ['FreightsType']; + FreightsData: any = {}; + + constructor( + private http: _HttpClient, + private modal: ModalHelper, + public service: UsermanageService, + private route: ActivatedRoute, + private modalHelper: ModalHelper, + private msgSrv: NzMessageService, + ) {} + + ngOnInit() { + console.log(this.route.snapshot); + this.initData(); + this.initSF(); + // this.launchSign(); + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + name: { + title: '许可证号', + type: 'string', + maxLength: 20, + ui: { + placeholder: '请输入角色名称', + }, + }, + phone: { + title: '业户名称', + type: 'string', + maxLength: 20, + ui: { + placeholder: '请输入业户名称', + }, + }, + roleDescription: { + title: '地址', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入地址', + widget: 'textarea', + }, + }, + effectiveDate: { + title: '发证日期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd 00:00:00', + // hidden: this.modalName === 'effectiveDate' ? false : true, + } as SFDateWidgetSchema, + }, + phone3: { + title: '有效期', + type: 'string', + ui: { + placeholder: '请输入业户名称', + }, + }, + phone4: { + title: '有效期截止', + type: 'string', + ui: { + placeholder: '请输入业户名称', + }, + }, + phone5: { + title: '经营范围', + type: 'string', + ui: { + placeholder: '请输入业户名称', + }, + }, + avatar: { + type: 'string', + title: '证照', + ui: { + // action: environment.UPLOAD_URL, + fileType: 'image/png,image/jpeg,image/jpg,image/png,image/gif,image/bmp', + limit: 1, + limitFileCount: 1, + resReName: 'url', + urlReName: 'url', + widget: 'upload', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + data: { + // appId: environment.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.fileList[0].response.url, + response: { + url: args.fileList[0].response.url, + }, + }, + ]; + this.sf?.setValue('/avatar', avatar); + } + }, + beforeUpload: (file: any, _fileList) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + } as SFUploadWidgetSchema, + }, + }, + required: ['name', 'phone'], + }; + this.ui = { '*': { spanLabelFixed: 200, grid: {offset:4, span: 12 } } }; + } + showModal(name: any) { + this.modalName = name; + if (name === 'effectiveDate') { + this.isShow = true; + } else { + this.isVisible = true; + } + } + async initData() { + console.log(this.route.snapshot, 'this.route.snapshot'); + + const params = { + tenantId: this.route.snapshot.params.id, + }; + } + + /** + * 根据地区code查询地区详情 + * @param code 地区代码 + */ + async getRegionFullName(code: any) { + const params = { + regionCode: code, + }; + const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true); + // if (res && res.regionFullName) { + // const arr = res.regionFullName.split(','); + // res.regionFullName = arr.reverse().join('-'); + // } + return res && res.regionFullName; + } + add() { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + goBack() { + window.history.go(-1); + } + /** + * 冻结 + */ + freezeOrResume(type: number) { + this.service.http + .post(this.service.$api_get_one, { + tenantId: this.route.snapshot.params.id, + // tenantId: this.route.snapshot.queryParams.tenantId, + status: type, + }) + .subscribe((res) => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else if (type === 1) { + this.service.msgSrv.success(`冻结成功!`); + } + this.ngOnInit(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); + } + + handleCancel(name: any) { + if (name === 'effectiveDate') { + this.isShow = false; + } else { + this.isVisible = false; + } + } + handleOK(name: any) { + const params: any = { + tenantId: this.route.snapshot.params.id, + // tenantId: this.route.snapshot.queryParams.tenantId, + }; + + if (name === 'effectiveDate') { + params.effectiveDate = this.sf?.value?.effectiveDate; + } else { + Object.assign(params, this.sf1?.value); + } + this.service.http.post(this.service.$api_get_one, params).subscribe((res) => { + if (res.data === true) { + this.service.msgSrv.success(`编辑成功!`); + this.ngOnInit(); + } else { + this.service.msgSrv.error(res.msg || '编辑失败!'); + } + if (name === 'effectiveDate') { + this.isShow = false; + } else { + this.isVisible = false; + } + }); + } +} diff --git a/src/app/routes/usercenter/components/freight/user/detail/detail.component.html b/src/app/routes/usercenter/components/freight/user/detail/detail.component.html new file mode 100644 index 00000000..24fb0a61 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/detail/detail.component.html @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + 个人信息 + + +
    + + + + + + + + + +
    +
    + + + + + + + +
    + + + + +
    +
    +
    + + + 关联企业 + + + + +
    +
    + + +
    +
    + + {{ userIdentityDetail?.name }} + + + + + + + {{ tag }} + + +
    +
    +
    + + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/user/detail/detail.component.less b/src/app/routes/usercenter/components/freight/user/detail/detail.component.less new file mode 100644 index 00000000..e30f5583 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/detail/detail.component.less @@ -0,0 +1,25 @@ +@import '../../../../less/edit.less'; + +:host { + ::ng-deep { + .user-info { + display : flex; + font-size: 16px; + + .enterprise-name { + margin-right: 15px; + } + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + .user-info-des { + margin-bottom: 5px; + } + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/user/detail/detail.component.ts b/src/app/routes/usercenter/components/freight/user/detail/detail.component.ts new file mode 100644 index 00000000..67e0fe6d --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/detail/detail.component.ts @@ -0,0 +1,200 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { UsermanageService } from '../../../../services/usercenter.service'; + +@Component({ + selector: 'app-supplier-components-list-view', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'] +}) +export class FreightComponentsUserDetailComponent implements OnInit { + @ViewChild('redectModal', { static: false }) + redectModal!: any; + + userDetail: any = {}; + userIdentityDetail: any = {}; + tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + @ViewChild('st', { static: false }) st!: STComponent; + columns: STColumn[] = [ + { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, + { title: '项目名称', className: 'text-center', index: 'projectName' }, + { title: '角色', className: 'text-center', index: 'roleName' } + ]; + + approvalOpinion = ''; + reasonTags = ['身份证照片太丑', '姓名与身份证号不匹配']; + + isEditUser = false; + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + constructor( + private nzModalService: NzModalService, + public service: UsermanageService, + public route: ActivatedRoute, + private nzImageService: NzImageService + ) {} + + ngOnInit() { + this.initData(); + // this.launchSign(); + } + async initData() { + // 获取司机头部信息 + this.service + .request(this.service.$api_get_user_detail, { + appUserId: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userDetail = res; + } + }); + // 获取用户个人信息 + this.service + .request(this.service.$api_get_user_identity, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userIdentityDetail = res; + this.tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + } + }); + } + + userAction(status: number) { + this.nzModalService.warning({ + nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?', + nzContent: + status === 1 + ? '启用后,该用户将恢复正常使用功能,请再次确认' + : '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作', + nzOnOk: () => { + this.service + .request(this.service.$api_lock_or_free_user, { + appUserId: [this.userDetail.appUserId], + freezeOrResume: !!!status, + pageName: '货主员工', + telephone: this.userDetail.phone + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + } + this.initData(); + }); + } + }); + } + + auditPass() { + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `是否确认通过(姓名:${this.userIdentityDetail?.name})审核`, + nzOnOk: () => { + this.auditEnterprise(0); + } + }); + } + + auditNo() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(1); + return; + } + }); + } + + private auditEnterprise(auditStatus: number) { + this.service + .request(this.service.$api_approve_identity, { + auditStatus: auditStatus, + identityId: this.userIdentityDetail.id, + auditType: 0, + certificationOpinions: this.approvalOpinion + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(auditStatus === 0 ? '审核通过' : '驳回成功'); + } + this.initData(); + }); + } + + /** + * 开启修改 + * @param type 修改类型 + */ + ratify() { + this.isEditUser = true; + } + + /** + * 需求修改 + * @param type 修改类型 + */ + reset() { + this.userIdentityDetail = { ...this.tempalateUserIdentityDetail }; + this.isEditUser = false; + } + + saveUser() { + const params = { ...this.userIdentityDetail }; + this.service.request(this.service.$api_update_driver_identity, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.isEditUser = false; + this.initData(); + } + }); + } + + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + } + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/usercenter/components/freight/user/user.component.html b/src/app/routes/usercenter/components/freight/user/user.component.html new file mode 100644 index 00000000..aebe3d5a --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/user.component.html @@ -0,0 +1,68 @@ + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + + +
    +
    + {{ item.enterpriseName }} +
    +
    +
    + + + {{ item.promotersTelephone || '添加' }} + + +
    + +
    + + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/user/user.component.less b/src/app/routes/usercenter/components/freight/user/user.component.less new file mode 100644 index 00000000..6bcd149d --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/user.component.less @@ -0,0 +1,12 @@ +:host::ng-deep { + + nz-range-picker { + width: 100%; + } + + .content-box { + .ant-card-body { + padding-top: 6px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/user/user.component.ts b/src/app/routes/usercenter/components/freight/user/user.component.ts new file mode 100644 index 00000000..73b44001 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/user/user.component.ts @@ -0,0 +1,245 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STColumnBadge, STComponent, STData, STRequestOptions } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from '../../../services/usercenter.service'; +@Component({ + selector: 'app-Freight-components-user', + styleUrls: ['./user.component.less'], + templateUrl: './user.component.html' +}) +export class FreightComponentsUserComponent implements OnInit { + _$expand = false; + ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; + schema: SFSchema = this.initSF(); + columns: STColumn[] = this.initST(); + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + promotersTelephone = ''; + + resourceStatus: any = 0; + + constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {} + + ngOnInit() { + this.ar.url.subscribe(params => { + this.st?.load(1); + }); + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus }); + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value + }); + if (this.sf?.value.effectiveDate) { + Object.assign(requestOptions.body, { + time: { + start: this.sf?.value.effectiveDate[0], + end: this.sf?.value.effectiveDate[1] + } + }); + } + delete requestOptions.body.effectiveDate; + delete requestOptions.body.expand; + } + return requestOptions; + }; + + selectChange(e: any) { + this.resourceStatus = e; + this.st.load(); + } + + addPromoter(item?: any) { + this.promotersTelephone = item?.promotersTelephone; + const modal = this.modal.create({ + nzTitle: '推广业务员', + nzContent: this.promoterModal, + nzOnOk: () => { + if (!!!this.promotersTelephone) { + return false; + } + if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) { + this.service.msgSrv.error('手机格式错误'); + return false; + } + this.service + .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功'); + } + this.st.load(); + }); + return; + } + }); + } + + userAction(status: number, appUserId: Array) { + this.modal.warning({ + nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?', + nzContent: + status === 1 + ? '启用后,该用户将恢复正常使用功能,请再次确认' + : '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作', + nzOnOk: () => { + this.service + .request(this.service.$api_lock_or_free_user, { + appUserId, + freezeOrResume: !!!status, + pageName: '货主员工列表' + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 1 ? '启用成功' : '冻结成功'); + this.st.reload(); + } + }); + } + }); + } + + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + name: { + title: '用户姓名', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + enterpriseName: { + title: '企业名称', + type: 'string', + ui: { + placeholder: '请输入', + showRequired: false + } + }, + telephone: { + title: '手机号', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入' + } + }, + stateLocked: { + type: 'string', + title: '状态', + enum: [ + { label: '全部', value: '' }, + { label: '正常', value: 0 }, + { label: '冻结', value: 1 } + ], + default: '', + ui: { + widget: 'select', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + promotersTelephone: { + title: '推广业务员', + type: 'string', + maxLength: 11, + ui: { + placeholder: '请输入手机号', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + effectiveDate: { + title: '申请时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + } + + private initST(): STColumn[] { + return [ + { title: '用户姓名', className: 'text-center', index: 'name' }, + { title: '手机号', className: 'text-center', index: 'telephone' }, + { title: '身份证件号', className: 'text-center', index: 'certificateNumber' }, + { title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode' }, + { title: '推广业务员', className: 'text-center', index: 'promotersTelephone', render: 'promotersTelephone' }, + { title: '申请时间', className: 'text-center', index: 'createTime', type: 'date' }, + { + title: '状态', + className: 'text-center', + index: 'certificationStatus', + type: 'badge', + badge: { + 0: { text: '待审核', color: 'processing' }, + 1: { text: '已成功', color: 'success' }, + 2: { text: '已驳回', color: 'warning' } + } + }, + { + title: '操作', + width: '170px', + className: 'text-center', + buttons: [ + { + text: '查看', + click: (item: any) => { + this.router.navigate(['./view', item.appUserId], { relativeTo: this.ar }); + }, + acl: { ability: ['USERCENTER-FREIGHT-USER-view'] }, + }, + { + text: '冻结', + iif: item => item.stateLocked === 0, + click: (item: any) => this.userAction(0, [item.appUserId]), + acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] }, + }, + { + text: '启用', + iif: item => item.stateLocked === 1, + click: (item: any) => this.userAction(1, [item.appUserId]), + acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] }, + } + ] + } + ]; + } +} diff --git a/src/app/routes/usercenter/less/edit.less b/src/app/routes/usercenter/less/edit.less new file mode 100644 index 00000000..22cfcaf0 --- /dev/null +++ b/src/app/routes/usercenter/less/edit.less @@ -0,0 +1,117 @@ +:host { + ::ng-deep { + sv-title { + font-weight: 700; + } + + + .sv__label, + .sv__detail { + line-height: 30px; + } + + .edit-box { + input { + max-width: 250px; + } + + nz-date-picker { + min-width: 250px; + } + + .calendar { + min-width: 130px; + } + } + + .readOnly-box { + input { + padding-left: 0; + color : #000; + border : 0; + } + + nz-select-top-control { + padding-left: 0px !important; + } + } + + .ant-select { + min-width: 250px; + + nz-select-top-control { + cursor: text !important; + color : #000 !important; + } + } + + // 图片展示工具样式改造 + .ant-upload.ant-upload-disabled { + cursor: pointer; + } + + .ant-upload.ant-upload-select-picture-card { + width : 200px; + height: 160px; + } + + .ant-upload-picture-card-wrapper { + width: auto; + } + } +} + +.image-hover { + .delete-icon { + border-radius : 50%; + color : #F55656; + font-size : 28px; + position : absolute; + top : -15px; + right : -15px; + background-color: #ffffff; + cursor : pointer; + } + + .show-icon { + color : #ffffff; + font-size: 30px; + cursor : pointer; + } +} + +.image-hover:hover .mask { + opacity: 0.8; +} + +.mask { + width : 200px; + height : 160px; + background-color : #4F4F4F; + opacity : 0; + position : absolute; + // top : 6px; + // left : 12px; + border-radius : 6px; + margin-top : -160px; +} + +.mask-over { + width : 200px; + height : 160px; + position : absolute; + // top : 6px; + // left : 12px; + border-radius : 6px; + display : flex; + justify-content : center; + align-items : center; + margin-top : -160px; + + label { + font-size : 20px; + line-height : 24px; + letter-spacing: 0.7px; + color : #FFFFFF; + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts new file mode 100644 index 00000000..6bd733d5 --- /dev/null +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -0,0 +1,180 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime : 2022-02-18 11:15:16 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\services\\usercenter.service.ts + */ +import { Injectable, Injector } from '@angular/core'; +import { cacheConf } from '@conf/cache.conf'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, ShipperBaseService } from '@shared'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +@Injectable({ + providedIn: 'root' +}) +export class UsermanageService extends ShipperBaseService { + // 获取一、二、三级地区详情 + $api_getRegionToThree = '/api/mdc/pbc/region/getRegionToThree'; + // 查询企业列表 + $api_get_freight_list = '/api/mdc/cuc/enterpriseInfo/operate/list/page'; + // 导出企业列表 + $api_export_freight_list = '/api/mdc/cuc/enterpriseInfo/operate/export'; + // 查询企业详情 + $api_get_freight_detail = '/api/mdc/cuc/enterpriseInfo/operate/detail'; + // 查询车队长列表-运营后台 + $api_get_user_expand = '/api/mdc/userDriverExpand/list/page'; + // 添加企业业务员 + $api_add_salesman = '/api/mdc/cuc/enterpriseInfo/operate/addSalesman'; + // 添加货主,司机,车队长业务员 + $api_add_user_salesman = '/api/mdc/cuc/user/addPromoter'; + // 冻结/启用企业业 + $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; + // 企业审核 + $api_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/audit'; + // 查询下一个待审核的企业ID + $api_get_next_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/getNextWaitAuditId'; + + // 查询货主配置列表 + $api_freight_config_page = '/api/mdc/cuc/enterpriseInfo/operate/list/configPage'; + // 导出货主配置列表 + $api_export_freight_config = '/api/mdc/cuc/enterpriseInfo/operate/exportConfig'; + // 更新企业超级管理员权限 + $api_update_enter_role_batch = '/api/mdc/cuc/enterpriseInfo/operate/updateRole'; + // 批量更新企业网络货运人 + $api_update_enter_newowork_batch = '/api/mdc/cuc/enterpriseInfo/operate/updatnNetworkTransporter'; + + // 货主员工列表(运营后台) + $api_get_user_list = '/api/mdc/cuc/userApp/getShipperUserList'; + // 冻结或恢复员工 + $api_lock_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff'; + // 冻结或恢复应用用户 + $api_lock_app_user = '/api/mdc/cuc/userApp/freezeOrResume'; + // 冻结/启用用户 + $api_lock_user = '/api/mdc/cuc/enterpriseInfo/operate/lock'; + + // 查询司机列表 + $api_get_driver_list = '/api/mdc/cuc/driver/list/page'; + // 根据应用用户id获取用户详情 + $api_get_user_detail = '/api/mdc/cuc/user/getUserDetailByAppUserId'; + // 根据应用用户ID获取身份信息表 + $api_get_user_identity = '/api/mdc/cuc/identityInfo/getIdentityInfoByAppUserId'; + // 司机详情查看-驾驶证 + $api_get_driver_license = '/api/mdc/cuc/driver/getDriversLicense'; + // 司机详情查看-从业资格证信息 + $api_get_driver_practice_seniority = '/api/mdc/cuc/driver/getDriversPracticeSeniority'; + // 司机详情查看-载具信息 + $api_get_driver_car_license = '/api/mdc/cuc/carLicense/getUserCatListByUserIds'; + // 司机详情查看-获取用户关联的企业项目角色信息 + $api_get_driver_projects = '/api/mdc/cuc/user/getEnterpriceProjectInfo'; + + // 根据应用用户ID获取银行信息表 + $api_get_user_bank_list = '/api/fcc/bankInfoOBC/list/page'; + + // 获取服务评级 + $api_get_driver_billEvaluate = '/api/sdc/billEvaluate/getServiceRating'; + // 总评分 + $api_get_freight_billEvaluate = '/api/sdc/billEvaluate/getTotalScore'; + + // 修改实名认证-运营管理后台 + $api_update_driver_identity = '/api/mdc/cuc/identityInfo/operatorAlterIdentity'; + // 修改驾驶证信息 + $api_update_driver_license = '/api/mdc/cuc/driver/updateDriverLicense'; + + // 冻结或恢复应用用户 + $api_lock_or_free_user = '/api/mdc/cuc/userApp/freezeOrResume'; + // 人工审核实名认证 + $api_approve_identity = '/api/mdc/cuc/identityInfo/identityAudit'; + // 审核驾驶证信息 + $api_approve_driver_license = '/api/mdc/cuc/driver/auditDriverLicense'; + + // 查询企业管理员审核信息 + $api_get_enterprise_admin_list = '/api/mdc/cuc/enterpriseAdmin/operate/list/page'; + // 根据主键ID获取企业管理员审核信息 + $api_get_enterprise_user_by_id = '/api/mdc/cuc/enterpriseAdmin/operate/get'; + // 审核企业管理员 + $api_audit_enterprise_admin = '/api/mdc/cuc/enterpriseAdmin/operate/audit'; + // 保存企业信息表 + $api_save_enterprise_admin = '/api/mdc/cuc/enterpriseInfo/operate/save'; + + // 根据地区code查询列表 + $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; + // 根据地区code查询地区详情 + $api_get_region_detail_by_code = '/api/mdc/pbc/region/getRegionDetailByCode'; + + // 导出企业 + $api_export_enterprise = '/api/mdc/cuc/enterpriseInfo/operate/export'; + // 司机列表导出 + $api_export_driver = '/api/mdc/cuc/driver/export'; + // 车队长导出-运营后台 + $api_export_driver_cap = '/api/mdc/userDriverExpand/export'; + + // 营业执照识别 + $api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense'; + // 身份证识别 + $api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + // 获取字典 + $api_getDictValue = '/api/mdc/pbc/dictItems/getDictValue'; + // 获取个人刷脸结果 + $api_getFaceFlowQuery = '/api/mdc/pbc/factorsVerify/getFaceFlowQuery'; + + /////////////////// + // 识别身份证 + $api_checkIdCard = '/api/mdc/pbc/hwc/ocr/recognizeIdCard'; + // 从业资格证 + $api_recognizeQualificationCertificate = '/api/mdc/pbc/hwc/ocr/recognizeQualificationCertificate'; + // 驾驶证识别 + $api_recognizeDriverLicense = `/api/mdc/pbc/hwc/ocr/recognizeDriverLicense`; + // 根据地区code查询列表 + $api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode'; + // 新增熟车 + $api_enterpriseVehicleSave = `/api/mdc/cuc/enterpriseVehicle/save`; + + // 结算单-新增车队长 + $api_saveCaptainr = '/api/mdc/cuc/enterpriseSettleDriver/saveCaptainr'; + // 结算单-车队长详情 + $api_captainrDetail = '/api/mdc/cuc/enterpriseSettleDriver/captainrDetail'; + // 根据手机号码查询结算单司机 + $api_getByMobile = '/api/mdc/cuc/identityInfo/getByMobile'; + + // 添加司机 + $api_driver_add = '/api/mdc/cuc/driver/add'; + // 添加车队长 + $api_saveCaptainr_new = '/api/mdc/userDriverExpand/saveCaptainr'; + + // 查询司机配置列表 + $api_configPage = '/api/mdc/cuc/driver/list/configPage'; + + // 批量修改企业渠道 + $api_batchUpdateEnterpriceChannel = '/api/mdc/enterpriceRelLog/batchUpdateEnterpriceChannel'; + // 批量修改企业合伙人 + $api_batchUpdateEnterpricePartner = '/api/mdc/enterpriceRelLog/batchUpdateEnterpricePartner'; + // 渠道销售修改详情 + $api_partnerChannelUpdateDetaiList = '/api/mdc/enterpriceRelLog/partnerChannelUpdateDetaiList'; + // 查询企业修改合伙人记录 + $api_findEnterpricePartnerRelLog = '/api/mdc/enterpriceRelLog/findEnterpricePartnerRelLog'; + // 查询企业修改渠道记录 + $api_findEnterpriceChannelRelLog = '/api/mdc/enterpriceRelLog/findEnterpriceChannelRelLog'; + // 查询企业合伙人渠道关系信息 + $api_getEnterpriceRel = '/api/mdc/enterpriceRelLog/getEnterpriceRel'; + // 员工列表 + $api_getStaffList = '/api/mdc/cuc/userApp/getStaffList'; + // 分配客服人员 + $api_distributionCusService = '/api/mdc/cuc/enterpriseInfo/operate/distributionCusService'; + + constructor(public injector: Injector, public nzModalService: NzModalService, private nzImageService: NzImageService) { + super(injector); + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } +} diff --git a/src/app/routes/usercenter/usercenter-routing.module.ts b/src/app/routes/usercenter/usercenter-routing.module.ts new file mode 100644 index 00000000..3034830b --- /dev/null +++ b/src/app/routes/usercenter/usercenter-routing.module.ts @@ -0,0 +1,82 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime: 2021-11-30 20:36:06 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\usercenter-routing.module.ts + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; +import { UserCenterComponentsDriverCaptainComponent } from './components/driver/captain/captain.component'; +import { UserCenterComponentsDriverDetailComponent } from './components/driver/detail/detail.component'; +import { UserCenterComponentsDriverConfigComponent } from './components/driver/driver-config/driver-config.component'; +import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; +import { FreightComponentsEnterpriseAuditComponent } from './components/freight/enterprise-audit/enterprise-audit.component'; +import { FreightConfigComponent } from './components/freight/freight-config/freight-config.component'; +import { FreightComponentsListDetailComponent } from './components/freight/list/detail/detail.component'; + +import { FreightComponentsListComponent } from './components/freight/list/list.component'; +import { FreightComponentsListNewComponent } from './components/freight/list/new/new.component'; +import { FreightComponentsUserDetailComponent } from './components/freight/user/detail/detail.component'; +import { FreightComponentsUserComponent } from './components/freight/user/user.component'; + +const routes: Routes = [ + { path: 'freight/list', component: FreightComponentsListComponent, data: { guard: { ability: ['USERCENTER-FREIGHT-LIST-list'] } } }, + // data: { guard: { ability: ['USERCENTER-FREIGHT-LIST-list'] } } + // { path: 'freight/list/view/:id', component: FreightComponentsListViewComponent }, + { path: 'freight/list/new', component: FreightComponentsListNewComponent, data: { guard: { ability: ['USERCENTER-FREIGHT-NEW-save'] } } }, + { + path: 'freight/list/detail/:id', + component: FreightComponentsListDetailComponent, + data: { guard: { ability: ['USERCENTER-FREIGHT-LIST-DETAIL-view'] } } + }, + { + path: 'freight/enterprise/detail/:id', + component: FreightComponentsListDetailComponent, + data: { guard: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] } } + }, + { + path: 'freight/enterprise', + component: FreightComponentsEnterpriseAuditComponent, + data: { guard: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-list', 'USERCENTER-FREIGHT-ENTERPRISE-adminList'] } } + }, + { + path: 'freight/config', + component: FreightConfigComponent + }, + { path: 'freight/user', component: FreightComponentsUserComponent, data: { guard: { ability: ['USERCENTER-FREIGHT-USER-list'] } } }, + { + path: 'freight/user/view/:id', + component: FreightComponentsUserDetailComponent, + data: { guard: { ability: ['USERCENTER-FREIGHT-USER-D-view'] } } + }, + { path: 'driver', component: UserCenterComponentsDriverComponent, data: { guard: { ability: ['USERCENTER-DRIVER-LIST-list'] } } }, + { + path: 'driver/detail/:id', + component: UserCenterComponentsDriverDetailComponent, + data: { guard: { ability: ['USERCENTER-DRIVER-LIST-DETAIL-view'] } } + }, + { + path: 'driver/captain', + component: UserCenterComponentsDriverCaptainComponent, + data: { guard: { ability: ['USERCENTER-DRIVER-CAPTAIN-list'] } } + }, + { + path: 'driver/captain/detail/:id', + component: CaptainDetailComponent, + data: { guard: { ability: ['USERCENTER-DRIVER-CAPTAIN-DETAIL-view'] } } + }, + { + path: 'driver/config', + component: UserCenterComponentsDriverConfigComponent, + data: { guard: { ability: ['USERCENTER-DRIVER-CAPTAIN-list'] } } + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class UsercenterRoutingModule {} diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts new file mode 100644 index 00000000..e8f55744 --- /dev/null +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -0,0 +1,56 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime: 2021-11-30 20:35:42 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\usercenter.module.ts + */ +import { NgModule } from '@angular/core'; +import { DynamicSettingModule, SharedModule } from '@shared'; +import { UserCenterComponentsDriverCaptainComponent } from './components/driver/captain/captain.component'; +import { UserCenterComponentsDriverDetailComponent } from './components/driver/detail/detail.component'; +import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; +import { FreightComponentsEnterpriseAuditComponent } from './components/freight/enterprise-audit/enterprise-audit.component'; +import { FreightComponentsListDetailComponent } from './components/freight/list/detail/detail.component'; +import { FreightComponentsListComponent } from './components/freight/list/list.component'; +import { FreightComponentsListNewComponent } from './components/freight/list/new/new.component'; +import { FreightComponentsUserDetailComponent } from './components/freight/user/detail/detail.component'; +import { FreightComponentsUserComponent } from './components/freight/user/user.component'; +import { UsercenterRoutingModule } from './usercenter-routing.module'; +import { AuditAdminComponent } from './components/freight/enterprise-audit/audit-admin/audit-admin.component'; +import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; +import { CarSettleAddDriverComponent } from './components/driver/add-driver/add-driver.component'; +import { CtcCaptatinAddComponent } from './components/driver/captain/add/add.component'; +import { FreightConfigComponent } from './components/freight/freight-config/freight-config.component'; +import { UserCenterComponentsDriverConfigComponent } from './components/driver/driver-config/driver-config.component'; +import { ShowServiceComponent } from './components/freight/list/showService/showservice.component'; +import { EditPartnerComponentsAddComponent } from './components/freight/list/editPartner/editPartner.component'; +import { EditSaleComponentsAddComponent } from './components/freight/list/editSale/editSale.component'; + +const COMPONENTS = [ + FreightComponentsListComponent, + // FreightComponentsListViewComponent, + FreightComponentsListNewComponent, + FreightComponentsListDetailComponent, + FreightComponentsEnterpriseAuditComponent, + // FreightComponentsEnterpriseAuditViewComponent, + FreightComponentsUserComponent, + FreightComponentsUserDetailComponent, + UserCenterComponentsDriverComponent, + UserCenterComponentsDriverDetailComponent, + UserCenterComponentsDriverCaptainComponent, + CaptainDetailComponent, + AuditAdminComponent, + CarSettleAddDriverComponent, + CtcCaptatinAddComponent, + FreightConfigComponent, + UserCenterComponentsDriverConfigComponent +]; +const COMPONENTS_NOROUNT = [ShowServiceComponent, EditPartnerComponentsAddComponent, EditSaleComponentsAddComponent]; + +@NgModule({ + imports: [SharedModule, UsercenterRoutingModule, DynamicSettingModule], + declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT] +}) +export class UsercenterModule {} diff --git a/src/app/routes/vehicle/components/audit/audit.component.html b/src/app/routes/vehicle/components/audit/audit.component.html new file mode 100644 index 00000000..051902e9 --- /dev/null +++ b/src/app/routes/vehicle/components/audit/audit.component.html @@ -0,0 +1,92 @@ + + + + + + +
    + +
    + + +
    + + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + +
    {{item?.carModelLabel}}-{{item?.carLength? item?.carLength + '米' : ''}}-{{ item?.carLoad? item?.carLoad + '吨' : ''}}
    +
    + +
    {{item?.isSelf ? '是' : '否'}}
    +
    + +
    + {{ item.contactsPhone }} +
    +
    + + 冻结 + 正常 + +
    +
    + + +
    + +
    +
    diff --git a/src/app/routes/vehicle/components/audit/audit.component.spec.ts b/src/app/routes/vehicle/components/audit/audit.component.spec.ts new file mode 100644 index 00000000..e815b19d --- /dev/null +++ b/src/app/routes/vehicle/components/audit/audit.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Author: your name + * @Date: 2021-12-01 20:05:59 + * @LastEditTime: 2021-12-01 20:35:33 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\list.component.spec.ts + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { VehicleComponentsListComponent } from './list.component'; + +describe('VehicleComponentsListComponent', () => { + let component: VehicleComponentsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [VehicleComponentsListComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(VehicleComponentsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/audit/audit.component.ts b/src/app/routes/vehicle/components/audit/audit.component.ts new file mode 100644 index 00000000..047604d4 --- /dev/null +++ b/src/app/routes/vehicle/components/audit/audit.component.ts @@ -0,0 +1,242 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of, Subject } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { VehicleService } from '../../../vehicle/services/vehicle.service'; +import { CarSettleCarauthComponent } from '../list/carauth/carauth.component'; +@Component({ + selector: 'app-Vehicle-components-audit', + templateUrl: './audit.component.html', +}) +export class VehicleComponentsAuditComponent implements OnInit { + _$expand = false; + resourceStatus: any = 1; + defaultTabs = 1; + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper) { } + /** + * 查询字段个数navigate + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus === 1) { + a.approvalStatus = 10 + } else if (this.resourceStatus === 2) { + a.approvalStatus = 20 + } else if (this.resourceStatus === 3) { + a.approvalStatus = 30 + } + return { + ...a, + ...this.sf?.value, + }; + } + + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + + ngOnInit() { + this.initSF(); + this.initST(); + this.ar.url.subscribe((params) => { + this.st?.load(1); + }); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true, + }, + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + if (!!q) { + return this.service + .request(this.service.$api_get_getCarLicenseListByCarNo_audit, { + carNo: q + }) + .pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.carNo } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + carNoColor: { + type: 'string', + title: '车牌颜色', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:color' }, + containsAllLabel: true, + } + }, + isSelf: { + type: 'string', + title: '是否挂靠', + enum: [ + { label: '是', value: 1 }, + { label: '否', value: 0 }, + ], + ui: { + widget: 'select', + allowClear: true, + } + }, + saveUser: { + type: 'string', + title: '录入人员', + ui: { + visibleIf: { + expand: (value: boolean) => value, + }, + }, + }, + // approvalStatus: { + // type: 'string', + // title: '审核状态', + // enum: [ + // { label: '未提交', value: '-1' }, + // { label: '草稿', value: 0}, + // { label: '待审核', value: 10 }, + // { label: '审核通过', value: 20 }, + // { label: '驳回', value: 30 }, + // { label: '证件过期', value: 40 }, + // ], + // default: '', + // ui: { + // widget: 'select', + // visibleIf: { + // expand: (value: boolean) => value, + // }, + // }, + // }, + }, + }; + this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } }; + } + + initST() { + this.columns = [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '车牌号', width: '180px', className: 'text-center', index: 'carNo' }, + { title: '车牌颜色', width: '180px', className: 'text-center', index: 'carNoColorLabel' }, + { title: '车型-车长-载重', width: '180px', className: 'text-center', render: 'carLength' }, + { title: '是否挂靠', width: '180px', className: 'text-center', render: 'isSelf' }, + { title: '所有人', width: '180px', className: 'text-center', index: 'carOwner' }, + { title: '录入人员', width: '180px', className: 'text-center', index: 'saveUser', }, + { + title: '审核状态', + className: 'text-center', + index: 'approvalStatus', + width: '180px', + type: 'badge', + badge: { + '-1': { text: '未上传', color: 'default' }, + 0: { text: '草稿', color: 'warning' }, + 15: { text: '已撤销', color: 'warning' }, + 10: { text: '待审核', color: 'warning' }, + 20: { text: '已审核', color: 'success' }, + 30: { text: '已驳回', color: 'error' }, + 40: { text: '证件过期', color: 'error' }, + }, + }, + { title: '申请时间', width: '180px', className: 'text-center', index: 'createTime' }, + { + title: '操作', + fixed: 'right', + width: '100px', + className: 'text-center', + buttons: [ + { + text: '查看', + acl: { ability: ['VEHICLE-AUDIT-view'] }, + click: (item) => { + this.router.navigate(['./detail', item.id], { relativeTo: this.ar, queryParams: { carId: item.carId } }); + // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } }); + }, + }, + ], + }, + ]; + } + selectChange(e: number) { + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(); + }, 500); + } + daoyun(item: any) { + this.router.navigate(['./view', item], { relativeTo: this.ar }); + } + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + creat() { + this.router.navigate(['./new',], { relativeTo: this.ar }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + // 导出 + exportFire() { + this.service.request(this.service.$api_carLicenseAudit_export, this.reqParams).subscribe((res: any) => { + if(res) { + this.service.msgSrv.success('导出成功,请去右上角下载中心下载') + return + } + }); + } + addModal() { + const i = { + appUserId: '', + } + this.modalHelper.create(CarSettleCarauthComponent, { i }, { size: 900 }).subscribe((res) => { + this.st.load() + }); + } +} diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.html b/src/app/routes/vehicle/components/audit/detail/detail.component.html new file mode 100644 index 00000000..58b837f0 --- /dev/null +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.html @@ -0,0 +1,254 @@ + + + + + + + +

    车牌号:{{detailData?.carNo}}

    + + 未上传 + 草稿 + 待审核 + 已审核 + 已驳回 + 证件过期 +
    + + + + + + + + + +
    +
    + + {{ detailData?.createTime }} + + + {{ detailData?.saveUser }} + +
    +
    +
    + + + + + 车辆基础信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 行驶证信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 道路运输证信息 + + + + + + + + + + + + + + + + + + + + + + 认证司机 + + + +
    + 未上传 + 草稿 + 待审核 + 已审核 + 已驳回 + 证件过期 +
    +
    +
    +
    + + + +
    +
    + + {{ detailData?.carNo }} + + + + +
    +
    +
    + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.less b/src/app/routes/vehicle/components/audit/detail/detail.component.less new file mode 100644 index 00000000..e2c82609 --- /dev/null +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.less @@ -0,0 +1,142 @@ +:host { + ::ng-deep { + + .sv__label, + .sv__detail { + line-height: 30px; + } + + .edit-box { + input { + max-width: 250px; + } + + nz-date-picker { + min-width: 250px; + } + } + + .readOnly-box { + input { + padding-left: 0; + color : #000; + } + + nz-select-top-control { + padding-left: 0 !important; + } + } + + .ant-select { + min-width: 250px; + + nz-select-top-control { + color : #000 !important; + cursor: text !important; + } + } + + // 图片展示工具样式改造 + .ant-upload.ant-upload-disabled { + cursor: pointer; + } + + .ant-upload.ant-upload-select-picture-card { + width : 200px; + height: 160px; + } + + .ant-upload-picture-card-wrapper { + width: auto; + } + } +} + +.image-hover { + .delete-icon { + position : absolute; + top : -15px; + right : -15px; + color : #F55656; + font-size : 28px; + background-color: #fff; + border-radius : 50%; + cursor : pointer; + } + + .show-icon { + color : #fff; + font-size: 30px; + cursor : pointer; + } +} + +.image-hover:hover .mask { + opacity: 0.8; +} + +.mask { + position : absolute; + width : 200px; + height : 160px; + margin-top : -160px; + background-color : #4F4F4F; + // top : 6px; + // left : 12px; + border-radius : 6px; + opacity : 0; +} + +.mask-over { + position : absolute; + display : flex; + align-items : center; + justify-content : center; + width : 200px; + height : 160px; + margin-top : -160px; + // top : 6px; + // left : 12px; + border-radius : 6px; + + label { + color : #FFF; + font-size : 20px; + line-height : 24px; + letter-spacing: 0.7px; + } +} + +input { + width: 200px; +} + +.sv__container { + padding-top: 10px; +} + +::ng-deep { + .affix { + position: fixed; + top : 20px !important; + right : 25px; + left : 25px; + z-index : 999 !important; + } + + .alain-pro__menu-side .alain-pro__main { + .affix { + position: fixed; + top : 20px !important; + right : 25px; + left : 250px; + z-index : 999 !important; + } + } + + .aside-collapsed.alain-pro__menu-side .alain-pro__main { + .affix { + left: 106px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.spec.ts b/src/app/routes/vehicle/components/audit/detail/detail.component.spec.ts new file mode 100644 index 00000000..df98f9ac --- /dev/null +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Author: your name + * @Date: 2021-11-29 20:19:08 + * @LastEditTime: 2021-12-13 09:58:36 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\detail\detail.component.spec.ts + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { VehicleComponentsAuditDetailComponent } from './detail.component'; + +describe('VehicleComponentsAuditDetailComponent', () => { + let component: VehicleComponentsAuditDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [VehicleComponentsAuditDetailComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(VehicleComponentsAuditDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.ts b/src/app/routes/vehicle/components/audit/detail/detail.component.ts new file mode 100644 index 00000000..d870e234 --- /dev/null +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.ts @@ -0,0 +1,276 @@ +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { VehicleService } from '../../../services/vehicle.service'; +// import { VehicleComponentsListEditComponent } from '../edit/edit.component'; +// import { VehicleImgViewComponent } from '../img-view/img-view.component'; +import { EADateUtil } from '@shared'; +import { VehicleImgViewComponent } from '../../list/img-view/img-view.component'; +import { VehicleComponentsListEditComponent } from '../../list/edit/edit.component'; +import { NzImageService } from 'ng-zorro-antd/image'; +import { fromEvent, Subscription } from 'rxjs'; + +@Component({ + selector: 'app-Vehicle-components-Audit-detail', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'] +}) +export class VehicleComponentsAuditDetailComponent implements OnInit, OnDestroy { + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('redectModal', { static: false }) redectModal!: any; + columns!: STColumn[]; + detailData: any = this.initData(); + tempalateData: any; + contenCarNoColor: any; + contencarModel: any; + contenCarLength: any; + isEdit = false; + approvalOpinion = ''; + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + + + scrollTop = 0; + subscribeScoll!: Subscription; + constructor( + public service: VehicleService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private modal: ModalHelper, + private nzImageService: NzImageService + ) {} + ngOnDestroy(): void { + this.subscribeScoll.unsubscribe(); + } + + ngOnInit() { + this.getSelectList(); + this.getDetailList(); + this.initST(); + this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { + this.scrollTop = document.documentElement.scrollTop; + }); + } + + initST() { + this.columns = [ + { title: '司机姓名', index: 'name', className: 'text-center' }, + { title: '司机手机号', index: 'mobile', className: 'text-center' }, + { title: '身份证号', index: 'idCardNo', className: 'text-center' }, + { title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' }, + { + title: '车主申明/挂靠协议', + fixed: 'right', + width: '200px', + className: 'text-left', + buttons: [ + { + text: '查看协议', + click: _record => this.viewEvaluate(_record), + iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20 + }, + { + text: '上传协议', + click: _record => this.updateEvaluate(_record), + iif: item => item.auditStatusEnum == -1 + } + ] + } + ]; + } + + getDetailList() { + const params = { + id: this.route.snapshot?.params?.id + }; + this.service.request(`${this.service.$api_get_operate_getaudit}`, params).subscribe(res => { + this.detailData = res; + this.tempalateData = res; + }); + } + + approveDriver() { + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `

    车牌号:${this.detailData?.carNo}

    是否确认通过审核`, + nzOnOk: () => { + this.adjuctUser( + { + approvalStatus: 20, + id: this.route.snapshot?.params?.id + }, + '审核成功' + ); + } + }); + } + + rejectedDriver() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + this.service.msgSrv.error('请填写备注!') + return false; + } + this.adjuctUser( + { + id: this.route.snapshot?.params?.id, + approvalStatus: 30, + approvalOpinion: this.approvalOpinion + }, + '审核驳回成功' + ); + return; + } + }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime); + + this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime); + + this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime); + + this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime); + + this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime); + console.log(this.detailData.roadTransportStartTime) + if((this.detailData.roadTransportStartTime > this.detailData.roadTransportEndTime) || (this.detailData.driverLicenseRegisterTime > this.detailData.driverLicenseEndTime)) { + this.service.msgSrv.error('发证日期起始不能大于结束日期!') + return; + } + this.service.request(this.service.$api_get_update_audit, this.detailData).subscribe(res => { + if (res) { + this.getDetailList(); + this.isEdit = false; + this.service.msgSrv.success('修改成功!'); + } + }); + } + + ratify() { + this.isEdit = true; + } + + changeUpload({ file, fileList, type }: any, key: string) { + if (type === 'success') { + this.detailData[key] = file.response.data.fullFileWatermarkPath; + } + } + + goBack() { + window.history.go(-1); + } + /** + * 查询参数 + */ + get reqParams() { + return { id: this.route.snapshot.queryParams.carId }; + } + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + deleteImg(key: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + this.detailData[key] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + private adjuctUser(params: any, msg: string) { + this.service.request(this.service.$api_get_operate_audit, { ...params }).subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + } + this.getDetailList(); + }); + } + + private initData() { + return { + carNo: '', + carNoColor: '', + carModel: '', + carLength: '', + archivesNo: '', + driverLicenseSigningOrg: '', + carDistinguishCode: '', + carLoad: '', + curbWeight: '', + roadTransportNo: '', + roadTransportLicenceNo: '', + carOwner: '', + isTrailer: null, + useNature: null, + driverLicenseRegisterTime: null, + driverLicenseGetTime: null, + driverLicenseEndTime: null, + roadTransportStartTime: null, + roadTransportEndTime: null, + carFrontPhotoWatermark: '' + }; + } + // 获取录单员 + getSelectList() { + this.Serveice('car:color'); + this.Serveice('car:model'); + this.Serveice('car:length'); + } + Serveice(param: any) { + let value: any; + this.service + .request(`${this.service.$api_get_getDictValue}`, { + dictKey: param + }) + .subscribe(res => { + if (param === 'car:color') { + this.contenCarNoColor = res; + } else if (param === 'car:model') { + this.contencarModel = res; + } else if (param === 'car:length') { + this.contenCarLength = res; + } + }); + return value; + } + viewEvaluate(item: any) { + this.modal.createStatic(VehicleImgViewComponent, { i: item }).subscribe(i => { + this.st.reload(); + this.getDetailList(); + }); + } + updateEvaluate(item: any) { + this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(i => { + this.st.reload(); + this.getDetailList(); + }); + } +} diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.html b/src/app/routes/vehicle/components/list/carauth/carauth.component.html new file mode 100644 index 00000000..9eda46b1 --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.html @@ -0,0 +1,47 @@ + +

    + +
    + + +
    +
    +
    行驶证首页
    +
    示例
    +
    +
    +
    +
    + +
    +
    +
    行驶证副页
    +
    示例
    +
    +
    +
    +
    + + + + + + +
    + + + \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.less b/src/app/routes/vehicle/components/list/carauth/carauth.component.less new file mode 100644 index 00000000..ee4cb587 --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.less @@ -0,0 +1,129 @@ +.sfBox { + position: relative; + .example { + position: absolute; + top: 215px; + right: 265px; + color: #1890ff; + cursor: pointer; + .popBox { + position: absolute; + top: -170px; + left: -125px; + width: 300px; + padding: 20px; + text-align: center; + background: #fff; + border: solid 1px #eee; + border-radius: 6px; + box-shadow: 0 1px 5px 1px #ececec; + &::before { + position: absolute; + bottom: -5px; + left: 50%; + width: 10px; + height: 10px; + margin-left: -5px; + background: #fff; + box-shadow: 0 1px 5px 1px #ececec; + transform: rotate(45deg); + content: ''; + } + &::after { + position: absolute; + bottom: 0; + left: 0; + z-index: 10; + width: 100%; + height: 10px; + background: #fff; + content: ''; + } + img { + max-width: 100%; + max-height: 200px; + } + } + } + .positionSet{ + top: 356px; + right: 235px; + } + .positionSet01{ + top: 500px; + right: 200px; + } + .positionSet02{ + top: 664px; + right: 265px; + } + .positionSet03{ + top: 808px; + right: 205px; + + } +} +.exaA{ + position: absolute; + top: 0; + left: 300px +} +.pr { + position: relative; +} + +.pa { + position: absolute; + top: 35px; + left: 140px; +} + +.tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } +} +.drivercard{ + position: absolute; + top: 0; + left: 325px; + border: solid 1px #ebf0fb; +} +.jopcard{ + position: absolute; + top: 1356px; + left: 330px; + border: solid 1px #ebf0fb; +} +.agreement{ + position: absolute; + top: 425px; + left: 330px; + border: solid 1px #ebf0fb; +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + .setCustom .ant-form-item-control{ + margin-left: -100px !important + } + .borderImg{ + border: solid 1px #ebf0fb; + } + } +} \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts b/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts new file mode 100644 index 00000000..3d248eed --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarSettleCarauthComponent } from './carauth.component'; + +describe('CarSettleCarauthComponent', () => { + let component: CarSettleCarauthComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarSettleCarauthComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarSettleCarauthComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.ts b/src/app/routes/vehicle/components/list/carauth/carauth.component.ts new file mode 100644 index 00000000..49342fda --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.ts @@ -0,0 +1,729 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { VehicleService } from '../../../services/vehicle.service'; + +@Component({ + selector: 'app-car-carauth', + templateUrl: './carauth.component.html', + styleUrls: ['./carauth.component.less'] +}) +export class CarSettleCarauthComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + ui: SFUISchema = {}; + schema: SFSchema = {}; + showCardFlag = false; + showJopFlag = false; + companyData: any = {}; + detailData: any = {}; + carNo = '' + + constructor( + private modal: NzModalRef, + public service: VehicleService, + private envSrv: EAEnvironmentService, + private eaCacheSrv: EACacheService, + ) { } + + ngOnInit(): void { + this.initData() + this.initSF() + } + initData() { + if (this.i.id) { + this.companyData = this.eaCacheSrv.get(cacheConf.env) + const params = { + id: this.i.id, + } + this.service.request(this.service.$api_shipperCarGet, params).subscribe(res => { + this.detailData = res + this.detailData.isSelf = res.isSelf ? 1 : 0 + this.detailData.isTrailer = res.isTrailer ? 1 : 0 + this.detailData.carFrontPhotoWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.carFrontPhotoWatermark, + response: this.detailData.carFrontPhotoWatermark, + }, + ]; + this.detailData.carProtocalWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.carProtocalWatermark, + response: this.detailData.carProtocalWatermark, + }, + ]; + this.detailData.certificatePhotoFrontWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.certificatePhotoFrontWatermark, + response: this.detailData.certificatePhotoFrontWatermark, + }, + ]; + this.detailData.certificatePhotoBackWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.certificatePhotoBackWatermark, + response: this.detailData.certificatePhotoBackWatermark, + }, + ]; + this.detailData.roadTransportPhotoWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.roadTransportPhotoWatermark, + response: this.detailData.roadTransportPhotoWatermark, + }, + ]; + }) + } + } + initSF() { + this.schema = { + properties: { + carFrontPhotoWatermark: { + type: 'string', + title: '车头照照片', + ui: { + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传车头照照片,支持JPG、PNG格式,文件小于5M。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + console.log(args); + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/carFrontPhotoWatermark', avatar); + this.detailData.carFrontPhoto = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + console.log(_fileList) + + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of( + // file?.response?.data?.fullFilePath + // ), + } + }, + carNo: { + title: '车牌号', + maxLength: 9, + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + carNoColor: { + title: '车牌颜色', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:color' }, + placeholder: '请选择车牌颜色', + containsAllLabel:false, + } as SFSelectWidgetSchema, + }, + carModel: { + title: '车型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:model' }, + placeholder: '请选择车型', + containsAllLabel:false, + } as SFSelectWidgetSchema, + }, + carLength: { + title: '车长', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:length' }, + placeholder: '请选择车长', + containsAllLabel:false, + } as SFSelectWidgetSchema, + }, + carLoad: { + title: '载重', + type: 'string', + maxLength: 6, + ui: { + placeholder: '请输入', + addOnAfter: '吨', + change: (val: any) =>{ + const value = val.replace(/\D/g,'') + this.sf.setValue('/carLoad', value) + }, + } + }, + isSelf: { + title: '是否挂靠', + type: 'string', + enum: [ + { label: '否', value: 0 }, + { label: '是', value: 1 }, + ], + ui: { + widget: 'select', + placeholder: '请选择', + } + }, + isTrailer: { + title: '是否为挂车', + type: 'string', + enum: [ + { label: '否', value: 0 }, + { label: '是', value: 1 }, + ], + ui: { + widget: 'select', + placeholder: '请选择', + } + }, + carProtocalWatermark: { + type: 'string', + title: '挂靠协议', + ui: { + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传挂靠协议,支持JPG、PNG格式,文件小于5M。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/carProtocalWatermark', avatar); + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: NzUploadFile) => of(file.url), + } + }, + agreeImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + titleA: { + title: '行驶证信息(必填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏', + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '行驶证首页照片', + ui: { + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传行驶证首页照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoFrontWatermark', avatar); + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath + this.checkCarCard(args.file.response.data.fullFilePath, 'front'); + } else { + this.detailData.certificatePhotoFront = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '行驶证副页照片', + ui: { + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传行驶证副业照片,支持JPG、PNG格式,文件小于5M。', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/certificatePhotoBackWatermark', avatar); + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath + this.checkCarCard(args.file.response.data.fullFilePath, 'back'); + } else { + this.detailData.certificatePhotoBack = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + driverLicenseRegisterTime: { + title: '行驶证注册日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入', + }, + }, + driverLicenseGetTime: { + title: '行驶证发证日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入', + }, + }, + driverLicenseEndTime: { + title: '行驶证到期日期', + type: 'string', + format: 'date', + maxLength: 30, + ui: { + placeholder: '请输入', + }, + }, + driverLicenseSigningOrg: { + title: '行驶证签发机关', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入', + }, + }, + carDistinguishCode: { + title: '车辆识别代码', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入', + }, + }, + useNature: { + title: '使用性质', + type: 'string', + maxLength: 30, + enum: [ + { label: '非营运', value: 0 }, + { label: '营运', value: 1 }, + ], + ui: { + widget: 'select', + placeholder: '请选择', + }, + }, + curbWeight: { + title: '整备质量', + type: 'string', + ui: { + placeholder: '请输入', + }, + }, + carOwner: { + title: '所有人', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入', + }, + }, + titleB: { + title: '道运证(选填)', + type: 'string', + ui: { + widget: 'text', + }, + default: '照片上传后会自动识别文字并填充下列内容栏', + }, + roadTransportPhotoWatermark: { + type: 'string', + title: '道运证照片', + ui: { + action: apiConf.waterFileUpload, + accept: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + widget: 'upload', + descriptionI18n: '请上传道运证照片,支持JPG、PNG格式,文件小于5M。蓝牌绿牌车辆,可不用传道运证', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + const avatar = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: args.file.response.data.fullFileWatermarkPath, + response: { + url: args.file.response.data.fullFileWatermarkPath, + }, + }, + ]; + this.sf?.setValue('/roadTransportPhotoWatermark', avatar); + this.detailData.roadTransportPhoto = args.file.response.data.fullFilePath + this.checkTransCard(args.file.response.data.fullFilePath); + } else { + this.detailData.roadTransportPhoto = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 5; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url), + } + }, + roadImg: { + title: '', + type: 'boolean', + // enum: [{ label: '长期', value: true }], + ui: { + widget: 'custom', + } + }, + roadTransportNo: { + title: '道运证号码', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + roadTransportLicenceNo: { + title: '经营许可证号', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入', + }, + }, + roadTransportStartTime: { + title: '发证日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入', + }, + }, + roadTransportEndTime: { + title: '有效期至', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入', + }, + }, + }, + required: [ + 'carFrontPhotoWatermark', + 'carNo', + 'carNoColor', + 'carModel', + 'carLength', + 'carLoad', + 'isSelf', + 'isTrailer', + 'certificatePhotoFrontWatermark', + 'certificatePhotoBackWatermark', + 'driverLicenseRegisterTime', + 'driverLicenseGetTime', + 'driverLicenseEndTime', + 'driverLicenseSigningOrg', + 'carDistinguishCode', + 'useNature', + 'carOwner' + ], + }; + + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600, + }, + $title1: { + spanLabelFixed: 0, + }, + $title2: { + spanLabelFixed: 0, + }, + $title3: { + spanLabelFixed: 0, + }, + $isTrailer:{ + grid: { span: 24 }, + }, + $carProtocalWatermark: { + grid: { span:12 }, + }, + $agreeImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + $titleB:{ + grid: { span: 24 }, + }, + $roadTransportPhotoWatermark: { + grid: { span: 12 }, + }, + $roadImg: { + grid: { span: 4 }, + class: 'setCustom' + }, + + }; + } + // 道路运输证识别 + checkTransCard(imgurl: any) { + const params = { + transportationLicenseUrl: imgurl, + }; + this.service.request(this.service.$api_recognizeTransportationLicense, params).subscribe((res: any) => { + if (res) { + this.sf.setValue('/roadTransportNo', res.number); + this.sf.setValue('/roadTransportLicenceNo', res.businessCertificate); + this.sf.setValue('/roadTransportStartTime', res.issueDate); + if(this.carNo === '') { + this.carNo = res.number + } else if(this.carNo && res.vehicleNumber.indexOf(this.carNo) === -1) { + this.service.msgSrv.warning('请上传同一认证车辆的相关证件') + } + } + }); + } + // 行驶证识别 + checkCarCard(imgurl: any, side: any) { + const params = { + vehicleLicenseUrl: imgurl, + side, + }; + this.service.request(this.service.$api_recognizeVehicleLicense, params).subscribe((res: any) => { + if (res) { + if (side === 'front') { // 正面 + this.sf.setValue('/driverLicenseRegisterTime', res.registerDate); + this.sf.setValue('/carNo', res.number); + this.sf.setValue('/driverLicenseGetTime', res.issueDate); + this.sf.setValue('/driverLicenseSigningOrg', res.issuingAuthority); + this.sf.setValue('/carDistinguishCode', res.vin); + this.sf.setValue('/carOwner', res.name); + this.sf.setValue('/useNature', res.useCharacter === '非营运' ? 0 : 1); + + } else { + this.sf.setValue('/curbWeight', res.unladenMass); + } + if(this.carNo === '') { + this.carNo = res.number + } else if(this.carNo && this.carNo !== res.number) { + this.service.msgSrv.warning('请上传同一认证车辆的相关证件') + } + } + }); + } + + close(): void { + this.modal.close(true); + } + showExample() { + this.showCardFlag = !this.showCardFlag + } + showJopExample() { + this.showJopFlag = !this.showJopFlag + } + submitForm() { + const params: any = { + appUserId: this.i.appUserId, + ...this.sf.value, + bindType: this.i.bindType + }; + params.carFrontPhoto = this.detailData.carFrontPhoto + params.carProtocal = this.detailData.carProtocal + params.certificatePhotoFront = this.detailData.certificatePhotoFront + params.certificatePhotoBack = this.detailData.certificatePhotoBack + params.roadTransportPhoto = this.detailData.roadTransportPhoto + delete params.titleA + delete params.titleB + console.log(params); + + this.service.request(this.service.$api_saveUpdateShipperCar, params).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('添加成功') + this.modal.close(true) + } + }) + } +} diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.html b/src/app/routes/vehicle/components/list/detail/detail.component.html new file mode 100644 index 00000000..a7422e70 --- /dev/null +++ b/src/app/routes/vehicle/components/list/detail/detail.component.html @@ -0,0 +1,263 @@ + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + 车辆基础信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + 行驶证信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 道路运输证信息 + + + + + + + + + + + + + + + + + + + + + + + 认证司机 + + + +
    + 未上传 + 草稿 + 待审核 + 已审核 + 已驳回 + 证件过期 +
    +
    +
    +
    +
    + + + + + +
    + 评分: +
    评价内容:
    +
    +
    + +
    + 暂无评价内容 +
    +
    +
    +
    + + + + +
    + + + + + +
    上传
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.less b/src/app/routes/vehicle/components/list/detail/detail.component.less new file mode 100644 index 00000000..a472c0b0 --- /dev/null +++ b/src/app/routes/vehicle/components/list/detail/detail.component.less @@ -0,0 +1,115 @@ +:host { + ::ng-deep { + + .sv__label, + .sv__detail { + line-height: 30px; + } + + .edit-box { + input { + max-width: 250px; + } + + nz-date-picker { + min-width: 250px; + } + } + + .readOnly-box { + input { + padding-left: 0; + color : #000; + } + + nz-select-top-control { + padding-left: 0 !important; + } + } + + .ant-select { + min-width: 250px; + + nz-select-top-control { + color : #000 !important; + cursor: text !important; + } + } + + // 图片展示工具样式改造 + .ant-upload.ant-upload-disabled { + cursor: pointer; + } + + .ant-upload.ant-upload-select-picture-card { + width : 200px; + height: 160px; + } + + .ant-upload-picture-card-wrapper { + width: auto; + } + } +} + +.image-hover { + .delete-icon { + position : absolute; + top : -15px; + right : -15px; + color : #F55656; + font-size : 28px; + background-color: #fff; + border-radius : 50%; + cursor : pointer; + } + + .show-icon { + color : #fff; + font-size: 30px; + cursor : pointer; + } +} + +.image-hover:hover .mask { + opacity: 0.8; +} + +.mask { + position : absolute; + width : 200px; + height : 160px; + margin-top : -160px; + background-color : #4F4F4F; + // top : 6px; + // left : 12px; + border-radius : 6px; + opacity : 0; +} + +.mask-over { + position : absolute; + display : flex; + align-items : center; + justify-content : center; + width : 200px; + height : 160px; + margin-top : -160px; + // top : 6px; + // left : 12px; + border-radius : 6px; + + label { + color : #FFF; + font-size : 20px; + line-height : 24px; + letter-spacing: 0.7px; + } + +} +input { + width: 200px; +} +.sv__container { + padding-top: 10px; +} \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.spec.ts b/src/app/routes/vehicle/components/list/detail/detail.component.spec.ts new file mode 100644 index 00000000..00666a0b --- /dev/null +++ b/src/app/routes/vehicle/components/list/detail/detail.component.spec.ts @@ -0,0 +1,31 @@ +/* + * @Author: your name + * @Date: 2021-11-29 20:19:08 + * @LastEditTime: 2021-11-29 20:31:00 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\detail\detail.component.spec.ts + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { FreightComponentsListDetailComponent } from './detail.component'; + +describe('FreightComponentsListDetailComponent', () => { + let component: FreightComponentsListDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [FreightComponentsListDetailComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FreightComponentsListDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.ts b/src/app/routes/vehicle/components/list/detail/detail.component.ts new file mode 100644 index 00000000..a07c9e7d --- /dev/null +++ b/src/app/routes/vehicle/components/list/detail/detail.component.ts @@ -0,0 +1,302 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { VehicleService } from '../../../services/vehicle.service'; +import { VehicleComponentsListEditComponent } from '../edit/edit.component'; +import { VehicleImgViewComponent } from '../img-view/img-view.component'; +import { apiConf } from '@conf/api.conf'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; +import { EADateUtil } from '@shared'; +import { NzImageService } from 'ng-zorro-antd/image'; + +@Component({ + selector: 'app-supplier-components-list-view', + templateUrl: './detail.component.html', + styleUrls: ['./detail.component.less'] +}) +export class VehicleComponentsListDetailComponent implements OnInit { + i: any; + @ViewChild('st', { static: false }) st!: STComponent; + isShow = false; + isVisible = false; + isEdit = false; + modalTitle = '有效期'; + modalName = ''; + ui!: SFUISchema; + columns!: STColumn[]; + uploadURl = apiConf.fileUpload; + schema!: SFSchema; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema1!: SFSchema; + @ViewChild('sf1', { static: false }) sf1!: SFComponent; + validData: any = ['suppliersType']; + suppliersData: any = {}; + disabledUpload = false; + detailData: any = this.initData(); + tempalateData: any; + contenCarNoColor: any; + contencarModel: any; + contenCarLength: any; + + constructor( + private http: _HttpClient, + private modal: ModalHelper, + public service: VehicleService, + private route: ActivatedRoute, + private modalHelper: ModalHelper, + private msgSrv: NzMessageService, + private nzModalService: NzModalService, + private nzImageService: NzImageService + ) {} + + ngOnInit() { + this.getSelectList(); + this.getDetailList(); + this.initSF(); + this.initSF1(); + this.initST(); + } + /** + * 查询参数 + */ + get reqParams() { + return { id: this.route.snapshot?.params?.id }; + } + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + effectiveDate: { + title: '有效期', + type: 'string', + ui: { + widget: 'date', + format: 'yyyy-MM-dd 00:00:00' + // hidden: this.modalName === 'effectiveDate' ? false : true, + } as SFDateWidgetSchema + } + }, + required: ['effectiveDate'] + }; + this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + } + initST() { + this.columns = [ + { title: '司机姓名', index: 'name', width: 300, className: 'text-center' }, + { title: '司机手机号', index: 'mobile', width: 300, className: 'text-center' }, + { title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' }, + { title: '录入人员', index: 'saveUser', className: 'text-center' }, + { + title: '车主申明/挂靠协议', + fixed: 'right', + width: '200px', + className: 'text-left', + buttons: [ + { + text: '查看协议', + click: _record => this.viewEvaluate(_record), + iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20 + }, + { + text: '上传协议', + click: _record => this.updateEvaluate(_record), + iif: item => item.auditStatusEnum == -1 + } + ] + } + ]; + } + initSF1() { + this.schema1 = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + suppliersType: { + type: 'string', + title: '类型', + enum: [ + { label: '非外部供应商', value: 0 }, + { label: '外部供应商', value: 1 } + ], + default: '', + ui: { + widget: 'select', + change: (args: any) => { + console.log(args, 'args'); + this.suppliersData.suppliersType = args; + if (args === 1) { + this.validData = ['suppliersType', 'externalSuppliersId']; + } else { + this.validData = ['suppliersType']; + this.suppliersData.externalSuppliersId = ''; + } + this.initSF1(); + } + } + }, + externalSuppliersId: { + title: '外部供应商id', + type: 'string', + default: '', + ui: { + visibleIf: { suppliersType: (value: any) => value === 1 } + } + } + }, + required: this.validData + }; + } + // 获取录单员 + getSelectList() { + this.Serveice('car:color'); + this.Serveice('car:model'); + this.Serveice('car:length'); + } + Serveice(param: any) { + let value: any; + this.service + .request(`${this.service.$api_get_getDictValue}`, { + dictKey: param + }) + .subscribe(res => { + if (param === 'car:color') { + this.contenCarNoColor = res; + } else if (param === 'car:model') { + this.contencarModel = res; + } else if (param === 'car:length') { + this.contenCarLength = res; + } + }); + return value; + } + // + getDetailList() { + console.log(this.route.snapshot?.params?.id); + const params = { + id: this.route.snapshot?.params?.id + }; + this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe(res => { + this.detailData = res; + this.tempalateData = res; + }); + } + + goBack() { + window.history.go(-1); + } + + handleCancel(name: any) {} + + /** + *查看评价 + */ + viewEvaluate(item: any) { + this.modal.createStatic(VehicleImgViewComponent, { i: item }).subscribe(() => { + this.st.reload(); + this.getDetailList(); + }); + } + /** + *查看评价 + */ + updateEvaluate(item: any) { + this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(() => { + this.st.reload(); + this.getDetailList(); + }); + } + handleOK() {} + ratify() { + this.isEdit = true; + } + changeUpload({ file, fileList, type }: any, key: string) { + console.log({ file, fileList, type }); + if (type === 'success') { + this.detailData[key] = file.response.data.fullFilePath; + } + } + deleteImg(key: string) { + console.log(key); + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + this.detailData[key] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzImageService.preview([{ src: url }]); + // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + console.log(this.detailData); + this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime); + + this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime); + + this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime); + + this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime); + + this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime); + console.log(this.detailData); + console.log(this.detailData.roadTransportStartTime) + if((this.detailData.roadTransportStartTime > this.detailData.roadTransportEndTime) || (this.detailData.driverLicenseRegisterTime > this.detailData.driverLicenseEndTime)) { + this.service.msgSrv.error('发证日期起始不能大于结束日期!') + return; + } + this.service.request(this.service.$api_get_update, this.detailData).subscribe(res => { + console.log(res); + if (res) { + this.getDetailList(); + this.isEdit = false; + this.service.msgSrv.success('修改成功!'); + } + }); + } + + private initData() { + return { + carNo: '', + carNoColor: '', + carModel: '', + carLength: '', + archivesNo: '', + driverLicenseSigningOrg: '', + carDistinguishCode: '', + carLoad: '', + curbWeight: '', + roadTransportNo: '', + roadTransportLicenceNo: '', + carOwner: '', + isTrailer: null, + useNature: null, + driverLicenseRegisterTime: null, + driverLicenseGetTime: null, + driverLicenseEndTime: null, + roadTransportStartTime: null, + roadTransportEndTime: null, + carFrontPhotoWatermark: '' + }; + } +} diff --git a/src/app/routes/vehicle/components/list/edit/edit.component.html b/src/app/routes/vehicle/components/list/edit/edit.component.html new file mode 100644 index 00000000..3442af67 --- /dev/null +++ b/src/app/routes/vehicle/components/list/edit/edit.component.html @@ -0,0 +1,19 @@ + + +
    + + +
    + diff --git a/src/app/routes/vehicle/components/list/edit/edit.component.spec.ts b/src/app/routes/vehicle/components/list/edit/edit.component.spec.ts new file mode 100644 index 00000000..688a7662 --- /dev/null +++ b/src/app/routes/vehicle/components/list/edit/edit.component.spec.ts @@ -0,0 +1,23 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { UcenterComponentsInfoEditComponent } from './edit.component'; + +describe('UcenterComponentsInfoEditComponent', () => { + let component: UcenterComponentsInfoEditComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [UcenterComponentsInfoEditComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UcenterComponentsInfoEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/list/edit/edit.component.ts b/src/app/routes/vehicle/components/list/edit/edit.component.ts new file mode 100644 index 00000000..ef6b14f3 --- /dev/null +++ b/src/app/routes/vehicle/components/list/edit/edit.component.ts @@ -0,0 +1,124 @@ +import { Params } from '@angular/router'; +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema, SFUploadWidgetSchema, SFTextareaWidgetSchema } from '@delon/form'; +import { EAEnvironmentService, CaptchaComponent, EAUserService } from '@shared'; +import { Observable, Observer } from 'rxjs'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { apiConf } from '@conf/api.conf'; +import { VehicleService } from '../../../services/vehicle.service'; +@Component({ + selector: 'app-setting-components-info-edit', + templateUrl: './edit.component.html', +}) +export class VehicleComponentsListEditComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any = {}; + infoData: any = {}; + schema!: SFSchema; + ui!: SFUISchema; + formData: any = {}; + interval$: any; + phone!: string; + + constructor( + private modal: NzModalRef, + public msgSrv: NzMessageService, + public service: VehicleService, + private envSrv: EAEnvironmentService, + ) {} + + ngOnInit(): void { + console.log('init:', this.i, this.infoData); + // 设置初始值 + this.initInfo(); + this.initSF(); + } + initInfo() { + if (this.infoData.carProtocal) { + this.formData = { + carProtocal: [ + { + uid: 'logo', + name: 'LOGO', + status: 'done', + url: this.infoData.carProtocal, + response: { + url: this.infoData.carProtocal, + }, + }, + ], + }; + } + } + initSF() { + // 依据类型初始表单 + this.schema = { + properties: { + carProtocal: { + type: 'string', + title: '车主申明/挂靠协议', + ui: { + widget: 'upload', + action: apiConf.fileUpload, + fileType: 'image/png,image/jpeg,image/jpg,image/gif', + limit: 1, + limitFileCount: 1, + resReName: 'data.fullFileWatermarkPath', + urlReName: 'data.fullFileWatermarkPath', + descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', + data: { + appId: this.envSrv.env.appId, + }, + name: 'multipartFile', + beforeUpload: (file: any, fileList: any) => { + return new Observable((observer: Observer) => { + const isLt1M = file.size / 1024 / 1024 < 5; + const fileType = 'image/png,image/jpeg'; + if (fileType.indexOf(file.type) === -1) { + this.service.msgSrv.warning('图片格式不正确!'); + observer.complete(); + return; + } + if (!isLt1M) { + this.service.msgSrv.warning('图片大小超过5M!'); + observer.complete(); + return; + } + observer.next(isLt1M); + observer.complete(); + }); + }, + multiple: false, + listType: 'picture-card', + showRequired: true, + } as SFUploadWidgetSchema, + }, + }, + required: ['carProtocal'], + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 }, + }, + }; + } + + close() { + this.modal.destroy(); + } + sure() { + const params ={ + carProtocal: this.sf.value.carProtocal?.data?.fullFilePath, + id: this.i.id + } + this.service.request(this.service.$api_get_upLoadCarProtocal, params).subscribe((res) => { + if(res) { + this.modal.destroy(true); + this.service.msgSrv.success('上传协议成功!') + } + }) + } +} diff --git a/src/app/routes/vehicle/components/list/img-view/img-view.component.html b/src/app/routes/vehicle/components/list/img-view/img-view.component.html new file mode 100644 index 00000000..9065b2fe --- /dev/null +++ b/src/app/routes/vehicle/components/list/img-view/img-view.component.html @@ -0,0 +1,34 @@ + + + +
    +
    +
    +
    + + + + + +
    + diff --git a/src/app/routes/vehicle/components/list/img-view/img-view.component.ts b/src/app/routes/vehicle/components/list/img-view/img-view.component.ts new file mode 100644 index 00000000..26149480 --- /dev/null +++ b/src/app/routes/vehicle/components/list/img-view/img-view.component.ts @@ -0,0 +1,58 @@ +/* + * @Author: your name + * @Date: 2021-12-07 17:30:18 + * @LastEditTime: 2022-01-18 16:36:27 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\img-view\img-view.component.ts + */ +import { Component, OnInit } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { VehicleService } from '../../../services/vehicle.service'; + +@Component({ + selector: 'app-setting-components-info-img-view', + templateUrl: './img-view.component.html', +}) +export class VehicleImgViewComponent implements OnInit { + record: any = {}; + i: any; + + constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public http: _HttpClient, public service: VehicleService) {} + + ngOnInit(): void { + console.log(this.i); + } + + cancel() { + this.modal.destroy(true); + } + // 驳回 + reject() { + const params ={ + approvalStatus: 30, + id: this.i.id + } + this.service.request(this.service.$api_get_auditCarProtocal_audit, params).subscribe((res) => { + if(res) { + this.modal.destroy(true); + this.service.msgSrv.success('已驳回') + } + }) + } + // 通过 + okCancel() { + const params ={ + approvalStatus: 20, + id: this.i.id + } + this.service.request(this.service.$api_get_auditCarProtocal_audit, params).subscribe((res) => { + if(res) { + this.modal.destroy(true); + this.service.msgSrv.success('已通过') + } + }) + } +} diff --git a/src/app/routes/vehicle/components/list/list.component.html b/src/app/routes/vehicle/components/list/list.component.html new file mode 100644 index 00000000..e2e98417 --- /dev/null +++ b/src/app/routes/vehicle/components/list/list.component.html @@ -0,0 +1,86 @@ + + + + + + +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + +
    {{ item?.carModelLabel }}-{{ item?.carLengthLabel ? item?.carLengthLabel + '米' : '' }}-{{ + item?.carLoad ? item?.carLoad + '吨' : '' + }}
    +
    + +
    + {{ item?.isSelf ? '是' : '否' }} +
    +
    + +
    + {{ item?.putOnRecord ? '是' : '否' }} +
    +
    + +
    + 未上传 + 草稿 + 待审核 + 已撤销 + 已审核 + 已驳回 + 证件过期 + - +
    +
    + + 冻结 + 正常 + +
    +
    diff --git a/src/app/routes/vehicle/components/list/list.component.ts b/src/app/routes/vehicle/components/list/list.component.ts new file mode 100644 index 00000000..7f81c557 --- /dev/null +++ b/src/app/routes/vehicle/components/list/list.component.ts @@ -0,0 +1,318 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { VehicleService } from '../../../vehicle/services/vehicle.service'; +@Component({ + selector: 'app-Vehicle-components-list', + templateUrl: './list.component.html' +}) +export class VehicleComponentsListComponent implements OnInit { + _$expand = false; + + ui!: SFUISchema; + schema!: SFSchema; + columns!: STColumn[]; + @ViewChild('st', { static: false }) st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + + constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) { } + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value) + }; + if (this.sf?.value.effectiveDate) { + params.effectiveDateStart = this.sf?.value.effectiveDate[0]; + params.effectiveDateEnd = this.sf?.value.effectiveDate[1]; + } + delete params.effectiveDate; + delete params.expand; + return params; + } + + ngOnInit() { + this.initSF(); + this.initST(); + this.ar.url.subscribe(params => { + this.st?.load(1); + }); + } + dataProcess(data: STData[]): STData[] { + return data.map((i, index) => { + i.showSortFlag = false; + return i; + }); + } + initSF() { + this.schema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + if (!!q) { + return this.service + .request(this.service.$api_get_getCarLicenseListByCarNo, { + carNo: q + }) + .pipe(map((res: any) => (res?.records as any[]).map(i => ({ label: i.carNo, value: i.carNo } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + } + } as SFSelectWidgetSchema + }, + carNoColor: { + type: 'string', + title: '车牌颜色', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'car:color' } + } + }, + carStatus: { + title: '运营状态', + type: 'string', + enum: [ + { label: '空闲', value: 0 }, + { label: '运输中', value: 1 } + ], + ui: { + allowClear: true, + widget: 'select' + } + }, + carModel: { + title: '车型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:model' }, + containsAllLabel: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + carLength: { + title: '车长', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:length' }, + containsAllLabel: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + carLoad: { + title: '载重', + type: 'string', + ui: { + visibleIf: { + expand: (value: boolean) => value + } + } + }, + isSelf: { + type: 'string', + title: '是否挂靠', + enum: [ + { label: '是', value: 1 }, + { label: '否', value: 0 } + ], + ui: { + widget: 'select', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + driverLicenseStatus: { + type: 'string', + title: '行驶证到期状态', + enum: [ + { label: '正常', value: 1 }, + { label: '即将到期', value: 2 }, + { label: '已到期', value: 3 } + ], + default: '', + ui: { + widget: 'select', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + roadTransportStatus: { + type: 'string', + title: '道运证到期状态', + enum: [ + { label: '正常', value: 1 }, + { label: '即将到期', value: 2 }, + { label: '已到期', value: 3 } + ], + ui: { + widget: 'select', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + isSelfs: { + type: 'string', + title: '是否入网', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: 1 }, + { label: '否', value: 0 } + ], + ui: { + widget: 'select', + allowClear: true, + visibleIf: { + expand: (value: boolean) => value + } + } + }, + // putOnRecord: { + // type: 'string', + // title: '是否已备案', + // enum: [ + // { label: '是', value: 1 }, + // { label: '否', value: 0 }, + // ], + // ui: { + // widget: 'select', + // visibleIf: { + // expand: (value: boolean) => value, + // }, + // }, + // }, + } + }; + this.ui = { '*': { spanLabelFixed: 130, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } }; + } + + initST() { + this.columns = [ + // { title: '', type: 'checkbox', className: 'text-center' }, + { title: '车牌号', width: '150px', className: 'text-center', index: 'carNo' }, + { title: '车牌颜色', width: '150px', className: 'text-center', index: 'carNoColorLabel' }, + { title: '车型-车长-载重', width: '180px', className: 'text-center', render: 'carLength' }, + { + title: '运营状态', + width: '150px', + className: 'text-center', + index: 'carStatus', + type: 'badge', + badge: { + true: { text: '运输中', color: 'success' }, + false: { text: '空闲', color: 'default' } + } + }, + // { title: '道运证', width: '150px', className: 'text-center', index: 'roadTransportNo' }, + // { title: '审核人', width: '150px', className: 'text-center', index: 'approvalUserName' }, + + { + title: '行驶证到期状态', + width: '180px', + className: 'text-center', + index: 'driverLicenseStatus', + type: 'badge', + badge: { + 1: { text: '正常', color: 'success' }, + 2: { text: '即将到期', color: 'warning' }, + 3: { text: '已到期', color: 'error' } + } + }, + { + title: '道运证到期状态', + width: '180px', + className: 'text-center', + index: 'roadTransportStatus', + type: 'badge', + badge: { + 1: { text: '正常', color: 'success' }, + 2: { text: '即将到期', color: 'warning' }, + 3: { text: '已到期', color: 'error' } + } + }, + { title: '是否入网', width: '200px', className: 'text-center', index: 'carOwner' }, + { title: '所有人', width: '200px', className: 'text-center', index: 'carOwner' }, + { title: '是否挂靠', width: '150px', className: 'text-center', render: 'isSelf' }, + { title: '挂靠协议', width: '150px', className: 'text-center', render: 'approvalAuditStatus' }, + // { title: '是否已备案', className: 'text-center', render: 'putOnRecord', }, + { + title: '操作', + fixed: 'right', + width: '100px', + className: 'text-center', + buttons: [ + { + text: '查看', + acl: { ability: ['VEHICLE-LIST-view'] }, + click: item => { + this.router.navigate(['/vehicle/list/detail/' + item.id] ); + // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } }); + } + } + // { + // text: '申请备案', + // click: (item) => { + + // }, + // }, + ] + } + ]; + } + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + creat() { + this.router.navigate(['./new'], { relativeTo: this.ar }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + // 导出 + exportFire() { + this.service.request(this.service.$api_carLicense_export, this.reqParams).subscribe((res: any) => { + if(res) { + this.service.msgSrv.success('导出成功,请去右上角下载中心下载') + return + } + }); + } +} diff --git a/src/app/routes/vehicle/services/vehicle.service.ts b/src/app/routes/vehicle/services/vehicle.service.ts new file mode 100644 index 00000000..2e95a0e3 --- /dev/null +++ b/src/app/routes/vehicle/services/vehicle.service.ts @@ -0,0 +1,72 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime : 2022-02-17 15:38:07 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\vehicle\\services\\vehicle.service.ts + */ +import { Injectable, Injector } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { BaseService } from 'src/app/shared/services/core/base.service'; +import { EAFileUtil } from 'src/app/shared/utils/file.util'; + +@Injectable({ + providedIn: 'root' +}) +export class VehicleService extends BaseService { + // 查询车辆认证表 + $api_get_operate_list = `/api/mdc/cuc/carLicense/operate/list/page`; + // 查询用户车辆认证表(审核列表) + $api_get_userCarLicense_list = `/api/mdc/cuc/carLicenseAudit/operate/list/page`; + // 获取车辆认证表 + $api_get_operate_get = `/api/mdc/cuc/carLicense/operate/get`; + // 获取车辆认证表(审核列表) + $api_get_operate_getaudit = `/api/mdc/cuc/carLicenseAudit/operate/get`; + + // 获取车辆认证司机列表 + // $api_get_queryDriverByCarId = `/api/mdc/cuc/carLicenseAudit/operate/queryDriverByCarId`; + $api_get_queryDriverByCarId = `/api/mdc/cuc/carLicenseAudit/operate/queryDriverByCarId`; + // 详情需要的下拉框数据 + $api_get_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; + // 审核司机车辆认证(审核列表) + $api_get_operate_audit = `/api/mdc/cuc/carLicenseAudit/operate/audit`; + // 审核司机挂靠协议(审核列表) + $api_get_auditCarProtocal_audit = `/api/mdc/cuc/carLicenseAudit/operate/auditCarProtocal`; + + // 更新司机车辆审核信息(审核列表) + $api_get_update_audit = `/api/mdc/cuc/carLicenseAudit/operate/update`; + // 更新司机车辆审核信息 + $api_get_update = `/api/mdc/cuc/carLicense/operate/update`; + + // 上传司机挂靠协议 + $api_get_upLoadCarProtocal = `/api/mdc/cuc/carLicenseAudit/operate/upLoadCarProtocal`; + + // 根据车牌号查询车辆信息(车辆认证表) + $api_get_getCarLicenseListByCarNo = `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`; + // /api/mdc/cuc/carLicense/findCarLicenseByCarNo + // 根据车牌号查询车辆信息(车辆审核认证表) + $api_get_getCarLicenseListByCarNo_audit = `/api/mdc/cuc/carLicenseAudit/operate/findCarLicenseAuditListByCarNo`; + + // 导出(车辆认证表) + $api_carLicense_export = `/api/mdc/cuc/carLicense/operate/export`; + // 导出(车辆审核认证表) + $api_carLicenseAudit_export = `/api/mdc/cuc/carLicenseAudit/operate/export`; + + // 获取货主车辆信息 + $api_shipperCarGet = '/api/mdc/shipperCar/get'; + // 根据地区code查询列表 + $api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode'; + // 道路运输证识别 + $api_recognizeTransportationLicense = '/api/mdc/pbc/hwc/ocr/recognizeTransportationLicense'; + // 行驶证识别 + $api_recognizeVehicleLicense = '/api/mdc/pbc/hwc/ocr/recognizeVehicleLicense'; + // 保存货主车辆关联表 + $api_saveUpdateShipperCar = '/api/mdc/shipperCar/saveUpdateShipperCar'; + // 添加车辆信息 + $api_addOrUpdateCarLicenseInfo = '/api/mdc/cuc/carLicenseAudit/operate/addOrUpdateCarLicenseInfo'; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/vehicle/vehicle-routing.module.ts b/src/app/routes/vehicle/vehicle-routing.module.ts new file mode 100644 index 00000000..9f3dad48 --- /dev/null +++ b/src/app/routes/vehicle/vehicle-routing.module.ts @@ -0,0 +1,27 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime: 2021-12-13 09:56:49 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\usercenter-routing.module.ts + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { VehicleComponentsAuditComponent } from './components/audit/audit.component'; +import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component'; +import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component'; +import { VehicleComponentsListComponent } from './components/list/list.component'; + +const routes: Routes = [ + { path: 'list', component: VehicleComponentsListComponent }, + { path: 'list/detail/:id', component: VehicleComponentsListDetailComponent }, + { path: 'audit', component: VehicleComponentsAuditComponent }, + { path: 'audit/detail/:id', component: VehicleComponentsAuditDetailComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class VehicleRoutingModule {} diff --git a/src/app/routes/vehicle/vehicle.module.ts b/src/app/routes/vehicle/vehicle.module.ts new file mode 100644 index 00000000..72ab6e09 --- /dev/null +++ b/src/app/routes/vehicle/vehicle.module.ts @@ -0,0 +1,35 @@ +/* + * @Author: your name + * @Date: 2021-11-29 15:22:34 + * @LastEditTime: 2021-12-13 09:58:58 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\usercenter\usercenter.module.ts + */ +import { NgModule } from '@angular/core'; +import { SharedModule } from '@shared'; +import { VehicleComponentsAuditComponent } from './components/audit/audit.component'; +import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component'; +import { CarSettleCarauthComponent } from './components/list/carauth/carauth.component'; +import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component'; +import { VehicleComponentsListEditComponent } from './components/list/edit/edit.component'; +import { VehicleImgViewComponent } from './components/list/img-view/img-view.component'; +import { VehicleComponentsListComponent } from './components/list/list.component'; +import { VehicleRoutingModule } from './vehicle-routing.module'; + + +const COMPONENTS = [ + VehicleComponentsListComponent, + VehicleComponentsListDetailComponent, + VehicleComponentsListEditComponent, + VehicleImgViewComponent, + VehicleComponentsAuditComponent, + VehicleComponentsAuditDetailComponent, + CarSettleCarauthComponent +]; + +@NgModule({ + imports: [SharedModule, VehicleRoutingModule], + declarations: [...COMPONENTS], +}) +export class VehicleModule {} diff --git a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.html b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.html new file mode 100644 index 00000000..d4ac94de --- /dev/null +++ b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.html @@ -0,0 +1,99 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + +
    +
    +
    +
    + + + + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    diff --git a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.less b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.less new file mode 100644 index 00000000..e87948ce --- /dev/null +++ b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.less @@ -0,0 +1,20 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } + .imgBox { + display: flex; + img { + width: 60px !important; + } + } + +} \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts new file mode 100644 index 00000000..d2c5afd4 --- /dev/null +++ b/src/app/routes/waybill-management/components/abnormal-appear/abnormal-appear.component.ts @@ -0,0 +1,272 @@ +import { Component, OnInit, ViewChild, Type } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { + SFComponent, + SFDateWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFUISchema +} from '@delon/form'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { WaybillManagementServe } from '../../services/waybill-management.service'; + +@Component({ + selector: 'app-abnormal-appear', + templateUrl: './abnormal-appear.component.html', + styleUrls: ['./abnormal-appear.component.less'] +}) +export class WaybillManagementAbnormalAppearComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('st2', { static: true }) + st2!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + ui: SFUISchema = {}; + ui2: SFUISchema = {}; + schema: SFSchema = {}; + addSchema: SFSchema = {}; + _$expand = false; + editText = ''; + formData: any; + isVisible = false; + edit = false; + editId = false; + selectedIndex = 0; + isLoading: boolean = false; + tabs = { + stayQuantity: 0, + receivedQuantity: 0 + }; + + columns: STColumn[] = [ + { title: '异常编号', index: 'exceptionCode', width: '180px', className: 'text-left' }, + { title: '关联运单号', index: 'wayBillCode', width: '180px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '220px', className: 'text-left' }, + { title: '卸货地', index: 'unloadingAddressArr', width: '220px', className: 'text-left' }, + { title: '承运司机', index: 'driver', width: '250px', className: 'text-left' }, + { title: '异常信息', index: 'exceptionContent', width: '250px', className: 'text-left' }, + { title: '异常图片', render: 'exceptionCertificateFirstFilePath', width: '200px', className: 'text-left' }, + { title: '上报时间', index: 'createTime', width: '180px', className: 'text-left' } + ]; + columns2: STColumn[] = [ + { title: '异常编号', index: 'exceptionCode', width: '180px', className: 'text-left' }, + { title: '关联运单号', index: 'wayBillCode', width: '180px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '180px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingAddressArr', width: '180px', className: 'text-left' }, + { title: '卸货地', index: 'unloadingAddressArr', width: '180px', className: 'text-left' }, + { title: '承运司机', index: 'driver', width: '200px', className: 'text-left' }, + { title: '异常信息', index: 'exceptionContent', width: '250px', className: 'text-left' }, + { title: '异常图片', render: 'exceptionCertificateFirstFilePath', width: '220px', className: 'text-left' }, + { title: '上报时间', index: 'createTime', width: '180px', className: 'text-left' }, + { title: '回复内容', index: 'replyContent', width: '180px', className: 'text-left' }, + { title: '回复人', index: 'replyAppUserName', width: '180px', className: 'text-left' }, + { title: '回复时间', index: 'replyTime', width: '180px', className: 'text-left' } + ]; + + + get reqParams() { + return { + ...this.sf?.value, + replyStatus: 0 + }; + } + get reqParams2() { + return { + ...this.sf?.value, + replyStatus: 1 + }; + } + + constructor(public service: WaybillManagementServe, private nzModalService: NzModalService, public shipperSrv: ShipperBaseService) {} + + ngOnInit(): void { + this.initSF(); + this.getGoodsSourceStatistical(); + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + exceptionCode: { + type: 'string', + title: '异常编号', + ui: { placeholder: '请输入' } + }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { placeholder: '请输入' } + }, + exceptionType: { + title: '异常类型', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLable: true, + params: { dictKey: 'exception:report:type' } + } as SFSelectWidgetSchema + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + reportingTime: { + title: '上报时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperSrv.getNetworkFreightForwarder() + } + } + } + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + getGoodsSourceStatistical() { + this.tabs = { + stayQuantity: 0, + receivedQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.replyStatus; + this.service.request(this.service.$api_get_listOperateStatus, params).subscribe(res => { + if (res) { + res.forEach((element: any) => { + if (element.replyStatus === '1') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.replyStatus === '0') { + this.tabs.stayQuantity = element.quantity; + } + }); + } + }); + } + search() { + if (this.selectedIndex === 0) { + this.st?.load(1); + } else { + this.st2?.load(1); + } + this.getGoodsSourceStatistical(); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this.isLoading = true + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } +} diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html new file mode 100644 index 00000000..6f5d861b --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html @@ -0,0 +1,259 @@ + + + + + + +
    + +

    运单号: {{ i?.wayBillCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.enterpriseInfoName }} + {{ i?.shippername }} + {{i?.enterpriseProjectName}} + {{i?.serviceTypeLabel}} + {{i?.dispatchName}} /{{i?.dispatchPhone}} + {{ i?.externalBillCode }} + {{ i?.resourceCode }} + {{ i?.paymentDays }} +
    + + + + + + + + + + + + +
    +
    +
    + +
    +
    +   + + + +
    +
    +
    + + + + + {{i?.goodsInfos?.[0]?.goodsName}} + + + + + {{i?.goodsInfos?.[0]?.weight}}吨,{{i?.goodsInfos?.[0]?.volume}}方,{{i?.goodsInfos?.[0]?.number}}件 + + + {{i?.goodsInfos?.[0]?.carModelLabel}}{{ i?.goodsInfos?.[0]?.carLength ? '/' + i?.goodsInfos?.[0]?.carLength + '米': ''}} + + + {{i?.driver?.name}}/{{i?.driver?.phone}} + + + {{i?.car?.carModelLabel}},{{i?.car?.carLengthLabel}}米,{{i?.car?.carLoad ? i?.car?.carLoad +'吨': ''}} + + + + {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方 + + + {{ i?.loadWeight }}吨,{{ i?.loadVolume }}方 + + + {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方 + + +
    +

    装货卸货信息 + ( + + + ) + +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

    +

    联系人:{{item.appUserName}}/{{item.contractTelephone}}

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

    +

    联系人:{{item.appUserName}}/{{item.contractTelephone}}

    +
    +
    +
    +
    +
    +
    +
    +
    + + +

    {{i?.freightPrice}}{{i?.goodsInfos?.[0]?.freightTypeLabel}}({{ i?.goodsInfos?.[0]?.settlementBasisLabel ? i?.goodsInfos?.[0]?.settlementBasisLabel + ',' :' ' }}{{i?.goodsInfos?.[0]?.ruleLabel}})

    + + 到付 + + {{ item.price | currency }} + + + {{ item.price + item.surcharge | currency }} + + + {{ item.surcharge | currency }} + + +
    +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2)}}%) +
    +
    +
    收款人:{{ i?.payee?.name }}/{{ i?.payee?.phone }}/{{ i?.payee?.idNo }}
    +
    + + + + + 查看附件      + 补充协议 + + + + + + + + + + + + + + + + + {{i?.receiptType == 1 ?'是':'否'}} + + + {{i?.receiptTypeLabel}} + + + {{i?.receiptUser}} / {{i?.receiptUserPhone}} + + + {{i?.receiptPlace}} + + + {{i?.receiptAddress}} + + + + + + + + + {{i?.goodsResource?.remarks}} + + + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + +
    暂无附件信息
    +
    +
    + + + + +
    \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.less b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.less new file mode 100644 index 00000000..b8327013 --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.less @@ -0,0 +1,70 @@ +:host{ + .btn-size{ + font-size: 14px; + } + .bdr{ + border-right: 1px solid #ccc; + } + .bdl{ + border-left: 1px solid #ccc; + } + .source-info{ + p{ + margin-bottom: .5em; + } + } + .freight-info-box{ + width: 95%; + } + .freigth-label{ + display: inline-block; + width: 50px; + text-align: right; + } + + ::ng-deep{ + .approval-status{ + .ant-steps{ + width: 70%; + margin: 0 auto; + } + } + } + .leftPadding { + padding-right: 100px; + } + .handling-info { + min-height: 100px; + border: 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width: 32px; + height: 32px; + margin-right: 24px; + color: #fff; + line-height: 32px; + text-align: center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.spec.ts b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.spec.ts new file mode 100644 index 00000000..8556cf2d --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { OrderManagementBulkeDetailComponent } from './bulk-detail.component'; + +describe('OrderManagementBulkeDetailComponent', () => { + let component: OrderManagementBulkeDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ OrderManagementBulkeDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderManagementBulkeDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts new file mode 100644 index 00000000..375f357c --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts @@ -0,0 +1,217 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:31:52 + * @LastEditTime : 2022-03-23 14:47:57 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\bulk-detail\\bulk-detail.component.ts + */ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; +import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; +import { WaybillManagementServe } from '../../services/waybill-management.service'; +@Component({ + selector: 'app-supply-management-bulk-detail', + templateUrl: './bulk-detail.component.html', + styleUrls: ['./bulk-detail.component.less'] +}) +export class WaybillManagementBulkeDetailComponent implements OnInit { + + id = this.route.snapshot.params.id; + i: any; + totalObj: any; + attObj: any; + isVisible = false; + MapList: any[]=[]; + trajectory = 'car'; + mapList:any[] = []; //地图点位数据组 + addressItems:any[] = []; //打点地址数据组 + billExpenses: any[] = []; //运费信息表格信息 + imges: any; + modalcontent: any; + modalTitle:string = ''; + unLoadingPlaceVOList: any = []; + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' }, + ]; + logColumns: STColumn[] = [ + { title: '款项', index: 'costCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatus', + type: 'badge', + width: '120px', + badge: { + '1': { text: '待申请', color: 'warning' }, + '2': { text: '已支付', color: 'success' }, + '3': { text: '已拒绝', color: 'warning' }, + '4': { text: '申请中', color: 'warning' } + } + } + ]; + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private modal: NzModalService, + private service: WaybillManagementServe, + private modalService: NzModalService + ) { + + } + + ngOnInit(): void { + this.initData() + this.getTrajectory() + } + initData() { + const params = { + id: this.id + } + this.service.request(this.service.$api_get_getBulkDetail, params).subscribe((res) => { + console.log(res) + this.unLoadingPlaceVOList.push(...res.loadingPlace) + this.unLoadingPlaceVOList.push(...res.dischargePlace) + console.log(this.unLoadingPlaceVOList) + this.i = res; + this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.costCode === 'TRA'); + this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE"); + }) + } + + + hand() { + this.modalService.create({ + nzTitle: '', + // nzContent: OrderManagementGaodeMapComponent, + nzWidth: 1200 + }); + } + + goBack() { + window.history.go(-1); + } + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false +} +handleOK() { + this.isVisible = false +} +goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + } +} + // *确认发车 + sureDepart(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认发车', + nzWidth: '50%', + nzContent: VehicleSureDepartComponent, + nzComponentParams: { + i: item, + Status: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.initData() + +}); +} +// 确认到车 +sureArrive(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认到车', + nzWidth: '50%', + nzContent: VehicleSureArriveComponent, + nzComponentParams: { + i: item, + Status: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.initData() +}); +} + // 获取车辆轨迹 + getTrajectory(){ + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res.cityArray; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory(){ + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list :any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event:any){ + if(event ==='car'){ + this.getTrajectory() + }else if(event ==='driver'){ + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.html b/src/app/routes/waybill-management/components/bulk/bulk.component.html new file mode 100644 index 00000000..cbc5221f --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.html @@ -0,0 +1,109 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + + +
    + + +
    {{ item?.createUserName }}/{{ item?.createUserPhone }}
    +
    + +
    {{ item?.driverName }}/{{ item?.driverTelephone }}/{{ item?.driverLicenseCarNo }}
    +
    + +
    {{ item?.payeeName }}/{{ item?.payeePhone }}
    +
    + + {{ item?.wayBillCode }} +
    + {{item?.wayBillStatusLabel}} +
    +
    + {{item?.resourceTypeLabel}}{{item?.serviceTypeLabel}} +
    +
    + + {{ item?.freightPrice }}/吨 +
    {{item?.settlementBasisLabel}}
    +
    + +
    +

    + {{ data.costName }}:{{ data.price | currency }} + {{ data.paymentStatusLabel }} +

    +
    +
    + + {{ item?.wayBillCode }} + + +
    {{ item?.goodsInfos?.goodsName }}
    +
    {{ item?.goodsInfos?.weight }}{{ item?.goodsInfos?.volume? '/' +item?.goodsInfos?.volume : '' }}{{ item?.goodsInfos?.number ? '/' + item?.goodsInfos?.number : '' }}
    +
    + +
    装 | {{ item?.loadingTime }}
    +
    卸 | {{ item?.unloadingTime }}
    +
    +
    +
    +
    diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.less b/src/app/routes/waybill-management/components/bulk/bulk.component.less new file mode 100644 index 00000000..45669c6a --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.less @@ -0,0 +1,16 @@ + + :host ::ng-deep{ + ::ng-deep nz-range-picker{ + width: 100%; + } + p{ + margin-bottom: 0 + } + .left_btn { + width: 50px; + height: 32px; + padding-left: 8px; + line-height:32px; + background-color: #d7d7d7; + } + } \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.spec.ts b/src/app/routes/waybill-management/components/bulk/bulk.component.spec.ts new file mode 100644 index 00000000..7027c72e --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.spec.ts @@ -0,0 +1,40 @@ +/* + * @Author: your name + * @Date: 2021-12-06 20:03:28 + * @LastEditTime : 2022-01-20 19:09:36 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\bulk\\bulk.component.spec.ts + */ +/* + * @Author: your name + * @Date: 2021-12-06 19:39:49 + * @LastEditTime: 2021-12-06 19:41:08 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\components\bulk\bulk.component.spec.ts + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { WaybillManagementBulkComponent } from './bulk.component'; + +describe('WaybillManagementBulkComponent', () => { + let component: WaybillManagementBulkComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ WaybillManagementBulkComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WaybillManagementBulkComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.ts b/src/app/routes/waybill-management/components/bulk/bulk.component.ts new file mode 100644 index 00000000..cb6a8a74 --- /dev/null +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.ts @@ -0,0 +1,485 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; +import { WaybillManagementServe } from '../../services/waybill-management.service'; + + +@Component({ + selector: 'app-supply-management-bulk', + templateUrl: './bulk.component.html', + styleUrls: ['./bulk.component.less'] +}) +export class WaybillManagementBulkComponent implements OnInit { + ui: SFUISchema = {}; + uiView: SFUISchema = {}; + schema: SFSchema = {}; + schemaView: SFSchema = {}; + isVisibleEvaluate = false; + _$expand = false; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + resourceStatus: any; + tabs = { + signQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + totalQuantity: 0, + compolatelQuantity: 0, + deltQuantity: 0 + }; + constructor( + public service: WaybillManagementServe, + private modal: NzModalService, + public shipperservice: ShipperBaseService) { } + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.wayBillStatus = this.resourceStatus + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '', + }, + }; + } + get selectedRows() { + return this.st?.list.filter((item) => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.getGoodsSourceStatistical() + } + + + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '最多100个运单,空号隔开' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '最多100个单号,空号隔开' + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + console.log(q) + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str}) + .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + + } as SFSelectWidgetSchema, + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + licenseCarNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value, + }, + } + }, + paymentstatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFSelectWidgetSchema, + }, + serviceType: { + title: '服务类型', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'service:type' }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + + riskStatus: { + type: 'string', + title: '是否风险单', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: '3' }, + { label: '否', value: '1' } + ], + ui: { + widget: 'select', + allowClear: true, + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value, + }, + }, + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value, + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder(), + }, + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value, + }, + } as SFDateWidgetSchema, + }, + }, + type: 'object', + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '运单号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'wayBillCode' + }, + { + title: '运费明细', + width: '250px', + className: 'text-right', + render: 'billExpenseDetails' + }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '220px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '180px', className: 'text-left' }, + { title: '关联订单号', index: 'billCode', width: '180px', className: 'text-left' }, + { title: '货源编号', index: 'resourceCode', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingPlace', width: '220px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '220px', + index: 'dischargePlace' + }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsInfos' + }, + { + title: '运费单价', + className: 'text-right', + width: '150px', + render: 'freightPrice' + }, + { + title: '接单数量', + index: 'orderReceivingQuantity', + width: '200px', + className: 'text-left', + }, + { + title: '结算数量', + index: '结算数量', + width: '200px', + className: 'text-left', + format: (item: any) => + `${item.settlementWeight || ''}` + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '200px', + render: 'payeeName', + }, + { + title: '装卸货时间', + className: 'text-left', + width: '200px', + render: 'loadingTime' + }, + { + title: '创建时间', + width: '180px', + className: 'text-left', + index: 'createTime', + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '确认发车', + click: (_record) => this.sureDepart(_record), + iif: item => item.wayBillStatus == '2', + acl: { ability: ['WAYBILL-BULK-insertBulkStartCarInfo'] }, + }, + { + text: '确认到车', + click: (_record) => this.sureArrive(_record), + iif: item => item.wayBillStatus == '3', + acl: { ability: ['WAYBILL-BULK-insertBulkUnloadCarInfo'] }, + }, + ], + }, + ]; + } + search() { + this.st?.load(1); + this.getGoodsSourceStatistical() + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + console.log(item) + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + selectChange(e: number) { + console.log(e); + if (e >= 1) { + this.resourceStatus = e + 1; + } else { + this.resourceStatus = 0 + } + this.initST(); + setTimeout(() => { + this.st.load(1); + }, 500); + } + /** + * 导入货源 + */ + importGoodsSource() { + + } + audit(item: any) { + console.log(item) + } + /** +* 审核通过按钮 +*/ + handleOK() { + + } + /** + *查看评价 + */ + viewEvaluate(item: any) { + console.log(item) + this.isVisibleEvaluate = true + } + getGoodsSourceStatistical() { + this.tabs = { + signQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + totalQuantity: 0, + compolatelQuantity: 0, + deltQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.wayBillStatus + this.service.request(this.service.$api_get_getBulkStatistics, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((ele: any) => { + switch (ele.wayBillStatus) { + case '2': + this.tabs.receivedQuantity = ele?.count; + break; + case '3': + this.tabs.cancelQuantity = ele?.count; + break; + case '4': + this.tabs.signQuantity = ele?.count; + break; + case '5': + this.tabs.compolatelQuantity = ele?.count; + break; + case '6': + this.tabs.deltQuantity = ele?.count; + break; + } + totalCount += ele.count + }); + this.tabs.totalQuantity = totalCount + } + }) + } + // *确认发车 + + sureDepart(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认发车', + nzWidth: '50%', + nzContent: VehicleSureDepartComponent, + nzComponentParams: { + i: item, + Status: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical() + }); + } + // 确认到车 + sureArrive(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认到车', + nzWidth: '50%', + nzContent: VehicleSureArriveComponent, + nzComponentParams: { + i: item, + Status: 2 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical() + }); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams,this.service.$api_asyncExportBulkList) + } +} diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html new file mode 100644 index 00000000..0ff1b2cc --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html @@ -0,0 +1,238 @@ + + + + + + +
    + +

    运单号: {{ i?.wayBillCode }}

    +
    +
    +
    + + +
    +
    +
    +
    + {{ i?.enterpriseInfoName }} + {{ i?.shippername }} + {{i?.enterpriseProjectName}} + {{i?.serviceTypeLabel}} + {{i?.dispatchName}}{{ i?.dispatchPhone ? '/' + i?.dispatchPhone : '' }} + {{ i?.resourceCode }} + {{ i?.paymentDays }} +
    + + + + + + + + + + + + +
    +
    +
    + +
    +
    +   +   +   +   +
    +
    +
    + + + + + {{i?.goodsInfos?.[0]?.goodsName}} + + + + + {{i?.goodsInfos?.[0]?.weight}}吨,{{i?.goodsInfos?.[0]?.volume}}方,{{i?.goodsInfos?.[0]?.number}}件 + + + {{i?.goodsInfos?.[0]?.carModelLabel}}{{ i?.goodsInfos?.[0]?.carLength ? '/' + i?.goodsInfos?.[0]?.carLength + '米': ''}} + + + {{i?.driverVo?.name}}{{ i?.driverVo?.phone ? '/' + i?.driverVo?.phone : ''}} + + + {{ i?.carVO?.carModelLabel ? i?.carVO?.carModelLabel +',': ''}}{{ i?.carVO?.carLengthLabel ? i?.carVO?.carLengthLabel +'米,': ''}}{{i?.carVO?.carLoad ? i?.carVO?.carLoad +'吨': ''}} + + + {{i?.loadingTime}} + + + {{i?.unloadingTime}} + + +
    +

    装货卸货信息 + ( + + + ) + +

    +
    +
    +
    +
    +
    +
    +
    +

    装货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

    +

    联系人:{{item.appUserName}}/{{item.contractTelephone}}

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    卸货地:{{item?.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}

    +

    联系人:{{item.appUserName}}/{{item.contractTelephone}}

    +
    +
    +
    +
    +
    +
    +
    +
    + + + + {{i?.insuranceTypeLabel}} + + + {{i?.goodsValue !==null?(i?.goodsValue|currency)+'元':'-'}} + + + {{i?.insurancePremium!==null?(i?.insurancePremium |currency)+'元':'-'}} + + + + + + + {{ item.price | currency }} + + + {{ item.price + item.surcharge | currency }} + + + {{ item.surcharge | currency }} + + +
    + 总计:{{ i?.totalAmount | currency }} (运费{{ i?.totalFreight | currency }}, + 附加费{{ i?.totalSurcharge | currency }},附加费率{{ (i?.totalRate * 100).toFixed(2)}}% ) +
    +
    车队长:{{ i?.payee?.name }}/{{ i?.payee?.phone }}/{{ i?.payee?.idNo }}
    +
    + + + + + 查看附件      + 补充协议 + + + + + + + + + + + + + + + + + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} + + + {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} + + {{ i?.supplementaryInformationVO?.receiptUserName }} / {{ i?.supplementaryInformationVO?.phon }} + + {{ i?.supplementaryInformationVO?.area }} + + + {{ i?.supplementaryInformationVO?.address }} + + + + + + + + {{ i?.supplementaryInformationVO?.remarks }} + + + + + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + +
    暂无附件信息
    +
    +
    + + + + +
    \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.less b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.less new file mode 100644 index 00000000..50b12799 --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.less @@ -0,0 +1,103 @@ +:host { + .btn-size { + font-size: 14px; + } + + .bdr { + border-right: 1px solid #ccc; + } + + .bdl { + border-left: 1px solid #ccc; + } + + .source-info { + p { + margin-bottom: .5em; + } + } + + .freight-info-box { + width: 95%; + } + + .freigth-label { + display : inline-block; + width : 50px; + text-align: right; + } + + ::ng-deep { + .approval-status { + .ant-steps { + width : 70%; + margin: 0 auto; + } + } + } + + .leftPadding { + padding-right: 100px; + } + + .handling-info { + min-height: 100px; + border : 1px solid #ccc; + + .loading-row { + display: flex; + } + + .handling-info-icon { + width : 32px; + height : 32px; + margin-right : 24px; + color : #fff; + line-height : 32px; + text-align : center; + border-radius: 50%; + + &.loading-bg { + background-color: #50D4AB; + } + + &.unloaing-bg { + background: #F66F6A; + } + } + + .info { + flex: 1; + } + + .time-info { + margin-left: 56px; + } + } +} + +::ng-deep { + // .affix { + // position: fixed; + // top : 20px !important; + // right : 25px; + // left : 25px; + // z-index : 999 !important; + // } + + // .alain-pro__menu-side .alain-pro__main { + // .affix { + // position: fixed; + // top : 20px !important; + // right : 25px; + // left : 250px; + // z-index : 999 !important; + // } + // } + + // .aside-collapsed.alain-pro__menu-side .alain-pro__main { + // .affix { + // left: 106px; + // } + // } +} \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.spec.ts b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.spec.ts new file mode 100644 index 00000000..8d8ab6b6 --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.spec.ts @@ -0,0 +1,32 @@ +/* + * @Author: your name + * @Date: 2021-12-07 14:52:29 + * @LastEditTime: 2021-12-07 14:56:17 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\waybill-management\components\vehicle-detail\vehicle-detail.component.spec.ts + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { WaybillManagementVehicleDetailComponent } from './vehicle-detail.component'; + +describe('WaybillManagementVehicleDetailComponent', () => { + let component: WaybillManagementVehicleDetailComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ WaybillManagementVehicleDetailComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WaybillManagementVehicleDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts new file mode 100644 index 00000000..626eadc9 --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts @@ -0,0 +1,210 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:31:52 + * @LastEditTime : 2022-04-01 11:11:14 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\vehicle-detail\\vehicle-detail.component.ts + */ +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { STColumn } from '@delon/abc/st'; +import { _HttpClient } from '@delon/theme'; +import format from 'date-fns/format'; +import { NzCardComponent } from 'ng-zorro-antd/card'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { Subscription, fromEvent } from 'rxjs'; +import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; +import { WaybillManagementServe } from '../../services/waybill-management.service'; +@Component({ + selector: 'app-supply-management-vehicle-detail', + templateUrl: './vehicle-detail.component.html', + styleUrls: ['./vehicle-detail.component.less'] +}) +export class WaybillManagementVehicleDetailComponent implements OnInit, OnDestroy { + id = this.route.snapshot.params.id; + MapList: any[] = []; + trajectory = 'car'; + mapList: any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 + i: any; + totalObj: any; + attObj: any; + isVisible = false; + imges: any; + unLoadingPlaceVOList: any = []; + logColumns2: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' } + ]; + modalcontent: any; + modalTitle:string = ''; + billExpenses: any[] = []; //运费信息表格信息 + logColumns: STColumn[] = [ + { title: '款项', index: 'costCodeLabel' }, + { title: '小计(元)', render: 'prices' }, + { title: '运输费(元)', render: 'price' }, + { title: '附加费(元)', render: 'surcharge' }, + { title: '支付时间', index: 'paymentTime' }, + { + title: '支付状态', + className: 'text-center', + index: 'paymentStatusLabel' + } + ]; + + scrollTop = 0; + subscribeScoll!: Subscription; + constructor( + private route: ActivatedRoute, + private msgSrv: NzMessageService, + private service: WaybillManagementServe, + private modal: NzModalService + ) {} + + ngOnDestroy(): void { + this.subscribeScoll.unsubscribe(); + } + + ngOnInit(): void { + this.initData(); + this.getTrajectory(); + this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { + this.scrollTop = document.documentElement.scrollTop; + }); + } + initData() { + const params = { + id: this.id + }; + this.service.request(this.service.$api_get_getWholeDetail, params).subscribe(res => { + console.log(res); + this.unLoadingPlaceVOList.push(...res.loadingPlace); + this.unLoadingPlaceVOList.push(...res.dischargePlace); + console.log(this.unLoadingPlaceVOList); + this.i = res; + this.billExpenses = this.i?.billExpenseDetails?.filter( + (data: any) => data.costCode === 'PRE' || data.costCode === 'RECE' || data.costCode === 'BACK' + ); + this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE'); + }); + } + + goBack() { + window.history.go(-1); + } + agreement(value: any) { + if(value ==='1'){ + this.modalTitle = '附件信息'; + this.modalcontent = this.i?.contractContent?.contractContent; + + }else if(value === '2'){ + this.modalTitle = '补充协议'; + this.modalcontent = this.i?.supplementContent?.contractContent; + } + this.isVisible = true; + } + handleCancel() { + this.isVisible = false; + } + handleOK() { + this.isVisible = false; + } + goDistance(elf: NzCardComponent) { + if (elf) { + elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); + } + } + // *确认发车 + + sureDepart(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认发车', + nzWidth: '50%', + nzContent: VehicleSureDepartComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.initData(); + }); + } + // 确认到车 + sureArrive(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认到车', + nzWidth: '50%', + nzContent: VehicleSureArriveComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.initData(); + }); + } + + // 获取车辆轨迹 + getTrajectory() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { + if (res) { + const points = res.trackArray; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = res.cityArray; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + // 获取司机轨迹 + getDriverTrajectory() { + this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { + if (res) { + const points = res.tracks; + let list: any[] = []; + points?.forEach((item: any) => { + list.push({ + name: item.hgt, + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + }); + }); + this.mapList = list; + this.addressItems = [...res.enclosureDataAppTrack]; + if (this.addressItems && this.addressItems.length > 0) { + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.gtm); + item.cityName = item.appAdress; + }); + } + } + }); + } + trajectoryChange(event: any) { + if (event === 'car') { + this.getTrajectory(); + } else if (event === 'driver') { + this.getDriverTrajectory(); + } + } + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } +} diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.html b/src/app/routes/waybill-management/components/vehicle/vehicle.component.html new file mode 100644 index 00000000..709cbfcd --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.html @@ -0,0 +1,114 @@ + + + + +
    + +
    + +
    + + + +
    + +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + +
    + + +
    {{ item?.createUserName }}/{{ item?.createUserPhone }}
    +
    + +
    {{ item?.createUserName }}/{{ item?.createUserPhone }}
    +
    + +
    {{ item?.driverName }}/{{ item?.driverTelephone }}/{{ item?.driverLicenseCarNo }}
    +
    + +
    {{ item?.payeeName }}/{{ item?.payeePhone }}
    +
    + +
    +

    {{ data?.expenseName }}:{{ data?.price | currency }}

    +
    +
    + +
    +

    + {{ data?.costName }}:{{ data?.price | currency }} + {{ data?.paymentStatusLabel }} +

    +
    +
    + + {{ item?.wayBillCode }} +
    + {{item?.wayBillStatusLabel}} +
    +
    + {{item?.resourceTypeLabel}}{{item?.serviceTypeLabel}} +
    +
    + + {{ item?.billCode }} + + +
    {{ item?.goodsInfos?.goodsName }}
    +
    {{ item?.goodsInfos?.weight }}{{ item?.goodsInfos?.volume? '/' +item?.goodsInfos?.volume : '' }}{{ item?.goodsInfos?.number ? '/' + item?.goodsInfos?.number : '' }}
    +
    + +
    装 | {{ item?.loadingTime }}
    +
    卸 | {{ item?.unloadingTime }}
    +
    +
    +
    +
    diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.less b/src/app/routes/waybill-management/components/vehicle/vehicle.component.less new file mode 100644 index 00000000..118c2a31 --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.less @@ -0,0 +1,8 @@ +:host ::ng-deep{ + p{ + margin-bottom: 0 + } + ::ng-deep nz-range-picker{ + width: 100%; + } +} \ No newline at end of file diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.spec.ts b/src/app/routes/waybill-management/components/vehicle/vehicle.component.spec.ts new file mode 100644 index 00000000..c8fb27ed --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.spec.ts @@ -0,0 +1,32 @@ +/* + * @Author: your name + * @Date: 2021-12-07 14:52:29 + * @LastEditTime: 2022-01-12 13:14:49 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\waybill-management\components\vehicle\vehicle.component.spec.ts + */ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { WaybillManagementVehicleComponent } from './vehicle.component'; + +describe('WaybillManagementVehicleComponent', () => { + let component: WaybillManagementVehicleComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ WaybillManagementVehicleComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WaybillManagementVehicleComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts b/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts new file mode 100644 index 00000000..189a802a --- /dev/null +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.ts @@ -0,0 +1,494 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { ShipperBaseService } from '@shared'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzUploadChangeParam } from 'ng-zorro-antd/upload'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; +import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; +import { WaybillManagementServe } from '../../services/waybill-management.service'; + +@Component({ + selector: 'app-supply-management-vehicle', + templateUrl: './vehicle.component.html', + styleUrls: ['./vehicle.component.less', '../../../commom/less/expend-but.less', '../../../commom/less/box.less'] +}) +export class WaybillManagementVehicleComponent implements OnInit { + ui: SFUISchema = {}; + schema: SFSchema = {}; + isVisibleEvaluate = false; + isVisible = false; + _$expand = false; + resourceStatus: any; + @ViewChild('st') private readonly st!: STComponent; + @ViewChild('sf', { static: false }) sf!: SFComponent; + columns: STColumn[] = []; + tabs = { + signQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + totalQuantity: 0, + compolatelQuantity: 0, + deltQuantity: 0 + }; + constructor(public service: WaybillManagementServe, private modal: NzModalService, public shipperservice: ShipperBaseService) {} + + /** + * 查询参数 + */ + get reqParams() { + const a: any = {}; + if (this.resourceStatus) { + a.wayBillStatus = this.resourceStatus; + } + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...a, + ...params, + createTime: { + start: this.sf?.value?.createTime?.[0] || '', + end: this.sf?.value?.createTime?.[1] || '' + } + }; + } + get selectedRows() { + return this.st?.list.filter(item => item.checked) || []; + } + ngOnInit(): void { + this.initSF(); + this.initST(); + this.getGoodsSourceStatistical(); + } + + /** + * 初始化查询表单 + */ + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + wayBillCode: { + type: 'string', + title: '运单号', + ui: { + placeholder: '最多100个运单,空号隔开' + } + }, + billCode: { + type: 'string', + title: '订单号', + ui: { + placeholder: '最多100个单号,空号隔开' + } + }, + resourceCode: { + type: 'string', + title: '货源编号' + }, + shipperAppUserId: { + type: 'string', + title: '货主', + ui: { + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, + onSearch: (q: any) => { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, + change: (q: any) => { + this.getRegionCode(q); + } + } as SFSelectWidgetSchema + }, + enterpriseProjectId: { + type: 'string', + title: '所属项目', + ui: { + widget: 'select', + placeholder: '请先选择货主', + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + loadingPlace: { + type: 'string', + title: '装货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + dischargePlace: { + type: 'string', + title: '卸货地', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + + driverName: { + title: '承运司机', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + licenseCarNo: { + title: '车牌号', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + carCaptainName: { + title: '车队长', + type: 'string', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + paymentstatus: { + title: '支付状态', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'overall:payment:status' }, + containsAllLabel: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + serviceType: { + title: '服务类型', + type: 'string', + ui: { + widget: 'dict-select', + containsAllLabel: true, + params: { dictKey: 'service:type' }, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFSelectWidgetSchema + }, + + riskStatus: { + type: 'string', + title: '是否风险单', + enum: [ + { label: '全部', value: '' }, + { label: '是', value: '3' }, + { label: '否', value: '1' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } + }, + enterpriseInfoId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + // 获取城市列表 + getRegionCode(regionCode: any) { + console.log(regionCode); + return this.service + .request(this.service.$api_get_enterprise_project, { id: regionCode }) + .pipe( + map(res => + res.map((item: any) => ({ + label: item.projectName, + value: item.id + })) + ) + ) + .subscribe(res => { + this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res; + this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res); + // if (this.enterpriseProjectIds) { + // this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds); + // } + }); + } + + /** + * 初始化数据列表 + */ + initST() { + this.columns = [ + { title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' }, + { + title: '运单号', + width: '180px', + fixed: 'left', + className: 'text-left', + render: 'wayBillCode' + }, + { + title: '货源编号', + width: '150px', + className: 'text-left', + index: 'resourceCode' + }, + { + title: '货主出价', + width: '250px', + className: 'text-right', + render: 'billExpenseDetailVOList2' + }, + { + title: '费用明细', + width: '250px', + className: 'text-right', + render: 'billExpenseDetailVOList' + }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, + { title: '网络货运人', index: 'enterpriseInfoName', width: '220px', className: 'text-left' }, + { title: '货主', index: 'shipperAppUserName', width: '200px', className: 'text-left' }, + { title: '关联订单号', index: 'billCode', width: '180px', className: 'text-left' }, + { title: '装货地', index: 'loadingPlace', width: '180px', className: 'text-left' }, + { + title: '卸货地', + className: 'text-left', + width: '180px', + index: 'dischargePlace' + }, + { + title: '货物信息', + className: 'text-left', + width: '250px', + render: 'goodsInfos' + }, + { + title: '承运司机', + className: 'text-left', + width: '250px', + render: 'driverName' + }, + { + title: '车队长', + className: 'text-left', + width: '200px', + render: 'payeeName' + }, + { + title: '装卸货时间', + className: 'text-left', + width: '200px', + render: 'loadingTime' + }, + { + title: '创建时间', + width: '180px', + className: 'text-left', + index: 'createTime' + }, + { + title: '操作', + fixed: 'right', + width: '110px', + className: 'text-center', + buttons: [ + { + text: '确认发车', + click: _record => this.sureDepart(_record), + iif: item => item.wayBillStatus == '2', + acl: { ability: ['WAYBILL-VEHICLE-wholeStartCarInfo'] } + }, + { + text: '确认到车', + click: _record => this.sureArrive(_record), + iif: item => item.wayBillStatus == '3', + acl: { ability: ['WAYBILL-VEHICLE-wholeUnloadCarInfo'] } + } + ] + } + ]; + } + /** + * 查询字段个数 + */ + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + tabChange(item: any) { + console.log(item); + } + /** + * 重置表单 + */ + resetSF(): void { + this.sf.reset(); + this._$expand = false; + } + search() { + this.st?.load(1); + this.getGoodsSourceStatistical(); + } + selectChange(e: number) { + console.log(e); + this.resourceStatus = e; + this.initST(); + setTimeout(() => { + this.st.load(1); + }, 500); + } + /** + * 导入货源 + */ + importGoodsSource() {} + /** + *查看评价 + */ + viewEvaluate(item: any) { + console.log(item); + this.isVisibleEvaluate = true; + } + getGoodsSourceStatistical() { + this.tabs = { + signQuantity: 0, + cancelQuantity: 0, + receivedQuantity: 0, + stayQuantity: 0, + totalQuantity: 0, + compolatelQuantity: 0, + deltQuantity: 0 + }; + const params: any = Object.assign({}, this.reqParams || {}); + delete params.wayBillStatus; + this.service.request(this.service.$api_get_getWholeStatistics, params).subscribe(res => { + if (res) { + let totalCount = 0; + res.forEach((ele: any) => { + switch (ele.wayBillStatus) { + case '1': + this.tabs.stayQuantity = ele?.count; + break; + case '2': + this.tabs.receivedQuantity = ele?.count; + break; + case '3': + this.tabs.cancelQuantity = ele?.count; + break; + case '4': + this.tabs.signQuantity = ele?.count; + break; + case '5': + this.tabs.compolatelQuantity = ele?.count; + break; + case '6': + this.tabs.deltQuantity = ele?.count; + break; + } + totalCount += ele.count; + }); + this.tabs.totalQuantity = totalCount; + } + }); + } + // *确认发车 + + sureDepart(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认发车', + nzWidth: '50%', + nzContent: VehicleSureDepartComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical(); + }); + } + // 确认到车 + sureArrive(item: any) { + const modalRef = this.modal.create({ + nzTitle: '确认到车', + nzWidth: '50%', + nzContent: VehicleSureArriveComponent, + nzComponentParams: { + i: item, + Status: 1 + }, + nzFooter: null + }); + modalRef.afterClose.subscribe((result: any) => { + this.st.load(1); + this.getGoodsSourceStatistical(); + }); + } + // 导出 + exprot() { + this.service.asyncExport(this.reqParams, this.service.$api_asyncExportWholeList); + } +} diff --git a/src/app/routes/waybill-management/services/waybill-management.service.ts b/src/app/routes/waybill-management/services/waybill-management.service.ts new file mode 100644 index 00000000..da36a391 --- /dev/null +++ b/src/app/routes/waybill-management/services/waybill-management.service.ts @@ -0,0 +1,72 @@ +import { WaybillManagementBulkComponent } from './../components/bulk/bulk.component'; +/* + * @Author: your name + * @Date: 2021-12-07 14:52:29 + * @LastEditTime : 2022-03-28 11:13:50 + * @LastEditors : Shiming + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\services\\waybill-management.service.ts + */ +import { Injectable, Injector } from '@angular/core'; +import { BaseService } from 'src/app/shared/services'; + +@Injectable({ + providedIn: 'root' +}) +export class WaybillManagementServe extends BaseService { + $api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表 + // 据 手机号/姓名 查询 车队长/司机 + $api_get_getDriverInfo = `/api/mdc/cuc/user/getDriverInfo`; + // 查询整车运单-运营后台 + $api_get_wholePage = `/api/sdc/wayBillOperate/listWholePage`; + // 查询整车运单详情-运营后台 + $api_get_getWholeDetail = `/api/sdc/wayBillOperate/getWholeDetail`; + + // 查询大宗运单-运营后台 + $api_get_Bulkpage = `/api/sdc/wayBillOperate/listBulkPage`; + // 查询大宗运单详情-运营后台 + $api_get_getBulkDetail = `/api/sdc/wayBillOperate/getBulkDetail`; + + // 整车运单分类统计 + $api_get_getWholeStatistics = `/api/sdc/wayBillOperate/getWholeStatistics`; + // 大宗运单分类统计 + $api_get_getBulkStatistics = `/api/sdc/wayBillOperate/getBulkStatistics`; + + // 根据车牌号查询车辆信息 + $api_get_getCarLicenseListByCarNo = `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`; + + // 大宗确认发车 + $api_get_insertBulkStartCarInfo = `/api/sdc/wayBillOperate/insertBulkStartCarInfo`; + // 整车确认发车 + $api_get_insertWholeStartCarInfo = `/api/sdc/wayBillOperate/insertWholeStartCarInfo`; + // 整车确认到车 + $api_get_insertWholeUnloadCarInfo = `/api/sdc/wayBillOperate/insertWholeUnloadCarInfo`; + // 大宗确认到车 + $api_get_insertBulkUnloadCarInfo = `/api/sdc/wayBillOperate/insertBulkUnloadCarInfo`; + // 确认到车界面信息(两个只能看的图片) + $api_get_getUnloadCarInfo = `/api/sdc/wayBillOperate/getUnloadCarInfo`; + + // 查询CRM客户信息表 + $api_get_crmCustomer_page = '/api/mdc/cuc/crmCustomer/list/page'; + + // 查询运营端异常上报 + $api_get_listOperatePage = '/api/sdc/exceptionReport/listOperatePage'; + // 查询运营端异常上报数据统计 + $api_get_listOperateStatus = '/api/sdc/exceptionReport/listOperateStatus'; + // // 查询运营端已回复异常上报 + // $api_get_listOperateReplyPage = '/api/sdc/exceptionReport/listOperateReplyPage'; + // 获取轨迹 + $api_get_getTrajectory = `/api/sdc/billShipper/getTrajectoryByBillId`; + // 获取订单司机轨迹 + $api_get_getAppDriverPosition = `/api/sdc/wayBillOperate/getAppDriverPosition`; + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; + + // 异步导出运营后台大宗运单列表 + public $api_asyncExportBulkList = '/api/sdc/wayBillOperate/asyncExportBulkList'; + // 异步导出运营后台整车运单列表 + public $api_asyncExportWholeList = '/api/sdc/wayBillOperate/asyncExportWholeList'; + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/routes/waybill-management/waybill-management-routing.module.ts b/src/app/routes/waybill-management/waybill-management-routing.module.ts new file mode 100644 index 00000000..f2b1025f --- /dev/null +++ b/src/app/routes/waybill-management/waybill-management-routing.module.ts @@ -0,0 +1,28 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:31:52 + * @LastEditTime: 2021-12-07 14:56:57 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\order-management-routing.module.ts + */ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { WaybillManagementAbnormalAppearComponent } from './components/abnormal-appear/abnormal-appear.component'; +import { WaybillManagementBulkeDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { WaybillManagementBulkComponent } from './components/bulk/bulk.component'; +import { WaybillManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; +import { WaybillManagementVehicleComponent } from './components/vehicle/vehicle.component'; + +const routes: Routes = [ + { path: 'vehicle', component: WaybillManagementVehicleComponent }, + { path: 'vehicle/vehicle-detail/:id', component: WaybillManagementVehicleDetailComponent }, + { path: 'bulk', component: WaybillManagementBulkComponent }, + { path: 'bulk/bulk-detail/:id', component: WaybillManagementBulkeDetailComponent }, + { path: 'abnormal-appear', component: WaybillManagementAbnormalAppearComponent }, +] +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class WaybillManagementRoutingModule { } diff --git a/src/app/routes/waybill-management/waybill-management.module.ts b/src/app/routes/waybill-management/waybill-management.module.ts new file mode 100644 index 00000000..38974b09 --- /dev/null +++ b/src/app/routes/waybill-management/waybill-management.module.ts @@ -0,0 +1,34 @@ +/* + * @Author: your name + * @Date: 2021-12-03 15:31:52 + * @LastEditTime: 2021-12-07 15:20:01 + * @LastEditors: Please set LastEditors + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \tms-obc-web\src\app\routes\order-management\order-management.module.ts + */ +import { NgModule, Type } from '@angular/core'; +import { SharedModule } from '@shared'; +import { WaybillManagementAbnormalAppearComponent } from './components/abnormal-appear/abnormal-appear.component'; +import { WaybillManagementBulkeDetailComponent } from './components/bulk-detail/bulk-detail.component'; +import { WaybillManagementBulkComponent } from './components/bulk/bulk.component'; + +import { WaybillManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; + +import { WaybillManagementVehicleComponent } from './components/vehicle/vehicle.component'; +import { WaybillManagementRoutingModule } from './waybill-management-routing.module'; +const COMPONENTS: Type[] = [ + WaybillManagementVehicleComponent, + WaybillManagementVehicleDetailComponent, + WaybillManagementBulkComponent, + WaybillManagementBulkeDetailComponent, + WaybillManagementAbnormalAppearComponent +]; + +@NgModule({ + imports: [ + SharedModule, + WaybillManagementRoutingModule + ], + declarations: COMPONENTS, +}) +export class WaybillManagementModule { } diff --git a/src/app/shared/components/account-detail/account-detail.component.html b/src/app/shared/components/account-detail/account-detail.component.html new file mode 100644 index 00000000..a9bc8438 --- /dev/null +++ b/src/app/shared/components/account-detail/account-detail.component.html @@ -0,0 +1,22 @@ + + + + {{ item.paAccount || '添加' }} + + + {{ item.pfAccount || '添加' }} + + \ No newline at end of file diff --git a/src/app/shared/components/account-detail/account-detail.component.ts b/src/app/shared/components/account-detail/account-detail.component.ts new file mode 100644 index 00000000..a0b1a133 --- /dev/null +++ b/src/app/shared/components/account-detail/account-detail.component.ts @@ -0,0 +1,106 @@ +import { CurrencyPipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { BaseService } from '../../services'; + +@Component({ + selector: 'app-account-detail', + templateUrl: './account-detail.component.html', + providers: [CurrencyPipe] +}) +export class AccountDetailComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + columns: STColumn[] = []; + + url = '/api/fcc/accountBalance/getDriverAccountDetailByOperator'; + + isCanCreate = false; + params: any = {}; + constructor(public service: BaseService, public currencyPipe: CurrencyPipe, private modalHelp: NzModalRef) { + this.initST(); + } + + ngOnInit(): void {} + createAccount(item: any, type: '1' | '2') { + if ((type === '1' && item.paAccount) || (type === '2' && item.pfAccount)) { + return; + } + const params = { + ltdId: item.ltdId || this.params.ltdId, + roleId: item.roleId || this.params.roleId, + projectId: item.projectId || this.params.projectId, + enterpriseId: item.enterpriseId || this.params.roleId, + ctfId: this.params.ctfId, + clientName: this.params.clientName, + roleName: this.params.clientName + }; + if (this.params.accountType === 1) { + this.service + .request('/api/fcc/accountBalance/saveByShipper', { + accountType: this.params.accountType, + bankType: type, + isProjectMain: 0, + ...params + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(type === '1' ? res?.paMsg : res?.pfMsg); + this.modalHelp.destroy(); + } + }); + } + if (this.params.accountType === 2) { + this.service + .request('/api/fcc/accountBalance/saveByDriver', { + accountType: this.params.accountType, + bankType: type, + ...params + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(type === '1' ? res?.paMsg : res?.pfMsg); + this.modalHelp.destroy(); + } + }); + } + } + + beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, this.params); + return requestOptions; + }; + + initST() { + this.columns = [ + { title: '网络货运人', index: 'ltdName', className: 'text-center' }, + { + title: '平安资金账户', + render: 'paAccount', + className: 'text-center', + iif: _ => this.isCanCreate + }, + { + title: '浦发资金账户', + render: 'pfAccount', + className: 'text-center', + iif: _ => this.isCanCreate + }, + { + title: '平安账户余额', + render: 'paBalance', + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.paBalance)}`, + iif: _ => !this.isCanCreate + }, + { + title: '浦发账户余额', + render: 'pfBalance', + className: 'text-right', + format: item => `${this.currencyPipe.transform(item.pfBalance)}`, + iif: _ => !this.isCanCreate + } + ]; + } +} diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.html b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.html new file mode 100644 index 00000000..2b5b369d --- /dev/null +++ b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.html @@ -0,0 +1,15 @@ + +
    +
    +
    巡航倍数 :
    +
    \ No newline at end of file diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.less b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts new file mode 100644 index 00000000..1c810c67 --- /dev/null +++ b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts @@ -0,0 +1,296 @@ +import AMapLoader from '@amap/amap-jsapi-loader'; +import { Component, Input, OnChanges, OnInit, Output, SimpleChanges, EventEmitter, OnDestroy } from '@angular/core'; +import { amapConf } from '@conf/amap.config'; +import { InputNumber } from '@delon/util'; +import { throwError } from 'rxjs'; +import { BaseService } from 'src/app/shared/services'; +import { AmapService, InfoItem, MapList, PathList, POI } from '../amap.service'; +declare var AMap: any; +declare var AMapUI: any; +declare var Loca: any; + +const CONFIG = amapConf; +@Component({ + selector: 'amap-path-simplifier', + templateUrl: './amap-path-simplifier.component.html', + styleUrls: ['./amap-path-simplifier.component.less'] +}) +export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy { + aMap: any; + pathSimplifierIns: any; + geocoder: any; + navigator: any; + infoWindow: any; + markerList: any; + SimpleMarker: any; + // 简单路径信息 + @Input() + mapList: MapList[] = []; + // 完整路线图信息 + @Input() + pathList: PathList[] = []; + // 当前选中路线图下标 + @Input() + selectedIndex = 0; + // 巡航倍数 + @InputNumber() + navSpeed = 1; + // 标点数组 + @Input() + pois: POI[] = []; + private _pois: any = []; + + @Input() + mapWidth = '800px'; + @Input() + mapHeight = '500px'; + + @Output() + readonly clcikPointEvent = new EventEmitter(); + + constructor(public service: BaseService, private amapService: AmapService) {} + ngOnChanges(changes: SimpleChanges): void { + // 路线图变更: 设置路线图, 指定路线图 + if (changes?.pathList?.currentValue && this?.pathSimplifierIns) { + this.setData(changes.pathList?.currentValue); + this.setPathIndex(this.selectedIndex); + } + // 路径信息变更: 更新路线图, 设置路线图, 指定路线图, 获取终点地址信息并标点 + if (changes?.mapList?.currentValue && this?.pathSimplifierIns && changes.mapList?.currentValue.length > 0) { + // console.log(this.mapList); + this.pathList = [ + { + name: '路线1', + points: changes.mapList?.currentValue + } + ]; + this.setData(this.pathList); + this.setPathIndex(this.selectedIndex); + this.getPoiByPositon(this.mapList[this.mapList?.length - 1]?.lnglat); + } + // 标点列表变更: 更新标点数据, 绘画标点 + if (changes?.pois?.currentValue) { + // console.log(this.pois); + this._pois = changes?.pois?.currentValue; + if (this?.markerList && this._pois.length > 0) { + this.markerList.render(this._pois); + } + } + } + ngOnInit(): void { + this.mapInit(); + } + ngOnDestroy(): void { + // 销毁地图数据 + if (this.aMap) { + this.aMap.destroy(); + } + } + + /** 地图初始化 */ + mapInit() { + AMapLoader.load({ + key: CONFIG.key, + version: CONFIG.version, + plugins: [ + // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + 'AMap.PathSimplifier', + 'AMap.InfoWindow', + 'AMap.Geocoder' + ], + AMapUI: { + version: CONFIG.AMapUIVersion, + plugins: ['misc/PathSimplifier'] // 需要加载的 AMapUI ui插件 + } + }) + .then(AMap => { + this.aMap = new AMap.Map('container', { + zoom: 10 + }); + + this.aMap.on('complete', () => { + // this.service.msgSrv.info('地图加载完成 !'); + // 信息窗口 + this.infoWindow = new AMap.InfoWindow({ + offset: new AMap.Pixel(0, -40) + }); + // 初始化定位工具 + this.geocoder = new AMap.Geocoder({ + radius: 500 //范围,默认:500 + }); + this.pathInit(); + this.setPOIS(); + }); + }) + .catch(e => { + throwError(e); + }); + } + + /** 初始化路径工具 */ + pathInit() { + this.pathSimplifierIns = new AMapUI.PathSimplifier({ + zIndex: 100, + //autoSetFitView:false, + map: this.aMap, + // 重组路径数据 + getPath: (pathData: PathList, pathIndex: number) => pathData.points.map(points => points.lnglat), + // 鼠标悬浮事件 + getHoverTitle: (pathData: PathList, pathIndex: number, pointIndex: number) => '', + renderOptions: { + renderAllPointsIfNumberBelow: 20 //绘制路线节点,如不需要可设置为-1 + } + }); + this.setData(this.pathList); + + if (this.pathList.length > 0) { + this.setPathIndex(this.selectedIndex); + } + + this.pathSimplifierIns.on('pointClick', (e: any, info: any) => { + this.clcikPointEvent.emit({ e, info }); + // 弹出信息窗口 + if (info) { + this.geocoder.getAddress(info.pathData.points[info.pointIndex].lnglat, (status: any, result: any) => { + if (status === 'complete' && result.info === 'OK') { + // result中对应详细地理坐标信息 + this.selectedPOI({ + position: info.pathData.points[info.pointIndex].lnglat, + content: ` +