Commit bf1ff55ded56760db8717cf366efe597fd39c28b

Authored by DESKTOP-P23T5P2\NewTeryEiEi
1 parent cb492052
Exists in master

ปุ่มค้นหา department หน้า after service

src/app/dashboard/dashboard.component.html
... ... @@ -721,6 +721,10 @@
721 721 </div>
722 722 <br>
723 723 <br>
  724 + <button type="button" class="btn btn-circle button" *ngFor="let nameD of ButtonValueDepart" (click)="getButton7Depart(nameD.valueN);getButton7DepartOnhold(nameD.valueN);"
  725 + style="margin-left: 5px; margin-top: 10px;">{{ nameD.name }}
  726 + </button>
  727 + <hr>
724 728 <button type="button" class="btn btn-circle button" *ngFor="let name of ButtonValue" (click)="getButton7(name.valueN);getButton7Onhold(name.valueN);"
725 729 style="margin-left: 5px; margin-top: 10px;"><span class="badge2" [hidden]="!name.num1" style="float: right; position: absolute; margin-top: -15px; margin-left: 19px;"> {{ name.num1 }} </span> {{ name.name }}
726 730 </button>
... ...
src/app/dashboard/dashboard.component.ts
... ... @@ -817,6 +817,7 @@ export class DashboardComponent implements OnInit {
817 817 r.birth_date = this._common.convertDate(r.birth_date);
818 818 this.resultNum7 = this.resultData7.length;
819 819 this.Show7.push(r);
  820 + this.Show7Depart.push(r);
820 821 this.Type7.push(r.type);
821 822 t7.push(r.type);
822 823 r.t7 = t7;
... ... @@ -894,6 +895,7 @@ export class DashboardComponent implements OnInit {
894 895 this.resultDataOnHold7[i].link = this._common.decodeURI(this.resultDataOnHold7[i].link);
895 896 this.resultDataOnHold7[i].birth_date = this._common.convertDate(this.resultDataOnHold7[i].birth_date);
896 897 this.Show7Onhold.push(this.resultDataOnHold7[i]);
  898 + this.Show7DepartOnhold.push(this.resultDataOnHold7[i]);
897 899 }
898 900 } else {
899 901 this.resultDataOnHold7 = [];
... ... @@ -1218,6 +1220,7 @@ setInterval(async () =&gt; {
1218 1220  
1219 1221 }
1220 1222  
  1223 + /* getbutton2 */
1221 1224 getButton2(valueN) {
1222 1225 console.log(valueN);
1223 1226  
... ... @@ -1273,6 +1276,7 @@ setInterval(async () =&gt; {
1273 1276 this.resultDataOnHold2 = resultArray;
1274 1277 }
1275 1278  
  1279 + /* getbutton3 */
1276 1280 getButton3(valueN) {
1277 1281 console.log(valueN);
1278 1282  
... ... @@ -1328,6 +1332,7 @@ setInterval(async () =&gt; {
1328 1332 this.resultDataOnHold3 = resultArray;
1329 1333 }
1330 1334  
  1335 + /* getbutton4 */
1331 1336 getButton4(valueN) {
1332 1337 console.log(valueN);
1333 1338  
... ... @@ -1383,6 +1388,7 @@ setInterval(async () =&gt; {
1383 1388 this.resultDataOnHold4 = resultArray;
1384 1389 }
1385 1390  
  1391 + /* getbutton5 */
1386 1392 getButton5(valueN) {
1387 1393 console.log(valueN);
1388 1394  
... ... @@ -1438,6 +1444,7 @@ setInterval(async () =&gt; {
1438 1444 this.resultDataOnHold5 = resultArray;
1439 1445 }
1440 1446  
  1447 + /* getbutton6 */
1441 1448 getButton6(valueN) {
1442 1449 console.log(valueN);
1443 1450  
... ... @@ -1500,6 +1507,7 @@ setInterval(async () =&gt; {
1500 1507 this.resultDataOnHold6 = resultArray;
1501 1508 }
1502 1509  
  1510 + /* getbutton7 */
1503 1511 getButton7(valueN) {
1504 1512 console.log(valueN);
1505 1513  
... ... @@ -1534,6 +1542,41 @@ setInterval(async () =&gt; {
1534 1542 this.resultData7 = resultArray;
1535 1543 }
1536 1544  
  1545 + getButton7Depart(valueN) {
  1546 + console.log(valueN);
  1547 +
  1548 + if (this.Show7Depart.length === 0) {
  1549 + return this.Show7Depart;
  1550 + }
  1551 +
  1552 + const resultArray = [];
  1553 + for (const item of this.Show7Depart) {
  1554 + // console.log('item: ', item);
  1555 +
  1556 + let st = '';
  1557 +
  1558 + if (item['department']) {
  1559 + st = item['department'].toLowerCase();
  1560 + }
  1561 +
  1562 + const string2 = valueN.toLowerCase();
  1563 + if (st.startsWith(string2)) {
  1564 + console.log(st);
  1565 + resultArray.push(item);
  1566 + }
  1567 +
  1568 + }
  1569 + if (resultArray.length === 0) {
  1570 + if (valueN !== '') {
  1571 + this.showSecret1 = true;
  1572 + }
  1573 + } else if (resultArray.length > 0) {
  1574 + this.showSecret1 = false;
  1575 + }
  1576 + this.resultData7 = resultArray;
  1577 +
  1578 + }
  1579 +
1537 1580 /* buttondataOnhold7 */
1538 1581 getButton7Onhold(valueN) {
1539 1582 console.log(valueN);
... ... @@ -1570,6 +1613,42 @@ setInterval(async () =&gt; {
1570 1613  
1571 1614 }
1572 1615  
  1616 + getButton7DepartOnhold(valueN) {
  1617 + console.log(valueN);
  1618 +
  1619 + if (this.Show7DepartOnhold.length === 0) {
  1620 + return this.Show7DepartOnhold;
  1621 + }
  1622 +
  1623 + const resultArray = [];
  1624 + for (const item of this.Show7DepartOnhold) {
  1625 + // console.log('item: ', item);
  1626 +
  1627 + let st = '';
  1628 +
  1629 + if (item['department']) {
  1630 + st = item['department'].toLowerCase();
  1631 + }
  1632 +
  1633 + const string2 = valueN.toLowerCase();
  1634 + if (st.startsWith(string2)) {
  1635 + console.log(st);
  1636 + resultArray.push(item);
  1637 + }
  1638 +
  1639 + }
  1640 + if (resultArray.length === 0) {
  1641 + if (valueN !== '') {
  1642 + this.showSecret2 = true;
  1643 + }
  1644 + } else if (resultArray.length > 0) {
  1645 + this.showSecret2 = false;
  1646 + }
  1647 + this.resultDataOnHold7 = resultArray;
  1648 +
  1649 + }
  1650 +
  1651 + /* getbutton8 */
1573 1652 getButton8(valueN) {
1574 1653 console.log(valueN);
1575 1654  
... ... @@ -1640,6 +1719,7 @@ setInterval(async () =&gt; {
1640 1719  
1641 1720 }
1642 1721  
  1722 +/* getbutton9 */
1643 1723 getButton9(valueN) {
1644 1724 console.log(valueN);
1645 1725  
... ...