cost-orderOutlog-view.vue 129 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675
<style scoped>
    .ctable .ct-row .row-line>.ct-col {


        overflow: inherit;

    }
    .datetime-picker{
        padding-top: 5px;
    }
</style>
<template>
    <div class="container resource close-left-menu contaNEW">
        <div class="pop-banner clearfix">
            <div class="operate-btns" style='width:100%;'>
                <!-- <a href="javascript:history.go(-1)" class="fbtn fb-return">返回</a> -->
                <a v-on:click="delCkdl()" class="fbtn fb-del"
                   v-if="'/supplier/trdo:deleteTrsupplierdoCkdl' | myqx trdo.billstate==ctns.dobillstated01||trdo.billstate==null">删除</a>
                <a v-on:click="submitDivSh()" class="fbtn fb-submit" v-show="sumitSh">提交</a>
                <!-- <a class="fbtn fb-submit" v-show="!sumitSh"
                   v-if="'/supplier/trdo:submitTrsupplierdoCkdl' | myqx trdo.billno!=null&&(trdo.billstate==ctns.dobillstated01||trdo.billstate==null)">提交</a> -->
                <a v-on:click="saveCkdl()" class="fbtn fb-save" v-show="saveSh"
                   v-if="'/supplier/trdo:saveTrsupplierdoCkdl' | myqx trdo.billstate==ctns.dobillstated01||trdo.billstate==null">保存</a>
                <a class="fbtn fb-save" v-show="!saveSh"
                   v-if="'/supplier/trdo:saveTrsupplierdoCkdl' | myqx trdo.billstate==ctns.dobillstated01||trdo.billstate==null">保存</a>
                <a v-on:click="printTag(trdo.guid)" v-show="btn"
                   v-if="'/supplier/print:printTag' | myqx (trdo.billtype=='02' && (trdo.billstate=='D02' || trdo.billstate=='D03')) "
                   class="fbtn fb-Print">打印高值追溯标签</a>
                <!--    <a v-on:click="printYsd()"
                      v-if="'/supplier/print:printYsd' | myqx (trdo.billstate=='D02' || trdo.billstate=='D03')"
                      class="fbtn fb-setting">打印质量验收单</a>

                   <a v-on:click="printTags()" class="fbtn fb-setting">打印送货标签</a>
                   <a v-on:click="goTRDoDetailsss(trdo.billno)" class="fbtn fb-lufp">录入发票</a>
                   <a v-on:click="exportTrmedplan(trdo.supplierpobillno)" class="fbtn fb-upload">导出</a> -->
                <!--  <upload-excel-plan :class="['fbtn fb-download']" :tag="tagType" :type="fileType" :label="fileLabel"
                                    :exceltype="med" v-bind:billno="trdo.supplierpobillno"
                                    v-on:file-change="getTipsPlan"></upload-excel-plan> -->
                <a v-on:click="closeTrs()" v-if="'/supplier/trpo:closeTrsupplier' | myqx" class="fbtn fb-close">关闭订单</a>
            </div>
            <h3 class="current-module">高值送货单详情</h3>
        </div>
        <div class="order-outlog">
            <div class="pd-form mb-20">
                <div class="group-row group-row-3 ">
                    <div class="form-group form-label">
                        <label for="cn1" class="label w100">高值送货单号</label>
                        <div class="control">

                            <input type="text" id="cn1" :value="trdo.billno" class="inp6" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn2" class="label">执行状态</label>
                        <div class="control">
                            <input type="text" id="cn2" :value="trdo.billstate | billstate_trdo" class="inp4"
                                   readonly="readonly"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn14" class="label">送货日期</label>
                        <div class="control">
                            <input type="text" id="cn14" :value="trdo.dodate  | getYMD" class="inp4" readonly="readonly"></div>
                    </div>
                </div>
                <div class="group-row group-row-3">
                    <div class="form-group form-label">
                        <label for="cn4" class="label">要货订单</label>
                        <div class="control">
                            <input type="text" id="cn4" :value="trdo.supplierpobillno" class="inp4" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn5" class="label w100">要求到货日期</label>
                        <div class="control">
                            <input type="text" id="cn5" :value="trdo.planenddate | getYMD" class="inp6"
                                   readonly="readonly"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn6" class="label">要货日期</label>
                        <div class="control">
                            <input type="text" id="cn6" :value="trdo.planbegindate | getYMD" class="inp4"
                                   readonly="readonly">
                        </div>
                    </div>
                </div>
                <div class="group-row group-row-3">
                    <div class="form-group form-label">
                        <label for="cn13" class="label">操作人</label>
                        <div class="control">
                            <input type="text" id="cn13" :value="$store.state.user.userName" class="inp3"
                                   readonly="readonly"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn12" class="label">业务员</label>
                        <div class="control">
                            <input type="text" id="cn12" :value="trdo.mkstaffname" class="inp3" readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cc22" class="label">单据类型</label>
                        <div class="control select-style">
                            <select v-model="trdo.billtype" class="inp4" readonly="readonly"  disabled="disabled">
                                <!-- <option v-for="option in HighValueList" v-bind:value="option.value">
                                    {{option.label}}
                                </option> -->
                            </select>
                        </div>
                    </div>
                </div>
                <div class="group-row ">
                    <div class="form-group form-label">
                        <label for="cn7" class="label">要货单位</label>
                        <div class="control">
                            <input type="text" id="cn7" :value="trdo.medname" class="inp4" readonly="readonly"></div>
                    </div>
                    <div class="form-group form-label">
                        <label for="cn8" class="label">收货地点</label>
                        <div class="control">
                            <input type="text" id="cn8" :value="trdo.address" class="inp4" readonly="readonly"></div>
                    </div>
                </div>
                <div class="group-row ">
                    <div class="form-group form-label">
                        <label for="cn7" class="label">备注</label>
                        <div class="control w700">
                            <input type="text" id="cn7" :value="trdo.memo" class="inp2" readonly="readonly"></div>
                    </div>
                </div>
                <div class="group-row">
                    <div class="form-group form-label">
                        <label for="cn9" class="label">UDI码</label>
                        <div class="control">
                            <input type="text" class="inp3 w700" :value="barcode" id="barcodeInput">
                        </div>
                    </div>
                </div>


                <div class="ctable ct-parent mt-20">
                    <div class="ct-head">
                        <span class="ct-col w30"></span>
                        <span class="ct-col w50">序号</span>
                        <span class="ct-col w130">商品</span>
                        <span class="ct-col w100">单价</span>
                        <span class="ct-col w120">批号</span>
                        <span class="ct-col w120">灭菌批号</span>
                        <span class="ct-col w80">要货数</span>
                        <span class="ct-col w80">送货数</span>
                        <span class="ct-col w80">已送货数</span>
                        <span class="ct-col w90">金额(元)</span>
                        <span class="ct-col w120">操作</span>
                    </div>
                    <div class="ct-row mt-0 pt10" id="warp2{{$index}}" v-for="(one,cus) in mxList " track-by="$index">
                        <div class="row-line">
                            <span class="ct-col w30 mt-5">
                                <img src="/images/consumable.png" alt="" v-if='trdo.billtype=="H02" || cus.do_supplier_pesentqty>=2 || cus.do_supplier_pesentqty == 0 || trdo.billtype=="02"'>
                            </span>
                            <span class="ct-col w50">{{$index+1}}</span>
                            <span class="ct-col w130 t-left pr10">{{cus.suppliergoodscode}}
                                <br>
                               <span class="p-tit-green"> {{cus.suppliergoodsname}}</span>
                                <br>
                                {{cus.suppliergoodsspec}}
                                <br>
                                {{cus.producer}}
                                <br>
                                {{cus.register}}
                            </span>
                            <span class="ct-col w100 pr10 t-right">
                                {{cus.supplierprice | numDigit 2 }}
                                <br><span class="table-detail-text">元/{{cus.supplierunit}}</span>
                            </span>
                            <span class="ct-col w120 pr10 pl10 t-right" v-if='trdo.billtype !="H02" && trdo.billtype!="02"'>
                                <input type="text" class="edit-number text-color-green"
                                       @keyup.enter="goTab" v-model="cus.lot" placeholder="批号">
                                    <br>
                                    <datepicker :target.sync="cus.productiondate | getYMD"
                                                @keyup.enter="goTab" :width="'100%'"
                                                :readonly="readonlyFlag" placeholder='生产日期'></datepicker>
                                    <br>
                                    <datepicker :target.sync="cus.expiredate | getYMD"
                                                @keyup.enter="goTab" :width="'100%'"
                                                :readonly="readonlyFlag" placeholder='有效期至'></datepicker>
                            </span>
                            <span class="ct-col w120 pr10 pl10 t-right" v-if='trdo.billtype !="H02" && trdo.billtype!="02"'>
                                 <input type = "text" class="edit-number text-color-green" 
                                        @keyup.enter="goTab" v-model="cus.sterilantlot"  placeholder='灭菌批号'>
                                 <br>
                                  <datepicker :target.sync="cus.sterilantdate | getYMD"
                                              @keyup.enter="goTab" :width="'100%'"
                                              :readonly="readonlyFlag" placeholder='灭菌日期'></datepicker>
                                      <br>
                                <datepicker :target.sync="cus.sterilantexpdate | getYMD"
                                            @keyup.enter="goTab" :width="'100%'"
                                            :readonly="readonlyFlag" placeholder='灭菌效期'></datepicker>

                            </span>
                            <span class="ct-col w240 pr10 pl10 t-right" v-else>
                            </span>
 
                            <span  class="ct-col w80 activate isFocus" v-if='trdo.billtype=="H02" || cus.purchaserpoqty>=2 || trdo.billtype=="02" || trdo.billtype=="H03"'>
                              <a href="javascript:;" @click="slidedown($index,cus.purchaserGoodsguid,cus.billno)"  class="txt_underline  status-switch text-color-blue"> {{ cus.purchaserpoqty }} {{ cus.purchaserunit }}</a>
                           </span>

                           <span  class="ct-col w80  activate t-right pr10" v-else>
                               <input type="text" class="edit-number t-right" v-model="cus.do_supplier_pesentqty | valNum">
                               <br>
                               <span class="table-detail-text">{{cus.supplierunit}}</span>
                           </span>

                            <span class="ct-col w80" :class='{"pt20 t-right pr10":cus.suppliergoodscode!="耗材包"}'>
                                <input type="text" v-model=" cus.do_supplier_pesentqty" style="width: 50%;">{{ cus.supplierunit }}
                          
                                
                           </span>
                            
                            
                            <span  class="ct-col w80  activate t-right pr10">
                               {{cus.supplierarrivalqty}}
                               <br>
                               <span class="table-detail-text">{{cus.supplierunit}}</span>
                           </span>
                            <span class="ct-col w90 t-right pr10">{{cus.taxsum | numDigit 2 }}</span>

                            <span class="ct-col w120" v-if='trdo.billtype=="H02" || trdo.billtype=="02"'>
                               <a href="javascript:;" class="btn button-red" @click='deleteLin($index)'>删除</a>
                           </span>
                            <!-- 只有商品才可以复制 -->
                            <span class="ct-col w120" v-else>
                                <div class="from-button" >
                                  <a href="javascript:;" @click='copy(cus,$index)' class="green-button p-lr-10">复制<i>|</i></a>
                                  <a href="javascript:;" @click='deleteLin($index)' class="red-button p-lr-10">删除</a>
                                </div>
                           </span>

                        </div>
                        <div class="row-launch" style="display: none;" v-if="trdo.billtype=='H02' || trdo.billtype=='02'">
                            <h3>品规数({{cus.parasite.length}}</h3>
                            <table class="itable mb-30">
                                <thead>
                                <tr>
                                    <th class="w50">序号</th>
                                    <th class="w120">商品</th>
                                    <th class="w100">单价</th>
                                    <th class="w120">批号</th>
                                    <th class="w120">灭菌批号</th>
                                    <th class="w80">要货数</th>
                                    <th class="w80">送货数</th>
                                    <th class="w80">已送货数</th>
                                    <th class="w100">金额(元)</th>
                                    <th class="w50">耗材类型</th>
                                    <th class="w100">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-if="cus.parasite==null || cus.parasite.length==0">
                                    <td colspan="12">暂无符合条件的记录</td>
                                </tr>
                                <tr v-for="(index,variation) in cus.parasite">
                                    <td >{{ $index + 1 }}</td>
                                    <td class='t-left pr10'>
                                        {{variation.suppliergoodscode}}
                                        <br>
                                        <span class="p-tit-green" style=' color: #4aa8e5;'>{{variation.suppliergoodsname}}</span>
                                        <br>
                                        {{variation.suppliergoodsspec}}
                                        <br>
                                        {{variation.producer}}
                                        <br>
                                        {{variation.register}}
                                    </td>
                                    <td class="t-right pr10">{{variation.supplierprice |numDigit 2}}
                                        <br>
                                        元/{{variation.supplierunit}}</td>
                                    <td class="t-right pr10">
                                        <input type="text" class="edit-number text-color-green"
                                               @keyup.enter="goTab" v-model="variation.lot" placeholder="批号">
                                        <br>
                                        <datepicker :target.sync="variation.productiondate | getYMD"
                                                    @keyup.enter="goTab" :width="'100%'"
                                                    :readonly="readonlyFlag" placeholder='生产日期'></datepicker>
                                        <br>
                                        <datepicker :target.sync="variation.expiredate | getYMD"
                                                    @keyup.enter="goTab" :width="'100%'"
                                                    :readonly="readonlyFlag" placeholder='有效期至'></datepicker>
                                    </td>
                                    <td class="t-right">
                                        <input type="text" class="edit-number text-color-green" 
                                               @keyup.enter="goTab" v-model="variation.sterilantlot" placeholder='灭菌批号'>
                                        <br>
                                        <datepicker :target.sync="variation.sterilantdate | getYMD"
                                                    @keyup.enter="goTab" :width="'100%'"
                                                    :readonly="readonlyFlag" placeholder='灭菌日期'></datepicker>
                                        <br>
                                        <datepicker :target.sync="variation.sterilantexpdate | getYMD"
                                                    @keyup.enter="goTab" :width="'100%'"
                                                    :readonly="readonlyFlag" placeholder='灭菌效期'></datepicker>

                                    </td>
                                    <td class="t-right pr10">
                                        {{variation.supplierpoqty}}  {{variation.supplierunit}}
                                    </td>
                                    <td class="t-right pr10 pt5">
                                        <input type="text" class="edit-number w60 t-right" v-model="variation.do_supplier_pesentqty | valNum">
                                        <br>
                                        {{variation.supplierunit}}
                                    </td>
                                    <td class="t-right pr10">
                                        {{variation.supplierarrivalqty}}
                                        <br>
                                        <span class="table-detail-text">{{variation.supplierunit}}</span>
                                    </td>
                                    <td>
                                        {{variation.taxsum | numDigit 2}}
                                    </td>
                                    <!-- <td>{{variation.isaccessory=='N'?'主料':'辅料'}}</td> -->
                                    <td>{{variation.isaccessory=='N'?'辅料':variation.isaccessory=='Y'?'主料':'工具'}}</td>

                                    <td>
                                        <a href="javascript:;" class="btn button-red" @click='deleteLin($index,one)'>删除</a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="zip" @click="slideup($index)"></div>
                        </div>

                        <div class="row-launch" style="display: none;" v-else>

                            <table class="itable mb-30" >
                                <thead>
                                <tr>
                                    <th class="w60">序号</th>
                                    <th class="w1400">商品编码</th>
                                    <th class="w140">商品名称</th>
                                    <th class="w120">规格</th>
                                    <th class="w140">生产厂家</th>
                                    <th class="w120">注册证号/批准文号</th>
                                    <th class="w100">批号</th>
                                    <th class="w80">数量</th>
                                    <th class="w150">UDI码</th>
                                    
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-if="!cus.udiList">
                                    <td colspan="12">暂无符合条件的记录</td>
                                </tr>
                                <tr v-for="(index,variation) in cus.udiList" >
                                    <td class="w50">{{ $index + 1 }}</td>
                                    <td class='pr10 w120'>{{cus.purchasergoodscode}}</td>
                                    <td class="w100">{{cus.purchasergoodsname}}</td>
                                    <td class="w120">{{cus.purchasergoodsspec}}</td>
                                    <td class="w120">{{cus.producer}}</td>
                                    <td class="w80">{{cus.register}}</td>
                                    <td class=" pr10">{{ !variation.lot ? '' : variation.lot }}</td>
                                    <td class=" pr10">
                                        1{{ cus.purchaserunit }}
                                    </td>
                                    <td class="t-right">
                                        {{ !variation.udiCodes ? '' : variation.udiCodes }}
                                    </td>
                                    
                                </tr>
                                </tbody>
                            </table>
                            
                           
                            <div class="zip" @click="slideup($index)"></div>
                        </div>
                    </div>
                    <!--      <div class="mt-20" style="text-align: center" v-if="getTrMedDeptDoList.length==0">
                             未查询到相关数据!
                         </div> -->
                    <div class="pagination" style="margin: 20px 0">
                        <pagination @page-change="getData" :class="['m-20-0']" :page-no.sync="search.page"
                                    :total-pages.sync="search.totalPages"></pagination>
                    </div>
                </div>

            </div>
        </div>

        <!--star 9-9 弹出导入提示信息-->
        <div class="modal " :class="backMessage1.showDialog=='Y'?'':'hide'">
            <div class="container resource">
                <div class="audit-detail" style="width:540px; margin-left: 250px; padding-right: 10px;">
                    <span class="close-win" v-on:click="closeDialog()"></span>
                    <div class="sdiv-9-9b" style="">
                        <a class="btn-d btn-d-activate btn-d-lg" href="javascript:;">错误信息提示</a>
                    </div>
                    <div class="status-process wbe-0 clearfix pd20"
                         style="padding-top:0px; max-height: 400px; overflow-y: auto;">
                        <p style="color:#606f7a;font-size:14px;">
                        </p>
                        <div class="sp-head sp-headb mb-0" v-for="m in backMessage1.mList">
							<span class="sp-col ml-0">
                    <span class="control radio-control ">
                      <p class="w30 fl">{{m.errorRowNo}}</p>
                      <p class="fl t-center text-color-yellow mr-20">{{m.errorType}}</p>
                      <p class="fl t-center mr-20">{{m.errorGoodCode}}</p>
                      <p class="fl t-center mr-20">{{m.errorGoodName}}</p>
                    </span>
							</span>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <!--star 9-9 受理弹出-->

        <!--star 9-9 提示缺货信息列表-->
        <div class="modal " :class="backMessage.showDialog=='Y'?'':'hide'">
            <div class="container resource">
                <div class="audit-detail ml-0 w1003">
                    <span class="close-win" v-on:click="closeDialog1()"></span>
                    <div class="sdiv-9-9b no-border pb0">
                        <p class="t-center">检测到您有<b
                                class="text-color-yellow">{{listHZ.sl}}</b>个品种送货数量不满足订单数量,依据【{{listHZ.medname}}】医院政策,请填写缺货原因!
                        </p>
                    </div>
                    <div class="status-process wbe-0 clearfix pd20">
                        <p style="color:#606f7a;font-size:14px;">
                        </p>
                        <div class="sp-head sp-headb mb-0">
                            <div class="ctable ct-parentr mt-10"
                                 style="padding-top:0px; max-height: 350px; overflow-y: auto;">
                                <div class="ct-head">
                                    <span class="ct-col w50">序号</span>
                                    <span class="ct-col w270">商品</span>
                                    <span class="ct-col w30"></span>
                                    <span class="ct-col w80 t-right">要货数</span>
                                    <span class="ct-col w100 t-right">本次送货数</span>
                                    <span class="ct-col w100 t-right">缺货</span>
                                    <span class="ct-col w120 t-center ml-20">请选择原因</span>
                                    <span class="ct-col w120  ml-20"></span>
                                </div>
                                <div class="ct-row" v-for="mx in backMessage.mList">
                                    <div class="row-line">
										<span class="ct-col w50  v-top">
                {{$index + 1 | getIndex}}
              </span>
                                        <span class="ct-col w270 t-left break-it  v-top">
                <div class="p-lr-10 break fl  w160">
                  {{mx.supplierGoodscode}}
                  <br>
                  <span class="p-tit-green">{{mx.supplierGoodsname}}</span>
										<br> {{mx.supplierGoodsspec}}
										<br> {{mx.manufacturer}}
										<br>{{mx.registkey}}</div>
									</span>
                                        <span class="ct-col w30">
                <span class="table-detail-icon icon-green"></span>
									<span class="table-detail-icon icon-green"></span>
									</span>

                                        <!--要货数-->
                                        <span class="ct-col w80 t-right  v-top">
                <span class="table-detail-text">
                  {{mx.purchaserPoqty == null ? '0' : mx.purchaserPoqty}}
                  <br>{{mx.purchaserUnit}}</span>
									<span class="table-detail-text">
                  {{mx.supplierPoqty == null ? '0' : mx.supplierPoqty}}
                  <br>{{mx.supplierUnit}}</span>
									</span>
                                        <!--本次送货数-->
                                        <span class="ct-col w100 t-right  v-top">
                <span class="table-detail-text">
                  {{mx.purchaserPesentqty == null ? '0' : mx.purchaserPesentqty}}
                  <br>{{mx.purchaserUnit}}</span>
									<span class="table-detail-text">
                {{mx.supplierPesentqty == null ? '0' : mx.supplierPesentqty}}
                  <br>{{mx.supplierUnit}}</span>
									</span>
                                        <!--缺货数-->
                                        <span class="ct-col w100 t-right">
                <span class="table-detail-text">
                  {{mx.purchaserArrivalqty == null ? '0' : mx.purchaserArrivalqty}}
                  <br>{{mx.purchaserUnit}}</span>
									<span class="table-detail-text">
                  {{mx.supplierArrivalqty == null ? '0' : mx.supplierArrivalqty}}
                  <br>{{mx.supplierUnit}}</span>
									</span>
                                        <!-- 缺货原因 -->
                                        <span class="ct-col w120 t-right  ml-20">
                    <select v-model="mx.memo" @change="selectname($index,mx.memo)">
                      <option v-for="option in shortageselectlist" v-bind:value="option.datavalue">
                        {{option.dataintroduction}}
                      </option>
                    </select>
              </span>
                                        <span class="ct-col w120 t-right  ml-20">
              <input type="text" class="edit-number" v-show="sh[$index]" v-model="mx.varchar1">
              </span>
                                    </div>

                                </div>
                            </div>
                            <div class="w240" style="margin:0 auto;">
                                <button class="btn button-green fl mt-15" v-on:click="closeDialog1()">取 消</button>
                                <button class="btn button-green fr mt-15" v-on:click="commitos()">提 交</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <!--star 9-9 受理弹出-->

        <!--star 9-9 提示缺货信息列表-->
        <div class="modal " :class="backMessage2.showDialog=='Y'?'':'hide'">
            <div class="container resource">
                <div class="audit-detail ml-0 w1003">
                    <span class="close-win" v-on:click="closeDialog()"></span>
                    <div class="sdiv-9-9b no-border pb0">
                        <p class="t-center">检测到您有<b
                                class="text-color-yellow">{{listHZ.sl}}</b>个品种送货数量不满足订单数量,依据【{{listHZ.medname}}】医院政策,请填写缺货原因!
                        </p>
                    </div>
                    <div class="status-process wbe-0 clearfix pd20">
                        <p style="color:#606f7a;font-size:14px;">
                        </p>
                        <div class="sp-head sp-headb mb-0">
                            <div class="ctable ct-parentr mt-10"
                                 style="padding-top:0px; max-height: 350px; overflow-y: auto;">
                                <div class="ct-head">
                                    <span class="ct-col w50">序号</span>
                                    <span class="ct-col w270">商品</span>
                                    <span class="ct-col w30"></span>
                                    <span class="ct-col w80 t-right">要货数</span>
                                    <span class="ct-col w100 t-right">本次送货数</span>
                                    <span class="ct-col w100 t-right">缺货</span>
                                    <span class="ct-col w120 t-center ml-20">请选择原因</span>
                                    <span class="ct-col w120  ml-20"></span>
                                </div>
                                <div class="ct-row" v-for="mx in backMessage2.mList">
                                    <div class="row-line">
									<span class="ct-col w50  v-top">
                {{$index + 1 | getIndex}}
              </span>
                                        <span class="ct-col w270 t-left break-it  v-top">
                <div class="p-lr-10 break fl  w160">
                  {{mx.supplierGoodscode}}
                  <br>
                  <span class="p-tit-green">{{mx.supplierGoodsname}}</span>
									<br> {{mx.supplierGoodsspec}}
									<br> {{mx.manufacturer}}
									<br>{{mx.registkey}}</div>
								</span>
                                        <span class="ct-col w30">
                <span class="table-detail-icon icon-green"></span>
								<span class="table-detail-icon icon-green"></span>
								</span>

                                        <!--要货数-->
                                        <span class="ct-col w80 t-right  v-top">
                <span class="table-detail-text">
                  {{mx.purchaserPoqty == null ? '0' : mx.purchaserPoqty}}
                  <br>{{mx.purchaserUnit}}</span>
								<span class="table-detail-text">
                  {{mx.supplierPoqty == null ? '0' : mx.supplierPoqty}}
                  <br>{{mx.supplierUnit}}</span>
								</span>
                                        <!--本次送货数-->
                                        <span class="ct-col w100 t-right  v-top">
                <span class="table-detail-text">
                  {{mx.purchaserPesentqty == null ? '0' : mx.purchaserPesentqty}}
                  <br>{{mx.purchaserUnit}}</span>
								<span class="table-detail-text">
                {{mx.supplierPesentqty == null ? '0' : mx.supplierPesentqty}}
                  <br>{{mx.supplierUnit}}</span>
								</span>
                                        <!--缺货数-->
                                        <span class="ct-col w100 t-right">
                <span class="table-detail-text">
                  {{mx.purchaserArrivalqty == null ? '0' : mx.purchaserArrivalqty}}
                  <br>{{mx.purchaserUnit}}</span>
								<span class="table-detail-text">
                  {{mx.supplierArrivalqty == null ? '0' : mx.supplierArrivalqty}}
                  <br>{{mx.supplierUnit}}</span>
								</span>
                                        <!-- 缺货原因 -->
                                        <span class="ct-col w120 t-right  ml-20">
                    <select v-model="mx.memo" @change="selectname($index,mx.memo)">
                      <option v-for="option in shortageselectlist" v-bind:value="option.datavalue">
                        {{option.dataintroduction}}
                      </option>
                    </select>
              </span>
                                        <span class="ct-col w120 t-right  ml-20">
              <input type="text" class="edit-number" v-show="sh[$index]" v-model="mx.varchar1">
              </span>
                                    </div>

                                </div>
                            </div>
                            <div class="w240" style="margin:0 auto;">
                                <button class="btn button-green fl mt-15" v-on:click="closeDialog()">取 消</button>
                                <button class="btn button-green fr mt-15" v-on:click="commitOsList()">提 交</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <!--star 9-9 受理弹出-->

        <!--新加提示信息-->
        <!--         <div class="modal " v-show="divbgShow">
                    <div class="container resource">
                        <div class="audit-detail"
                             style="width:300px; margin:300px auto; min-height: 150px; border:0; padding: 15px 0 0px; border-radius: 2px;">
                            <div class="sdiv-9-9b t-center text-color-gray f-size18" style="margin-left: 0; margin-right: 0; ">
                                提示
                            </div>
                            <div class="sdiv-9-9b t-center text-color-gray f-size16"
                                 style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px;">
                                删除成功!
                            </div>
                            <a v-on:click="closeDialog()">
                                <div class="t-center text-color-gray f-size16"
                                     style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px; cursor: pointer;">
                                    确定
                                </div>
                            </a>
                        </div>
                    </div>
                </div> -->
        <!--新加提示信息 end-->
        <!--新加提示信息-->
        <div class="modal " v-show="divbgShow1">
            <div class="container resource">
                <div class="audit-detail"
                     style="width:300px; margin:300px auto; min-height: 150px; border:0; padding: 15px 0 0px; border-radius: 2px;">
                    <div class="sdiv-9-9b t-center text-color-gray f-size18" style="margin-left: 0; margin-right: 0; ">
                        提示
                    </div>
                    <div class="sdiv-9-9b t-center text-color-gray f-size16"
                         style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px;">
                        复制成功!
                    </div>
                    <a v-on:click="closeDialog()">
                        <div class="t-center text-color-gray f-size16"
                             style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px; cursor: pointer;">
                            确定
                        </div>
                    </a>
                </div>
            </div>
        </div>
        <!--新加提示信息 end-->
        <!--新加提示信息-->
        <div class="modal " v-show="divbgShow2">
            <div class="container resource">
                <div class="audit-detail"
                     style="width:550px; margin:220px auto; min-height: 150px; border:0; padding: 15px 0 0px; border-radius: 2px;">
                    <div class="sdiv-9-9b t-center text-color-gray f-size18" style="margin-left: 0; margin-right: 0; ">
                        提示
                    </div>
                    <div class="sdiv-9-9b t-center text-color-gray f-size18"
                         style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 100px;  padding:20px 90px 0px 90px">
                        该订单还未完成送货,关闭后将生成缺货信息,需要<b class="text-color-red">慎重操作</b>,请确认是否继续关闭!
                    </div>
                    <a v-on:click="closeDialog()">
                        <div class="sdiv-9-9b t-center text-color-gray f-size18"
                             style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px; cursor: pointer;">
                            取消
                        </div>
                    </a>
                    <div class="t-right text-color-gray f-size14"
                         style="margin-left: 0; margin-right: 0; padding-bottom: 0; padding-right: 20px; height: 30px; line-height: 30px; ">
                        <a v-on:click="closeTrsupplier()">
                            继续
                        </a>
                    </div>

                </div>
            </div>
        </div>
        <!--新加提示信息 end-->
        <!--新加提示信息-->
        <div class="modal " v-show="divbgShow3">
            <div class="container resource">
                <div class="audit-detail"
                     style="width:550px; margin:220px auto; min-height: 150px; border:0; padding: 15px 0 0px; border-radius: 2px;">
                    <div class="sdiv-9-9b t-center text-color-gray f-size18" style="margin-left: 0; margin-right: 0; ">
                        提示
                    </div>
                    <div class="sdiv-9-9b t-center text-color-gray f-size18"
                         style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 100px;  padding:20px 90px 0px 90px">
                        提交后,将发送给医院进行入库,请确保送货信息全部录入完整后再提交!
                    </div>
                    <a v-on:click="closeDialog()">
                        <div class="sdiv-9-9b t-center text-color-gray f-size18"
                             style="margin-left: 0; margin-right: 0; padding-bottom: 0; height: 50px; line-height: 50px; cursor: pointer;">
                            先不提交,我再检查一下
                        </div>
                    </a>
                    <div class="t-right text-color-gray f-size14"
                         style="margin-left: 0; margin-right: 0; padding-bottom: 0; padding-right: 20px; height: 30px; line-height: 30px; ">
                        <a v-on:click="submitCkdl(trdo.billno,trdo.billtype)">
                            确认无误,继续提交
                        </a>
                    </div>

                </div>
            </div>
        </div>

        <!--新加提示信息 end-->
        <div class="roll-bg" v-if='requestS'>
            <div class="w60" style="margin:0 auto;">
                <img src="/images/roll.gif">
            </div>
            <div class="container resource t-center text-color-red">
                正在处理中,请勿关闭!
            </div>
        </div>
        <!-- 两票制弹窗 -->
        <div class="modal backMessage" v-if="showMir">
            <div class="container resource">
                <div class="audit-detail ml-0 w1003 pd20">

                    <section class="epi-form basic-data-form" style='position: relative;'>
                        <span class="close-win" v-on:click="showMir=false"></span>
                        <div class="fheader mb-0">
                            <h4 class="fh-out">送货商品</h4>
                            <div class="stretch">
                                <div class="stretch-pull ml-20" @click='push("pull")' v-if='pullState'>
                                </div>
                                <div class="stretch-push ml-20" @click='pull("pull")' v-else>
                                </div>
                            </div>
                        </div>
                        <div class="fpart clearfix pull " style="position:relative;">
                            <table class="itable itable-thead-13px ">
                                <thead>
                                <tr>
                                    <!--<th class="w40 ">序号</th>-->
                                    <th class="w100 t-left pl10">商品信息</th>
                                    <th class="w40">本次送货</th>
                                    <th class="w40">价格</th>
                                    <th class="w40">送货金额</th>
                                    <th class="w80 t-left">厂商发票</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td class="text-left">
                                        {{goodR.suppliergoodscode}}
                                        <br>
                                        <span class="p-tit-green">{{goodR.suppliergoodsname}}</span>
                                        <br> {{goodR.suppliergoodsspec}}
                                        <br> {{goodR.manufacturer}}
                                        <br>{{goodR.registkey}}
                                    </td>
                                    <td> {{goodR.do_supplier_pesentqty}} {{goodR.supplierunit}}</td>
                                    <td> {{goodR.purchaserprice == null ? '0' : goodR.purchaserprice | numDigit
                                        2 | numFmt}}
                                    </td>
                                    <td>
                                        {{goodR.do_purchaser_pesentqty == null ? '0' : goodR.amount  | numDigit
                                        2 | numFmt}}
                                    </td>
                                    <td class="t-left">
                                        已选择 <span class="p-tit-green">{{goodR.listSize}} </span><br/> 核销数量:<span
                                            class="p-tit-green"> {{goodR.listSum}}</span> {{goodR.supplierunit}}<br/> 欠缺:
                                        <span
                                                class="p-tit-green">{{goodR.do_supplier_pesentqty - goodR.listSum}}  </span>
                                        {{goodR.supplierunit}}
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </section>
                    <p class="pt20  " style="margin-bottom: -25px;">该商品有<span
                            class="p-tit-green f-size16"> {{mfmedgoodsList.length}}</span>条厂商发票,请选择使用: </p>
                    <div style="width: 1000px; height: 250px;overflow-x: scroll;padding-top:0px;" id="content-1"
                         class="content" v-if='mfmedgoodsList.length>0'>
                        <ul class="select-product clearfix mt-20" id="view"
                            :style='{"width":mfmedgoodsList.length*313+"px"}'>
                            <li v-for="(index, mfmedgoods) in mfmedgoodsList" style='width:300px;'>
                                <div
                                        v-bind:class="{'product-item active clearfix' : mfmedgoods.checked, 'product-item clearfix' :!mfmedgoods.checked}">
                                    <div class="product-item-l">
                                        <div class="pro-pic pro-pic-lg" v-if="mfmedgoods.invoicePic">
                                            <imagebox v-bind:imgarr="mfmedgoods.invoicePic | original">
                                                <img class="pro-pic pro-pic-lg" style="margin-top:0px;"
                                                     :src="mfmedgoods.invoicePic | picSrc">
                                                <span class="pic-max blue-search"></span>
                                            </imagebox>
                                        </div>
                                        <div v-else>
                                            <img class="pro-pic pro-pic-lg" src="/images/default.jpg">
                                        </div>
                                        <div class="checkbox-control" v-if="mfmedgoods.checkable && mfmedgoods.doNum">
                                            <input type="checkbox" id="pro{{$index}}" v-model="mfmedgoods.checked"
                                                   @change="clickCheck()">
                                            <label class="checkbox" for="pro{{$index}}">选择</label>
                                        </div>
                                        <div v-else class="checkbox-control disabled-checkbox">
                                            <input type="checkbox" id="pro{{$index}}" disabled>
                                            <label class="checkbox" for="pro{{$index}}">{{ $index + 1 }} </label>
                                        </div>
                                    </div>
                                    <div class="product-item-r f-size14" style='height: 150px;'>
                                        <p class="f-size18">
                                            <span class="product-tit">{{ mfmedgoods.invoiceNo }}</span>
                                        </p>
                                        <p><span class="p-tit-green">{{ mfmedgoods.invoiceNum }}</span>
                                            {{goodR.supplierunit}} </p>
                                        <p><span class="ibox">开票时间:</span>{{ mfmedgoods.invoiceDate | getYMD }}</p>
                                        <p><span class="ibox">已核销:</span>{{ mfmedgoods.usedNum }} {{goodR.supplierunit}}
                                        </p>
                                        <p class="p-tit-green"><span
                                                class="ibox">可用:</span>{{ mfmedgoods.doNum}} {{goodR.supplierunit}}</p>

                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div v-if="goodR.listSum!=0" class="w280" style="margin:0 auto;">
                        <button class="btn button-green " @click="showMir=false">取 消</button>
                        <button class="btn button-red ml-20 mr-20" @click="resetmirBySupGoods()">重 置</button>
                        <button class="btn button-green " @click.once="savemirBySupGoods()" v-if="canSaveMir">保 存
                        </button>
                        <button class="btn button-green " v-else>保 存</button>

                    </div>
                    <div v-else class="w250" style="margin:0 auto;">
                        <button class="btn button-green " style="margin-right: 81px;" @click="showMir=false">取 消
                        </button>
                        <button class="btn button-green " @click.once="savemirBySupGoods()" v-if="canSaveMir">保 存
                        </button>
                        <button class="btn button-green " v-else>保 存</button>

                    </div>

                </div>
            </div>

        </div>
        <div class="modal" v-if='getListFlag'>
            <div class="container resource">
                <div class="audit-detail" style="margin:100px auto;width:1000px;padding:30px;">
                    <span class="close-win" @click='getListFlag=false'></span>
                    <h3 class="text-color-blue">品规数({{getList.length}}</h3>
                    <table class="itable mb-30">
                        <thead>
                        <tr>
                            <th class="w50">序号</th>
                            <th class="w120">商品</th>
                            <th class="w80">规格</th>
                            <th class="w120">生产厂商</th>
                            <th class="w120">注册证号/批准文号</th>
                            <th class="w100">单价</th>
                            <th class="w80">要货数</th>
                            <th class="w80">送货数</th>
                            <th class="w100">金额(元)</th>
                            <th class="w100">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-if="getList==null || getList.length==0">
                            <td colspan="12">暂无符合条件的记录</td>
                        </tr>
                        <tr v-for="(index,variation) in getList" >
                            <td >{{ $index + 1 }}</td>
                            <td class='t-left pr10'>
                                {{variation.suppliergoodscode}}
                                <br>
                                <span class="p-tit-green" style=' color: #4aa8e5;'>{{variation.suppliergoodsname}}</span>
                            </td>
                            <td>{{variation.suppliergoodsspec}}</td>
                            <td class='t-left'>{{variation.producer}}</td>
                            <td>{{variation.regiterkey}}</td>
                            <td class="t-right pr10">{{variation.supplierprice |numDigit 2}}
                                <br>
                                元/{{variation.supplierunit}}</td>
                            <td class="t-right pr10">
                                {{variation.supplierpoqty}}
                                <br>
                                {{variation.supplierunit}}
                            </td>
                            <td class="t-right pr10 pt5">
                                <input type="text" class="edit-number w60 t-right" v-model="variation.do_supplier_pesentqty | valNum">
                                <br>
                                {{variation.supplierunit}}
                            </td>

                            <td>
                                {{variation.taxsum |numDigit 2}}
                            </td>
                            <td>
                                <a href="javascript:;" class="btn button-red" @click='deleteLin(indexNum,$index)'>删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>
</template>
<!--送货登录:明细页-->
<script>
const Vue = require('vue');

    module.exports = {
        data: function () {
            return {
                getListFlag:false,
                getList:[],

                fileType: 'file',
                tagType: 'a',
                med: 'cdk',
                fileLabel: '导入',
                trdo: {},
                btn: false,
                sumitSh: true,
                saveSh: true,
                // 明细数据
                mxList: [],
                // 图片数据
                imgcache: [],
                shortagelist: {
                    billno: '',
                },
                sh: [],
                divbgShow: false,
                divbgShow1: false,
                divbgShow2: false,
                divbgShow3: false,
                shortageselectlist: [],
                TrsupplierDoListVO: {
                    billno: '',
                    trpo_billno: '',
                    trsupplierosList: [],
                },
                listHZ: {
                    sl: '',
                    medname: '',
                },
                billno: '', // 送货单编号
                // 保存送货的对象
                doList: {},
                // 删除的条件
                delParams: {},
                backMessage: {
                    showDialog: 'N',
                    mList: [], // 提示信息
                },
                backMessage1: {
                    showDialog: 'N',
                    mList: [], // 提示信息
                },
                backMessage2: {
                    showDialog: 'N',
                    mList: [], // 提示信息
                },
                readonlyFlag: false,
                dateWidth: '80%',
                // 查询条件
                search: {
                    //total: 0,
                    page: 1,
                    pageSize: 100,
                    totalPages: 0,
                    search_trpo_billno: '', // 采购订单编号
                    search_trdo_billno: '', // 送货汇总表编号
                },
                search1: {
                    //total: 0,
                    page: 1,
                    pageSize: 500,
                    totalPages: 0,
                    search_trpo_billno: '', // 采购订单编号
                    search_trdo_billno: '', // 送货汇总表编号
                    search_isShowNull: 'N', // 是否修改汇总单表
                },
                

                goodNumcache: [],

                // 打印质量验收单
                printParam: {
                    guid: '', // 送货汇总单单据编号
                },
                requestS: false,
                showMir: false,
                goodR: '',
                mfmedgoodsList: '',
                mirParam: '',
                canSaveMir: true,
                objParm:'',
                indexNum:'',
                HighValueList:[{
                    value:'H02',
                    label:'跟台高值'
                },{
                    value:'H03',
                    label:'备货高值'
                }],
                barcode:'',
                pList:[],
                currentIndex:0,
                udiList:[],
    //             mxListList:[
    //                 {
    //     "guid": "20240229091453230001",
    //     "rowno": 1,
    //     "billno": "CGD2024022900001",
    //     "ckbillno": null,
    //     "medplanrowno": 1,
    //     "distrbporowno": null,
    //     "ispackage": "N",
    //     "parentpackageguid": null,
    //     "suppliergoodsguid": "24e53850958d4f11b2ec14cafa19e1b0",
    //     "suppliergoodscode": "ZH00842",
    //     "suppliergoodsname": "外科胶",
    //     "suppliergoodsspec": "G-NB-2",
    //     "supplierunit": "支",
    //     "supplierprice": 150,
    //     "purchasergoodsguid": "00a231dc6b7447ea8e33b2760bb9be33",
    //     "purchasergoodscode": "ZH00842",
    //     "purchasergoodsname": "外科胶",
    //     "purchasergoodsspec": "G-NB-2",
    //     "purchaserunit": "支",
    //     "purchaserprice": 150,
    //     "registkey": null,
    //     "register": "-",
    //     "mfrguid": null,
    //     "producer": "GEM S.R.L",
    //     "manufacturer": null,
    //     "goodstype": null,
    //     "supplierpoqty": 3,
    //     "supplierpesentqty": null,
    //     "supplierarrivalqty": 0,
    //     "purchaserpoqty": 3,
    //     "purchaserpesentqty": null,
    //     "purchaserarrivalqty": null,
    //     "taxsum": 450,
    //     "amount": null,
    //     "do_guid": null,
    //     "do_rowno": "0",
    //     "do_supplier_poqty": null,
    //     "do_purchaser_poqty": null,
    //     "do_supplier_pesentqty": 3,
    //     "do_purchaser_pesentqty": 3,
    //     "do_supplier_arrivalqty": null,
    //     "do_purchaser_arrivalqty": null,
    //     "lot": "240300",
    //     "productiondate": "2024-03-01",
    //     "expiredate": "2024-03-01",
    //     "sterilantlot": null,
    //     "sterilantdate": null,
    //     "sterilantexpdate": null,
    //     "isaccessory": null,
    //     "diCode": "19498565615453",
    //     "sitem": 1,
    //     "pitem": 1,
    //     "isMir": null,
    //     "listSize": 0,
    //     "listSum": null,
    //     "defSum": null,
    //     "udiCodes": null,
    //     "parasite": [],
    //     "udiList": [
    //         {
    //             "diCode": "19498565615453",
    //             "productiondate": "2024-03-01",
    //             "expiredate": "2024-03-01",
    //             "lot": "240300",
    //             "part5": "145627",
    //             "udiCodes": "(01)19498565615453(11)240301(17)250301(10)240300(21)145627"
    //         }
    //     ]
    // },
    // {
    //     "guid": "20240229091453230001",
    //     "rowno": 2,
    //     "billno": "CGD2024022900001",
    //     "ckbillno": null,
    //     "medplanrowno": 2,
    //     "distrbporowno": null,
    //     "ispackage": "N",
    //     "parentpackageguid": null,
    //     "suppliergoodsguid": "87d27e21f1614b42a792dc8ad637d067",
    //     "suppliergoodscode": "ZH04501",
    //     "suppliergoodsname": "医用冲洗器",
    //     "suppliergoodsspec": "脉冲WJ-06",
    //     "supplierunit": "个",
    //     "supplierprice": 120,
    //     "purchasergoodsguid": "793ecc27573441148abb77f675cae009",
    //     "purchasergoodscode": "ZH04501",
    //     "purchasergoodsname": "医用冲洗器",
    //     "purchasergoodsspec": "脉冲WJ-06",
    //     "purchaserunit": "个",
    //     "purchaserprice": 120,
    //     "registkey": null,
    //     "register": "京械注准20152540709",
    //     "mfrguid": null,
    //     "producer": "北京万洁天元医疗器械股份有限公司",
    //     "manufacturer": null,
    //     "goodstype": null,
    //     "supplierpoqty": 3,
    //     "supplierpesentqty": null,
    //     "supplierarrivalqty": 0,
    //     "purchaserpoqty": 3,
    //     "purchaserpesentqty": null,
    //     "purchaserarrivalqty": null,
    //     "taxsum": 360,
    //     "amount": null,
    //     "do_guid": null,
    //     "do_rowno": "0",
    //     "do_supplier_poqty": null,
    //     "do_purchaser_poqty": null,
    //     "do_supplier_pesentqty": 3,
    //     "do_purchaser_pesentqty": 3,
    //     "do_supplier_arrivalqty": null,
    //     "do_purchaser_arrivalqty": null,
    //     "lot": "210610",
    //     "productiondate": "2021-05-15",
    //     "expiredate": "2021-05-15",
    //     "sterilantlot": null,
    //     "sterilantdate": null,
    //     "sterilantexpdate": null,
    //     "isaccessory": null,
    //     "diCode": "06973720135656",
    //     "sitem": 1,
    //     "pitem": 1,
    //     "isMir": null,
    //     "listSize": 0,
    //     "listSum": null,
    //     "defSum": null,
    //     "udiCodes": null,
    //     "parasite": [],
    //     "udiList": [
    //         {
    //             "diCode": "06973720135656",
    //             "productiondate": "2021-05-15",
    //             "expiredate": "2021-05-15",
    //             "lot": "210610",
    //             "part5": "328975",
    //             "udiCodes": "(01)06973720135656(11)210515(17)210610(10)210610(21)328975"
    //         }
    //     ]
    //}],
           };
        },
        methods: {
            slidedown:function(index,val){
                var self = this;

                if(self.mxList[index].parasite.length>10){
                    self.indexNum=index;
                    self.$set('getList',self.mxList[index].parasite);
                    self.getListFlag=true;

                }else{

                    $('#warp2' + index).find(".row-launch").slideDown(400, function () {
                        $('#warp2' + index).find(".isFocus").addClass("focus active");
                    })
                }

            },
            slideup:function(index){

                $('#warp2' + index).find(".row-launch").slideUp(400, function () {
                    $('#warp2' + index).removeClass('active');
                    $('#warp2' + index).find(".isFocus").removeClass("focus");
                })
            },
            // 初始化操作
            getData: function () {
                // alert(this.ctns.state_dck);
                var self = this;

                // ***采购订单编号***
                if ((self.search.search_trpo_billno || '') == '') {
                    var trpo_billno = this.$route.params.billno;
                    self.search.search_trpo_billno = trpo_billno;
                    self.search.search_trdo_billno = self.trdo.billno;
                }

                // 1.获得订单详细信息
                Ajax.get('/cost/getTrsupplierdoCkdl', this.search)
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('trdo', data);

                    })

                // 2.获得商品列表信息
                Ajax.get('/cost/listTrsupplierdetailCkdl', this.search)
                    .then(function (response) {
                        var data = response.data.data;
                        for(var a=0;a<data.list.length;a++){
                            if(!data.list[a].supplierarrivalqty){
                                data.list[a].supplierarrivalqty=0;
                            }
                            if(data.list[a].ispackage=='N'){
                             Vue.set(data.list[a],'parasite',[])   ;
                                self.mxList.push(data.list[a]);
                                console.log(self.mxList);
                            }else{
                                for(var i=0;i<self.mxList.length;i++){

                                    if( self.mxList[i].suppliergoodscode=="耗材包" && self.mxList[i].suppliergoodsguid==data.list[a].parentpackageguid){

                                        data.list[i].parasite.push(data.list[a]);
                                        // console.log(data.list[i].parasite);
                                    }

                                }

                            }

                        }
                        // self.$set('mxList', data.list);
                        self.search.pageno = data.pageno;
                        self.search.totalPages = data.totalPages;
                        self.search.total = data.total;

                        // 封存商品图片信息
                        self.$set('imgcache', response.data.senData);
                    })
            },
            getDatadetail: function (trdo_billno) {
                // alert(this.ctns.state_dck);
                var self = this;
                self.$set('mxList',[]);
                // ***采购订单编号***

                if ((self.search1.search_trpo_billno || '') == '') {
                    var trpo_billno = this.$route.params.billno;
                    self.search1.search_trpo_billno = trpo_billno;
                    self.search1.search_trdo_billno = trdo_billno;
                }

                // 1.获得订单详细信息
                Ajax.get('/cost/getTrsupplierdoCkdl', this.search1)
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('trdo', data);
                        self.$route.router.go('/cost/costOrderOutallView2/' + ((self.trdo.supplierpobillno || '') + "@" + (self.trdo.billno || '')));
                        // 废弃(换成后台验证):获得订单中商品剩余可以送货的数量
                        // self.getGoodNumInplan();
                    })
                // 2.获得商品列表信息
                Ajax.get('/cost/listTrsupplierdetailCkdl', this.search1)
                    .then(function (response) {
                        var data = response.data.data;
                        for(var a=0;a<data.list.length;a++){
                            if(!data.list[a].supplierarrivalqty){
                                data.list[a].supplierarrivalqty=0;
                            }
                            if(data.list[a].ispackage=='N'){
                                data.list[a].parasite=[];
                                self.mxList.push(data.list[a]);
                            }else{
                                for(var i=0;i<self.mxList.length;i++){

                                    if( self.mxList[i].suppliergoodscode=="耗材包" && self.mxList[i].suppliergoodsguid==data.list[a].parentpackageguid){

                                        data.list[i].parasite.push(data.list[a]);
                                    }

                                }

                            }

                        }
                        // self.$set('mxList', data.list);
                        self.search.pageno = data.pageno;
                        self.search.totalPages = data.totalPages;
                        self.search.total = data.total;

                        // 封存商品图片信息
                        self.$set('imgcache', response.data.senData);
                    })
            },
            exportTrmedplan: function (billno) {
                var self = this;
                self.search.billno = billno;
                Ajax.get('/trpo/exportTrPoSl', this.search)
                    .then(function (response) {
                        var data = response.data;
                        window.open(data);
                    })
            },
            // 批量导入订单
            getTipsPlan: function (data) {
                var self = this;

                if (data.errorCode == 0) {

                    var trpo_billno = this.$route.params.billno;
                    var trdo_billno = data.data;

                    // 返回信息
                    self.MessageBox({
                        title: '提示',
                        message: '导入商品成功!',
                        type: 'alert'
                    }, function (action) {
                        //跳转
                        self.$route.router.go('/trdo/orderOutall2-2/' + ((trpo_billno || '') + "@" + (trdo_billno || '')));
                    });
                } else {
                    self.$set('backMessage1.showDialog', 'Y');
                    var myobj = eval(data.message);
                    this.$set('backMessage1.mList', myobj);
                }
            },
            // 废弃(换成后台验证):获得订单中商品剩余可以送货的数量
            getGoodNumInplan: function () {
                var self = this;
                Ajax.get('/trdo/getGoodsNumInplan', {
                    billno: self.trdo.supplierpobillno
                })
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('goodNumcache', data);
                    })
            },
            // 删除送货汇总单
            delCkdl: function () {
                var self = this;
                // 首先判断是否已经有汇总单,如果没有,提示还未保存汇总单,不需要删除
                if ((self.trdo.billno || '') == '') {
                    layer.msg('高值送货单还未生成,不需要删除!')
                    return;
                }

                self.MessageBox({
                    title: '提示',
                    message: "您确定要删除本次已经生成的高值送货单吗?",
                    type: 'success',
                    showCancelButton: true
                }, function (action) {
                    if (action == 'confirm') {
                        // 删除送货单 然后删除两票制 do
                        // deleteTrsupplierdoCkdl          deleteCkdl

                        self.delParams.trpo_billno = self.search.search_trpo_billno;
                        self.delParams.trdo_billno = self.search.search_trdo_billno;
                        self.requestS = true;
                        Ajax.get('/cost/deleteTrsupplierdoCkdl', self.delParams)
                            .then(function (response) {
                                var data = response.data.data;
                                if (data.split("@")[0] == "1") { // 删除成功的情况
                                    self.MessageBox({
                                        title: '提示',
                                        message: '删除成功!',
                                        type: 'alert'
                                    }, function (action) {
                                        self.$route.router.go('/cost/costOrderOutlog');

                                    });
                                } else {
                                    // 如果删除失败,需要重新增加进去
                                    layer.msg('删除失败!')
                                }
                                self.requestS = false;
                            })
                        return;


                    } else {
                        layer.msg(data.message);
                    }

                });
            },
            // 关闭订单 然后删除两票制 po
            resetmirBySupGoodsBypo:function () {
                var self=this;
                Ajax.post('/trdo/resetmirBySupGoodsBypo', {pobillno:self.search.search_trpo_billno})
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {

                        } else {
                            layer.msg(data.message);
                        }
                    })
            },

            submitDivSh: function () {
                var self = this;
                self.divbgShow3 = true;
            },
            // 复制一条商品
            copy:function(item,index){

                var self = this;
                var obj=JSON.parse(JSON.stringify(item));
                
                Vue.set(obj, 'guid', '')
                Vue.set(obj, 'do_supplier_pesentqty', 1)
                Vue.set(obj, 'udiList', [])
                Vue.set(obj, 'lot', null)
                // obj.guid='';
                // obj.do_guid='';
                // obj.do_rowno='';
                // obj.lot = null;
                // obj.productiondate = "";
                // obj.expiredate = "";
                // obj.sterilantlot = "";
                // obj.sterilantdate = "";
                // obj.udiList = [];
                // obj.do_supplier_pesentqty =3;
                self.mxList.splice(index + 1, 0, obj)
                console.log(this.mxList);
            },

            // 送货信息保存
            saveCkdl: function () {
                var self = this;
                var reg=/^[1-9]+\d*$/;

                self.sumitSh = true;
                //self.doList.list =JSON.parse( JSON.stringify(this.mxList));
                var arrs=[];
                // console.log(this.mxList);
                for(var a=0;a<this.mxList.length;a++){
                    if(self.mxList[a].parasite){
                        self.mxList[a].parasite.forEach(function (value,index,arr) {
                            arrs.push(value)
                        });
                    }
                }
                self.mxList.forEach(function (value,index,arr) {
                    arrs.push(value)
                    if(value.suppliergoodscode=="耗材包"){
                        delete value.lot;

                    }

                });
                // console.log(self.mxList);
                // console.log(self.doList);
                self.doList.list =arrs;
                // console.log(self.doList.list);
                for(var a=0;a<self.doList.list.length;a++){
                    if(!self.doList.list[a].lot && self.doList.list[a].purchasergoodscode!="耗材包" ){
                        // console.log(111);
                        layer.msg('请输入批号');
                        return;

                    }
                    if (self.doList.list[a].udiList.length < self.doList.list[a].do_supplier_pesentqty) {
                        layer.msg('商品扫码数小于本次送货书,请核对商品继续扫码!');
                        return
                    }
                    if(self.doList.list[a].ispackage=='Y' && self.doList.list[a].parentpackageguid){
                        var parasite=self.doList.list;
                        if(parasite[a].supplierpoqty-parasite[a].supplierarrivalqty<parasite[a].do_supplier_pesentqty ){
                            layer.msg('耗材包中的送货数不得大于要货数!');
                            return;

                        }


                        if(parasite[a].pitem>parasite[a].sitem){

                            parasite[a].do_purchaser_pesentqty=(parasite[a].do_supplier_pesentqty *( parasite[a].pitem/ parasite[a].sitem) * 10000) / 10000;
                        }else{
                            if(self.exact(parasite[a].do_supplier_pesentqty ,parasite[a].sitem*parasite[a].pitem)){

                                parasite[a].do_purchaser_pesentqty=(parasite[a].do_supplier_pesentqty / (parasite[a].sitem * parasite[a].pitem) * 10000) / 10000;

                            }else{
                                layer.msg('商品【'+ parasite[a].suppliergoodsname+'】转换为医院商品数量时出错,医院商品与供应商商品转换比是'+parasite[a].do_supplier_pesentqty * parasite[a].sitem+'/'+parasite[a].pitem+',请输入合适的送货数量。');

                                return;
                            }

                        }
                    }else{

                        if(self.doList.list[a].do_supplier_pesentqty<0){
                            self.MessageBox({title: '提示',message: '商品请输入大于0的数量!',type: 'alert'})

                            return;
                        }
                        if(self.doList.list[a].pitem>self.doList.list[a].sitem){
                            self.doList.list[a].do_purchaser_pesentqty=(self.doList.list[a].do_supplier_pesentqty *( self.doList.list[a].pitem/ self.doList.list[a].sitem) * 10000) / 10000;

                        }else{

                            if(self.exact(self.doList.list[a].do_supplier_pesentqty , self.doList.list[a].sitem*self.doList.list[a].pitem)){

                                self.doList.list[a].do_purchaser_pesentqty=(self.doList.list[a].do_supplier_pesentqty / (self.doList.list[a].sitem * self.doList.list[a].pitem) * 10000) / 10000;

                            }else{
                                layer.msg('商品【'+ self.doList.list[a].suppliergoodsname+'】转换为医院商品数量时出错,医院商品与供应商商品转换比是'+self.doList.list[a].do_supplier_pesentqty * self.doList.list[a].sitem+'/'+self.doList.list[a].pitem+',请输入合适的送货数量。');
                                return;
                            }

                        }
                        if(self.doList.list[a].do_supplier_pesentqty ==0){

                            layer.msg('送货数不得等于零!')
                            return;
                        }
                        // 要货数-送货数  <  送货数
                        if(self.doList.list[a].supplierpoqty-self.doList.list[a].supplierarrivalqty<self.doList.list[a].do_supplier_pesentqty ){

                            layer.msg('送货数不得大于要货数!')
                            return;
                        }
                        
                        var num=0;

                        for(var k=0;k<self.doList.list.length;k++){
                            if(self.doList.list[k].purchasergoodsguid==self.doList.list[a].purchasergoodsguid
                                && self.doList.list[k].rowno==self.doList.list[a].rowno)
                                num+=self.doList.list[k].do_supplier_pesentqty*1;
                            if(self.doList.list[a].supplierpoqty-self.doList.list[a].supplierarrivalqty<num){
                                layer.msg('本次送货数已经超出需要送货的数量')
                                return;
                            }
                            


                        }


                    }

                }
                self.saveSh = false;

                self.doList.trhvdo = this.trdo;
                self.doList.trpo_billno = self.search.search_trpo_billno;


                //     if (mxLists > 0) {
                self.requestS = true;
                Ajax.post('/cost/saveTrsupplierdoCkdl', this.doList)
                    .then(function (response) {
                        // ***送货汇总单编号***
                        var data = response.data;
                        console.log(data);
                        if (data.errorCode == 0) {
                            layer.msg('保存成功')
                            self.saveSh = true;
                            self.sumitSh=true;
                            self.search.search_trdo_billno = data.data;
                            self.trdo.billno = data.data.billno
                            self.trdo.billstate = data.data.billstate
                            self.trdo.guid = data.data.guid
                            // 重新刷新页面
                            // self.getDatadetail(data.data);


                        } else {
                            self.saveSh = true;
                            layer.msg(data.message)

                        }
                        self.requestS = false;
                    })
                //     } else {
                //         layer.msg('本次送货数请输入大于0的正整数!');
                //         self.saveSh = true;
                //         return;
                //     }
                // }
                self.saveSh = true;
            },
            // 提交送货单
            submitCkdl: function (trpo_billno, trdo_billtype) {
                var self = this;
                self.divbgShow3 = false;
                // self.sumitSh = false;
                // var reg=/^[1-9]+\d*$/;
                // self.sumitSh = true;

                var date1 = new Date();
                var date2 = new Date(date1);
                date2.setMonth(date1.getMonth() + 6);
                var times = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
                // alert(times);
                for (var i = 0; i < self.mxList.length; i++) {
                    var mxListss = self.mxList[i];
                    //有效期
                    if(mxListss.expiredate){
                        var mxLists = mxListss.expiredate;
                        var da1 = mxLists.replace(/\-/gi, "/");
                        var da2 = times.replace(/\-/gi, "/");
                        var time1 = new Date(da1).getTime();
                        var time2 = new Date(da2).getTime();
                        if (time1 <= time2) {
                            var tr = true;
                        }
                    }

                }


                // if (trdo_billtype == '02' || trdo_billtype == '03') {
                    //     self.doList.hvList = null;
                    // self.doList.trpo_billno = '';
                    // self.doList.trdo = this.trdo;
                    // console.log(this.sumitSh);
                    // for (var i = 0; i < self.mxList.length; i++) {
                        if (!this.sumitSh) {
                            layer.msg('请先保存,再进行提交操作!');
                            return;
                        }else{
                            self.requestS = true;
                            self.doList.list = this.mxList;
                            self.doList.trpo_billno = self.search.search_trpo_billno;
                            self.doList.trhvdo = this.trdo;
                            console.log(self.doList);
                      // 送货信息

                            Ajax.post('/cost/submitTrsupplierdoCkdl', this.doList)
                            .then(function (response) {
                            var data = response.data.data;
                            self.sumitSh = true;
                            if (response.data.errorCode == 0) {
                                self.requestS = false;

                                if (data.split("@")[0] == "1") { // 删除成功的情况

                                    if (tr) {

                                        self.MessageBox({
                                            title: '提示',
                                            message: '有效期小于6个月',
                                            type: 'alert'
                                        }, function (action) {
                                            self.$route.router.go('/cost/costOrderOutallView/' + trpo_billno);
                                        });
                                    }

                                    if (trpo_billno == null || trpo_billno == '') {
                                        layer.msg('请先提交送货单!');
                                    } else {

                                        // 根据单据类型,单据状态跳转不同的页面
                                        self.$route.router.go('/cost/costOrderOutallView/' + trpo_billno);
                                    }
                                } else if (data.split("@")[0] == "-1") {
                                    layer.msg('本次送货数已经超出需要送货的数量!');
                                } else if (data.split("@")[0] == "-2") {
                                    layer.msg('只有待提交的单据可提交!');
                                } else if (data.split("@")[0] == "-3") {
                                    self.listsupplier();
                                } else if (data.split("@")[0] == "-4") {

                                    layer.msg('有两票制商品未勾选厂商发票或送货数量和厂商发票数量不一致!');
                                } else {
                                    // 提交送货单失败!
                                    layer.msg('删除失败!');
                                }
                                // 重新刷新页面
                                //self.getData();
                            } else {
                                layer.msg(data.message);
                            }
                            self.requestS = false;
                        })
                        }
                    // }


                // } else {
                //     self.requestS = true;
                //     // self.doList.list = this.mxList;
                //     self.doList.trpo_billno = self.search.search_trpo_billno;
                //     self.doList.trhvdo = this.trdo;
                //     // 送货信息

                //     Ajax.post('/cost/submitTrsupplierdoCkdl', this.doList)
                //         .then(function (response) {
                //             var data = response.data.data;
                //             self.sumitSh = true;
                //             if (response.data.errorCode == 0) {
                //                 self.requestS = false;

                //                 if (data.split("@")[0] == "1") { // 删除成功的情况

                //                     if (tr) {

                //                         self.MessageBox({
                //                             title: '提示',
                //                             message: '有效期小于6个月',
                //                             type: 'alert'
                //                         }, function (action) {
                //                             self.$route.router.go('/cost/costOrderOutallView/' + trpo_billno);
                //                         });
                //                     }

                //                     if (trpo_billno == null || trpo_billno == '') {
                //                         layer.msg('请先提交送货单!');
                //                     } else {

                //                         // 根据单据类型,单据状态跳转不同的页面
                //                         self.$route.router.go('/cost/costOrderOutallView/' + trpo_billno);
                //                     }
                //                 } else if (data.split("@")[0] == "-1") {
                //                     layer.msg('本次送货数已经超出需要送货的数量!');
                //                 } else if (data.split("@")[0] == "-2") {
                //                     layer.msg('只有待提交的单据可提交!');
                //                 } else if (data.split("@")[0] == "-3") {
                //                     self.listsupplier();
                //                 } else if (data.split("@")[0] == "-4") {

                //                     layer.msg('有两票制商品未勾选厂商发票或送货数量和厂商发票数量不一致!');
                //                 } else {
                //                     // 提交送货单失败!
                //                     layer.msg('删除失败!');
                //                 }
                //                 // 重新刷新页面
                //                 //self.getData();
                //             } else {
                //                 layer.msg(data.message);
                //             }
                //             self.requestS = false;
                //         })
                // }
            },
            listsupplier: function () {
                var self = this;
                var billno = self.trdo.billno;
                Ajax.get('/trdo/listsupplieros/' + billno)
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {
                            self.$set('backMessage.showDialog', 'Y');
                            // self.listostypelist();
                            self.$set('backMessage.mList', data);
                            self.listHZ.sl = self.backMessage.mList.length;
                            self.listHZ.medname = self.trdo.medname;
                            for (var i = 0; i < self.backMessage.mList.length; i++) {
                                self.sh.push(false);
                            }
                        } else {
                            self.commitosz();
                        }
                    })
            },
            // 提交
            commitosz: function () {
                var self = this;
                self.TrsupplierDoListVO.billno = self.trdo.billno;
                self.TrsupplierDoListVO.trpo_billno = self.trdo.supplierpobillno;
                self.$set('TrsupplierDoListVO.trsupplierosList', self.backMessage.mList);
                // 送货信息 立继武
                Ajax.post('/trdo/commitOsList', self.TrsupplierDoListVO)
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {
                            var billno = self.trdo.supplierpobillno;
                            Ajax.get('/trdo/sendOsMsg/' + billno)
                                .then(function (response) {
                                    self.$route.router.go('/cost/costOrderOutlog');
                                })
                        } else {
                            layer.msg(data.message);
                        }
                    })
            },
            // listostypelist: function () {
            //     var self = this;
            //     Ajax.get('/trdo/listostype')
            //         .then(function (response) {
            //             var data = response.data.data;
            //             if (response.data.errorCode == 0) {
            //                 self.$set('shortageselectlist', data);
            //             } else {
            //                layer.msg(response.data.message);
            //             }
            //         })
            // },
            //缺货原因
            selectname: function (index, memo) {
                var self = this;
                if (memo == "OS11") {
                    self.sh.splice(index, 1, true);
                } else {
                    self.sh.splice(index, 1, false);
                }
            },
            // 提交
            commitos: function () {
                var self = this;
                self.TrsupplierDoListVO.billno = self.trdo.billno;
                self.TrsupplierDoListVO.trpo_billno = self.trdo.supplierpobillno;
                for (var i = 0; i < self.backMessage.mList.length; i++) {
                    if (self.backMessage.mList[i].memo == null || self.backMessage.mList[i].memo == "") {
                        layer.msg("请填写缺货原因!");
                        return;
                    }
                }
                self.$set('TrsupplierDoListVO.trsupplierosList', self.backMessage.mList);
                self.MessageBox({
                    title: '提示',
                    message: '将这' + self.listHZ.sl + '个品种缺货信息通知给医院!',
                    type: 'alert',
                    showCancelButton: true
                }, function (action) {
                    if (action == 'cancel') {
                        // self.$route.router.go('/cost/costOrderOutlog');
                    } else {
                        // 送货信息 立继武
                        Ajax.post('/trdo/commitOsList', self.TrsupplierDoListVO)
                            .then(function (response) {
                                var data = response.data.data;
                                if (response.data.errorCode == 0) {
                                    var billno = self.trdo.supplierpobillno;
                                    Ajax.get('/trdo/sendOsMsg/' + billno)
                                        .then(function (response) {
                                            self.$route.router.go('/cost/costOrderOutlog');
                                        })
                                } else {
                                    layer.msg(data.message);
                                }
                            })

                    }
                });
            },
            // 关闭信息提示弹出框
            closeDialog: function () {
                var self = this;
                this.$set('backMessage.showDialog', 'N');
                this.$set('backMessage.mList', []);
                this.$set('backMessage1.showDialog', 'N');
                this.$set('backMessage1.mList', []);
                this.$set('backMessage2.showDialog', 'N');
                this.$set('backMessage2.mList', []);
                self.divbgShow = false;
                self.divbgShow1 = false;
                self.divbgShow2 = false;
                self.divbgShow3 = false;
                self.sumitSh = true;
            },
            // 关闭信息提示弹出框
            closeDialog1: function () {
                var self = this;
                this.$set('backMessage.showDialog', 'N');
                this.$set('backMessage.mList', []);
                self.divbgShow = false;
                self.sumitSh = true;
                self.getDatadetail(self.trdo.billno);
            },
            // 关闭订单
            closeTrs: function () {
                var self = this;
                self.divbgShow2 = true;
            },
            // 关闭订单
            closeTrsupplier: function () {
                var self = this;
                self.MessageBox({
                    title: '提示',
                    message: "您确认要关闭订单吗?",
                    type: 'success',
                    showCancelButton: true
                }, function (action) {
                    if (action == 'confirm') {
                        Ajax.get('/cost/closeTrsupplier', {
                            billno: self.search.search_trpo_billno
                        })
                            .then(function (response) {
                                var data = response.data.data;
                                if (response.data.errorCode == 0) {
                                    if (data.split("@")[0] == "0") { // 删除成功的情况
                                        self.MessageBox({
                                            title: '提示',
                                            message: '采购单不存在!',
                                            type: 'alert'
                                        }, function (action) {
                                            self.closeDialog();
                                        });
                                    } else if (data.split("@")[0] == "-1") {
                                        self.MessageBox({
                                            title: '提示',
                                            message: '已生成送货单且未完结,无法关闭高值订单!',
                                            type: 'alert'
                                        }, function (action) {
                                            self.closeDialog();
                                        });
                                    } else if (data.split("@")[0] == "-2") {
                                        //未生成送货单,关闭订单给医院发消息
                                        self.MessageBox({
                                            title: '提示',
                                            message: '已生成入库单且未签收,无法关闭高值订单!',
                                            type: 'alert'
                                        }, function (action) {
                                            self.closeDialog();
                                        });

                                    } else if(data.split("@")[0] == "-3"){
                                        self.sendcloseMsg();
                                    }

                                    // else if (data.split("@")[0] == "-3") {
                                    //     //未生成送货单,将采购单走缺货发给医院
                                    //     self.divbgShow2 = false;
                                    //     self.$set('backMessage2.showDialog', 'Y');
                                    //     self.closeTrsupplierList();
                                    //     self.listostypelist();
                                    // } else {
                                    //     // 提交送货单失败!
                                    //     layer.msg('关闭成功!');
                                    // }
                                } else {
                                    layer.msg('操作异常!');
                                }
                            });
                        return;
                    }
                });
            },
            sendcloseMsg: function () {
                var self = this;
                var billno = self.trdo.supplierpobillno;
                Ajax.get('/cost/sendcloseMsg/' + billno)
                    .then(function (response) {
                        //跳转
                        self.$route.router.go('/cost/costOrderOutlog');
                    })
            },
            // closeTrsupplierList: function () {
            //     var self = this;
            //     var billno = self.trdo.supplierpobillno;
            //     Ajax.get('/trpo/listsupplieros/' + billno)
            //         .then(function (response) {
            //             var data = response.data.data;
            //             if (response.data.errorCode == 0) {
            //                 self.$set('backMessage2.mList', data);
            //                 self.listHZ.sl = self.backMessage2.mList.length;
            //                 self.listHZ.medname = self.trdo.medname;
            //                 for (var i = 0; i < self.backMessage2.mList.length; i++) {
            //                     self.sh.push(false);
            //                 }
            //             } else {
            //                 layer.msg(response.data.message);
            //             }
            //         })
            // },

            //判断是否是正确的日期格式
            isdatatime: function (list) {
                var self = this;
                var date0 = '';
                var date1 = '';
                var date2 = '';
                var date3 = '';
                var date4 = '';
                var date5 = '';
                var isboolean = true;
                var null0 = '';
                var datatimelist = list;
                for (var i = 0; i < datatimelist.length; i++) {

                    date0 = datatimelist[i].lot; //批号
                    date1 = datatimelist[i].productiondate; //生产日期
                    date2 = datatimelist[i].expiredate; //有效期
                    date3 = datatimelist[i].sterilantdate; //灭菌日期
                    date4 = datatimelist[i].sterilantexpdate; //灭菌效期
                    date5 = datatimelist[i].sterilantlot; //灭菌批号

                    //获取当前的商品编号
                    if ((date0 == null || date0 == '') ||
                        (date1 == null || date1 == '') ||
                        (date2 == null || date2 == '')) {
                        null0 = i + 1;
                    }
                    //判断是否是空值
                    if (date0 == '' || date0 == null) {
                        layer.msg('第' + null0 + '条商品的批号不能为空!');
                        isboolean = false;
                        return isboolean;
                    } else if (date2 == '' || date2 == null) {
                        layer.msg('第' + null0 + '条商品的有效日期不能为空!');
                        isboolean = false;
                        return isboolean;
                    } else {
                        //截取00:00:00
                        date2 = date2.substr(0, 10);
                        return isboolean;
                    }
                    if (date1 != '' && date1 != null) {
                        date1 = date1.substr(0, 10);
                    }
                    if (date3 != '' && date3 != null) {
                        date3 = date3.substr(0, 10);
                    }
                    if (date4 != '' && date4 != null) {
                        date4 = date4.substr(0, 10);
                    }
                }
                //判断批号和灭菌批号是否是数字
                // if(isNaN(date0)){
                //    layer.msg('商品的批号请输入数字!');
                //     return isboolean;
                // }
                if (isNaN(date5)) {
                    layer.msg('商品的灭菌批号请输入数字!');
                    return isboolean;
                }
                //判断是否是正确的日期格式
                if (date1 != null && date1 != '' && !self.isData(date1)) {
                    layer.msg('请输入正确的生产日期格式,如xxxx-xx-xx!');
                    isboolean = false;
                    return isboolean;
                }
                if (date2 != null && date2 != '' && !self.isData(date2)) {
                    layer.msg('请输入正确的有效期格式,如xxxx-xx-xx!');
                    isboolean = false;
                    return isboolean;
                }
            },
            // 供应商送货数量修改之后,联动修改医院端送货数量
            setPurPesentqty: function (guid, index, mx, rowno) {
                var self = this;

                var oldValue = mx.do_supplier_pesentqty || 0;
                // 取到刚刚输入的数据
                var newValue = $("#" + guid + "" + index).val();
                // 判断输入的是不是数值
                if (newValue < 0) {
                    layer.msg('请输入大于0的正整数!');
                    $("#" + guid + "" + index).val(oldValue);
                    return;
                }
                if (isNaN(newValue)) {
                    layer.msg('请输入数字!');
                    self.$set('mxList[' + index + '].do_supplier_pesentqty', oldValue);
                    $("#" + guid + "" + index).val(oldValue);
                    return;
                }
                //判断单据类型是否是中药
                if (self.trdo.billtype != '08') {
                    if (parseInt(newValue) != newValue) {
                        layer.msg('请输入整数!');
                        $("#" + guid + "" + index).val(oldValue);
                        return;
                    }
                } else {
                    if (parseInt(newValue) != newValue) {
                        var y = newValue.indexOf(".") + 1;
                        var count = String(newValue).length - y;
                        if (count > 6) {
                            layer.msg('请输入6位小数!');
                            $("#" + guid + "" + index).val(oldValue);
                            return;
                        }
                    }
                }
                /*if(newValue>mx.supplierpoqty - mx.supplierarrivalqty){
                  layer.msg('本次送货数已经超出需要送货的数量!');
                  mx.do_supplier_pesentqty = oldValue;
                  return;
                }else{
                  mx.do_supplier_pesentqty = newValue;
                  // 转换成医院端应该送货的数量(XXXXXXX 火狐浏览器是5舍6入,很坑爹 XXXXXXXXXXXXX)
                  mx.do_purchaser_pesentqty =  Math.round(newValue * mx.sitem/mx.pitem *10000)/10000;
                }*/

                // if(sum>mx.supplierpoqty){
                //   layer.msg('送货数不能大于要货数!');
                //   self.$set('mxList['+index+'].do_supplier_pesentqty',oldValue);
                //   $("#"+guid+""+index).val(oldValue);
                //   return;
                // }else{
                //   mx.do_supplier_pesentqty = newValue;
                //   // 转换成医院端应该送货的数量(XXXXXXX 火狐浏览器是5舍6入,很坑爹 XXXXXXXXXXXXX)
                //   mx.do_purchaser_pesentqty =  Math.round(newValue * mx.sitem/mx.pitem *10000)/10000;
                // }

                if (newValue > mx.supplierpoqty - mx.supplierarrivalqty) {
                    layer.msg('送货数不能大于要货数!');
                    self.$set('mxList[' + index + '].do_supplier_pesentqty', oldValue);
                    $("#" + guid + "" + index).val(oldValue);
                    return;
                } else {
                    mx.do_supplier_pesentqty = newValue;
                    // 转换成医院端应该送货的数量(XXXXXXX 火狐浏览器是5舍6入,很坑爹 XXXXXXXXXXXXX)
                    mx.do_purchaser_pesentqty = Math.round(newValue * mx.sitem / mx.pitem * 10000) / 10000;
                }

                // 如果没有问题需要修改金额
                mx.amount = mx.do_purchaser_pesentqty * mx.purchaserprice;

                var sums = 0;
                if (self.mxList.length > 1) {
                    for (var i = 0; i < self.mxList.length; i++) {
                        if (self.mxList[i].guid == guid && self.mxList[i].rowno == rowno) {
                            sums += self.mxList[i].do_supplier_pesentqty * 1;
                        }
                    }
                    if (sums > mx.supplierpoqty) {
                        layer.msg('送货数不能大于要货数!');
                        self.$set('mxList[' + index + '].do_supplier_pesentqty', oldValue);
                        $("#" + guid + "" + index).val(oldValue);
                        return;
                    } else {
                        mx.do_supplier_pesentqty = newValue;
                        // 转换成医院端应该送货的数量(XXXXXXX 火狐浏览器是5舍6入,很坑爹 XXXXXXXXXXXXX)
                        mx.do_purchaser_pesentqty = Math.round(newValue * mx.sitem / mx.pitem * 10000) / 10000;
                    }
                }


            },

            // 复制一行记录
            copyNewObj: function (index, mxObj) {
                var self = this;
                var newObj = $.extend(true, {}, mxObj);
                // 清空一些属性的数据
                newObj.do_guid = "";
                // newObj.rowno = "";
                newObj.do_supplier_poqty = "0";
                newObj.do_purchaser_poqty = "0";
                newObj.do_supplier_pesentqty = "0";
                newObj.do_purchaser_pesentqty = "0";
                newObj.do_supplier_arrivalqty = "0";
                newObj.do_purchaser_arrivalqty = "0";
                newObj.lot = null;
                newObj.productiondate = "";
                newObj.expiredate = "";
                newObj.sterilantlot = "";
                newObj.sterilantdate = "";
                newObj.sterilantexpdate = "";
                newObj.do_rowno=0;
                self.mxList.splice(index + 1, 0, newObj);
                self.divbgShow1 = true;
            },
            // 删除一行记录
            deleteLin: function (index,one) {
                var self = this;
                // 要删除的数据
                if(one>=0){

                    var mxObj = self.mxList[one].parasite[index];
                }else{
                    self.slideup(index);
                    var mxObj = self.mxList[index];
                }

                if (!self.mxList[index].do_guid) {
                    if(one>=0){

                        self.mxList[one].parasite.splice(index, 1)
                        if(self.mxList[one].parasite.length==0){
                            self.slideup(one);
                            self.mxList.splice(one, 1);
                        }

                    }else{
                        self.slideup(index);
                        self.mxList.splice(index, 1);
                    }
                    // 数组中的数据删除记录


                    if(self.mxList.length==0){
                        self.$route.router.go('/cost/costOrderOutlog');
                    }

                } else {

                    self.delParams.guid = mxObj.do_guid;
                    self.delParams.rowno = mxObj.do_rowno;
                    this.delParams.billno = self.trdo.billno;
                    this.delParams.purchaserGoodsguid = mxObj.purchasergoodsguid;
                    self.delParams.supplierGoodscode = mxObj.suppliergoodscode;
                    self.delParams.ispackage = mxObj.ispackage;
                    self.delParams.parentpackageguid = mxObj.parentpackageguid;
                    // 送货信息
                    Ajax.post('/cost/deleteTrsupplierdodetailCommon', self.delParams)
                        .then(function (response) {
                            var data = response.data.data;
                            if (data.split("@")[0] != "0") { // 删除成功的情况
                                layer.msg('删除成功!');
                                if(one>=0){
                                    self.mxList[one].parasite.splice(index, 1)
                                    if(self.mxList[one].parasite.length==0){
                                        self.slideup(one);
                                        self.mxList.splice(one, 1);
                                    }

                                }else{
                                    self.mxList.splice(index, 1);
                                }

                                if(self.mxList.length==0){
                                    self.$route.router.go('/cost/costOrderOutlog');
                                }
                            }
                            if( response.data.errorCode!=0){
                                if(one>=0){
                                    self.mxList[one].parasite.splice(index, 0,mxObj);
                                }else{
                                    self.mxList.splice(index, 0, mxObj);
                                }

                                layer.msg('删除失败!');
                            }
                        })


                }


            },
            goTab: function (event) {
                //alert($(this).next().find("input").attr("id"))
                var a = $(this).next('input');
                if (!a.length) {
                    a = $('input:first');
                    a.focus();
                }
            },
            // 打印质量验收单
            printYsd: function () {
                var self = this;
                self.printParam.guid = self.trdo.guid;
                Ajax.get('/print/printYsd', this.printParam)
                    .then(function (response) {
                        var data = response.data;
                        if (data.errorCode == 0) {
                            window.open(data.data);
                        } else {
                            layer.msg(data.message);
                        }
                    })
            },
            // 打印送货单 立继武
            printTags: function () {
                var self = this;
                Ajax.get('/print/printTags/' + self.trdo.billno)
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {
                            window.open(data);
                        } else {
                            layer.msg(response.data.message);
                        }
                    })
            },
            // 跳转到订单受理详情页面
            goTRDoDetailsss: function (trpo_billno) {
                var self = this;
                if (trpo_billno == null || trpo_billno == '') {
                    layer.msg('请先保存送货单!');
                } else {
                    // 根据单据类型,单据状态跳转不同的页面
                    self.$route.router.go('/trsettle/settlementInvoice3/' + trpo_billno);
                }

            },
            // 打印跟台高值标签
            printTag: function () {
                var self = this;
                self.printParam.guid = self.trdo.guid;
                Ajax.get('/cost/printTag', this.printParam)
                    .then(function (response) {
                        var data = response.data;
                        if (data.errorCode == 0) {
                            window.open(data.data);
                        } else {
                            layer.msg(data.message);
                        }
                    })
            },
            // 点击2票制
            clickMir: function (mir) {
                var self = this;
                if(mir.do_rowno==0){
                    layer.msg('请保存送货单后再录两票制');
                    return;
                }
                self.$set('mirParam', mir);
                var mx = self.mxList;
                var sum = 0;

                self.showMir = true;
                mir.ckbillno=self.trdo.billno;
                Ajax.post('/supplierReport/findDoDetailByMir', mir)
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {

                            self.$set('goodR', data);

                            // findmirBySupGoods
                            Ajax.post('/supplierReport/findmirBySupGoods', mir)
                                .then(function (response) {
                                    var data = response.data.data;
                                    if (response.data.errorCode == 0) {

                                        self.$set('mfmedgoodsList', data);
                                        let li = self.mfmedgoodsList;
                                        for (let i = 0; i < li.length; i++) {
                                            self.$set('mfmedgoodsList[' + i + '].checkable', true);
                                        }
                                        var del = self.goodR.do_supplier_pesentqty - self.goodR.listSum;

                                        if (del <= 0) {
                                            for (let i = 0; i < li.length; i++) {
                                                self.$set('mfmedgoodsList[' + i + '].checkable', false);
                                            }
                                        }

                                    } else {
                                        layer.msg(response.data.message)

                                    }

                                })

                        } else {
                            layer.msg(response.data.message)
                        }

                    })

            },
            savemirBySupGoods: function () {
                var self = this;

                var arr = [];
                for (let i = 0; i < self.mfmedgoodsList.length; i++) {
                    if (self.mfmedgoodsList[i].checked) {
                        arr.push(self.mfmedgoodsList[i])
                    }
                }
                self.canSaveMir = false;
                self.goodR.ckbillno=self.trdo.billno;
                self.goodR.defSum = self.goodR.do_supplier_pesentqty - self.goodR.listSum;
                Ajax.post('/supplierReport/savemirBySupGoods', {
                    'vo': self.goodR,
                    'list': arr
                })
                    .then(function (response) {
                        self.canSaveMir = true;

                        var data = response.data.data;
                        if (response.data.errorCode == 0) {

                            if (data) {
                                self.MessageBox({
                                    title: '提示',
                                    message: '保存成功',
                                    type: 'alert'
                                }, function (action) {
                                    self.showMir = false;
                                });
                            } else {
                                layer.msg('保存失败')
                            }
                        } else {
                            layer.msg(response.data.message)
                        }

                    })
            },
            // 重置 两票制
            resetmirBySupGoods: function () {
                var self = this;

                var arr = [];
                for (let i = 0; i < self.mfmedgoodsList.length; i++) {
                    if (self.mfmedgoodsList[i].checked) {
                        arr.push(self.mfmedgoodsList[i])
                    }
                }
                self.goodR.ckbillno=self.trdo.billno;
                self.goodR.defSum = self.goodR.do_supplier_pesentqty - self.goodR.listSum;
                Ajax.post('/supplierReport/resetmirBySupGoods', {
                    'vo': self.goodR,
                    'list': arr
                })
                    .then(function (response) {
                        var data = response.data.data;
                        if (response.data.errorCode == 0) {

                            if (data) {
                                self.MessageBox({
                                    title: '提示',
                                    message: '重置成功',
                                    type: 'alert'
                                }, function (action) {
                                    self.clickMir(self.mirParam);
                                });
                            } else {
                                self.MessageBox({
                                    title: '提示',
                                    message: '重置失败',
                                    type: 'alert'
                                }, function (action) {
                                    self.showMir = false;

                                });
                            }
                        } else {
                            layer.msg(response.data.message);
                        }

                    })
            },
            clearcheck: function () {
                var self = this;
                let li = self.mfmedgoodsList;
                for (let i = 0; i < self.mfmedgoodsList.length; i++) {

                    if (self.mfmedgoodsList[i].checked != true) {

                        self.$set('mfmedgoodsList[' + i + '].checkable', false);
                    }
                }
            },
            clickCheck: function () {
                var self = this;
                var li = self.mfmedgoodsList;
                var sum = 0;
                var arr = [];
                var del = self.goodR.do_supplier_pesentqty - self.goodR.listSum;

                for (let i = 0; i < self.mfmedgoodsList.length; i++) {
                    if (li[i].checked) {
                        sum += li[i].doNum;
                        arr.push(i);
                    }
                    if (sum >= del) {

                        self.clearcheck();

                        for (let j = 0; j < arr.length; j++) {
                            self.$set('mfmedgoodsList[' + arr[j] + '].checkable', true);
                        }
                        return;
                    } else {
                        for (let i = 0; i < self.mfmedgoodsList.length; i++) {
                            self.$set('mfmedgoodsList[' + i + '].checkable', true);
                        }
                    }

                }

            },
            exact:function (x,y){//x是被除数,y是除数
                var z =  x/y;
                if(z.toString().length<7){
                    // 能整除

                    return true;

                }else{
                    return false;
                }
            },
            handleScan(event) {
                if (event.type === 'scan' || event.keyCode === 13) {
                   this.barcode += event.target.value;
                   console.log(this.barcode);

                   // 定义输入的字符串
                   const inputString = this.barcode;

                   const regex = /\(01\)(.*?)\(11\)(.*?)\(17\)(.*?)\(10\)(.*?)\(21\)(.*)/; // 匹配指定的格式
                   const match = inputString.match(regex);

                    // 输出匹配结果
                   if (match && match.length >= 6) {
                      const part1 = match[1].trim();
                      const part2 = match[2].trim();
                      const part3 = match[3].trim();
                      const part4 = match[4].trim();
                      const part5 = match[5].trim();
                      console.log("第一部分: ", part1);
                      console.log("第二部分: ", part2);
                      console.log("第三部分: ", part3);
                      console.log("第四部分: ", part4);
                      console.log("第五部分及之后的字符串: ", part5);

                      // 提取年、月、日
                      const year = "20" + part2.substring(0, 2); // 假设年份前两位固定为20
                      const month = part2.substring(2, 4);
                      const day = part2.substring(4);

                      // 转换为正确格式
                      const productiondate = `${year}-${month}-${day}`;
                      // 提取年、月、日
                      const year2 = "20" + part3.substring(0, 2); // 假设年份前两位固定为20
                      const month2 = part3.substring(2, 4);
                      const day2 = part3.substring(4);

                      // 转换为正确格式
                      const expiredate = `${year2}-${month2}-${day2}`;

                      

                      const dataString = `diCode:${part1}, productiondate:${productiondate}, expiredate:${expiredate}, lot:${part4}, serialnumber:${part5}, udiCodes:${inputString}`;

                      // 将字符串拆分成数组
                      const dataArray = dataString.split(', ');

                      // 创建对象
                      const dataObject = {};
                      dataArray.forEach(item => {
                        const [key, value] = item.split(':');
                        dataObject[key] = value;
                      });
                     
                      // 判断是否存在相同属性的元素
                      const isDuplicate = this.pList.some(item => item.udiCodes == dataObject.udiCodes);

                      // 添加新元素(如果不存在相同属性的元素)
                      if (!isDuplicate) {
                        this.pList.push(dataObject);
                      }

                    //   if (this.currentIndex < this.mxList.length ) {
                    //     console.log(this.pList);
                    //       this.mxList[this.currentIndex].productiondate=this.pList[this.currentIndex].productiondate ;
                    //       this.mxList[this.currentIndex].expiredate =this.pList[this.currentIndex].expiredate
                    //     //   this.mxList[this.currentIndex].lot = this.pList[this.currentIndex].lot
                    //     //   this.mxList[this.currentIndex].udiCodes = this.pList[this.currentIndex].udiCodes
                    //       this.currentIndex++;
                    //   } 

                    //   this.mxList.forEach(function(item) {
                    //       item.push(this.udiList); // 在每个元素中添加一个空数组 udiList
                    //   });

                      for (let index = 0; index < this.mxList.length; index++) {
                         
                         Vue.set(this.mxList[index], 'udiList', [])
                      }
                      console.log(this.mxList);
                      
                      if(this.mxList[0].parasite.length==0){
                         for (var i = 0; i < this.pList.length; i++) {
                           var item1 = this.pList[i];
                           for (var j = 0; j < this.mxList.length; j++) {
                               var item2 = this.mxList[j];
                               if(item2.diCode == null || item2.diCode == ''){
                                layer.msg('请先对码!')
                               }
                               if (item1.diCode == item2.diCode ) {
                                   if(item2.lot == null || item2.lot === item1.lot){
                                    console.log(11111111);

                                       
                                       
                                           item2.udiList.push(item1);
                                           item2.lot = item1.lot
                                           item2.productiondate = item1.productiondate
                                           item2.expiredate = item1.expiredate
                                       
                                       if (item2.udiList.length > item2.do_supplier_pesentqty) {
                                        
                                        layer.msg('条码数不能大于本次送货数,请重新扫码');
                                       } 
                                    
                                    
                                   } else {
                                    layer.msg('请手动增行')
                                   }
                               } 
                            
                               
                            }
                         }
                      }else{
                        for (var i = 0; i < this.pList.length; i++) {
                           var item1 = this.pList[i];
                           for (var j = 0; j < this.mxList[0].parasite.length; j++) {
                            console.log(11111);
                            for(let k=0;k<this.mxList[0].parasite.length;k++ ){
                                Vue.set(this.mxList[0].parasite[k],'udiList',[])
                            }
                            // console.log('mxList',this.mxList);
                               var item2 = this.mxList[0].parasite[j];
                               if (item1.diCode == item2.diCode ) {
                                    console.log(11111111);
                                    item2.udiList.push(item1);
                                    item2.lot=item1.lot
                                    item2.productiondate=item1.productiondate
                                    item2.expiredate=item1.expiredate
                                    // console.log(22222222);
                                   
                               } else {
                                layer.msg('请先对码')
                               }
                               
                            }
                         }
                      }

                    //   console.log('mxList',this.mxList);
                      
                    } else {
                      layer.msg("请输入正确的UDI码!");
                    }
               
                   this.barcode=''
                   event.target.value = '';
                }
            }
        },
        route: {
            activate: function () {
                this.getData();

            }
        },
        watch:{
            'mxList':{
                handler(curVal,oldVal){
                    var self = this;
                    var list = self.mxList;
                    for(var a=0;a<list.length;a++){
                        if(list[a].suppliergoodscode=="耗材包"){
                            var parasite= list[a].parasite;
                            var amountS=0;
                            for(var i=0;i<parasite.length;i++){

                                parasite[i].taxsum= parasite[i].supplierprice*parasite[i].do_supplier_pesentqty;
                                // parasite[i].do_purchaser_pesentqty=Math.round(parasite[i].do_supplier_pesentqty * parasite[i].sitem / parasite[i].pitem * 10000) / 10000;

                                // parasite[i].amount= parasite[i].price*parasite[i].poqty;
                                amountS+=parasite[i].taxsum;

                            }
                            list[a].do_purchaser_pesentqty=1;
                            list[a].do_supplier_pesentqty=1;
                            list[a].taxsum =amountS;
                            list[a].supplierprice =amountS;
                        }else{
                            // list[a].do_purchaser_pesentqty=Math.round(list[a].do_supplier_pesentqty * list[a].sitem / list[a].pitem * 10000) / 10000;

                            list[a].taxsum= list[a].supplierprice*list[a].do_supplier_pesentqty;

                        }

                    }

                },
                deep:true
            }
        },
        ready() {
            document.getElementById('barcodeInput').focus(); // 页面加载时将光标设置到input框
            document.addEventListener('keydown', this.handleScan);
            document.addEventListener('scan', this.handleScan);
            
        },
        beforeDestroy() {
            document.removeEventListener('keydown', this.handleScan);
            document.removeEventListener('scan', this.handleScan);
        },
    };
</script>