diff --git a/LICENSE b/LICENSE index d159169..94a9ed0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,281 +1,622 @@ GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + TERMS AND CONDITIONS - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". + 0. Definitions. -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. + "This License" refers to version 3 of the GNU General Public License. - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. + A "covered work" means either the unmodified Program or a work based +on the Program. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. + 1. Source Code. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. + The Corresponding Source for a work in source code form is that +same work. -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. + 2. Basic Permissions. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. + 13. Use with the GNU Affero General Public License. -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. + 14. Revised Versions of this License. - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. - NO WARRANTY + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. + 15. Disclaimer of Warranty. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. END OF TERMS AND CONDITIONS @@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + You should have received a copy of the GNU General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/app/adm/common.php b/app/adm/common.php new file mode 100644 index 0000000..212b2d8 --- /dev/null +++ b/app/adm/common.php @@ -0,0 +1,12 @@ +isAjax()) { + $cate = Db::name('CarCate')->order('create_time asc')->select(); + return to_assign(0, '', $cate); + } else { + return view(); + } + } + //车辆类型添加 + public function car_cate_add() + { + if (request()->isAjax()) { + $param = get_params(); + if (!empty($param['id']) && $param['id'] > 0) { + try { + validate(CarCateCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $data['update_time'] = time(); + $res = Db::name('CarCate')->strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + } + return to_assign(); + } else { + try { + validate(CarCateCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $insertId = Db::name('CarCate')->strict(false)->field(true)->insertGetId($param); + if ($insertId) { + add_log('add', $insertId, $param); + } + return to_assign(); + } + } + } + + //车辆类型设置 + public function car_cate_check() + { + $param = get_params(); + $res = Db::name('CarCate')->strict(false)->field('id,status')->update($param); + if ($res) { + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + return to_assign(); + } + else{ + return to_assign(0, '操作失败'); + } + } +} diff --git a/app/adm/controller/Meeting.php b/app/adm/controller/Meeting.php new file mode 100644 index 0000000..e553993 --- /dev/null +++ b/app/adm/controller/Meeting.php @@ -0,0 +1,83 @@ +isAjax()) { + $cate = Db::name('MeetingCate')->order('create_time asc')->select(); + return to_assign(0, '', $cate); + } else { + return view(); + } + } + //会议室添加 + public function meeting_cate_add() + { + if (request()->isAjax()) { + $param = get_params(); + if (!empty($param['id']) && $param['id'] > 0) { + try { + validate(MeetingCateCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $data['update_time'] = time(); + $res = Db::name('MeetingCate')->strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + } + return to_assign(); + } else { + try { + validate(MeetingCateCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $insertId = Db::name('MeetingCate')->strict(false)->field(true)->insertGetId($param); + if ($insertId) { + add_log('add', $insertId, $param); + } + return to_assign(); + } + } + } + + //会议室设置 + public function meeting_cate_check() + { + $param = get_params(); + $res = Db::name('MeetingCate')->strict(false)->field('id,status')->update($param); + if ($res) { + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + return to_assign(); + } + else{ + return to_assign(0, '操作失败'); + } + } +} diff --git a/app/adm/controller/Seal.php b/app/adm/controller/Seal.php new file mode 100644 index 0000000..fe7a473 --- /dev/null +++ b/app/adm/controller/Seal.php @@ -0,0 +1,83 @@ +isAjax()) { + $cate = Db::name('SealCate')->order('create_time asc')->select(); + return to_assign(0, '', $cate); + } else { + return view(); + } + } + //印章类别添加 + public function seal_cate_add() + { + if (request()->isAjax()) { + $param = get_params(); + if (!empty($param['id']) && $param['id'] > 0) { + try { + validate(SealCateCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $data['update_time'] = time(); + $res = Db::name('SealCate')->strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + } + return to_assign(); + } else { + try { + validate(SealCateCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $insertId = Db::name('SealCate')->strict(false)->field(true)->insertGetId($param); + if ($insertId) { + add_log('add', $insertId, $param); + } + return to_assign(); + } + } + } + + //印章类别设置 + public function seal_cate_check() + { + $param = get_params(); + $res = Db::name('SealCate')->strict(false)->field('id,status')->update($param); + if ($res) { + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + return to_assign(); + } + else{ + return to_assign(0, '操作失败'); + } + } +} diff --git a/app/adm/event.php b/app/adm/event.php new file mode 100644 index 0000000..4eff890 --- /dev/null +++ b/app/adm/event.php @@ -0,0 +1,5 @@ + 'require|unique:meeting_cate', + 'id' => 'require', + ]; + + protected $message = [ + 'title.require' => '名称不能为空', + 'title.unique' => '同样的名称已经存在', + 'id.require' => '缺少更新条件', + ]; + + protected $scene = [ + 'add' => ['title'], + 'edit' => ['id', 'title'], + ]; +} diff --git a/app/home/validate/SealCateCheck.php b/app/adm/validate/SealCateCheck.php similarity index 95% rename from app/home/validate/SealCateCheck.php rename to app/adm/validate/SealCateCheck.php index 590ce6d..80582c3 100644 --- a/app/home/validate/SealCateCheck.php +++ b/app/adm/validate/SealCateCheck.php @@ -5,7 +5,7 @@ * @link https://www.gougucms.com */ -namespace app\home\validate; +namespace app\adm\validate; use think\Validate; diff --git a/app/adm/view/car/car_cate.html b/app/adm/view/car/car_cate.html new file mode 100644 index 0000000..e5e86c2 --- /dev/null +++ b/app/adm/view/car/car_cate.html @@ -0,0 +1,145 @@ +{extend name="../../base/view/common/base" /} + +{block name="body"} +
+
+
+ +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/adm/view/meeting/meeting_cate.html b/app/adm/view/meeting/meeting_cate.html new file mode 100644 index 0000000..b0b58f7 --- /dev/null +++ b/app/adm/view/meeting/meeting_cate.html @@ -0,0 +1,120 @@ +{extend name="../../base/view/common/base" /} + +{block name="body"} +
+
+
+ +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/adm/view/seal/seal_cate.html b/app/adm/view/seal/seal_cate.html new file mode 100644 index 0000000..92365f0 --- /dev/null +++ b/app/adm/view/seal/seal_cate.html @@ -0,0 +1,120 @@ +{extend name="../../base/view/common/base" /} + +{block name="body"} +
+
+
+ +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 14fc10d..7c1f975 100644 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -8,11 +8,7 @@ declare (strict_types = 1); namespace app\api\controller; use app\api\BaseController; -use app\home\model\AdminLog; -use app\user\validate\AdminCheck; -use think\exception\ValidateException; use think\facade\Db; -use think\facade\Session; class Index extends BaseController { @@ -126,13 +122,6 @@ class Index extends BaseController return to_assign(0, '系统缓存已清空'); } - //获取关键字 - public function get_keyword_cate() - { - $keyword = Db::name('Keywords')->where(['status' => 1])->order('id desc')->select()->toArray(); - return to_assign(0, '', $keyword); - } - // 测试邮件发送 public function email_test() { @@ -228,177 +217,6 @@ class Index extends BaseController $position = Db::name('Position')->field('id,title as name')->where([['status', '=', 1], ['id', '>', 1]])->select(); return to_assign(0, '', $position); } - - //首页公告 - public function get_note_list() - { - $list = Db::name('Note') - ->field('a.id,a.title,a.create_time,c.title as cate_title') - ->alias('a') - ->join('note_cate c', 'a.cate_id = c.id') - ->where(['a.status' => 1]) - ->order('a.id desc') - ->limit(10) - ->select()->toArray(); - foreach ($list as $key => $val) { - $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); - } - $res['data'] = $list; - return table_assign(0, '', $res); - } - - //首页文章 - public function get_article_list() - { - $prefix = get_config('database.connections.mysql.prefix');//判断是否安装了文章模块 - $exist = Db::query('show tables like "'.$prefix.'article"'); - $res['data'] = []; - if($exist){ - $list = Db::name('Article') - ->field('a.id,a.title,a.create_time,a.read,c.title as cate_title') - ->alias('a') - ->join('article_cate c', 'a.cate_id = c.id') - ->where(['a.delete_time' => 0]) - ->order('a.id desc') - ->limit(10) - ->select()->toArray(); - foreach ($list as $key => $val) { - $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); - } - $res['data'] = $list; - } - return table_assign(0, '', $res); - } - - - //首页项目 - public function get_project_list() - { - $prefix = get_config('database.connections.mysql.prefix');//判断是否安装了项目模块 - $exist = Db::query('show tables like "'.$prefix.'project"'); - $res['data'] = []; - if($exist){ - $project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id'); - $list = Db::name('Project') - ->field('a.id,a.name,a.status,a.create_time,a.start_time,a.end_time,u.name as director_name') - ->alias('a') - ->join('Admin u', 'a.director_uid = u.id') - ->where([['a.delete_time', '=', 0], ['a.id', 'in', $project_ids]]) - ->order('a.id desc') - ->limit(10) - ->select()->toArray(); - foreach ($list as $key => $val) { - $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); - $list[$key]['plan_time'] = date('Y-m-d', $list[$key]['start_time']) . ' 至 ' . date('Y-m-d', $list[$key]['end_time']); - $list[$key]['status_name'] = \app\project\model\Project::$Status[(int) $val['status']]; - } - $res['data'] = $list; - } - return table_assign(0, '', $res); - } - - //修改个人信息 - public function edit_personal() - { - if (request()->isAjax()) { - $param = get_params(); - $uid = $this->uid; - Db::name('Admin')->where(['id' => $uid])->strict(false)->field(true)->update($param); - $session_admin = get_config('app.session_admin'); - Session::set($session_admin, Db::name('admin')->find($uid)); - return to_assign(); - } - else{ - return view('user@user/edit_personal', [ - 'admin' => get_admin($this->uid), - ]); - } - } - - //修改密码 - public function edit_password() - { - if (request()->isAjax()) { - $param = get_params(); - try { - validate(AdminCheck::class)->scene('editPwd')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $uid = $this->uid; - - $admin = Db::name('Admin')->where(['id' => $uid])->find(); - $old_psw = set_password($param['old_pwd'], $admin['salt']); - if ($admin['pwd'] != $old_psw) { - return to_assign(1, '旧密码错误'); - } - - $salt = set_salt(20); - $new_pwd = set_password($param['pwd'], $salt); - $data = [ - 'reg_pwd' => '', - 'salt' => $salt, - 'pwd' => $new_pwd, - 'update_time' => time(), - ]; - Db::name('Admin')->where(['id' => $uid])->strict(false)->field(true)->update($data); - $session_admin = get_config('app.session_admin'); - Session::set($session_admin, Db::name('admin')->find($uid)); - return to_assign(); - } - else{ - return view('user@user/edit_password', [ - 'admin' => get_admin($this->uid), - ]); - } - } - - //系统操作日志 - public function log_list() - { - if (request()->isAjax()) { - $param = get_params(); - $log = new AdminLog(); - $content = $log->get_log_list($param); - return table_assign(0, '', $content); - }else{ - return view('home@log/log_list'); - } - } - - //保存密码修改 - public function password_submit() - { - if (request()->isAjax()) { - $param = get_params(); - try { - validate(AdminCheck::class)->scene('editpwd')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $admin = get_admin($this->uid); - if (set_password($param['old_pwd'], $admin['salt']) !== $admin['pwd']) { - return to_assign(1, '旧密码不正确!'); - } - unset($param['username']); - $param['salt'] = set_salt(20); - $param['pwd'] = set_password($param['pwd'], $param['salt']); - Db::name('Admin')->where(['id' => $admin['id'], - ])->strict(false)->field(true)->update($param); - $session_admin = get_config('app.session_admin'); - Session::set($session_admin, Db::name('admin')->find($admin['id'])); - return to_assign(); - } - } - - //获取工作类型列表 - public function get_work_cate() - { - $cate = Db::name('WorkCate')->field('id,title')->where([['status', '=', 1]])->select(); - return to_assign(0, '', $cate); - } //获取审核类型 public function get_flow_cate($type=0) @@ -411,10 +229,17 @@ class Index extends BaseController { $flow = Db::name('Flow')->where(['id' => $id])->find(); $flowData = unserialize($flow['flow_list']); - foreach ($flowData as $key => &$val) { - $val['user_id_info'] = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['flow_uids'])->select()->toArray(); - } + if(!empty($flowData)){ + foreach ($flowData as $key => &$val) { + $val['user_id_info'] = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['flow_uids'])->select()->toArray(); + } + } $data['copy_uids'] = $flow['copy_uids']; + $data['copy_unames'] =''; + if($flow['copy_uids']!=''){ + $copy_unames = Db::name('Admin')->where('id', 'in', $flow['copy_uids'])->column('name'); + $data['copy_unames'] = implode(',', $copy_unames); + } $data['flow_data'] = $flowData; return to_assign(0, '', $data); } @@ -468,57 +293,341 @@ class Index extends BaseController } return to_assign(0, '', $check_list); } - - - //删除报销附件 - public function del_expense_interfix() - { - $id = get_params("id"); - $admin_id = Db::name('ExpenseInterfix')->where('id', $id)->value('admin_id'); - if ($admin_id == $this->uid) { - if (Db::name('ExpenseInterfix')->where('id', $id)->delete() !== false) { - return to_assign(0, "删除成功"); - } else { - return to_assign(1, "删除失败"); - } - } else { - return to_assign(1, "您没权限删除该报销数据"); - } - } - //删除消息附件 - public function del_message_interfix() - { - $id = get_params("id"); - $detail = Db::name('MessageFileInterfix')->where('id', $id)->find(); - if ($detail['admin_id'] == $this->uid) { - if (Db::name('MessageFileInterfix')->where('id', $id)->delete() !== false) { - $data = Db::name('MessageFileInterfix')->where('mid', $detail['mid'])->column('file_id'); - return to_assign(0, "删除成功",$data); - } else { - return to_assign(1, "删除失败"); - } - } else { - return to_assign(1, "您没权限删除该消息附件"); - } - - } - - //获取访问记录 - public function get_view_data() + //流程审核 + public function flow_check() { $param = get_params(); - $first_time = time(); - $second_time = $first_time - 86400; - $three_time = $first_time - 86400 * 365; - $begin_first = strtotime(date('Y-m-d', $first_time) . " 00:00:00"); - $end_first = strtotime(date('Y-m-d', $first_time) . " 23:59:59"); - $begin_second = strtotime(date('Y-m-d', $second_time) . " 00:00:00"); - $end_second = strtotime(date('Y-m-d', $second_time) . " 23:59:59"); - $begin_three = strtotime(date('Y-m-d', $three_time) . " 00:00:00"); - $data_first = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_first,$end_first")->select(); - $data_second = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_second,$end_second")->select(); - $data_three = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_three,$end_first")->select(); - return to_assign(0, '', ['data_first' => hour_document($data_first), 'data_second' => hour_document($data_second), 'data_three' => date_document($data_three)]); + $id = $param['id']; + $type = $param['type']; + $detail = []; + if($type==1){ + //日常审核 + $detail = Db::name('Approve')->where(['id' => $id])->find(); + } + else if($type==2){ + //报销审核 + $detail = Db::name('Expense')->where(['id' => $id])->find(); + } + else if($type==3){ + //发票审核 + $detail = Db::name('Invoice')->where(['id' => $id])->find(); + } + else if($type==4){ + //合同审核 + $detail = Db::name('Contract')->where(['id' => $id])->find(); + } + if (empty($detail)){ + return to_assign(1,'审批数据错误'); + } + //当前审核节点详情 + $step = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); + + //审核通过 + if($param['check'] == 1){ + $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); + if (!in_array($this->uid, $check_admin_ids)){ + return to_assign(1,'您没权限审核该审批'); + } + + //多人会签审批 + if($step['flow_type'] == 4){ + //查询当前会签记录数 + $check_count = Db::name('FlowRecord')->where(['action_id'=>$id,'type'=>$type,'step_id'=>$step['id']])->count(); + //当前会签记应有记录数 + $flow_count = explode(',', $step['flow_uids']); + if(($check_count+1) >=count($flow_count)){ + $next_step = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); + if($next_step){ + //存在下一步审核 + $param['check_admin_ids'] = $next_step['flow_uids']; + $param['check_step_sort'] = $detail['check_step_sort']+1; + $param['check_status'] = 1; + } + else{ + //不存在下一步审核,审核结束 + $param['check_status'] = 2; + $param['check_admin_ids'] =''; + } + } + else{ + $param['check_status'] = 1; + $param['check_admin_ids'] = $step['flow_uids']; + } + } + else if($step['flow_type'] == 0){ + //自由人审批 + if($param['check_node'] == 2){ + $next_step = $detail['check_step_sort']+1; + $flow_step = array( + 'action_id' => $id, + 'sort' => $next_step, + 'type' => $type, + 'flow_uids' => $param['check_admin_ids'], + 'create_time' => time() + ); + $fid = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); + //下一步审核步骤 + $param['check_admin_ids'] = $param['check_admin_ids']; + $param['check_step_sort'] = $next_step; + $param['check_status'] = 1; + } + else{ + //不存在下一步审核,审核结束 + $param['check_status'] = 2; + $param['check_admin_ids'] =''; + } + } + else{ + $next_step = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); + if($next_step){ + //存在下一步审核 + if($next_step['flow_type'] == 1){ + $param['check_admin_ids'] = get_department_leader($this->uid); + } + else if($next_step['flow_type'] == 2){ + $param['check_admin_ids'] = get_department_leader($this->uid,1); + } + else{ + $param['check_admin_ids'] = $next_step['flow_uids']; + } + $param['check_step_sort'] = $detail['check_step_sort']+1; + $param['check_status'] = 1; + } + else{ + //不存在下一步审核,审核结束 + $param['check_status'] = 2; + $param['check_admin_ids'] =''; + } + } + if($param['check_status'] == 1 && $param['check_admin_ids']==''){ + return to_assign(1,'找不到下一步的审批人,该审批流程设置有问题,请联系HR或者管理员'); + } + //审核通过数据操作 + $param['last_admin_id'] = $this->uid; + $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; + + if($type==1){ + //日常审核 + $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==2){ + //报销审核 + $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==3){ + //发票审核 + $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==4){ + //合同审核 + $res = Db::name('Contract')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + + if($res!==false){ + $checkData=array( + 'action_id' => $id, + 'step_id' => $step['id'], + 'check_user_id' => $this->uid, + 'type' => $type, + 'check_time' => time(), + 'status' => $param['check'], + 'content' => $param['content'], + 'create_time' => time() + ); + $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('check', $param['id'], $param); + //发送消息通知 + $msg=[ + 'create_time'=>time(), + 'action_id'=>$id + ]; + if($param['check_status'] == 1){ + $users = $param['check_admin_ids']; + sendMessage($users,($type*10+11),$msg); + } + if($param['check_status'] == 2){ + $users = $detail['admin_id']; + sendMessage($users,($type*10+12),$msg); + } + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } + else if($param['check'] == 2){ + $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); + if (!in_array($this->uid, $check_admin_ids)){ + return to_assign(1,'您没权限审核该审批'); + } + //拒绝审核,数据操作 + $param['check_status'] = 3; + $param['last_admin_id'] = $this->uid; + $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; + $param['check_admin_ids'] =''; + if($step['flow_type'] == 5){ + //获取上一步的审核信息 + $prev_step = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'sort'=>($detail['check_step_sort']-1),'delete_time'=>0])->find(); + if($prev_step){ + //存在上一步审核 + $param['check_step_sort'] = $prev_step['sort']; + $param['check_admin_ids'] = $prev_step['flow_uids']; + $param['check_status'] = 1; + } + else{ + //不存在上一步审核,审核初始化步骤 + $param['check_step_sort'] = 0; + $param['check_admin_ids'] = ''; + $param['check_status'] = 0; + } + } + if($type==1){ + //日常审核 + $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==2){ + //报销审核 + $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==3){ + //发票审核 + $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + else if($type==4){ + //合同审核 + $res = Db::name('Contract')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); + } + if($res!==false){ + $checkData=array( + 'action_id' => $id, + 'step_id' => $step['id'], + 'check_user_id' => $this->uid, + 'type' => $type, + 'check_time' => time(), + 'status' => $param['check'], + 'content' => $param['content'], + 'create_time' => time() + ); + $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('refue', $param['id'], $param); + //发送消息通知 + $msg=[ + 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), + 'action_id'=>$detail['id'] + ]; + $users = $detail['admin_id']; + sendMessage($users,($type*10+13),$msg); + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } + else if($param['check'] == 3){ + if($detail['admin_id'] != $this->uid){ + return to_assign(1,'你没权限操作'); + } + //撤销审核,数据操作 + $param['check_status'] = 4; + $param['check_admin_ids'] =''; + $param['check_step_sort'] =0; + if($type==1){ + //日常审核 + $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,check_admin_ids')->update($param); + } + else if($type==2){ + //报销审核 + $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,check_admin_ids')->update($param); + } + else if($type==3){ + //发票审核 + $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,check_admin_ids')->update($param); + } + else if($type==4){ + //合同审核 + $res = Db::name('Contract')->strict(false)->field('check_step_sort,check_status,check_admin_ids')->update($param); + } + if($res!==false){ + $checkData=array( + 'action_id' => $id, + 'step_id' => 0, + 'check_user_id' => $this->uid, + 'type' => $type, + 'check_time' => time(), + 'status' => $param['check'], + 'content' => $param['content'], + 'create_time' => time() + ); + $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('back', $param['id'], $param); + return to_assign(); + }else{ + return to_assign(1,'操作失败'); + } + } + } + + //获取关键字 + public function get_keyword_cate() + { + $keyword = Db::name('Keywords')->where(['status' => 1])->order('id desc')->select()->toArray(); + return to_assign(0, '', $keyword); + } + + //读取报销类型 + function get_expense_cate() + { + $cate = get_expense_cate(); + return to_assign(0, '', $cate); + } + + //读取费用类型 + function get_cost_cate() + { + $cate = get_cost_cate(); + return to_assign(0, '', $cate); + } + + //读取印章类型 + function get_seal_cate() + { + $cate = get_seal_cate(); + return to_assign(0, '', $cate); + } + + //读取车辆类型 + function get_car_cate() + { + $cate = get_car_cate(); + return to_assign(0, '', $cate); + } + + //读取企业主体 + function get_subject() + { + $subject = get_subject(); + return to_assign(0, '', $subject); + } + + //读取行业类型 + function get_industry() + { + $industry = get_industry(); + return to_assign(0, '', $industry); + } + + //读取服务类型 + function get_services() + { + $services = get_services(); + return to_assign(0, '', $services); + } + + //获取工作类型列表 + public function get_work_cate() + { + $cate = get_work_cate(); + return to_assign(0, '', $cate); } } diff --git a/app/base/BaseController.php b/app/base/BaseController.php index e74d72f..bbfdad7 100644 --- a/app/base/BaseController.php +++ b/app/base/BaseController.php @@ -90,7 +90,7 @@ abstract class BaseController $this->did = Session::get($session_admin)['did']; View::assign('login_user', $this->uid); // 验证用户访问权限 - if (($this->module == 'api') || ($this->module == 'home' && $this->controller == 'index')) { + if (($this->module == 'api') || ($this->module == 'message') || ($this->module == 'home' && $this->controller == 'index')) { return true; } else{ @@ -101,7 +101,7 @@ abstract class BaseController } if (!$this->checkAuth()) { if ($this->request->isAjax()) { - return to_assign(405, '你没有权限,请联系管理员或者人事部'); + return to_assign(405, '你没有权限,请联系管理员或者HR'); } else { echo '
你没有权限访问,请联系管理员或者人事部
';exit; } diff --git a/app/base/view/common/errortemplate.html b/app/base/view/common/errortemplate.html index c8f197b..bf4178c 100644 --- a/app/base/view/common/errortemplate.html +++ b/app/base/view/common/errortemplate.html @@ -31,7 +31,7 @@
{$file | default=""}模板不存在,请检查对应的目录文件,注意区分大小写!
diff --git a/app/base/view/common/roletemplate.html b/app/base/view/common/roletemplate.html new file mode 100644 index 0000000..5644099 --- /dev/null +++ b/app/base/view/common/roletemplate.html @@ -0,0 +1,38 @@ + + + + + + + + + 你没有权限 + + + + +
+
+
+
4
😔
6
+
+
哎呀!你没有权限,请联系管理员或者HR!
+
+ +
+ + + \ No newline at end of file diff --git a/app/common.php b/app/common.php index c0cba3f..c6d1fde 100644 --- a/app/common.php +++ b/app/common.php @@ -231,58 +231,170 @@ function get_position() return $position; } -//读取行业 +//根据流程类型读取某部门某模块的审核流程 +function get_cate_department_flows($cate=1,$department=0) +{ + $map1 = []; + $map2 = []; + $map1[] = ['status', '=', 1]; + $map1[] = ['flow_cate', '=', $cate]; + $map1[] = ['department_ids', '=', '']; + + $map2[] = ['status', '=', 1]; + $map2[] = ['flow_cate', '=', $cate]; + $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; + + $list = Db::name('Flow')->field('id,name,check_type')->whereOr([$map1,$map2])->order('id desc')->select()->toArray(); + return $list; +} + +//根据流程所属模块读取某部门某模块的审核流程 +function get_type_department_flows($type=6,$department=0) +{ + $map1 = []; + $map2 = []; + $map1[] = ['status', '=', 1]; + $map1[] = ['type', '=', $type]; + $map1[] = ['department_ids', '=', '']; + + $map2[] = ['status', '=', 1]; + $map2[] = ['type', '=', $type]; + $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; + + $list = Db::name('Flow')->field('id,name,check_type')->whereOr([$map1,$map2])->order('id desc')->select()->toArray(); + return $list; +} + + +/** + * 初始化审批流程数据 + * @param $flow_id 审批流程id + * @return + */ +function set_flow($flow_id,$check_admin_ids='') +{ + $flow_detail = Db::name('Flow')->where('id',$flow_id)->find(); + $check_type = $flow_detail['check_type']; + $flow = unserialize($flow_detail['flow_list']); + if ($check_type == 1) { + if($flow[0]['flow_type'] == 1){ + //部门负责人 + $leader = get_department_leader($this->uid); + if($leader == 0){ + return to_assign(1,'审批流程设置有问题:当前部门负责人还未设置,请联系HR或者管理员'); + } + else{ + $check_admin_ids = $leader; + } + } + else if($flow[0]['flow_type'] == 2){ + //上级部门负责人 + $leader = get_department_leader($this->uid,1); + if($leader == 0){ + return to_assign(1,'审批流程设置有问题:上级部门负责人还未设置,请联系HR或者管理员'); + } + else{ + $check_admin_ids = $leader; + } + } + else{ + $check_admin_ids = $flow[0]['flow_uids']; + } + } + else if ($check_type == 3) { + $check_admin_ids = $flow[0]['flow_uids']; + } + $flow_data = array( + 'check_type' => $check_type, + 'flow' => $flow, + 'check_admin_ids' => $check_admin_ids + ); + return $flow_data; +} + +/** + * 获取审批流程数据 + * @param $uid 当前登录用户 + * @param $flows 当前步骤内容 + * @return + */ +function get_flow($uid,$flows) +{ + $check_user = ''; + $check_user_ids = []; + if($flows['flow_type']==1){ + $check_user = '部门负责人-'; + $check_user_ids[]=get_department_leader($uid); + } + else if($flows['flow_type']==2){ + $check_user = '上级部门负责人-'; + $check_user_ids[]=get_department_leader($uid,1); + } + else{ + $check_user_ids = explode(',',$flows['flow_uids']); + } + $check_user_array = Db::name('Admin')->where('id','in',$check_user_ids)->column('name'); + $res = array( + 'check_user' => $check_user.implode(',',$check_user_array), + 'check_user_ids' => $check_user_ids + ); + return $res; +} + +//读取报销类型 +function get_expense_cate() +{ + $expense = Db::name('ExpenseCate')->where(['status' => 1])->select()->toArray(); + return $expense; +} + +//读取费用类型 +function get_cost_cate() +{ + $cost = Db::name('CostCate')->where(['status' => 1])->select()->toArray(); + return $cost; +} + +//读取印章类型 +function get_seal_cate() +{ + $seal = Db::name('SealCate')->where(['status' => 1])->select()->toArray(); + return $seal; +} + +//读取车辆类型 +function get_car_cate() +{ + $car = Db::name('CarCate')->where(['status' => 1])->select()->toArray(); + return $car; +} + +//读取企业主体 +function get_subject() +{ + $subject = Db::name('Subject')->where(['status' => 1])->select()->toArray(); + return $subject; +} + +//读取行业类型 function get_industry() { $industry = Db::name('Industry')->where(['status' => 1])->select()->toArray(); return $industry; } -//读取服务 +//读取服务类型 function get_services() { $services = Db::name('Services')->where(['status' => 1])->select()->toArray(); return $services; } -//根据流程模块读取某部门某模块的审核流程 -function get_flows($type=1,$department=0) +//读取工作类型 +function get_work_cate() { - $map1 = []; - $map2 = []; - $map1[] = ['status', '=', 1]; - $map1[] = ['flow_cate', '=', $type]; - $map1[] = ['department_ids', '=', '']; - - $map2[] = ['status', '=', 1]; - $map2[] = ['flow_cate', '=', $type]; - $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; - - $list = Db::name('Flow') - ->field('id,name,check_type') - ->whereOr([$map1,$map2]) - ->order('id desc')->select()->toArray(); - return $list; -} - -//根据流程所属模块读取某部门某模块的审核流程 -function get_type_flows($module=6,$department=0) -{ - $map1 = []; - $map2 = []; - $map1[] = ['status', '=', 1]; - $map1[] = ['type', '=', $module]; - $map1[] = ['department_ids', '=', '']; - - $map2[] = ['status', '=', 1]; - $map2[] = ['type', '=', $module]; - $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; - - $list = Db::name('Flow') - ->field('id,name,check_type') - ->whereOr([$map1,$map2]) - ->order('id desc')->select()->toArray(); - return $list; + $work = Db::name('WorkCate')->where(['status' => 1])->select()->toArray(); + return $work; } /** diff --git a/app/contract/controller/Api.php b/app/contract/controller/Api.php index aeb160f..7570152 100644 --- a/app/contract/controller/Api.php +++ b/app/contract/controller/Api.php @@ -87,30 +87,71 @@ class Api extends BaseController public function check() { if (request()->isPost()) { - $params = get_params(); - if($params['status'] == 3){ - $params['check_uid'] = $this->uid; - $params['check_time'] = time(); - $params['check_remark'] = $params['mark']; + $param = get_params(); + if($param['check_status'] == 1){ + $check_admin_ids = isset($param['check_admin_ids'])?$param['check_admin_ids']:''; + $flow_data = set_flow($param['flow_id'],$check_admin_ids); + $param['check_admin_ids'] = $flow_data['check_admin_ids']; + $flow = $flow_data['flow']; + $check_type = $flow_data['check_type']; + //删除原来的审核流程和审核记录 + Db::name('FlowStep')->where(['action_id'=>$param['id'],'type'=>4,'delete_time'=>0])->update(['delete_time'=>time()]); + Db::name('FlowRecord')->where(['action_id'=>$param['id'],'type'=>4,'delete_time'=>0])->update(['delete_time'=>time()]); + if($check_type == 2){ + $flow_step = array( + 'action_id' => $param['id'], + 'type' => 4, + 'flow_uids' => $param['check_admin_ids'], + 'create_time' => time() + ); + //增加审核流程 + Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); + } + else{ + foreach ($flow as $key => &$value){ + $value['action_id'] = $param['id']; + $value['sort'] = $key; + $value['type'] = 4; + $value['create_time'] = time(); + } + //增加审核流程 + Db::name('FlowStep')->strict(false)->field(true)->insertAll($flow); + } + $checkData=array( + 'action_id' => $param['id'], + 'step_id' => 0, + 'check_user_id' => $this->uid, + 'type' => 4, + 'check_time' => time(), + 'status' => 0, + 'content' => '提交申请', + 'create_time' => time() + ); + $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); } - if($params['status'] == 4){ - $params['stop_uid'] = $this->uid; - $params['stop_time'] = time(); - $params['stop_remark'] = $params['mark']; + if($param['check_status'] == 3){ + $param['check_uid'] = $this->uid; + $param['check_time'] = time(); + $param['check_remark'] = $param['mark']; } - if($params['status'] == 5){ - $params['void_uid'] = $this->uid; - $params['void_time'] = time(); - $params['void_remark'] = $params['mark']; + if($param['check_status'] == 4){ + $param['stop_uid'] = $this->uid; + $param['stop_time'] = time(); + $param['stop_remark'] = $param['mark']; } - $old = Db::name('Contract')->where('id', $params['id'])->find(); - if (Db::name('Contract')->strict(false)->update($params) !== false) { + if($param['check_status'] == 5){ + $param['void_uid'] = $this->uid; + $param['void_time'] = time(); + $param['void_remark'] = $param['mark']; + } + $old = Db::name('Contract')->where('id', $param['id'])->find(); + if (Db::name('Contract')->strict(false)->update($param) !== false) { $log_data = array( - 'field' => 'status', - 'contract_id' => $params['id'], + 'field' => 'check_status', + 'contract_id' => $param['id'], 'admin_id' => $this->uid, - 'new_content' => $params['status'], - 'old_content' => $old['status'], + 'new_content' => $param['check_status'], + 'old_content' => $old['check_status'], 'create_time' => time(), ); Db::name('ContractLog')->strict(false)->field(true)->insert($log_data); @@ -127,20 +168,20 @@ class Api extends BaseController public function archive() { if (request()->isPost()) { - $params = get_params(); + $param = get_params(); $old = 1; - if($params['archive_status'] == 1){ - $params['archive_uid'] = $this->uid; - $params['archive_time'] = time(); + if($param['archive_status'] == 1){ + $param['archive_uid'] = $this->uid; + $param['archive_time'] = time(); $old = 0; } - $old = Db::name('Contract')->where('id', $params['id'])->find(); - if (Db::name('Contract')->strict(false)->update($params) !== false) { + $old = Db::name('Contract')->where('id', $param['id'])->find(); + if (Db::name('Contract')->strict(false)->update($param) !== false) { $log_data = array( 'field' => 'archive_status', - 'contract_id' => $params['id'], + 'contract_id' => $param['id'], 'admin_id' => $this->uid, - 'new_content' => $params['archive_status'], + 'new_content' => $param['archive_status'], 'old_content' => $old['archive_status'], 'create_time' => time(), ); diff --git a/app/contract/controller/Index.php b/app/contract/controller/Index.php index ec84b5f..5bc952b 100644 --- a/app/contract/controller/Index.php +++ b/app/contract/controller/Index.php @@ -33,43 +33,24 @@ class Index extends BaseController if (!empty($param['type'])) { $where[] = ['a.type', '=', $param['type']]; } - if (!empty($param['status'])) { - $where[] = ['a.status', '=', $param['status']]; + if (!empty($param['check_status'])) { + $where[] = ['a.check_status', '=', $param['check_status']]; } $where[] = ['a.delete_time', '=', 0]; $where[] = ['a.archive_status', '=', 0]; $uid = $this->uid; - $auth = contract_auth($uid); + $auth = isAuth($uid,'contract'); if($auth==0){ $whereOr[] =['a.admin_id|a.prepared_uid|a.sign_uid|a.keeper_uid', '=', $uid]; $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; + $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.check_admin_ids)")]; + $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.flow_admin_ids)")]; } - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - $content = ContractList::where($where) - ->where(function ($query) use($whereOr) { - $query->whereOr($whereOr); - }) - ->field('a.*,c.title as cate_title,d.title as sign_department') - ->alias('a') - ->join('contract_cate c', 'a.cate_id = c.id') - ->join('department d', 'a.sign_did = d.id','LEFT') - ->order('a.create_time desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - $item->keeper_name = Db::name('Admin')->where(['id' => $item->keeper_uid])->value('name'); - $item->sign_name = Db::name('Admin')->where(['id' => $item->sign_uid])->value('name'); - $item->sign_time = date('Y-m-d', $item->sign_time); - $item->interval_time = date('Y-m-d', $item->start_time) . ' 至 ' . date('Y-m-d', $item->end_time); - $item->type_name = ContractList::$Type[(int) $item->type]; - $item->status_name = ContractList::$Status[(int) $item->status]; - $item->chack_status_name = ContractList::$Status[(int) $item->CheckStatus]; - if($item->cost == 0){ - $item->cost = '-'; - } - }); - return table_assign(0, '', $content); + $model = new ContractList(); + $list = $model->get_list($param, $where, $whereOr); + return table_assign(0, '', $list); } else { return view(); } @@ -97,36 +78,14 @@ class Index extends BaseController $where[] = ['a.archive_status', '=', 1]; $uid = $this->uid; - $auth = contract_auth($uid); + $auth = isAuth($uid,'contract_admin'); if($auth==0){ $whereOr[] =['a.admin_id|a.prepared_uid|a.sign_uid|a.keeper_uid', '=', $uid]; $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; - } - - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - $content = ContractList::where($where) - ->where(function ($query) use($whereOr) { - $query->whereOr($whereOr); - }) - ->field('a.*,c.title as cate_title,d.title as sign_department') - ->alias('a') - ->join('contract_cate c', 'a.cate_id = c.id') - ->join('department d', 'a.sign_did = d.id','LEFT') - ->order('a.create_time desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - $item->keeper_name = Db::name('Admin')->where(['id' => $item->keeper_uid])->value('name'); - $item->sign_name = Db::name('Admin')->where(['id' => $item->sign_uid])->value('name'); - $item->sign_time = date('Y-m-d', $item->sign_time); - $item->interval_time = date('Y-m-d', $item->start_time) . ' 至 ' . date('Y-m-d', $item->end_time); - $item->type_name = ContractList::$Type[(int) $item->type]; - $item->status_name = ContractList::$Status[(int) $item->status]; - $item->chack_status_name = ContractList::$Status[(int) $item->CheckStatus]; - if($item->cost == 0){ - $item->cost = '-'; - } - }); - return table_assign(0, '', $content); + } + $model = new ContractList(); + $list = $model->get_list($param, $where, $whereOr); + return table_assign(0, '', $list); } else { return view(); } @@ -158,11 +117,11 @@ class Index extends BaseController } $param['update_time'] = time(); $old = Db::name('Contract')->where(['id' => $param['id']])->find(); - $auth = contract_auth($this->uid); - if($this->uid!=$old['admin_id'] && $auth==0 && $old['status'] == 1){ + $auth = isAuth($this->uid,'contract_admin'); + if($this->uid!=$old['admin_id'] && $auth==0 && $old['check_status'] == 1){ return to_assign(1, "只有录入人员和合同管理员有权限操作"); } - if($auth==0 && $old['status'] > 1){ + if($auth==0 && $old['check_status'] > 1){ return to_assign(1, "只有合同管理员有权限操作"); } $res = contractList::strict(false)->field(true)->update($param); @@ -205,10 +164,10 @@ class Index extends BaseController View::assign('id', $id); View::assign('type', $type); View::assign('pid', $pid); - View::assign('auth', contract_auth($this->uid)); + View::assign('auth', isAuth($this->uid,'contract_admin')); if ($id > 0) { $detail = (new ContractList())->detail($id); - if($detail['status']>1){ + if($detail['check_status']>1){ echo '
当前状态不开放编辑,请联系合同管理员
';exit; } View::assign('detail', $detail); @@ -222,27 +181,100 @@ class Index extends BaseController } } - //查看文章 + //查看 public function view() { $id = get_params("id"); $detail = (new ContractList())->detail($id); - $auth = contract_auth($this->uid); - + $auth = isAuth($this->uid,'contract_admin'); + $is_check_admin = 0; + $is_create_admin = 0; + $check_record = []; $auth_array=[]; if(!empty($detail['share_ids'])){ - $auth_array = explode(",",$detail['share_ids']); + $share_ids = explode(",",$detail['share_ids']); + $auth_array = array_merge($auth_array,$share_ids); + } + if(!empty($detail['check_admin_ids'])){ + $check_admin_ids = explode(",",$detail['check_admin_ids']); + $auth_array = array_merge($auth_array,$check_admin_ids); + } + if(!empty($detail['flow_admin_ids'])){ + $flow_admin_ids = explode(",",$detail['flow_admin_ids']); + $auth_array = array_merge($auth_array,$flow_admin_ids); } array_push($auth_array,$detail['admin_id'],$detail['prepared_uid'],$detail['sign_uid'],$detail['keeper_uid']); - if($auth==0 && !in_array($this->uid,$auth_array)){ - echo '
你无权限查看该合同
';exit; + return view('../../base/view/common/roletemplate'); } + + $detail['create_user'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name'); + + $detail['copy_user'] = '-'; + if($detail['copy_uids'] !=''){ + $copy_user = Db::name('Admin')->where('id','in',$detail['copy_uids'])->column('name'); + $detail['copy_user'] = implode(',',$copy_user); + } + + if($detail['check_status']==1){ + $flows = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>4,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); + $flow_check = get_flow($this->uid,$flows); + $detail['check_user'] = $flow_check['check_user']; + $check_user_ids = $flow_check['check_user_ids']; + if(in_array($this->uid,$check_user_ids)){ + $is_check_admin = 1; + if($flows['flow_type'] == 4){ + $check_count = Db::name('FlowRecord')->where(['action_id'=>$detail['id'],'type'=>4,'step_id'=>$flows['id'],'check_user_id'=>$this->uid])->count(); + if($check_count>0){ + $is_check_admin = 0; + } + } + } + + } + else{ + //获取合同审批流程 + $flows = get_type_department_flows(8,$this->did); + $detail['check_user'] = '-'; + } + + if($detail['admin_id'] == $this->uid){ + $is_create_admin = 1; + } + + $check_record = Db::name('FlowRecord')->field('f.*,a.name,a.thumb') + ->alias('f') + ->join('Admin a', 'a.id = f.check_user_id', 'left') + ->where(['f.action_id'=>$detail['id'],'f.type'=>4]) + ->order('check_time asc') + ->select()->toArray(); + foreach ($check_record as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d :H:i', $vv['check_time']); + $vv['status_str'] = '提交'; + if($vv['status'] == 1){ + $vv['status_str'] = '审核通过'; + } + else if($vv['status'] == 2){ + $vv['status_str'] = '审核拒绝'; + } + if($vv['status'] == 3){ + $vv['status_str'] = '撤销'; + } + } + View::assign('is_check_admin', $is_check_admin); + View::assign('is_create_admin', $is_create_admin); + View::assign('check_record', $check_record); + View::assign('flows', $flows); View::assign('auth', $auth); View::assign('detail', $detail); - return view(); + if($detail['check_status'] == 0 || $detail['check_status'] == 4){ + return view('view_set'); + } + else{ + return view(); + } } - //删除文章 + //删除 public function delete() { if (request()->isDelete()) { diff --git a/app/contract/model/Contract.php b/app/contract/model/Contract.php index 4a5fc09..7911ed0 100644 --- a/app/contract/model/Contract.php +++ b/app/contract/model/Contract.php @@ -18,6 +18,7 @@ class Contract extends Model const THREE = 3; const FORE = 4; const FIVE = 5; + const SIX = 6; public static $Type = [ self::ZERO => '未设置', @@ -28,22 +29,54 @@ class Contract extends Model ]; public static $Status = [ - self::ZERO => '未设置', - self::ONE => '已录入', - self::TWO => '待审核', - self::THREE => '已审核', - self::FORE => '已中止', - self::FIVE => '已作废', + self::ZERO => '待审核', + self::ONE => '审核中', + self::TWO => '审核通过', + self::THREE => '审核拒绝', + self::FORE => '已撤销', + self::FIVE => '已中止', + self::SIX => '已作废', ]; public static $ArchiveStatus = [ self::ZERO => '未归档', self::ONE => '已归档', ]; + + //列表检索 + public function get_list($param = [], $where = [], $whereOr=[]) + { + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $list = self::where($where) + ->where(function ($query) use($whereOr) { + $query->whereOr($whereOr); + }) + ->field('a.*,a.type as type_a, c.title as cate_title,d.title as sign_department') + ->alias('a') + ->join('contract_cate c', 'a.cate_id = c.id') + ->join('department d', 'a.sign_did = d.id','LEFT') + ->order('a.create_time desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + $item->keeper_name = Db::name('Admin')->where(['id' => $item->keeper_uid])->value('name'); + $item->sign_name = Db::name('Admin')->where(['id' => $item->sign_uid])->value('name'); + $item->sign_time = date('Y-m-d', $item->sign_time); + $item->interval_time = date('Y-m-d', $item->start_time) . ' 至 ' . date('Y-m-d', $item->end_time); + $item->type_name = self::$Type[(int)$item->type_a]; + $item->status_name = self::$Status[(int)$item->check_status]; + $item->chack_status_name = self::$Status[(int) $item->CheckStatus]; + if($item->cost == 0){ + $item->cost = '-'; + } + }); + return $list; + } + + // 获取合同详情 public function detail($id) { - $detail = Db::name('Contract')->where(['id' => $id])->find(); + $detail = self::where(['id' => $id])->find(); if (!empty($detail)) { $file_array = Db::name('ContractFile') ->field('cf.id,f.filepath,f.name,f.filesize,f.fileext') @@ -53,12 +86,11 @@ class Contract extends Model ->where(array('cf.contract_id' => $id, 'cf.delete_time' => 0)) ->select()->toArray(); - $detail['status_name'] = self::$Status[(int) $detail['status']]; + $detail['status_name'] = self::$Status[(int) $detail['check_status']]; $detail['archive_status_name'] = self::$ArchiveStatus[(int) $detail['archive_status']]; $detail['sign_time'] = date('Y-m-d', $detail['sign_time']); $detail['start_time'] = date('Y-m-d', $detail['start_time']); $detail['end_time'] = date('Y-m-d', $detail['end_time']); - $detail['create_time'] = date('Y-m-d', $detail['create_time']); $detail['cate_title'] = Db::name('ContractCate')->where(['id' => $detail['cate_id']])->value('title'); $detail['sign_department'] = Db::name('Department')->where(['id' => $detail['sign_did']])->value('title'); $detail['sign_name'] = Db::name('Admin')->where(['id' => $detail['sign_uid']])->value('name'); @@ -91,7 +123,7 @@ class Contract extends Model } if($detail['pid']>0){ - $detail['pname'] = Db::name('Contract')->where(['id' => $detail['pid']])->value('name'); + $detail['pname'] = self::where(['id' => $detail['pid']])->value('name'); } $detail['file_array'] = $file_array; } diff --git a/app/contract/model/ContractLog.php b/app/contract/model/ContractLog.php index f50e616..370b0ee 100644 --- a/app/contract/model/ContractLog.php +++ b/app/contract/model/ContractLog.php @@ -15,7 +15,7 @@ class ContractLog extends Model { public static $Sourse = [ 'type' => ['', '未设置', '普通合同', '框架合同', '补充协议', '其他合同'], - 'status' => ['', '已录入', '待审核', '已审核', '已中止', '已作废'], + 'check_status' => ['待审核', '审核中', '审核通过', '审核拒绝', '已撤销', '已中止', '已作废'], 'action' => [ 'add' => '添加', 'edit' => '修改', @@ -42,6 +42,7 @@ class ContractLog extends Model 'cost' => '金额', 'is_tax' => '是否含税', 'tax' => '税点', + 'check_status' => '状态', 'status' => '状态', 'archive_status' => '归档状态', 'file' => '合同附件', diff --git a/app/contract/view/cate/conf.html b/app/contract/view/cate/conf.html index 0186c3a..b9ec3a1 100644 --- a/app/contract/view/cate/conf.html +++ b/app/contract/view/cate/conf.html @@ -8,7 +8,7 @@

合同模块使用说明:

1、设置合同管理员,可设置多个

-

a、拥有合同管理员权限的员工可以查看、编辑、审核、作废、中止所有合同。

+

a、拥有合同管理员权限的员工可以查看、编辑、作废、中止所有合同。

b、非合同管理员的员工,可查看(合同制定人、合同签订人、合同保管人、合同共享人员、合同录入人)相关联的合同。

c、合同的编辑权限只有合同录入人和合同管理员拥有。

2、合同状态有:已录入、待审核、已审核、已中止、已作废

diff --git a/app/contract/view/index/index.html b/app/contract/view/index/index.html index ad83a53..cc91266 100644 --- a/app/contract/view/index/index.html +++ b/app/contract/view/index/index.html @@ -67,8 +67,8 @@ title: '编号', align: 'center', width: 80 - },{ field: 'status', title: '状态', align: 'center', width: 70, templet: function (d) { - var html = '' + d.status_name + ''; + },{ field: 'check_status', title: '状态', align: 'center', width: 70, templet: function (d) { + var html = '' + d.status_name + ''; return html; } },{ @@ -90,7 +90,7 @@ align: 'center', width: 80, templet: function (d) { - var html = '' + d.type_name + ''; + var html = '' + d.type_name + ''; return html; } },{ diff --git a/app/contract/view/index/view.html b/app/contract/view/index/view.html index f365f99..b725e56 100644 --- a/app/contract/view/index/view.html +++ b/app/contract/view/index/view.html @@ -2,22 +2,6 @@ {block name="style"} {/block} {block name="body"} -
+
  • 合同详情
  • 操作记录
-
- +
{gt name="$detail.pid" value="0"} @@ -116,7 +143,7 @@ html{background-color:#fff;} + + + + + + - - - - - - - {lt name="$detail.status" value="3" } - + - - {/lt} - - {eq name="$detail.status" value="3" } - - - - - - - - - - - - - - - - - - + + {notempty name="$check_record"} + + + + + {/notempty} + {eq name="$detail.check_status" value="3" } {eq name="$detail.archive_status" value="0" } @@ -199,20 +220,12 @@ html{background-color:#fff;} {/eq} - {eq name="$detail.status" value="4" } - - - - + {eq name="$detail.check_status" value="4" } - - - - - + @@ -220,67 +233,47 @@ html{background-color:#fff;} {/eq} - {eq name="$detail.status" value="5" } - - - - + {eq name="$detail.check_status" value="5" } - - - - - + - {/eq} - + {/eq}
合同附件
- {eq name="$detail.status" value="1" }
{/eq} + {eq name="$detail.check_status" value="1" }
{/eq}
{volist name="$detail.file_array" id="vo"} @@ -146,45 +173,39 @@ html{background-color:#fff;} 合同签订部门 {$detail.sign_department}
合同保管人{$detail.keeper_name}{gt name="$auth" value="0"}更改{/gt}合同共享人员{$detail.share_names}{gt name="$auth" value="0"}更改{/gt}
审核信息
合同保管人{$detail.keeper_name}{gt name="$auth" value="0"}{/gt}合同共享人员{$detail.share_names}{gt name="$auth" value="0"}{/gt}
合同状态{$detail.status_name}{$detail.status_name} 录入人 {$detail.admin_name} 录入时间 {$detail.create_time}
合同状态{$detail.status_name}
审核人{$detail.check_name} 审核时间{$detail.check_time}录入人{$detail.admin_name} 录入时间{$detail.create_time}
审核备注{$detail.check_remark}
历史审批记录 +
    + {volist name="$check_record" id="vo"} +
  • + +

    {$vo.check_time_str}{$vo.name}{$vo.status_str}了此申请。操作意见:{$vo.content}

    +
  • + {/volist} +
+
归档状态
合同状态{$detail.status_name}
中止人 {$detail.stop_name} 中止时间{$detail.stop_time}录入人{$detail.admin_name} 录入时间{$detail.create_time}{$detail.stop_time}
中止备注
合同状态{$detail.status_name}
作废人 {$detail.void_name} 作废时间{$detail.void_time}录入人{$detail.admin_name} 录入时间{$detail.create_time}{$detail.void_time}
作废备注 {$detail.void_remark}
- {gt name="$auth" value="0"} - {eq name="$detail.status" value="1" } -
- 编辑合同 - - - -
- {/eq} - - {eq name="$detail.status" value="2" } -
- - -
- {/eq} - {eq name="$detail.status" value="3" } -
- {eq name="$detail.archive_status" value="1" } - - {else/} - - + {eq name="$detail.check_status" value="1" } + {include file="/index/view_step" /} + {/eq} + + {gt name="$auth" value="0"} + {eq name="$detail.check_status" value="3" } +
+ {eq name="$detail.archive_status" value="1" } + 反确认归档 + {else/} + 合同归档 + 反确认审核 + {/eq} +
{/eq} -
- {/eq} - {eq name="$detail.status" value="4" } -
- -
- {/eq} - - {eq name="$detail.status" value="5" } -
- -
- {/eq} + {eq name="$detail.check_status" value="5" } +
+ 反中止合同 +
+ {/eq} + + {eq name="$detail.check_status" value="6" } +
+ 反作废合同 +
+ {/eq} {/gt}
@@ -290,7 +283,7 @@ html{background-color:#fff;}
-
+ {/block} @@ -298,19 +291,21 @@ html{background-color:#fff;} {block name="script"} +{/block} + \ No newline at end of file diff --git a/app/contract/view/index/view_step.html b/app/contract/view/index/view_step.html new file mode 100644 index 0000000..2d72dde --- /dev/null +++ b/app/contract/view/index/view_step.html @@ -0,0 +1,285 @@ + + {eq name="$detail.check_status" value="1"} + + + + + + + {/eq} + + + + + + + + + {if ( $is_check_admin eq 1) } + {eq name="$flows.flow_type" value="0"} + + + + + {/eq} + + + + + {/if} +
当前审核人{$detail.check_user}审核状态 + 审批中 +
抄送人{$detail.copy_user}
审批流程 +
+
+ +
{$detail.create_user}
+
提交申请
+ +
+
+
审批节点 * + + +
+ +
+
审批意见 * + +
+ + + + +
+ {eq name="$detail.check_status" value='1'} + {eq name="$is_check_admin" value='1'} + 通过 + {$flows.flow_type == 5?'回退':'拒绝'} + {/eq} + {eq name="$is_create_admin" value='1'} + 撤回 + {/eq} + {/eq} + {if ( $detail.check_status eq 3) AND ( $is_create_admin eq 1) } + 撤回 + {/if} + {if ( $detail.check_status eq 4) AND ( $is_create_admin eq 1) } + 重新编辑 + {/if} +
+ \ No newline at end of file diff --git a/app/customer/common.php b/app/customer/common.php index 27c92cb..c244d33 100644 --- a/app/customer/common.php +++ b/app/customer/common.php @@ -85,7 +85,7 @@ function trace_stage() //写入日志 -function to_log($uid,$type=0,$new,$old) +function to_log($uid,$type,$new,$old) { $log_data = []; $key_array = ['id', 'create_time', 'update_time', 'admin_id','belong_did','belong_time','distribute_time']; diff --git a/app/customer/controller/Api.php b/app/customer/controller/Api.php index 9788dc6..a23e6a4 100644 --- a/app/customer/controller/Api.php +++ b/app/customer/controller/Api.php @@ -17,6 +17,102 @@ use think\facade\View; class Api extends BaseController { + + //分配客户 + public function distribute() + { + if (request()->isAjax()) { + $params = get_params(); + //是否是客户管理员 + $auth = isAuth($this->uid,'customer_admin'); + if($auth==0){ + return to_assign(1, "只有客户管理员才有权限操作"); + } + $data['id'] = $params['id']; + $data['belong_uid'] = $params['uid']; + $data['belong_did'] = $params['did']; + $data['distribute_time'] = time(); + if (Db::name('Customer')->update($data) !== false) { + add_log('allot', $data['id']); + to_log($this->uid,0,$data,['belong_uid'=>0]); + return to_assign(0, "操作成功"); + } else { + return to_assign(1, "操作失败"); + } + } else { + return to_assign(1, "错误的请求"); + } + } + + //删除客户 + public function delete() + { + if (request()->isDelete()) { + $params = get_params(); + //是否是客户管理员 + $auth = isAuth($this->uid,'customer_admin'); + if($auth==0){ + return to_assign(1, "只有客户管理员才有权限操作"); + } + $data['id'] = $params['id']; + $log_data = array( + 'field' => 'del', + 'action' => 'delete', + 'type' => 0, + 'customer_id' => $params['id'], + 'admin_id' => $this->uid, + 'create_time' => time(), + ); + if($params['type'] ==1){ + $data['delete_time'] = time(); + $log_data['action'] = 'totrash'; + } + else{ + $data['delete_time'] = -1; + } + if (Db::name('Customer')->update($data) !== false) { + add_log('delete', $params['id']); + Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, "删除成功"); + } else { + return to_assign(1, "删除失败"); + } + } else { + return to_assign(1, "错误的请求"); + } + } + //还原客户 + public function revert() + { + if (request()->isAjax()) { + $params = get_params(); + //是否是客户管理员 + $auth = isAuth($this->uid,'customer_admin'); + if($auth==0){ + return to_assign(1, "只有客户管理员才有权限操作"); + } + $data['id'] = $params['id']; + $data['delete_time'] = 0; + if (Db::name('Customer')->update($data) !== false) { + add_log('recovery', $params['id']); + $log_data = array( + 'field' => 'del', + 'action' => 'recovery', + 'type' => 0, + 'customer_id' => $params['id'], + 'admin_id' => $this->uid, + 'create_time' => time(), + ); + Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, "删除成功"); + } else { + return to_assign(1, "删除失败"); + } + } else { + return to_assign(1, "错误的请求"); + } + } + //跟进记录列表 public function get_trace() { @@ -99,7 +195,7 @@ class Api extends BaseController } - //添加跟进记录 + //查看跟进记录 public function view_trace() { $param = get_params(); diff --git a/app/customer/controller/Index.php b/app/customer/controller/Index.php index 14083d0..6845bc0 100644 --- a/app/customer/controller/Index.php +++ b/app/customer/controller/Index.php @@ -415,99 +415,5 @@ class Index extends BaseController return to_assign(1, "错误的请求"); } } - - //分配客户 - public function distribute() - { - if (request()->isAjax()) { - $params = get_params(); - //是否是客户管理员 - $auth = isAuth($this->uid,'customer_admin'); - if($auth==0){ - return to_assign(1, "只有客户管理员才有权限操作"); - } - $data['id'] = $params['id']; - $data['belong_uid'] = $params['uid']; - $data['belong_did'] = $params['did']; - $data['distribute_time'] = time(); - if (Db::name('Customer')->update($data) !== false) { - add_log('allot', $data['id']); - to_log($this->uid,0,$data,['belong_uid'=>0]); - return to_assign(0, "操作成功"); - } else { - return to_assign(1, "操作失败"); - } - } else { - return to_assign(1, "错误的请求"); - } - } - - //删除 - public function delete() - { - if (request()->isDelete()) { - $params = get_params(); - //是否是客户管理员 - $auth = isAuth($this->uid,'customer_admin'); - if($auth==0){ - return to_assign(1, "只有客户管理员才有权限操作"); - } - $data['id'] = $params['id']; - $log_data = array( - 'field' => 'del', - 'action' => 'delete', - 'type' => 0, - 'customer_id' => $params['id'], - 'admin_id' => $this->uid, - 'create_time' => time(), - ); - if($params['type'] ==1){ - $data['delete_time'] = time(); - $log_data['action'] = 'totrash'; - } - else{ - $data['delete_time'] = -1; - } - if (Db::name('Customer')->update($data) !== false) { - add_log('delete', $params['id']); - Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); - return to_assign(0, "删除成功"); - } else { - return to_assign(1, "删除失败"); - } - } else { - return to_assign(1, "错误的请求"); - } - } - //还原 - public function revert() - { - if (request()->isAjax()) { - $params = get_params(); - //是否是客户管理员 - $auth = isAuth($this->uid,'customer_admin'); - if($auth==0){ - return to_assign(1, "只有客户管理员才有权限操作"); - } - $data['id'] = $params['id']; - $data['delete_time'] = 0; - if (Db::name('Customer')->update($data) !== false) { - add_log('recovery', $params['id']); - $log_data = array( - 'field' => 'del', - 'action' => 'recovery', - 'type' => 0, - 'customer_id' => $params['id'], - 'admin_id' => $this->uid, - 'create_time' => time(), - ); - Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); - return to_assign(0, "删除成功"); - } else { - return to_assign(1, "删除失败"); - } - } else { - return to_assign(1, "错误的请求"); - } - } + } diff --git a/app/finance/common.php b/app/finance/common.php index 616e7c8..6db4af3 100644 --- a/app/finance/common.php +++ b/app/finance/common.php @@ -10,6 +10,46 @@ ====================== */ use think\facade\Db; + +//是否是报销打款管理员,count>1即有权限 +function isAuthExpense($uid) +{ + if($uid == 1){ + return 1; + } + $map = []; + $map[] = ['name', '=', 'finance_admin']; + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',uids)")]; + $count = Db::name('DataAuth')->where($map)->count(); + return $count; +} + +//是否是发票管理员,count>1即有权限 +function isAuthInvoice($uid) +{ + if($uid == 1){ + return 1; + } + $map = []; + $map[] = ['name', '=', 'finance_admin']; + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',conf_1)")]; + $count = Db::name('DataAuth')->where($map)->count(); + return $count; +} + +//是否是到账管理员,count>1即有权限 +function isAuthIncome($uid) +{ + if($uid == 1){ + return 1; + } + $map = []; + $map[] = ['name', '=', 'finance_admin']; + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',conf_2)")]; + $count = Db::name('DataAuth')->where($map)->count(); + return $count; +} + //读取开票主体 function finance_invoice_subject() { diff --git a/app/finance/controller/Api.php b/app/finance/controller/Api.php new file mode 100644 index 0000000..fd2fc4b --- /dev/null +++ b/app/finance/controller/Api.php @@ -0,0 +1,141 @@ +where('id', $id)->value('admin_id'); + if ($admin_id == $this->uid) { + if (Db::name('ExpenseInterfix')->where('id', $id)->delete() !== false) { + return to_assign(0, "删除成功"); + } else { + return to_assign(1, "删除失败"); + } + } else { + return to_assign(1, "您不是上传者,没权限删除该报销数据"); + } + } + + //报销设置为已打款 + public function topay() + { + $param = get_params(); + if (request()->isAjax()) { + $auth = isAuthExpense($this->uid); + if($auth == 0){ + return to_assign(1, "你没有打款权限,请联系管理员或者HR"); + } + //打款,数据操作 + $param['check_status'] = 5; + $param['pay_admin_id'] = $this->uid; + $param['pay_time'] = time(); + $res = Expense::where('id', $param['id'])->strict(false)->field(true)->update($param); + if ($res !== false) { + add_log('topay', $param['id'],$param,'报销'); + //发送消息通知 + $detail = Expense::where(['id' => $param['id']])->find(); + $msg=[ + 'create_time'=>date('Y-m-d H:i:s',(int)$detail['create_time']), + 'action_id'=>$detail['id'] + ]; + $users = $detail['admin_id']; + sendMessage($users,34,$msg); + return to_assign(); + } else { + return to_assign(1, "操作失败"); + } + } + } + + //开具发票 + public function open() + { + $param = get_params(); + if (request()->isAjax()) { + $auth = isAuthInvoice($this->uid); + if($auth == 0){ + return to_assign(1, "你没有开票权限,请联系管理员或者HR"); + } + $status = Invoice::where(['id' => $param['id']])->value('check_status'); + if ($status == 2) { + $param['check_status'] = 5; + $param['open_admin_id'] = $this->uid; + } + $param['open_time'] = isset($param['open_time']) ? strtotime(urldecode($param['open_time'])) : 0; + $res = Invoice::where('id', $param['id'])->strict(false)->field('code,check_status,open_time,open_admin_id,delivery')->update($param); + if ($res !== false) { + add_log('open', $param['id'],$param,'发票'); + return to_assign(); + } else { + return to_assign(1, "操作失败"); + } + } + } + + //作废发票 + public function tovoid() + { + $param = get_params(); + if (request()->isAjax()) { + $auth = isAuthInvoice($this->uid); + if($auth == 0){ + return to_assign(1, "你没有作废发票权限,请联系管理员或者HR"); + } + if ($param['check_status'] == 10) { + $count = InvoiceIncome::where(['inid'=>$param['id'],'status'=>1])->count(); + if($count>0){ + return to_assign(1, "发票已经新增有到账记录,请先反到账后再作废发票"); + } + else{ + $param['update_time'] = time(); + } + } + $res = Invoice::where('id', $param['id'])->strict(false)->field('check_status')->update($param); + if ($res !== false) { + return to_assign(); + add_log('tovoid', $param['id'],$param,'发票'); + } else { + return to_assign(1, "操作失败"); + } + } + } + + //反作废发票 + public function novoid() + { + $param = get_params(); + if (request()->isAjax()) { + $auth = isAuthInvoice($this->uid); + if($auth == 0){ + return to_assign(1, "你没有作废发票权限,请联系管理员或者HR"); + } + $param['check_status'] = 5; + $param['update_time'] = time(); + add_log('tovoid', $param['id'],$param,'发票'); + $res = Invoice::where('id', $param['id'])->strict(false)->field('check_status')->update($param); + if ($res !== false) { + return to_assign(); + add_log('novoid', $param['id'],$param,'发票'); + } else { + return to_assign(1, "操作失败"); + } + } + } + +} diff --git a/app/finance/controller/Expense.php b/app/finance/controller/Expense.php index 9a1bd84..e500f7a 100644 --- a/app/finance/controller/Expense.php +++ b/app/finance/controller/Expense.php @@ -18,74 +18,24 @@ use think\facade\View; class Expense extends BaseController { - public function get_list($where = [], $param = [], $type='and') + public function conf() { - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - if($type == 'or'){ - $expense = ExpenseList::whereOr($where) - ->order('id desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - $item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month); - $item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time); - $item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); - $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); - $item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name'); - $item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time); - $item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount'); - $item['check_user'] = '-'; - if($item['check_status']<2 && !empty($item['check_admin_ids'])){ - $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); - $item['check_user'] = implode(',',$check_user); - } - }); - } - else{ - $expense = ExpenseList::where($where) - ->order('id desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - $item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month); - $item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time); - $item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); - $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); - $item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name'); - $item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time); - $item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount'); - $item['check_user'] = '-'; - if($item['check_status']<2 && !empty($item['check_admin_ids'])){ - $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); - $item['check_user'] = implode(',',$check_user); - } - }); - } - return $expense; - } - - public function detail($id = 0) - { - $expense = Db::name('Expense')->where(['id' => $id])->find(); - if ($expense) { - $expense['income_month'] = empty($expense['income_month']) ? '-' : date('Y-m', $expense['income_month']); - $expense['expense_time'] = empty($expense['expense_time']) ? '-' : date('Y-m-d', $expense['expense_time']); - $expense['create_user'] = Db::name('Admin')->where(['id' => $expense['admin_id']])->value('name'); - $expense['department'] = Db::name('Department')->where(['id' => $expense['did']])->value('title'); - $expense['amount'] = Db::name('ExpenseInterfix')->where(['exid' => $expense['id']])->sum('amount'); - if ($expense['pay_time'] > 0) { - $expense['pay_time'] = date('Y-m-d H:i:s', $expense['pay_time']); - $expense['pay_admin'] = Db::name('Admin')->where(['id' => $expense['pay_admin_id']])->value('name'); - } - else{ - $expense['pay_time'] = '-'; - } - $expense['list'] = Db::name('ExpenseInterfix') - ->field('a.*,c.title as cate_title') - ->alias('a') - ->join('ExpenseCate c', 'a.cate_id = c.id','LEFT') - ->where(['a.exid' => $expense['id']]) - ->select(); + $param = get_params(); + if (request()->isPost()) { + $param['update_time'] = time(); + $res = Db::name('DataAuth')->strict(false)->field(true)->update($param); + return to_assign(); + } else { + $detail = Db::name('DataAuth')->where('name','finance_admin')->find(); + $unames = Db::name('Admin')->where('id', 'in', $detail['uids'])->column('name'); + $detail['unames'] = implode(',', $unames); + $conf_unames_1 = Db::name('Admin')->where('id', 'in', $detail['conf_1'])->column('name'); + $detail['conf_unames_1'] = implode(',', $conf_unames_1); + $conf_unames_2 = Db::name('Admin')->where('id', 'in', $detail['conf_2'])->column('name'); + $detail['conf_unames_2'] = implode(',', $conf_unames_2); + View::assign('detail', $detail); + return view(); } - return $expense; } public function index() @@ -93,6 +43,7 @@ class Expense extends BaseController if (request()->isAjax()) { $param = get_params(); $where = []; + $where[] = ['delete_time', '=', 0]; //按时间检索 $start_time = !empty($param['start_time']) ? strtotime(urldecode($param['start_time'])) : 0; $end_time = !empty($param['end_time']) ? strtotime(urldecode($param['end_time'])) : 0; @@ -103,9 +54,10 @@ class Expense extends BaseController $where[] = ['admin_id','=',$this->uid]; if (!empty($param['check_status']) && $param['check_status']!='') { $where[] = ['check_status', '=', $param['check_status']]; - } - $expense = $this->get_list($where, $param); - return table_assign(0, '', $expense); + } + $model = new ExpenseList; + $list = $model->get_list($param,$where); + return table_assign(0, '', $list); } else { return view(); } @@ -122,16 +74,22 @@ class Expense extends BaseController $map1 = []; $map2 = []; $map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',check_admin_ids)")]; + $map1[] = ['delete_time', '=', 0]; + $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',flow_admin_ids)")]; + $map2[] = ['delete_time', '=', 0]; if($status == 0){ - $list = $this->get_list([$map1,$map2],$param,'or'); + $model = new ExpenseList; + $list = $model->get_list($param,[$map1,$map2],'or'); } if($status == 1){ - $list = $this->get_list($map1,$param); + $model = new ExpenseList; + $list = $model->get_list($param,$map1); } if($status == 2){ - $list = $this->get_list($map2,$param); + $model = new ExpenseList; + $list = $model->get_list($param,$map2); } return table_assign(0, '', $list); } else { @@ -150,12 +108,13 @@ class Expense extends BaseController $start_time = !empty($param['start_time']) ? strtotime(urldecode($param['start_time'])) : 0; $end_time = !empty($param['end_time']) ? strtotime(urldecode($param['end_time'])) : 0; if ($start_time > 0 && $end_time > 0) { - $where[] = ['expense_time', 'between', [$start_time, $end_time]]; + $map[] = ['expense_time', 'between', [$start_time, $end_time]]; } $map[] = ['check_status', '=', 2]; - $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',copy_uids)")]; - $expense = $this->get_list($map, $param); - return table_assign(0, '', $expense); + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',copy_uids)")]; + $model = new ExpenseList; + $list = $model->get_list($param,$map); + return table_assign(0, '', $list); } else { return view(); } @@ -179,9 +138,14 @@ class Expense extends BaseController if ($start_time > 0 && $end_time > 0) { $where[] = ['expense_time', 'between', [$start_time, $end_time]]; } - $list = $this->get_list($where,$param); + $model = new ExpenseList; + $list = $model->get_list($param,$where); return table_assign(0, '', $list); } else { + $auth = isAuthExpense($this->uid); + if($auth == 0){ + return view('../../base/view/common/roletemplate'); + } return view(); } } @@ -191,7 +155,6 @@ class Expense extends BaseController { $param = get_params(); if (request()->isAjax()) { - $dbRes = false; $admin_id = $this->uid; $param['income_month'] = isset($param['income_month']) ? strtotime(urldecode($param['income_month'])) : 0; $param['expense_time'] = isset($param['expense_time']) ? strtotime(urldecode($param['expense_time'])) : 0; @@ -229,6 +192,7 @@ class Expense extends BaseController } } + $dbRes = false; if (!empty($param['id']) && $param['id'] > 0) { try { validate(ExpenseCheck::class)->scene('edit')->check($param); @@ -287,49 +251,56 @@ class Expense extends BaseController } $res = ExpenseList::where('id', $param['id'])->strict(false)->field(true)->update($param); - if ($res !== false) { - $exid = $param['id']; - //相关内容多个数组; - $amountData = isset($param['amount']) ? $param['amount'] : ''; - $remarksData = isset($param['remarks']) ? $param['remarks'] : ''; - $cateData = isset($param['cate_id']) ? $param['cate_id'] : ''; - $idData = isset($param['expense_id']) ? $param['expense_id'] : 0; - if ($amountData) { - foreach ($amountData as $key => $value) { - if (!$value) { - continue; - } - $data = []; - $data['id'] = $idData[$key]; - $data['exid'] = $exid; - $data['admin_id'] = $admin_id; - $data['amount'] = $amountData[$key]; - $data['cate_id'] = $cateData[$key]; - $data['remarks'] = $remarksData[$key]; - if ($data['id'] > 0) { - $data['update_time'] = time(); - $resa = Db::name('ExpenseInterfix')->strict(false)->field(true)->update($data); - } else { - $data['create_time'] = time(); - $eid = Db::name('ExpenseInterfix')->strict(false)->field(true)->insertGetId($data); - } - } - } - add_log('edit', $exid, $param); - //发送消息通知 - $msg=[ - 'from_uid'=>$this->uid, - 'action_id'=>$param['id'] - ]; - $users = $param['check_admin_ids']; - sendMessage($users,31,$msg); - Db::commit(); - $dbRes = true; - } else { - Db::rollback(); - } + + $exid = $param['id']; + //相关内容多个数组; + $amountData = isset($param['amount']) ? $param['amount'] : ''; + $remarksData = isset($param['remarks']) ? $param['remarks'] : ''; + $cateData = isset($param['cate_id']) ? $param['cate_id'] : ''; + $idData = isset($param['expense_id']) ? $param['expense_id'] : 0; + if ($amountData) { + foreach ($amountData as $key => $value) { + if (!$value) { + continue; + } + $data = []; + $data['id'] = $idData[$key]; + $data['exid'] = $exid; + $data['admin_id'] = $admin_id; + $data['amount'] = $amountData[$key]; + $data['cate_id'] = $cateData[$key]; + $data['remarks'] = $remarksData[$key]; + if ($data['id'] > 0) { + $data['update_time'] = time(); + $resa = Db::name('ExpenseInterfix')->strict(false)->field(true)->update($data); + } else { + $data['create_time'] = time(); + $eid = Db::name('ExpenseInterfix')->strict(false)->field(true)->insertGetId($data); + } + } + } + //添加提交申请记录 + $checkData=array( + 'action_id' => $exid, + 'check_user_id' => $this->uid, + 'content' => '重新提交申请', + 'type' => 2, + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('edit', $exid, $param); + //发送消息通知 + $msg=[ + 'from_uid'=>$this->uid, + 'action_id'=>$param['id'] + ]; + $users = $param['check_admin_ids']; + sendMessage($users,31,$msg); + Db::commit(); + $dbRes = true; } catch (\Exception $e) { ##这里参数不能删除($e:错误信息) - Db::rollback(); + Db::rollback(); return to_assign(1, $e->getMessage()); } } else { @@ -390,41 +361,47 @@ class Expense extends BaseController Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); } - if ($exid) { - //相关内容多个数组; - $amountData = isset($param['amount']) ? $param['amount'] : ''; - $remarksData = isset($param['remarks']) ? $param['remarks'] : ''; - $cateData = isset($param['cate_id']) ? $param['cate_id'] : ''; - if ($amountData) { - foreach ($amountData as $key => $value) { - if (!$value) { - continue; - } - $data = []; - $data['exid'] = $exid; - $data['admin_id'] = $admin_id; - $data['amount'] = $amountData[$key]; - $data['cate_id'] = $cateData[$key]; - $data['remarks'] = $remarksData[$key]; - $data['create_time'] = time(); - $eid = Db::name('ExpenseInterfix')->strict(false)->field(true)->insertGetId($data); - } - } - add_log('add', $exid, $param); - //发送消息通知 - $msg=[ - 'from_uid'=>$this->uid, - 'action_id'=>$exid - ]; - $users = $param['check_admin_ids']; - sendMessage($users,31,$msg); - Db::commit(); - $dbRes = true; - } else { - Db::rollback(); - } + //相关内容多个数组; + $amountData = isset($param['amount']) ? $param['amount'] : ''; + $remarksData = isset($param['remarks']) ? $param['remarks'] : ''; + $cateData = isset($param['cate_id']) ? $param['cate_id'] : ''; + if ($amountData) { + foreach ($amountData as $key => $value) { + if (!$value) { + continue; + } + $data = []; + $data['exid'] = $exid; + $data['admin_id'] = $admin_id; + $data['amount'] = $amountData[$key]; + $data['cate_id'] = $cateData[$key]; + $data['remarks'] = $remarksData[$key]; + $data['create_time'] = time(); + $eid = Db::name('ExpenseInterfix')->strict(false)->field(true)->insertGetId($data); + } + } + //添加提交申请记录 + $checkData=array( + 'action_id' => $exid, + 'check_user_id' => $this->uid, + 'content' => '提交申请', + 'type' => 2, + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('add', $exid, $param); + //发送消息通知 + $msg=[ + 'from_uid'=>$this->uid, + 'action_id'=>$exid + ]; + $users = $param['check_admin_ids']; + sendMessage($users,31,$msg); + Db::commit(); + $dbRes = true; } catch (\Exception $e) { ##这里参数不能删除($e:错误信息) - Db::rollback(); + Db::rollback(); return to_assign(1, $e->getMessage()); } } @@ -437,7 +414,13 @@ class Expense extends BaseController else{ $id = isset($param['id']) ? $param['id'] : 0; if ($id > 0) { - $expense = $this->detail($id); + $expense = (new ExpenseList())->detail($id); + if($expense['admin_id']!=$this->uid){ + throw new \think\exception\HttpException(403, '禁止访问'); + } + if($expense['check_status']!=4){ + throw new \think\exception\HttpException(403, '禁止访问'); + } if($expense['file_ids'] !=''){ $fileArray = Db::name('File')->where('id','in',$expense['file_ids'])->select(); $expense['fileArray'] = $fileArray; @@ -446,7 +429,7 @@ class Expense extends BaseController } $department = $this->did; //获取报销审批流程 - $flows = get_type_flows(6,$department); + $flows = get_type_department_flows(6,$department); $expense_cate = Db::name('ExpenseCate')->where(['status' => 1])->select()->toArray(); View::assign('user', get_admin($this->uid)); View::assign('expense_cate', $expense_cate); @@ -460,12 +443,12 @@ class Expense extends BaseController public function view() { $id = empty(get_params('id')) ? 0 : get_params('id'); - $detail = $this->detail($id); + $detail = (new ExpenseList())->detail($id); $flows = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); $detail['check_user'] = '-'; $detail['copy_user'] = '-'; $check_user_ids = []; - if($detail['check_status']<2){ + if($detail['check_status']==1){ if($flows['flow_type']==1){ $detail['check_user'] = '部门负责人'; $check_user_ids[]=get_department_leader($detail['admin_id']); @@ -477,7 +460,7 @@ class Expense extends BaseController else{ $check_user_ids = explode(',',$flows['flow_uids']); $check_user = Db::name('Admin')->where('id','in',$flows['flow_uids'])->column('name'); - $detail['check_user'] = implode(',',$check_user); + $detail['check_user'] = implode(',',$check_user); } } if($detail['copy_uids'] !=''){ @@ -505,8 +488,30 @@ class Expense extends BaseController } } } + + $check_record = Db::name('FlowRecord')->field('f.*,a.name,a.thumb') + ->alias('f') + ->join('Admin a', 'a.id = f.check_user_id', 'left') + ->where(['f.action_id'=>$detail['id'],'f.type'=>2]) + ->order('check_time desc') + ->select()->toArray(); + foreach ($check_record as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d :H:i', $vv['check_time']); + $vv['status_str'] = '提交'; + if($vv['status'] == 1){ + $vv['status_str'] = '审核通过'; + } + else if($vv['status'] == 2){ + $vv['status_str'] = '审核拒绝'; + } + if($vv['status'] == 3){ + $vv['status_str'] = '撤销'; + } + } + View::assign('is_create_admin', $is_create_admin); View::assign('is_check_admin', $is_check_admin); + View::assign('check_record', $check_record); View::assign('detail', $detail); View::assign('flows', $flows); View::assign('uid', $this->uid); @@ -517,16 +522,15 @@ class Expense extends BaseController public function delete() { $id = get_params("id"); - $expense = $this->detail($id); + $expense = (new ExpenseList())->detail($id); if ($expense['check_status'] == 2) { return to_assign(1, "已审核的报销记录不能删除"); } - if ($expense['check_status'] == 3) { + if ($expense['check_status'] == 5) { return to_assign(1, "已打款的报销记录不能删除"); } - $data['status'] = '-1'; + $data['delete'] = time(); $data['id'] = $id; - $data['update_time'] = time(); if (Db::name('expense')->update($data) !== false) { add_log('delete', $id); return to_assign(0, "删除成功"); @@ -534,218 +538,4 @@ class Expense extends BaseController return to_assign(1, "删除失败"); } } - - - //审核 - public function check() - { - $param = get_params(); - $detail = Db::name('Expense')->where(['id' => $param['id']])->find(); - //当前审核节点详情 - $step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); - //审核通过 - if($param['status'] == 1){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //多人会签审批 - if($step['flow_type'] == 4){ - //查询当前会签记录数 - $check_count = Db::name('FlowRecord')->where(['action_id'=>$detail['id'],'type'=>2,'step_id'=>$step['id']])->count(); - //当前会签记应有记录数 - $flow_count = explode(',', $step['flow_uids']); - if(($check_count+1) >=count($flow_count)){ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - } - } - else{ - $param['check_status'] = 1; - } - } - else if($step['flow_type'] == 0){ - //自由人审批 - if($param['check_node'] == 2){ - $next_step = $detail['check_step_sort']+1; - $flow_step = array( - 'action_id' => $detail['id'], - 'sort' => $next_step, - 'type' => 2, - 'flow_uids' => $param['check_admin_ids'], - 'create_time' => time() - ); - $fid = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); - //下一步审核步骤 - $param['check_admin_ids'] = $param['check_admin_ids']; - $param['check_step_sort'] = $next_step; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - else{ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - if($next_step['flow_type'] == 1){ - $param['check_admin_ids'] = get_department_leader($this->uid); - } - else if($next_step['flow_type'] == 2){ - $param['check_admin_ids'] = get_department_leader($this->uid,1); - } - else{ - $param['check_admin_ids'] = $next_step['flow_uids']; - } - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - if($param['check_status'] == 1 && $param['check_admin_ids']==''){ - return to_assign(1,'找不到下一步的审批人,该审批流程设置有问题,请联系HR或者管理员'); - } - //审核通过数据操作 - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'type' => 2, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('check', $param['id'], $param); - //发送消息通知 - $msg=[ - 'from_uid'=>$detail['admin_id'], - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'action_id'=>$detail['id'] - ]; - if($param['check_status'] == 1){ - $users = $param['check_admin_ids']; - sendMessage($users,31,$msg); - } - if($param['check_status'] == 2){ - $users = $detail['admin_id']; - sendMessage($users,32,$msg); - } - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 2){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //拒绝审核,数据操作 - $param['check_status'] = 3; - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $param['check_admin_ids'] =''; - $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'type' => 2, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('refue', $param['id'], $param); - //发送消息通知 - $msg=[ - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'action_id'=>$detail['id'] - ]; - $users = $detail['admin_id']; - sendMessage($users,33,$msg); - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 3){ - if($detail['admin_id'] != $this->uid){ - return to_assign(1,'你没权限操作'); - } - //撤销审核,数据操作 - $param['check_status'] = 4; - $param['check_admin_ids'] =''; - $param['check_step_sort'] =0; - $res = Db::name('Expense')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => 0, - 'check_user_id' => $this->uid, - 'type' => 2, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('back', $param['id'], $param); - return to_assign(); - }else{ - return to_assign(1,'操作失败'); - } - } - } - - //设置为已打款 - public function topay() - { - $param = get_params(); - if (request()->isAjax()) { - //打款,数据操作 - $param['check_status'] = 5; - $param['pay_admin_id'] = $this->uid; - $param['pay_time'] = time(); - $res = ExpenseList::where('id', $param['id'])->strict(false)->field(true)->update($param); - if ($res !== false) { - //发送消息通知 - $detail = Db::name('Expense')->where(['id' => $param['id']])->find(); - $msg=[ - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'action_id'=>$detail['id'] - ]; - $users = $detail['admin_id']; - sendMessage($users,34,$msg); - return to_assign(); - } else { - return to_assign(1, "操作失败"); - } - } - } - } diff --git a/app/finance/controller/Income.php b/app/finance/controller/Income.php index 2393ab7..7bd6929 100644 --- a/app/finance/controller/Income.php +++ b/app/finance/controller/Income.php @@ -10,67 +10,21 @@ declare (strict_types = 1); namespace app\finance\controller; use app\base\BaseController; -use app\finance\model\Invoice as InvoiceList; +use app\finance\model\Invoice; +use app\finance\model\InvoiceIncome; use think\exception\ValidateException; use think\facade\Db; use think\facade\View; class Income extends BaseController { - public function get_list($param = [], $where = []) - { - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - $expense = InvoiceList::where($where) - ->order('create_time asc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - $item->user = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); - $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); - $item->check_name = Db::name('Admin')->where(['id' => $item->check_admin_id])->value('name'); - $item->check_time = empty($item->check_time) ? '-' : date('Y-m-d H:i', $item->check_time); - $item->enter_time = empty($item->enter_time) ? '-' : date('Y-m-d H:i', $item->enter_time); - $item->open_name = Db::name('Admin')->where(['id' => $item->open_admin_id])->value('name'); - $item->open_time = empty($item->open_time) ? '-' : date('Y-m-d H:i', $item->open_time); - }); - return $expense; - } - - public function detail($id = 0) - { - $invoice = Db::name('Invoice')->where(['id' => $id])->find(); - if ($invoice) { - $invoice['user'] = Db::name('Admin')->where(['id' => $invoice['admin_id']])->value('name'); - $invoice['department'] = Db::name('Department')->where(['id' => $invoice['did']])->value('title'); - $invoice['check_admin'] = Db::name('Admin')->where(['id' => $invoice['check_admin_id']])->value('name'); - $invoice['open_admin'] = Db::name('Admin')->where(['id' => $invoice['open_admin_id']])->value('name'); - if ($invoice['check_time'] > 0) { - $invoice['check_time'] = empty($invoice['check_time']) ? '0' : date('Y-m-d H:i', $invoice['check_time']); - } - if ($invoice['open_time'] > 0) { - $invoice['open_time'] = empty($invoice['open_time']) ? '0' : date('Y-m-d H:i', $invoice['open_time']); - } - else{ - $invoice['open_time'] = '-'; - } - $invoice['not_income'] = ($invoice['amount']*100 - $invoice['enter_amount']*100)/100; - //已到账的记录 - $invoice['income'] = Db::name('InvoiceIncome') - ->field('i.*,a.name as admin') - ->alias('i') - ->join('Admin a', 'a.id = i.admin_id', 'LEFT') - ->where(['i.inid'=>$id,'i.status'=>1]) - ->order('i.id asc') - ->select(); - } - return $invoice; - } - public function index() { + $auth = isAuthIncome($this->uid); if (request()->isAjax()) { $param = get_params(); $where = []; - $where[] = ['status', '=', 1]; + $where[] = ['delete_time', '=', 0]; $where[] = ['check_status', '=', 5]; //按时间检索 $start_time = isset($param['start_time']) ? strtotime(urldecode($param['start_time'])) : 0; @@ -81,9 +35,14 @@ class Income extends BaseController if (isset($param['is_cash']) && $param['is_cash']!='') { $where[] = ['is_cash', '=', $param['is_cash']]; } - $invoice = $this->get_list($param, $where); + if($auth == 0){ + $where[] = ['admin_id','=',$this->uid]; + } + $model = new Invoice(); + $invoice = $model->income_list($param, $where); return table_assign(0, '', $invoice); } else { + View::assign('auth', $auth); return view(); } } @@ -92,13 +51,17 @@ class Income extends BaseController public function add() { $param = get_params(); + $auth = isAuthIncome($this->uid); if (request()->isAjax()) { + if($auth == 0){ + return to_assign(1, "你没有到账管理权限,请联系管理员或者HR"); + } $inid = $param['inid']; $admin_id = $this->uid; //计算已到账的金额 - $hasIncome = Db::name('InvoiceIncome')->where(['inid'=>$inid,'status'=>1])->sum('amount'); + $hasIncome = InvoiceIncome::where(['inid'=>$inid,'status'=>1])->sum('amount'); //查询发票金额 - $invoiceAmount = Db::name('Invoice')->where(['id'=>$inid])->value('amount'); + $invoiceAmount = Invoice::where(['id'=>$inid])->value('amount'); if($param['enter_type']==1){ //单个到账记录 //相关内容多个数组 $enterPriceData=isset($param['amount'])? $param['amount'] : ''; @@ -126,16 +89,16 @@ class Income extends BaseController return to_assign(1,'到账金额大于发票金额,不允许保存'); } else{ - $res = Db::name('InvoiceIncome')->strict(false)->field(true)->insertAll($insert); + $res = InvoiceIncome::strict(false)->field(true)->insertAll($insert); if($res!==false){ if(($enter_price + $hasIncome*100) == $invoiceAmount*100){ //发票全部到账 - Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>2,'enter_amount'=>$invoiceAmount,'enter_time'=>time()]); + Invoice::where(['id'=>$inid])->update(['is_cash'=>2,'enter_amount'=>$invoiceAmount,'enter_time'=>time()]); } else if(($enter_price + $hasIncome*100) < $invoiceAmount*100){ $incomeTotal=($enter_price + $hasIncome*100)/100; //发票部分到账 - Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>1,'enter_amount'=>$incomeTotal,'enter_time'=>time()]); + Invoice::where(['id'=>$inid])->update(['is_cash'=>1,'enter_amount'=>$incomeTotal,'enter_time'=>time()]); } add_log('add',$inid,$param); return to_assign(); @@ -159,28 +122,47 @@ class Income extends BaseController 'admin_id' => $admin_id, 'create_time' => time() ]; - $res = Db::name('InvoiceIncome')->strict(false)->field(true)->insertGetId($data); + $res = InvoiceIncome::strict(false)->field(true)->insertGetId($data); if($res!==false){ //设置发票全部到账 - Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>2,'enter_amount'=>$invoiceAmount,'enter_time'=>time()]); + Invoice::where(['id'=>$inid])->update(['is_cash'=>2,'enter_amount'=>$invoiceAmount,'enter_time'=>time()]); add_log('add',$inid,$param); return to_assign(); } } else if ($param['enter_type']==3) {//全部反账记录 //作废初始化发票到账数据 - $res = Db::name('InvoiceIncome')->where(['inid'=>$inid])->update(['status'=>'6','update_time'=>time()]); + $res = InvoiceIncome::where(['inid'=>$inid])->update(['status'=>'6','update_time'=>time()]); if($res!==false){ //设置发票全部没到账 - Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>0,'enter_amount'=>0,'enter_time'=>0]); + Invoice::where(['id'=>$inid])->update(['is_cash'=>0,'enter_amount'=>0,'enter_time'=>0]); add_log('tovoid',$inid,$param); return to_assign(); } } } else{ + if($auth == 0){ + return view('../../base/view/common/roletemplate'); + } $id = isset($param['id']) ? $param['id']: 0 ; - $detail = $this->detail($id); + $model = new Invoice(); + $detail = $model->detail($id); + if(empty($detail)){ + throw new \think\exception\HttpException(406, '找不到记录'); + } + if($detail['file_ids'] !=''){ + $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select(); + $detail['fileArray'] = $fileArray; + } + $detail['not_income'] = ($detail['amount']*100 - $detail['enter_amount']*100)/100; + //已到账的记录 + $detail['income'] = InvoiceIncome::field('i.*,a.name as admin') + ->alias('i') + ->join('Admin a', 'a.id = i.admin_id', 'LEFT') + ->where(['i.inid'=>$id,'i.status'=>1]) + ->order('i.enter_time desc') + ->select(); View::assign('uid', $this->uid); View::assign('id', $id); View::assign('detail', $detail); @@ -191,7 +173,19 @@ class Income extends BaseController public function view() { $id = empty(get_params('id')) ? 0 : get_params('id'); - $detail = $this->detail($id); + $model = new Invoice(); + $detail = $model->detail($id); + if(empty($detail)){ + throw new \think\exception\HttpException(406, '找不到记录'); + } + $detail['not_income'] = ($detail['amount']*100 - $detail['enter_amount']*100)/100; + //已到账的记录 + $detail['income'] = InvoiceIncome::field('i.*,a.name as admin') + ->alias('i') + ->join('Admin a', 'a.id = i.admin_id', 'LEFT') + ->where(['i.inid'=>$id,'i.status'=>1]) + ->order('i.enter_time desc') + ->select(); View::assign('uid', $this->uid); View::assign('detail', $detail); return view(); @@ -203,19 +197,19 @@ class Income extends BaseController $param = get_params(); if (request()->isAjax()) { //作废初始化发票到账数据 - $income = Db::name('InvoiceIncome')->where(['id'=>$param['id']])->find(); - $invoice = Db::name('Invoice')->where(['id'=>$income['inid']])->find(); + $income =InvoiceIncome::where(['id'=>$param['id']])->find(); + $invoice = Invoice::where(['id'=>$income['inid']])->find(); if($income){ - $res = Db::name('InvoiceIncome')->where(['id'=>$param['id']])->update(['status'=>'6','update_time'=>time()]); + $res = InvoiceIncome::where(['id'=>$param['id']])->update(['status'=>'6','update_time'=>time()]); if($res!==false){ if($income['amount']*100 == $invoice['amount']*100){ //发票全部反到账 - Db::name('Invoice')->where(['id'=>$income['inid']])->update(['is_cash'=>0,'enter_amount'=>0,'enter_time'=>0]); + Invoice::where(['id'=>$income['inid']])->update(['is_cash'=>0,'enter_amount'=>0,'enter_time'=>0]); } else if($income['amount']*100 < $invoice['amount']*100){ - $incomeTotal=Db::name('InvoiceIncome')->where(['inid'=>$income['inid'],'status'=>1])->sum('amount'); + $incomeTotal=InvoiceIncome::where(['inid'=>$income['inid'],'status'=>1])->sum('amount'); //发票部分到账 - Db::name('Invoice')->where(['id'=>$income['inid']])->update(['is_cash'=>1,'enter_amount'=>$incomeTotal,'enter_time'=>time()]); + Invoice::where(['id'=>$income['inid']])->update(['is_cash'=>1,'enter_amount'=>$incomeTotal,'enter_time'=>time()]); } add_log('enter',$income['inid'],$invoice); return to_assign(); diff --git a/app/finance/controller/Invoice.php b/app/finance/controller/Invoice.php index 02b980e..286e199 100644 --- a/app/finance/controller/Invoice.php +++ b/app/finance/controller/Invoice.php @@ -18,90 +18,6 @@ use think\facade\View; class Invoice extends BaseController { - //发票列表检索 - public function get_list($where = [],$param=[], $type='and') - { - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - if($type == 'or'){ - $list = Db::name('Invoice') - ->field('i.*,a.name,d.title as department_name') - ->alias('i') - ->join('Admin a', 'a.id = i.admin_id', 'left') - ->join('Department d', 'd.id = i.did', 'left') - ->whereOr($where) - ->order('i.id desc') - ->group('i.id') - ->paginate(['list_rows' => $rows, 'query' => $param]) - ->each(function($item, $key){ - $item['create_time'] = date('Y-m-d H:i', $item['create_time']); - if ($item['open_time'] > 0) { - $item['open_time'] = empty($item['open_time']) ? '0' : date('Y-m-d', $item['open_time']); - $item['open_name'] = Db::name('Admin')->where('id',$item['open_admin_id'])->value('name'); - } - else{ - $item['open_time'] = ''; - $item['open_name'] = '-'; - } - $item['check_user'] = '-'; - if($item['check_status']<2 && !empty($item['check_admin_ids'])){ - $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); - $item['check_user'] = implode(',',$check_user); - } - return $item; - }); - } - else{ - $list = Db::name('Invoice') - ->field('i.*,a.name,d.title as department_name') - ->alias('i') - ->join('Admin a', 'a.id = i.admin_id', 'left') - ->join('Department d', 'd.id = i.did', 'left') - ->where($where) - ->order('i.id desc') - ->paginate(['list_rows' => $rows, 'query' => $param]) - ->each(function($item, $key){ - $item['create_time'] = date('Y-m-d H:i', $item['create_time']); - $item['check_user'] = '-'; - if ($item['open_time'] > 0) { - $item['open_time'] = empty($item['open_time']) ? '0' : date('Y-m-d', $item['open_time']); - $item['open_name'] = Db::name('Admin')->where('id',$item['open_admin_id'])->value('name'); - } - else{ - $item['open_time'] = ''; - $item['open_name'] = '-'; - } - if($item['check_status']<2 && !empty($item['check_admin_ids'])){ - $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); - $item['check_user'] = implode(',',$check_user); - } - return $item; - }); - } - return $list; - } - - //发票详情 - public function detail($id = 0) - { - $invoice = Db::name('Invoice')->where(['id' => $id])->find(); - if ($invoice) { - $invoice['create_user'] = Db::name('Admin')->where(['id' => $invoice['admin_id']])->value('name'); - $invoice['department'] = Db::name('Department')->where(['id' => $invoice['did']])->value('title'); - $invoice['check_admin'] = Db::name('Admin')->where(['id' => $invoice['check_admin_id']])->value('name'); - $invoice['open_admin'] = Db::name('Admin')->where(['id' => $invoice['open_admin_id']])->value('name'); - if ($invoice['check_time'] > 0) { - $invoice['check_time'] = empty($invoice['check_time']) ? '0' : date('Y-m-d H:i', $invoice['check_time']); - } - if ($invoice['open_time'] > 0) { - $invoice['open_time'] = empty($invoice['open_time']) ? '0' : date('Y-m-d', $invoice['open_time']); - } - else{ - $invoice['open_time'] = '-'; - } - } - return $invoice; - } - //我申请的发票 public function index() { @@ -118,8 +34,9 @@ class Invoice extends BaseController $where[] = ['i.create_time', 'between', [$start_time, $end_time]]; } $where[] = ['i.admin_id','=',$this->uid]; - $where[] = ['i.status','=',1]; - $list = $this->get_list($where,$param); + $where[] = ['i.delete_time','=',0]; + $model = new InvoiceList(); + $list = $model->get_list($param, $where); return table_assign(0, '', $list); } else { return view(); @@ -137,18 +54,18 @@ class Invoice extends BaseController $map1 = []; $map2 = []; $map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',i.check_admin_ids)")]; - $map1[] = ['i.status','=',1]; + $map1[] = ['i.delete_time','=',0]; $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',i.flow_admin_ids)")]; - $map2[] = ['i.status','=',1]; - + $map2[] = ['i.delete_time','=',0]; + $model = new InvoiceList(); if($status == 0){ - $list = $this->get_list([$map1,$map2],$param,'or'); + $list = $model->get_list($param,[$map1,$map2],'or'); } if($status == 1){ - $list = $this->get_list($map1,$param); + $list = $model->get_list($param,$map1); } if($status == 2){ - $list = $this->get_list($map2,$param); + $list = $model->get_list($param,$map2); } return table_assign(0, '', $list); } else { @@ -169,11 +86,12 @@ class Invoice extends BaseController if ($start_time > 0 && $end_time > 0) { $where[] = ['i.expense_time', 'between', [$start_time, $end_time]]; } - $map[] = ['i.status','=',1]; + $map[] = ['i.delete_time','=',0]; $map[] = ['i.check_status', '=', 2]; - $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',i.copy_uids)")]; - $expense = $this->get_list($map, $param); - return table_assign(0, '', $expense); + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',i.copy_uids)")]; + $model = new InvoiceList(); + $list = $model->get_list($param,$map); + return table_assign(0, '', $list); } else { return view(); } @@ -197,10 +115,15 @@ class Invoice extends BaseController if ($start_time > 0 && $end_time > 0) { $where[] = ['i.create_time', 'between', [$start_time, $end_time]]; } - $where[] = ['i.status','=',1]; - $list = $this->get_list($where,$param); + $where[] = ['i.delete_time','=',0]; + $model = new InvoiceList(); + $list = $model->get_list($param,$where); return table_assign(0, '', $list); } else { + $auth = isAuthInvoice($this->uid); + if($auth == 0){ + return view('../../base/view/common/roletemplate'); + } return view(); } } @@ -289,6 +212,16 @@ class Invoice extends BaseController $res = InvoiceList::where('id', $param['id'])->strict(false)->field(true)->update($param); if ($res !== false) { + //添加提交申请记录 + $checkData=array( + 'action_id' => $param['id'], + 'check_user_id' => $this->uid, + 'content' => '重新提交申请', + 'type' => 3, + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); add_log('edit', $param['id'], $param); //发送消息通知 $msg=[ @@ -308,9 +241,8 @@ class Invoice extends BaseController // 验证失败 输出错误信息 return to_assign(1, $e->getError()); } - $admin_id = $this->uid; - $param['admin_id'] = $admin_id; - $param['did'] = get_login_admin('did'); + $param['admin_id'] = $this->uid; + $param['did'] = $this->did; $param['create_time'] = time(); if (!isset($param['check_admin_ids'])) { @@ -360,6 +292,16 @@ class Invoice extends BaseController } if ($exid) { + //添加提交申请记录 + $checkData=array( + 'action_id' => $exid, + 'check_user_id' => $this->uid, + 'content' => '提交申请', + 'type' => 3, + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); add_log('apply', $exid, $param); //发送消息通知 $msg=[ @@ -376,7 +318,11 @@ class Invoice extends BaseController } else { $id = isset($param['id']) ? $param['id'] : 0; if ($id > 0) { - $detail = $this->detail($id); + $model = new InvoiceList(); + $detail = $model->detail($id); + if(empty($detail)){ + throw new \think\exception\HttpException(406, '找不到记录'); + } if($detail['file_ids'] !=''){ $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select(); $detail['fileArray'] = $fileArray; @@ -385,7 +331,7 @@ class Invoice extends BaseController } $department = $this->did; //获取发票审批流程 - $flows = get_type_flows(7,$department); + $flows = get_type_department_flows(7,$department); View::assign('user', get_admin($this->uid)); View::assign('id', $id); View::assign('flows', $flows); @@ -397,12 +343,16 @@ class Invoice extends BaseController public function view() { $id = empty(get_params('id')) ? 0 : get_params('id'); - $detail = $this->detail($id); + $model = new InvoiceList(); + $detail = $model->detail($id); + if(empty($detail)){ + throw new \think\exception\HttpException(406, '找不到记录'); + } $flows = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); $detail['check_user'] = '-'; $detail['copy_user'] = '-'; $check_user_ids = []; - if($detail['check_status']<2){ + if($detail['check_status'] == 1){ if($flows['flow_type']==1){ $detail['check_user'] = '部门负责人'; $check_user_ids[]=get_department_leader($detail['admin_id']); @@ -435,7 +385,6 @@ class Invoice extends BaseController if(in_array($this->uid,$check_user_ids)){ $is_check_admin = 1; //当前审核节点详情 - //$step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); if($flows['flow_type'] == 4){ $check_count = Db::name('FlowRecord')->where(['action_id'=>$detail['id'],'type'=>3,'step_id'=>$flows['id'],'check_user_id'=>$this->uid])->count(); if($check_count>0){ @@ -443,8 +392,30 @@ class Invoice extends BaseController } } } + + $check_record = Db::name('FlowRecord')->field('f.*,a.name,a.thumb') + ->alias('f') + ->join('Admin a', 'a.id = f.check_user_id', 'left') + ->where(['f.action_id'=>$detail['id'],'f.type'=>3]) + ->order('check_time desc') + ->select()->toArray(); + foreach ($check_record as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d :H:i', $vv['check_time']); + $vv['status_str'] = '提交'; + if($vv['status'] == 1){ + $vv['status_str'] = '审核通过'; + } + else if($vv['status'] == 2){ + $vv['status_str'] = '审核拒绝'; + } + if($vv['status'] == 3){ + $vv['status_str'] = '撤销'; + } + } + View::assign('is_create_admin', $is_create_admin); View::assign('is_check_admin', $is_check_admin); + View::assign('check_record', $check_record); View::assign('detail', $detail); View::assign('flows', $flows); View::assign('uid', $this->uid); @@ -455,253 +426,20 @@ class Invoice extends BaseController public function delete() { $id = get_params("id"); - $detail = $this->detail($id); - if ($detail['status'] == 2) { + $status = InvoiceList::where(['id' => $param['id']])->value('check_status'); + if ($status == 2) { return to_assign(1, "已审核的发票不能删除"); } - if ($detail['status'] == 3) { + if ($status == 3) { return to_assign(1, "已开具的发票不能删除"); } - $data['status'] = '-1'; + $data['delete_time'] = time(); $data['id'] = $id; - $data['update_time'] = time(); - if (Db::name('Invoice')->update($data) !== false) { + if (InvoiceList::update($data) !== false) { add_log('delete', $id); return to_assign(0, "删除成功"); } else { return to_assign(1, "删除失败"); } - } - - //审核 - public function check() - { - $param = get_params(); - $detail = Db::name('Invoice')->where(['id' => $param['id']])->find(); - //当前审核节点详情 - $step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); - //审核通过 - if($param['status'] == 1){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //多人会签审批 - if($step['flow_type'] == 4){ - //查询当前会签记录数 - $check_count = Db::name('FlowRecord')->where(['action_id'=>$detail['id'],'type'=>3,'step_id'=>$step['id']])->count(); - //当前会签记应有记录数 - $flow_count = explode(',', $step['flow_uids']); - if(($check_count+1) >=count($flow_count)){ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - } - } - else{ - $param['check_status'] = 1; - } - } - else if($step['flow_type'] == 0){ - //自由人审批 - if($param['check_node'] == 2){ - $next_step = $detail['check_step_sort']+1; - $flow_step = array( - 'action_id' => $detail['id'], - 'sort' => $next_step, - 'type' => 3, - 'flow_uids' => $param['check_admin_ids'], - 'create_time' => time() - ); - $fid = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); - //下一步审核步骤 - $param['check_admin_ids'] = $param['check_admin_ids']; - $param['check_step_sort'] = $next_step; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - else{ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - if($next_step['flow_type'] == 1){ - $param['check_admin_ids'] = get_department_leader($this->uid); - } - else if($next_step['flow_type'] == 2){ - $param['check_admin_ids'] = get_department_leader($this->uid,1); - } - else{ - $param['check_admin_ids'] = $next_step['flow_uids']; - } - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - if($param['check_status'] == 1 && $param['check_admin_ids']==''){ - return to_assign(1,'找不到下一步的审批人,该审批流程设置有问题,请联系HR或者管理员'); - } - //审核通过数据操作 - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'type' => 3, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['check_remark'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('check', $param['id'], $param); - //发送消息通知 - $msg=[ - 'from_uid'=>$detail['admin_id'], - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'action_id'=>$detail['id'] - ]; - if($param['check_status'] == 1){ - $users = $param['check_admin_ids']; - sendMessage($users,41,$msg); - } - if($param['check_status'] == 2){ - $users = $detail['admin_id']; - sendMessage($users,42,$msg); - } - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 2){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //拒绝审核,数据操作 - $param['check_status'] = 3; - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $param['check_admin_ids'] =''; - $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids,check_remark')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'type' => 3, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['check_remark'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('refue', $param['id'], $param); - //发送消息通知 - $msg=[ - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'action_id'=>$detail['id'] - ]; - $users = $detail['admin_id']; - sendMessage($users,43,$msg); - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 3){ - if($detail['admin_id'] != $this->uid){ - return to_assign(1,'你没权限操作'); - } - //撤销审核,数据操作 - $param['check_status'] = 4; - $param['check_admin_ids'] =''; - $param['check_step_sort'] =0; - $res = Db::name('Invoice')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids,check_remark')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => 0, - 'check_user_id' => $this->uid, - 'type' => 3, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['check_remark'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('back', $param['id'], $param); - return to_assign(); - }else{ - return to_assign(1,'操作失败'); - } - } - } - - - //作废 - public function tovoid() - { - $param = get_params(); - if (request()->isAjax()) { - if ($param['check_status'] == 10) { - $count = Db::name('InvoiceIncome')->where(['inid'=>$param['id'],'status'=>1])->count(); - if($count>0){ - return to_assign(1, "发票已经新增有到账记录,请先反到账后再作废发票"); - } - else{ - $param['update_time'] = time(); - add_log('tovoid', $param['id'],$param); - } - } - $res = InvoiceList::where('id', $param['id'])->strict(false)->field('check_status')->update($param); - if ($res !== false) { - return to_assign(); - } else { - return to_assign(1, "操作失败"); - } - } - } - - //开具发票 - public function open() - { - $param = get_params(); - if (request()->isAjax()) { - $detail = Db::name('Invoice')->where(['id' => $param['id']])->find(); - if ($detail['check_status'] == 2) { - $param['check_status'] = 5; - $param['open_admin_id'] = $this->uid; - } - $param['open_time'] = isset($param['open_time']) ? strtotime(urldecode($param['open_time'])) : 0; - $res = InvoiceList::where('id', $param['id'])->strict(false)->field('code,check_status,open_time,open_admin_id,delivery')->update($param); - if ($res !== false) { - add_log('open', $param['id'],$param); - return to_assign(); - } else { - return to_assign(1, "操作失败"); - } - } - } + } } diff --git a/app/finance/model/Expense.php b/app/finance/model/Expense.php index 89478f6..2f45cfc 100644 --- a/app/finance/model/Expense.php +++ b/app/finance/model/Expense.php @@ -1,7 +1,76 @@ order('id desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + $item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month); + $item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time); + $item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); + $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); + $item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name'); + $item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time); + $item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount'); + $item['check_user'] = '-'; + if($item['check_status']==1 && !empty($item['check_admin_ids'])){ + $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); + $item['check_user'] = implode(',',$check_user); + } + }); + } + else{ + $expense = Expense::where($where) + ->order('id desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + $item->income_month = empty($item->income_month) ? '-' : date('Y-m', $item->income_month); + $item->expense_time = empty($item->expense_time) ? '-' : date('Y-m-d', $item->expense_time); + $item->admin_name = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); + $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); + $item->pay_name = Db::name('Admin')->where(['id' => $item->pay_admin_id])->value('name'); + $item->pay_time = empty($item->pay_time) ? '-' : date('Y-m-d H:i', $item->pay_time); + $item->amount = Db::name('ExpenseInterfix')->where(['exid' => $item->id])->sum('amount'); + $item['check_user'] = '-'; + if($item['check_status']==1 && !empty($item['check_admin_ids'])){ + $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); + $item['check_user'] = implode(',',$check_user); + } + }); + } + return $expense; + } + public function detail($id = 0) + { + $expense = Expense::where(['id' => $id])->find(); + if ($expense) { + $expense['income_month'] = empty($expense['income_month']) ? '-' : date('Y-m', $expense['income_month']); + $expense['expense_time'] = empty($expense['expense_time']) ? '-' : date('Y-m-d', $expense['expense_time']); + $expense['create_user'] = Db::name('Admin')->where(['id' => $expense['admin_id']])->value('name'); + $expense['department'] = Db::name('Department')->where(['id' => $expense['did']])->value('title'); + $expense['amount'] = Db::name('ExpenseInterfix')->where(['exid' => $expense['id']])->sum('amount'); + if ($expense['pay_time'] > 0) { + $expense['pay_time'] = date('Y-m-d H:i:s', $expense['pay_time']); + $expense['pay_admin'] = Db::name('Admin')->where(['id' => $expense['pay_admin_id']])->value('name'); + } + else{ + $expense['pay_time'] = '-'; + } + $expense['list'] = Db::name('ExpenseInterfix') + ->field('a.*,c.title as cate_title') + ->alias('a') + ->join('ExpenseCate c', 'a.cate_id = c.id','LEFT') + ->where(['a.exid' => $expense['id']]) + ->select(); + } + return $expense; + } } \ No newline at end of file diff --git a/app/finance/model/Invoice.php b/app/finance/model/Invoice.php index 60fcf47..29e4a13 100644 --- a/app/finance/model/Invoice.php +++ b/app/finance/model/Invoice.php @@ -1,7 +1,101 @@ alias('i') + ->join('Admin a', 'a.id = i.admin_id', 'left') + ->join('Department d', 'd.id = i.did', 'left') + ->whereOr($where) + ->order('i.id desc') + ->group('i.id') + ->paginate(['list_rows' => $rows, 'query' => $param]) + ->each(function($item, $key){ + if ($item['open_time'] > 0) { + $item['open_time'] = empty($item['open_time']) ? '0' : date('Y-m-d', (int)$item['open_time']); + $item['open_name'] = Db::name('Admin')->where('id',$item['open_admin_id'])->value('name'); + } + else{ + $item['open_time'] = ''; + $item['open_name'] = '-'; + } + $item['check_user'] = '-'; + if($item['check_status']==1 && !empty($item['check_admin_ids'])){ + $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); + $item['check_user'] = implode(',',$check_user); + } + return $item; + }); + } + else{ + $list = Invoice::field('i.*,a.name,d.title as department_name') + ->alias('i') + ->join('Admin a', 'a.id = i.admin_id', 'left') + ->join('Department d', 'd.id = i.did', 'left') + ->where($where) + ->order('i.id desc') + ->paginate(['list_rows' => $rows, 'query' => $param]) + ->each(function($item, $key){ + $item['check_user'] = '-'; + if ($item['open_time'] > 0) { + $item['open_time'] = empty($item['open_time']) ? '0' : date('Y-m-d', (int)$item['open_time']); + $item['open_name'] = Db::name('Admin')->where('id',$item['open_admin_id'])->value('name'); + } + else{ + $item['open_time'] = ''; + $item['open_name'] = '-'; + } + if($item['check_status'] == 1 && !empty($item['check_admin_ids'])){ + $check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name'); + $item['check_user'] = implode(',',$check_user); + } + return $item; + }); + } + return $list; + } + + //到账列表检索 + public function income_list($param = [], $where = []) + { + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $list = Invoice::where($where) + ->order('is_cash asc,create_time desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + $item->user = Db::name('Admin')->where(['id' => $item->admin_id])->value('name'); + $item->department = Db::name('Department')->where(['id' => $item->did])->value('title'); + $item->enter_time = empty($item->enter_time) ? '-' : date('Y-m-d H:i', $item->enter_time); + $item->open_name = Db::name('Admin')->where(['id' => $item->open_admin_id])->value('name'); + $item->open_time = empty($item->open_time) ? '-' : date('Y-m-d H:i', $item->open_time); + }); + return $list; + } + + public function detail($id = 0) + { + $detail = Invoice::where(['id' => $id])->find(); + if ($detail) { + $detail['create_user'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name'); + $detail['department'] = Db::name('Department')->where(['id' => $detail['did']])->value('title'); + if ($detail['open_time'] > 0) { + $detail['open_time'] = empty($detail['open_time']) ? '0' : date('Y-m-d H:i', $detail['open_time']); + $detail['open_admin'] = Db::name('Admin')->where(['id' => $detail['open_admin_id']])->value('name'); + } + else{ + $detail['open_time'] = '-'; + $detail['open_admin'] = '-'; + } + } + return $detail; + } + + } \ No newline at end of file diff --git a/app/finance/model/InvoiceIncome.php b/app/finance/model/InvoiceIncome.php new file mode 100644 index 0000000..71e5c34 --- /dev/null +++ b/app/finance/model/InvoiceIncome.php @@ -0,0 +1,7 @@ + {/block} @@ -58,31 +43,31 @@ 报销选项* - -
- - - - - - - - - - - - - -
报销金额报销项目备注信息操作
- - 删除
+ + + + + + + + + + + + + + +
报销金额报销项目备注信息操作
+ + 删除
+
+
- @@ -113,7 +98,7 @@ 抄送人 - + @@ -142,32 +127,32 @@ 报销选项* -
- - - - - - - - {volist name="$expense.list" id="val"} - - - - - - - {/volist} -
报销金额报销类别备注信息操作
- - 删除
+ + + + + + + + {volist name="$expense.list" id="val"} + + + + + + + {/volist} +
报销金额报销类别备注信息操作
+ + 删除
+
+
- @@ -177,13 +162,13 @@ {notempty name="$expense.file_ids"} {volist name="$expense.fileArray" id="vo"} -
+
{$vo.name}
- - + +
@@ -212,7 +197,7 @@ 抄送人 - + @@ -220,7 +205,7 @@
- +
@@ -255,57 +240,14 @@ Array.prototype.remove = function (val) { } }; -const moduleInit = ['tool','formSelects','employeepicker']; +const moduleInit = ['tool','employeepicker']; function gouguInit() { var form = layui.form, upload = layui.upload, tool=layui.tool, - formSelects = layui.formSelects, employeepicker = layui.employeepicker, laydate = layui.laydate; - //多附件上传 - upload.render({ - elem: '#upFile' - ,url: "/api/index/upload" - ,multiple: true - ,accept: 'file' //普通文件 - ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 - ,done: function(res){ - layer.msg(res.msg); - if (res.code == 0) { - //上传成功 - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.push(res.data.id); - $('#fileList input').attr('value', idsArray.join(',')); - let temp = `
-
- -
${res.data.name}
-
- - -
-
-
`; - $('#fileList').append(temp); - } - } - }); - $('#fileList').on('click', '.btn-delete', function () { - var _id = $(this).data('id'); - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.remove(_id); - $('#fileList input').attr('value', idsArray.join(',')); - $('#uploadImg' + _id).remove(); - }) - laydate.render({ elem: '#income_month', type:'month', @@ -345,7 +287,7 @@ const moduleInit = ['tool','formSelects','employeepicker']; title: '提示' }, function(index) { $.ajax({ - url: "/api/index/del_expense_interfix", + url: "/finance/api/del_expense_interfix", type:'post', data: {id: _id}, success: function(res) { @@ -393,35 +335,53 @@ const moduleInit = ['tool','formSelects','employeepicker']; return false; }); - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ + //选择单个员工弹窗 + $('body').on('click','.picker-one',function () { if($('[name="flow_id"]').val()==''){ layer.msg('请先选择审批流程'); return false; } + let that = $(this); + let ids=that.next().val()+'',names = that.val()+''; employeepicker.init({ + ids:ids, + names:names, + type:0, department_url: "/api/index/get_department_tree", employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); + callback:function(ids,names,dids,departments){ + that.val(names); + that.next().val(ids); } }); - }) - - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, }); - + + //选择多个员工弹窗 + $('body').on('click','.picker-more',function () { + let that = $(this); + let ids=that.next().val()+'',names = that.val()+'',ids_array=[],names_array=[]; + if(ids.length>0){ + ids_array=ids.split(','); + names_array=names.split(','); + } + employeepicker.init({ + ids:ids_array, + names:names_array, + type:1, + department_url: "/api/index/get_department_tree", + employee_url: "/api/index/get_employee", + callback:function(ids,names,dids,departments){ + that.val(names.join(',')); + that.next().val(ids.join(',')); + } + }); + }); + form.on('select(flowtype)', function(data){ var check_type = data.elem[data.elem.selectedIndex].title; var formHtml='审核人*\ \ - \ + \ '; if(check_type == 2){ $('#flow_tr').html(formHtml); @@ -439,24 +399,33 @@ const moduleInit = ['tool','formSelects','employeepicker']; var flowLi=''; var flow_data = e.data.flow_data; if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); + $('[name="copy_names"]').val(e.data.copy_unames); + $('[name="copy_uids"]').val(e.data.copy_uids.split(',')); } - if(check_type == 1){ + if(check_type == 1 || check_type == 3){ for(var a=0;a'+flow_data[a].user_id_info[b].name+''; + } + } + } + else if(check_type == 3){ + sign_type= ' '+flow_data[a].flow_name+'' for(var b=0;b'+flow_data[a].user_id_info[b].name+''; } @@ -470,7 +439,7 @@ const moduleInit = ['tool','formSelects','employeepicker']; '; } formHtml = '审批流程\ - \ + \
    '+flowLi+'
\ '; $('#flow_tr').html(formHtml); @@ -479,6 +448,48 @@ const moduleInit = ['tool','formSelects','employeepicker']; } }) }); + + $('#fileList').on('click', '.btn-delete', function () { + var _id = $(this).data('id'); + var idsStr = $('#fileList input').val(),idsArray = []; + if (idsStr != '') { + idsArray = idsStr.split(","); + } + idsArray.remove(_id); + $('#fileList input').attr('value', idsArray.join(',')); + $('#uploadImg' + _id).remove(); + }) + //多附件上传 + upload.render({ + elem: '#upFile' + ,url: "/api/index/upload" + ,multiple: true + ,accept: 'file' //普通文件 + ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 + ,done: function(res){ + layer.msg(res.msg); + if (res.code == 0) { + //上传成功 + var idsStr = $('#fileList input').val(),idsArray = []; + if (idsStr != '') { + idsArray = idsStr.split(","); + } + idsArray.push(res.data.id); + $('#fileList input').attr('value', idsArray.join(',')); + let temp = `
+
+ +
${res.data.name}
+
+ + +
+
+
`; + $('#fileList').append(temp); + } + } + }); } {/block} diff --git a/app/finance/view/expense/checkedlist.html b/app/finance/view/expense/checkedlist.html index c0ec2b5..100474c 100644 --- a/app/finance/view/expense/checkedlist.html +++ b/app/finance/view/expense/checkedlist.html @@ -166,7 +166,7 @@ title: '提示' }, function(index) { $.ajax({ - url: "/finance/expense/topay", + url: "/finance/api/topay", type:'post', data: {id: data.id}, success: function(res) { diff --git a/app/finance/view/expense/conf.html b/app/finance/view/expense/conf.html new file mode 100644 index 0000000..bc1727d --- /dev/null +++ b/app/finance/view/expense/conf.html @@ -0,0 +1,97 @@ +{extend name="../../base/view/common/base" /} + +{block name="body"} +
+

权限配置

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

财务模块使用说明:

+

1、设置报销打款管理员,可设置多个

+

拥有报销打款管理员权限的员工可以设置报销的打款情况。

+

2、设置发票管理员,可设置多个

+

拥有发票管理员权限的员工可以开具、废弃发票。

+

3、设置到账管理员,可设置多个

+

拥有到账管理员权限的员工可以设置发票的到账情况。

+
权限名称 + + {$detail.title} + 权限标识{$detail.name}
报销管理员* + + + +
发票管理员* + + +
到账管理员* + + +
+
+ + +
+
+{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/finance/view/expense/index.html b/app/finance/view/expense/index.html index deb01c8..98f69c7 100644 --- a/app/finance/view/expense/index.html +++ b/app/finance/view/expense/index.html @@ -28,7 +28,7 @@
{/block} @@ -79,15 +79,18 @@ align: 'center', width: 120, templet:function(d){ - var html='审批不通过'; + var html='待审批'; if(d.check_status==1){ - html='审批中'; + html='审批中'; } else if(d.check_status==2){ - html='审批通过'; + html='审批通过'; + } + else if(d.check_status==3){ + html='审批失败'; } else if(d.check_status==4){ - html='撤销'; + html='已撤销'; } else if(d.check_status==5){ html='已打款'; diff --git a/app/finance/view/expense/view.html b/app/finance/view/expense/view.html index bae8020..d8172ef 100644 --- a/app/finance/view/expense/view.html +++ b/app/finance/view/expense/view.html @@ -8,7 +8,7 @@ .layui-form-item:hover .layui-btn-danger{display:inline-block;} .select-1,.select-2{display:none;} -.check-items{overflow-x: auto; padding: 10px 0;} +.check-items{overflow-x: auto; padding: 2px 0;} .flow-flex-row {box-direction: row; box-orient: horizontal; -webkit-box-orient: horizontal; @@ -24,11 +24,13 @@ -webkit-box-align: center; -ms-flex-align: center; align-items: center; + flex-wrap: wrap; } - -.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0;} -.check-item i{font-size:20px; margin-right:3px; color:#4285f4;} +.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0; padding:4px 0} +.check-item i{margin-right:3px; color:#646464;} .check-item span{color:#999;margin:0 3px;} +.check-item .layui-icon {font-size:18px;} +.check-item .layui-icon.layui-icon-right{font-size:12px;} .layui-icon[data-ok]{color:#34a853} .layui-icon[data-no]{color:#FF5722;} .check-item-status{color:#999; font-size:12px; margin-left:3px;} @@ -38,31 +40,17 @@ .flow-tips li i{color:#4285f4;} .flow-tips li span{color:#999; font-size:12px; margin-left:4px;} -.flow-record{padding:10px 10px 0;} -.flow-record .layui-icon {font-size:20px;} -.flow-record .layui-timeline-item{padding-bottom:10px;} +.flow-record{padding:4px 4px 0;} +.flow-record .layui-timeline-item{text-decoration:line-through; color:#acacac; padding-bottom:10px;} +.flow-record .layui-timeline-item.delete-0{text-decoration:none; color:#323232;} .layui-timeline-content ul{font-size:12px;} .check-status{color:#999; margin-left:5px;} .check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;} - +.check-record{line-height:1.5; padding:4px 0} +.flow-this{font-weight:800;} +.flow-this i{color:#4285f4} .layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;} .layui-table-min td{font-size:13px; padding:6px;text-align:center;} - -.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding:8px 0; margin:4px 8px 4px 0; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} -.file-card .file-icon{font-size:36px; color:#646464; margin-right: 4px;} -.file-card .file-title {font-size: 12px; letter-spacing: 0; margin-right: 8px; line-height: 16px; word-break: break-all; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; - -webkit-line-clamp: 2; - line-clamp: 2; - -webkit-box-orient: vertical;width: calc(100% - 80px); -} -.file-card .file-tool .layui-icon{font-size:22px; padding:2px; cursor:pointer;} {/block} @@ -121,12 +109,12 @@
{volist name="$detail.fileArray" id="vo"} -
+
-
{$vo.name}
+
{$vo.name}
- +
@@ -135,15 +123,27 @@ {/notempty} + {if ( $detail.check_status eq 5)} + + 报销状态 + 已打款 + 打款人 + {$detail.pay_admin} + 打款时间 + {$detail.pay_time} + + {/if} + + + - @@ -163,18 +163,31 @@ - {if ( $detail.check_status lt 2) AND ( $is_check_admin eq 1) } + {notempty name="$check_record"} + + + + + {/notempty} + {if ( $detail.check_status eq 1) AND ( $is_check_admin eq 1) } {eq name="$flows.flow_type" value="0"} {/eq} @@ -185,33 +198,26 @@ {/if} - {if ( $detail.check_status eq 5)} - - - - - - - - - {/if}
审核状态{eq name="$detail.check_status" value="0"}待审批{/eq} - {eq name="$detail.check_status" value="1"}审批中{/eq} - {eq name="$detail.check_status" value="2"}已通过,待打款{/eq} + {eq name="$detail.check_status" value="0"}待审批{/eq} + {eq name="$detail.check_status" value="1"}审批中{/eq} + {eq name="$detail.check_status" value="2"}已通过,待打款{/eq} {eq name="$detail.check_status" value="3"}已拒绝{/eq} {eq name="$detail.check_status" value="4"}已撤销{/eq} {eq name="$detail.check_status" value="5"}已通过,并打款{/eq} - 查看审批记录 当前审核人 {$detail.check_user}
审批记录 +
    + {volist name="$check_record" id="vo"} +
  • + +

    {$vo.check_time_str}{$vo.name}{$vo.status_str}了此申请。操作意见:{$vo.content}

    +
  • + {/volist} +
+
审批节点 * -
- - -
- -
-
+ + +
+ +
报销状态已打款打款人{$detail.pay_admin}打款时间{$detail.pay_time}
-
- {if ( $detail.check_status lt 2)} + + +
+ {eq name="$detail.check_status" value='1'} {eq name="$is_check_admin" value='1'} 通过 - 拒绝 + {$flows.flow_type == 5?'回退':'拒绝'} {/eq} {eq name="$is_create_admin" value='1'} 撤回 {/eq} + {/eq} + {if ( $detail.check_status eq 3) AND ( $is_create_admin eq 1) } + 撤回 {/if} - {if ( $detail.check_status eq 3) OR ( $detail.check_status eq 4 ) } - {eq name="$is_create_admin" value='1'} - 重新编辑 - {/eq} + {if ( $detail.check_status eq 4) AND ( $is_create_admin eq 1) } + 重新编辑 {/if}
{/block} @@ -221,24 +227,24 @@ {block name="script"} {/block} diff --git a/app/finance/view/income/add.html b/app/finance/view/income/add.html index c069431..69fe577 100644 --- a/app/finance/view/income/add.html +++ b/app/finance/view/income/add.html @@ -1,7 +1,19 @@ {extend name="../../base/view/common/base" /} {block name="style"} @@ -56,7 +71,8 @@ 发票类型 {eq name="$detail.invoice_type" value="1"}增值税专用发票{/eq} - {eq name="$detail.invoice_type" value="2"}增值税普通发票{/eq} + {eq name="$detail.invoice_type" value="2"}普通发票{/eq} + {eq name="$detail.invoice_type" value="3"}专业发票{/eq} 发票主体 @@ -100,21 +116,20 @@ 发票状态 {if condition="($detail.check_status == 0)"} - 待审 + 待审核 {elseif condition="($detail.check_status == 1)"} - 审核中 + 审核中 {elseif condition="($detail.check_status == 2)"} - 审核通过,待开具 + 审核通过,待开具 {elseif condition="($detail.check_status == 3)"} - 审核不通过 【原因:{$detail.check_remark}】 + 审核不通过 【原因:{$detail.check_remark}】 {elseif condition="($detail.check_status == 4)"} - 撤销 【原因:{$detail.check_remark}】 + 已撤销 【原因:{$detail.check_remark}】 {elseif condition="($detail.check_status == 5)"} - 已开具 + 已开具 {elseif condition="($detail.check_status == 10)"} - 已作废 + 已作废 {/if} - 查看审批记录 {if condition="$detail.open_admin_id > 0"} @@ -174,7 +189,7 @@ {/empty} {if condition="($detail.is_cash lt 2)"} -
+
{/if} @@ -183,7 +198,7 @@ {if condition="($detail.is_cash lt 2)"} - + {/if} {if condition="($detail.is_cash eq 0)"} @@ -207,158 +222,7 @@ -{/block} +{block name="script"}{/block} \ No newline at end of file diff --git a/app/finance/view/invoice/add.html b/app/finance/view/invoice/add.html index 8d1fbba..7242235 100644 --- a/app/finance/view/invoice/add.html +++ b/app/finance/view/invoice/add.html @@ -89,7 +89,7 @@
- + 审批流程* + @@ -210,7 +210,7 @@ 抄送人 - + @@ -218,7 +218,7 @@
- +
@@ -245,118 +245,112 @@ Array.prototype.remove = function (val) { } }; -const moduleInit = ['tool','formSelects','employeepicker']; - function gouguInit() { - var form = layui.form, - upload = layui.upload, - tool=layui.tool, - formSelects = layui.formSelects, - employeepicker = layui.employeepicker, - laydate = layui.laydate; +const moduleInit = ['tool','employeepicker']; +function gouguInit() { + var form = layui.form, + upload = layui.upload, + tool=layui.tool, + employeepicker = layui.employeepicker, + laydate = layui.laydate; - //多附件上传 - upload.render({ - elem: '#upFile' - ,url: "/api/index/upload" - ,multiple: true - ,accept: 'file' //普通文件 - ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 - ,done: function(res){ - layer.msg(res.msg); - if (res.code == 0) { - //上传成功 - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.push(res.data.id); - $('#fileList input').attr('value', idsArray.join(',')); - let temp = `
-
- -
${res.data.name}
-
- - -
-
-
`; - $('#fileList').append(temp); + //选择抬头类型 + form.on('radio(type)', function (data) { + if(data.value==2){ + $('.invoice-type').hide(); + } + else{ + $('.invoice-type').show(); + } + }); + + + //监听提交 + form.on('submit(webform)', function(data){ + $.ajax({ + url: "/finance/invoice/add", + type:'post', + data:data.field, + success:function(e){ + layer.msg(e.msg); + if (e.code == 0) { + parent.layui.tool.close(1000); } } - }); - $('#fileList').on('click', '.btn-delete', function () { - var _id = $(this).data('id'); - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.remove(_id); - $('#fileList input').attr('value', idsArray.join(',')); - $('#uploadImg' + _id).remove(); - }) - - //选择抬头类型 - form.on('radio(type)', function (data) { - if(data.value==2){ - $('.invoice-type').hide(); - } - else{ - $('.invoice-type').show(); - } - }); - - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ - if($('[name="flow_id"]').val()==''){ - layer.msg('请先选择审批流程'); - return false; - } - employeepicker.init({ - department_url: "/api/index/get_department_tree", - employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); - } - }); }) - - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, - }); + return false; + }); - form.on('select(flowtype)', function(data){ - var check_type = data.elem[data.elem.selectedIndex].title; - var formHtml='审核人*\ - \ - \ - '; - if(check_type == 2){ - $('#flow_tr').html(formHtml); - form.render(); + //选择单个员工弹窗 + $('body').on('click','.picker-one',function () { + if($('[name="flow_id"]').val()==''){ + layer.msg('请先选择审批流程'); + return false; + } + let that = $(this); + let ids=that.next().val()+'',names = that.val()+''; + employeepicker.init({ + ids:ids, + names:names, + type:0, + department_url: "/api/index/get_department_tree", + employee_url: "/api/index/get_employee", + callback:function(ids,names,dids,departments){ + that.val(names); + that.next().val(ids); } - if(data.value==''){ - return false; + }); + }); + + //选择多个员工弹窗 + $('body').on('click','.picker-more',function () { + let that = $(this); + let ids=that.next().val()+'',names = that.val()+'',ids_array=[],names_array=[]; + if(ids.length>0){ + ids_array=ids.split(','); + names_array=names.split(','); + } + employeepicker.init({ + ids:ids_array, + names:names_array, + type:1, + department_url: "/api/index/get_department_tree", + employee_url: "/api/index/get_employee", + callback:function(ids,names,dids,departments){ + that.val(names.join(',')); + that.next().val(ids.join(',')); } - $.ajax({ - url: "/api/index/get_flow_users", - type:'get', - data:{id:data.value}, - success: function (e) { - if (e.code == 0) { - var flowLi=''; - var flow_data = e.data.flow_data; - if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); - } - if(check_type == 1){ - for(var a=0;a'+flow_data[a].user_id_info[b].name+''; } } - flowLi+='
  • \ - \ -
    \ -

    第'+(a+1)+'级审批'+sign_type+'

    \ -
      '+userList+'
    \ -
    \ -
  • '; - } - formHtml = '审批流程\ - \ -
      '+flowLi+'
    \ - '; - $('#flow_tr').html(formHtml); - } + } + else if(check_type == 3){ + sign_type= ' '+flow_data[a].flow_name+'' + for(var b=0;b'+flow_data[a].user_id_info[b].name+''; + } + } + flowLi+='
  • \ + \ +
    \ +

    第'+(a+1)+'级审批'+sign_type+'

    \ +
      '+userList+'
    \ +
    \ +
  • '; + } + formHtml = '审批流程\ + \ +
      '+flowLi+'
    \ + '; + $('#flow_tr').html(formHtml); } } - }) - }); + } + }) + }); + - - //监听提交 - form.on('submit(webform)', function(data){ - $.ajax({ - url: "/finance/invoice/add", - type:'post', - data:data.field, - success:function(e){ - layer.msg(e.msg); - if (e.code == 0) { - parent.layui.tool.close(1000); - } + $('#fileList').on('click', '.btn-delete', function () { + var _id = $(this).data('id'); + var idsStr = $('#fileList input').val(),idsArray = []; + if (idsStr != '') { + idsArray = idsStr.split(","); + } + idsArray.remove(_id); + $('#fileList input').attr('value', idsArray.join(',')); + $('#uploadImg' + _id).remove(); + }) + //多附件上传 + upload.render({ + elem: '#upFile' + ,url: "/api/index/upload" + ,multiple: true + ,accept: 'file' //普通文件 + ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 + ,done: function(res){ + layer.msg(res.msg); + if (res.code == 0) { + //上传成功 + var idsStr = $('#fileList input').val(),idsArray = []; + if (idsStr != '') { + idsArray = idsStr.split(","); } - }) - return false; - }); - } - + idsArray.push(res.data.id); + $('#fileList input').attr('value', idsArray.join(',')); + let temp = `
    +
    + +
    ${res.data.name}
    +
    + + +
    +
    +
    `; + $('#fileList').append(temp); + } + } + }); +} + {/block} \ No newline at end of file diff --git a/app/finance/view/invoice/checkedlist.html b/app/finance/view/invoice/checkedlist.html index 2b015aa..855d3cd 100644 --- a/app/finance/view/invoice/checkedlist.html +++ b/app/finance/view/invoice/checkedlist.html @@ -107,23 +107,23 @@ field: 'check_status', title: '发票状态', align: 'center', - width: 100, + width: 120, templet:function(d){ - var html='待审核'; + var html='待审核'; if(d.check_status==1){ - html='审核中'; + html='审核中'; } else if(d.check_status==2){ - html='待开具'; + html='审核通过,待开具'; } else if(d.check_status==3){ html='审核不通过'; } else if(d.check_status==4){ - html='撤销'; + html='已撤销'; } else if(d.check_status==5){ - html='已开具'; + html='已开具'; } else if(d.check_status==10){ html='已作废'; @@ -164,20 +164,25 @@ field: 'right', fixed: 'right', title: '操作', - width: 168, + width: 170, align: 'center', templet:function(d){ //0待审、1审批中、2通过、3失败、4撤销、5已开具、10已作废 var html='
    '; var btn1='详情'; var btn2='标记为开票'; - var btn3='作废'; + var btn3='修改开票信息'; + var btn4='作废'; + var btn5='反作废'; html+=btn1; if(d.check_status==2){ html+=btn2; } - if(d.check_status==5 && d.open_admin_id==login_user){ - html+=btn2+btn3; + if(d.check_status==5){ + html+=btn3+btn4; + } + if(d.check_status==10){ + html+=btn5; } html+='
    '; return html; @@ -232,8 +237,16 @@ let code = $('#LAY_module').find('[name="code"]').val(); let open_time = $('#LAY_module').find('[name="open_time"]').val(); let delivery = $('#LAY_module').find('[name="delivery"]').val(); + if(code == ''){ + layer.msg('请输入发票号码'); + return false; + } + if(open_time == ''){ + layer.msg('请选择开票时间'); + return false; + } $.ajax({ - url: "/finance/invoice/open", + url: "/finance/api/open", type: 'post', data: { id: data.id, @@ -255,13 +268,13 @@ } }); } - if (obj.event === 'disabled') { + if (obj.event === 'tovoid') { layer.confirm('确定作废该发票吗?', { icon: 3, title: '提示' }, function(index) { $.ajax({ - url: "/finance/invoice/tovoid", + url: "/finance/api/tovoid", type:'post', data: { id: data.id, @@ -277,6 +290,28 @@ layer.close(index); }); } + if (obj.event === 'novoid') { + layer.confirm('确定反作废该发票吗?', { + icon: 3, + title: '提示' + }, function(index) { + $.ajax({ + url: "/finance/api/novoid", + type:'post', + data: { + id: data.id, + check_status:5 + }, + success: function(res) { + layer.msg(res.msg); + if (res.code == 0) { + layui.pageTable.reload(); + } + } + }) + layer.close(index); + }); + } }); } diff --git a/app/finance/view/invoice/copy.html b/app/finance/view/invoice/copy.html index 56aaaec..ddc7cb6 100644 --- a/app/finance/view/invoice/copy.html +++ b/app/finance/view/invoice/copy.html @@ -93,23 +93,23 @@ field: 'check_status', title: '发票状态', align: 'center', - width: 100, + width: 120, templet:function(d){ - var html='待审核'; + var html='待审核'; if(d.check_status==1){ - html='审核中'; + html='审核中'; } else if(d.check_status==2){ - html='待开具'; + html='审核通过,待开具'; } else if(d.check_status==3){ html='审核不通过'; } else if(d.check_status==4){ - html='撤销'; + html='已撤销'; } else if(d.check_status==5){ - html='已开具'; + html='已开具'; } else if(d.check_status==10){ html='已作废'; diff --git a/app/finance/view/invoice/index.html b/app/finance/view/invoice/index.html index e7e930f..e5f9605 100644 --- a/app/finance/view/invoice/index.html +++ b/app/finance/view/invoice/index.html @@ -29,7 +29,7 @@
    {/block} @@ -109,23 +109,23 @@ field: 'check_status', title: '发票状态', align: 'center', - width: 100, + width: 120, templet:function(d){ - var html='待审核'; + var html='待审核'; if(d.check_status==1){ - html='审核中'; + html='审核中'; } else if(d.check_status==2){ - html='待开具'; + html='审核通过,待开具'; } else if(d.check_status==3){ html='审核不通过'; } else if(d.check_status==4){ - html='撤销'; + html='已撤销'; } else if(d.check_status==5){ - html='已开具'; + html='已开具'; } else if(d.check_status==10){ html='已作废'; @@ -150,7 +150,7 @@ },{ field: 'check_user', title: '当前审核人', - width: 150 + width: 140 },{ field: 'open_name', title: '开票人', diff --git a/app/finance/view/invoice/list.html b/app/finance/view/invoice/list.html index 9835346..088bb9d 100644 --- a/app/finance/view/invoice/list.html +++ b/app/finance/view/invoice/list.html @@ -87,23 +87,23 @@ field: 'check_status', title: '发票状态', align: 'center', - width: 100, + width: 120, templet:function(d){ - var html='待审核'; + var html='待审核'; if(d.check_status==1){ - html='审核中'; + html='审核中'; } else if(d.check_status==2){ - html='待开具'; + html='审核通过,待开具'; } else if(d.check_status==3){ html='审核不通过'; } else if(d.check_status==4){ - html='撤销'; + html='已撤销'; } else if(d.check_status==5){ - html='已开具'; + html='已开具'; } else if(d.check_status==10){ html='已作废'; diff --git a/app/finance/view/invoice/view.html b/app/finance/view/invoice/view.html index 8da7b7c..76c242b 100644 --- a/app/finance/view/invoice/view.html +++ b/app/finance/view/invoice/view.html @@ -8,7 +8,7 @@ .layui-form-item:hover .layui-btn-danger{display:inline-block;} .select-1,.select-2{display:none;} -.check-items{overflow-x: auto; padding: 10px 0;} +.check-items{overflow-x: auto; padding: 2px 0;} .flow-flex-row {box-direction: row; box-orient: horizontal; -webkit-box-orient: horizontal; @@ -24,11 +24,13 @@ -webkit-box-align: center; -ms-flex-align: center; align-items: center; + flex-wrap: wrap; } - -.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0;} -.check-item i{font-size:20px; margin-right:3px; color:#4285f4;} +.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0; padding:4px 0} +.check-item i{margin-right:3px; color:#646464;} .check-item span{color:#999;margin:0 3px;} +.check-item .layui-icon {font-size:18px;} +.check-item .layui-icon.layui-icon-right{font-size:12px;} .layui-icon[data-ok]{color:#34a853} .layui-icon[data-no]{color:#FF5722;} .check-item-status{color:#999; font-size:12px; margin-left:3px;} @@ -38,36 +40,21 @@ .flow-tips li i{color:#4285f4;} .flow-tips li span{color:#999; font-size:12px; margin-left:4px;} -.flow-record{padding:10px 10px 0;} -.flow-record .layui-icon {font-size:20px;} -.flow-record .layui-timeline-item{padding-bottom:10px;} +.flow-record{padding:4px 4px 0;} +.flow-record .layui-timeline-item{text-decoration:line-through; color:#acacac; padding-bottom:10px;} +.flow-record .layui-timeline-item.delete-0{text-decoration:none; color:#323232;} .layui-timeline-content ul{font-size:12px;} .check-status{color:#999; margin-left:5px;} .check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;} - +.check-record{line-height:1.5; padding:4px 0} +.flow-this{font-weight:800;} +.flow-this i{color:#4285f4} .layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;} .layui-table-min td{font-size:13px; padding:6px;text-align:center;} - -.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding:8px 0; margin:4px 8px 4px 0; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} -.file-card .file-icon{font-size:36px; color:#646464; margin-right: 4px;} -.file-card .file-title {font-size: 12px; letter-spacing: 0; margin-right: 8px; line-height: 16px; word-break: break-all; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; - -webkit-line-clamp: 2; - line-clamp: 2; - -webkit-box-orient: vertical;width: calc(100% - 80px); -} -.file-card .file-tool .layui-icon{font-size:22px; padding:2px; cursor:pointer;} {/block} {block name="body"} -{block name="body"}

    发票详情

    @@ -126,12 +113,12 @@ @@ -178,7 +164,22 @@ - {if ( $detail.check_status lt 2) AND ( $is_check_admin eq 1) } + {notempty name="$check_record"} + + + + + {/notempty} + {if ( $detail.check_status eq 1) AND ( $is_check_admin eq 1) } {eq name="$flows.flow_type" value="0"} @@ -210,27 +211,30 @@ - + {/if}
    {volist name="$detail.fileArray" id="vo"} -
    +
    -
    {$vo.name}
    +
    {$vo.name}
    - +
    @@ -144,21 +131,20 @@
    发票状态 {if condition="($detail.check_status == 0)"} - 待审 + 待审核 {elseif condition="($detail.check_status == 1)"} - 审核中 + 审核中 {elseif condition="($detail.check_status == 2)"} - 审核通过,待开具 + 审核通过,待开具 {elseif condition="($detail.check_status == 3)"} 审核不通过 【原因:{$detail.check_remark}】 {elseif condition="($detail.check_status == 4)"} - 撤销 【原因:{$detail.check_remark}】 + 已撤销 【原因:{$detail.check_remark}】 {elseif condition="($detail.check_status == 5)"} - 已开具 + 已开具 {elseif condition="($detail.check_status == 10)"} 已作废 {/if} - 查看审批记录 当前审核人 {$detail.check_user}
    审批记录 +
      + {volist name="$check_record" id="vo"} +
    • + +

      {$vo.check_time_str}{$vo.name}{$vo.status_str}了此申请。操作意见:{$vo.content}

      +
    • + {/volist} +
    +
    审批节点 *{$detail.open_time}
    快递单号物流单号 {$detail.delivery}
    + +
    - {if ( $detail.check_status lt 2)} + {eq name="$detail.check_status" value='1'} {eq name="$is_check_admin" value='1'} 通过 - 拒绝 + {$flows.flow_type == 5?'回退':'拒绝'} {/eq} {eq name="$is_create_admin" value='1'} 撤回 {/eq} + {/eq} + {if ( $detail.check_status eq 3) AND ( $is_create_admin eq 1) } + 撤回 {/if} - {if ( $detail.check_status eq 3) OR ( $detail.check_status eq 4 ) } - {eq name="$is_create_admin" value='1'} - 重新编辑 - {/eq} + {if ( $detail.check_status eq 4) AND ( $is_create_admin eq 1) } + 重新编辑 {/if}
    @@ -241,157 +245,145 @@ {block name="script"} {/block} diff --git a/app/home/controller/Api.php b/app/home/controller/Api.php new file mode 100644 index 0000000..f45c153 --- /dev/null +++ b/app/home/controller/Api.php @@ -0,0 +1,175 @@ +field('a.id,a.title,a.create_time,c.title as cate_title') + ->alias('a') + ->join('note_cate c', 'a.cate_id = c.id') + ->where(['a.status' => 1]) + ->order('a.end_time desc,a.sort desc,a.create_time desc') + ->limit(10) + ->select()->toArray(); + foreach ($list as $key => $val) { + $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); + } + $res['data'] = $list; + return table_assign(0, '', $res); + } + + //首页知识列表 + public function get_article_list() + { + $prefix = get_config('database.connections.mysql.prefix');//判断是否安装了文章模块 + $exist = Db::query('show tables like "'.$prefix.'article"'); + $res['data'] = []; + if($exist){ + $list = Db::name('Article') + ->field('a.id,a.title,a.create_time,a.read,c.title as cate_title') + ->alias('a') + ->join('article_cate c', 'a.cate_id = c.id') + ->where(['a.delete_time' => 0]) + ->order('a.id desc') + ->limit(10) + ->select()->toArray(); + foreach ($list as $key => $val) { + $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); + } + $res['data'] = $list; + } + return table_assign(0, '', $res); + } + + + //首页项目 + public function get_project_list() + { + $prefix = get_config('database.connections.mysql.prefix');//判断是否安装了项目模块 + $exist = Db::query('show tables like "'.$prefix.'project"'); + $res['data'] = []; + if($exist){ + $project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id'); + $list = Db::name('Project') + ->field('a.id,a.name,a.status,a.create_time,a.start_time,a.end_time,u.name as director_name') + ->alias('a') + ->join('Admin u', 'a.director_uid = u.id') + ->where([['a.delete_time', '=', 0], ['a.id', 'in', $project_ids]]) + ->order('a.id desc') + ->limit(10) + ->select()->toArray(); + foreach ($list as $key => $val) { + $list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']); + $list[$key]['plan_time'] = date('Y-m-d', $list[$key]['start_time']) . ' 至 ' . date('Y-m-d', $list[$key]['end_time']); + $list[$key]['status_name'] = \app\project\model\Project::$Status[(int) $val['status']]; + } + $res['data'] = $list; + } + return table_assign(0, '', $res); + } + + //获取访问记录 + public function get_view_data() + { + $param = get_params(); + $first_time = time(); + $second_time = $first_time - 86400; + $three_time = $first_time - 86400 * 365; + $begin_first = strtotime(date('Y-m-d', $first_time) . " 00:00:00"); + $end_first = strtotime(date('Y-m-d', $first_time) . " 23:59:59"); + $begin_second = strtotime(date('Y-m-d', $second_time) . " 00:00:00"); + $end_second = strtotime(date('Y-m-d', $second_time) . " 23:59:59"); + $begin_three = strtotime(date('Y-m-d', $three_time) . " 00:00:00"); + $data_first = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_first,$end_first")->select(); + $data_second = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_second,$end_second")->select(); + $data_three = Db::name('AdminLog')->field('create_time')->whereBetween('create_time', "$begin_three,$end_first")->select(); + return to_assign(0, '', ['data_first' => hour_document($data_first), 'data_second' => hour_document($data_second), 'data_three' => date_document($data_three)]); + } + + //修改个人信息 + public function edit_personal() + { + if (request()->isAjax()) { + $param = get_params(); + $uid = $this->uid; + Db::name('Admin')->where(['id' => $uid])->strict(false)->field(true)->update($param); + $session_admin = get_config('app.session_admin'); + Session::set($session_admin, Db::name('admin')->find($uid)); + return to_assign(); + } + else{ + return view('user@user/edit_personal', [ + 'admin' => get_admin($this->uid), + ]); + } + } + + //修改密码 + public function edit_password() + { + if (request()->isAjax()) { + $param = get_params(); + try { + validate(AdminCheck::class)->scene('editPwd')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $uid = $this->uid; + + $admin = Db::name('Admin')->where(['id' => $uid])->find(); + $old_psw = set_password($param['old_pwd'], $admin['salt']); + if ($admin['pwd'] != $old_psw) { + return to_assign(1, '旧密码错误'); + } + + $salt = set_salt(20); + $new_pwd = set_password($param['pwd'], $salt); + $data = [ + 'reg_pwd' => '', + 'salt' => $salt, + 'pwd' => $new_pwd, + 'update_time' => time(), + ]; + Db::name('Admin')->where(['id' => $uid])->strict(false)->field(true)->update($data); + $session_admin = get_config('app.session_admin'); + Session::set($session_admin, Db::name('admin')->find($uid)); + return to_assign(); + } + else{ + return view('user@user/edit_password', [ + 'admin' => get_admin($this->uid), + ]); + } + } + + //系统操作日志 + public function log_list() + { + if (request()->isAjax()) { + $param = get_params(); + $log = new AdminLog(); + $content = $log->get_log_list($param); + return table_assign(0, '', $content); + }else{ + return view('home@log/log_list'); + } + } + +} diff --git a/app/home/controller/Cate.php b/app/home/controller/Cate.php index cc2e832..e91d224 100644 --- a/app/home/controller/Cate.php +++ b/app/home/controller/Cate.php @@ -13,8 +13,6 @@ use app\base\BaseController; use app\home\validate\FlowTypeCheck; use app\home\validate\ExpenseCateCheck; use app\home\validate\CostCateCheck; -use app\home\validate\SealCateCheck; -use app\home\validate\CarCateCheck; use app\home\validate\IndustryCheck; use app\home\validate\ServicesCheck; use app\home\validate\WorkCateCheck; @@ -165,134 +163,6 @@ class Cate extends BaseController } } - //印章类别 - public function seal_cate() - { - if (request()->isAjax()) { - $cate = Db::name('SealCate')->order('create_time asc')->select(); - return to_assign(0, '', $cate); - } else { - return view(); - } - } - //印章类别添加 - public function seal_cate_add() - { - if (request()->isAjax()) { - $param = get_params(); - if (!empty($param['id']) && $param['id'] > 0) { - try { - validate(SealCateCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $data['update_time'] = time(); - $res = Db::name('SealCate')->strict(false)->field(true)->update($param); - if ($res) { - add_log('edit', $param['id'], $param); - } - return to_assign(); - } else { - try { - validate(SealCateCheck::class)->scene('add')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $param['create_time'] = time(); - $insertId = Db::name('SealCate')->strict(false)->field(true)->insertGetId($param); - if ($insertId) { - add_log('add', $insertId, $param); - } - return to_assign(); - } - } - } - - //印章类别设置 - public function seal_cate_check() - { - $param = get_params(); - $res = Db::name('SealCate')->strict(false)->field('id,status')->update($param); - if ($res) { - if($param['status'] == 0){ - add_log('disable', $param['id'], $param); - } - else if($param['status'] == 1){ - add_log('recovery', $param['id'], $param); - } - return to_assign(); - } - else{ - return to_assign(0, '操作失败'); - } - } - - //车辆类型 - public function car_cate() - { - if (request()->isAjax()) { - $cate = Db::name('CarCate')->order('create_time asc')->select(); - return to_assign(0, '', $cate); - } else { - return view(); - } - } - //车辆类型添加 - public function car_cate_add() - { - if (request()->isAjax()) { - $param = get_params(); - if (!empty($param['id']) && $param['id'] > 0) { - try { - validate(CarCateCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $data['update_time'] = time(); - $res = Db::name('CarCate')->strict(false)->field(true)->update($param); - if ($res) { - add_log('edit', $param['id'], $param); - } - return to_assign(); - } else { - try { - validate(CarCateCheck::class)->scene('add')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $param['create_time'] = time(); - $insertId = Db::name('CarCate')->strict(false)->field(true)->insertGetId($param); - if ($insertId) { - add_log('add', $insertId, $param); - } - return to_assign(); - } - } - } - - //车辆类型设置 - public function car_cate_check() - { - $param = get_params(); - $res = Db::name('CarCate')->strict(false)->field('id,status')->update($param); - if ($res) { - if($param['status'] == 0){ - add_log('disable', $param['id'], $param); - } - else if($param['status'] == 1){ - add_log('recovery', $param['id'], $param); - } - return to_assign(); - } - else{ - return to_assign(0, '操作失败'); - } - } - //报销类别 public function expense_cate() { diff --git a/app/home/controller/Flow.php b/app/home/controller/Flow.php index ad209a3..0e8a677 100644 --- a/app/home/controller/Flow.php +++ b/app/home/controller/Flow.php @@ -44,19 +44,48 @@ class Flow extends BaseController { $param = get_params(); if (request()->isAjax()) { - $flowTypeData = isset($param['flowType']) ? $param['flowType'] : ''; - $flowUidsData = isset($param['flowUids']) ? $param['flowUids'] : ''; - $flow_list=[]; - foreach ($flowTypeData as $key => $value) { - if (!$value) { - continue; + $param['flow_list'] = ''; + $flow_list=[]; + if($param['check_type']==1){ + $flowTypeData = isset($param['flowType']) ? $param['flowType'] : ''; + $flowUidsData = isset($param['flowUidsA']) ? $param['flowUidsA'] : ''; + foreach ($flowTypeData as $key => $value) { + if (!$value) { + continue; + } + if($value>2 && $flowUidsData[$key]==''){ + return to_assign(1, '第'.($key+1).'行的指定人未选择'); + break; + } + $item = []; + $item['flow_type'] = $value; + $item['flow_uids'] = $flowUidsData[$key]; + $flow_list[]=$item; } - $item = []; - $item['flow_type'] = $value; - $item['flow_uids'] = $flowUidsData[$key]; - $flow_list[]=$item; + $param['flow_list'] = serialize($flow_list); } - $param['flow_list'] = serialize($flow_list); + if($param['check_type']==3){ + $flowNameData = isset($param['flowName']) ? $param['flowName'] : ''; + $flowUidsData = isset($param['flowUidsB']) ? $param['flowUidsB'] : ''; + foreach ($flowNameData as $key => $value) { + if (!$value) { + continue; + } + if($flowUidsData[$key]==''){ + return to_assign(1, '第'.($key+1).'行的指定人未选择'); + break; + } + $item = []; + $item['flow_name'] = $value; + $item['flow_type'] = 5; + $item['flow_uids'] = $flowUidsData[$key]; + $flow_list[]=$item; + } + if(empty($flow_list)){ + return to_assign(1, '审批流程信息未完善'); + } + $param['flow_list'] = serialize($flow_list); + } if ($param['id'] > 0) { try { validate(FlowCheck::class)->scene('edit')->check($param); @@ -84,7 +113,22 @@ class Flow extends BaseController $id = isset($param['id']) ? $param['id'] : 0; if($id>0){ $detail = Db::name('Flow')->where('id',$id)->find(); - $detail['flow_list'] = unserialize($detail['flow_list']); + $flow_list = unserialize($detail['flow_list']); + if(!empty($flow_list)){ + foreach ($flow_list as $key => &$val) { + $val['flow_unames'] =''; + if($val['flow_type']>2){ + $flow_unames = Db::name('Admin')->where('id', 'in', $val['flow_uids'])->column('name'); + $val['flow_unames'] = implode(',', $flow_unames); + } + } + } + $detail['flow_list'] = $flow_list; + $detail['copy_unames'] =''; + if($detail['copy_uids']!=''){ + $copy_unames = Db::name('Admin')->where('id', 'in', $detail['copy_uids'])->column('name'); + $detail['copy_unames'] = implode(',', $copy_unames); + } $detail['flow_cate_list'] = Db::name('FlowType')->where(['type'=>$detail['type'],'status'=>1])->select()->toArray(); View::assign('detail', $detail); } diff --git a/app/home/controller/Index.php b/app/home/controller/Index.php index 0783889..2b5bf81 100644 --- a/app/home/controller/Index.php +++ b/app/home/controller/Index.php @@ -22,7 +22,7 @@ class Index extends BaseController //发票待审核统计 $invoice_map_check[] = ['check_status', '<', 2]; $invoice_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")]; - $invoice_map_check[] = ['status', '=', 1]; + $invoice_map_check[] = ['delete_time', '=', 0]; $invoice_count_check = Db::name('Invoice')->where($invoice_map_check)->count(); $statistics['invoice_html_check'] = ' 您有' . $invoice_count_check . '条发票申请待审核'; if ($invoice_count_check == 0) { @@ -32,7 +32,7 @@ class Index extends BaseController //发票待开具统计 $invoice_map_open[] = ['open_time', '=', 0]; $invoice_map_open[] = ['open_admin_id', '=', $admin_id]; - $invoice_map_open[] = ['status', '=', 1]; + $invoice_map_open[] = ['delete_time', '=', 0]; $invoice_count_open = Db::name('Invoice')->where($invoice_map_open)->count(); $statistics['invoice_html_open'] = '您有' . $invoice_count_open . '条发票待开具'; if ($invoice_count_open == 0) { @@ -42,7 +42,7 @@ class Index extends BaseController //待审核的报销统计 $expense_map_check[] = ['check_status', '<', 2]; $expense_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")]; - $expense_map_check[] = ['status', '=', 1]; + $expense_map_check[] = ['delete_time', '=', 0]; $expense_count_check = Db::name('Expense')->where($expense_map_check)->count(); $statistics['expense_html_check'] = '您有' . $expense_count_check . '条报销单待审核'; if ($expense_count_check == 0) { @@ -97,8 +97,8 @@ class Index extends BaseController $total = []; $adminCount = Db::name('Admin')->where('status', '1')->count(); $approveCount = Db::name('Approve')->count(); - $expenseCount = Db::name('Expense')->where('status', '1')->count(); - $invoiceCount = Db::name('Invoice')->where('status', '1')->count(); + $expenseCount = Db::name('Expense')->where('delete_time', '0')->count(); + $invoiceCount = Db::name('Invoice')->where('delete_time', '0')->count(); $total[] = array( 'name' => '员工', 'num' => $adminCount, diff --git a/app/home/view/cate/car_cate.html b/app/home/view/cate/car_cate.html index f54d332..485d9dc 100644 --- a/app/home/view/cate/car_cate.html +++ b/app/home/view/cate/car_cate.html @@ -6,7 +6,7 @@
    {/block} @@ -41,9 +41,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/cost_cate.html b/app/home/view/cate/cost_cate.html index dbed009..baf2349 100644 --- a/app/home/view/cate/cost_cate.html +++ b/app/home/view/cate/cost_cate.html @@ -6,7 +6,7 @@
    {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/expense_cate.html b/app/home/view/cate/expense_cate.html index 3caa8ba..ca22e84 100644 --- a/app/home/view/cate/expense_cate.html +++ b/app/home/view/cate/expense_cate.html @@ -6,7 +6,7 @@
    {/block} @@ -24,7 +24,7 @@ ,title:'报销类别列表' ,url: "/home/cate/expense_cate" ,page: false - ,cellMinWidth: 80 + ,cellMinWidth: 120 ,cols: [[ {field:'id',width:80, title: 'ID号', align:'center'} ,{field:'title',title: '类别名称'} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/flow_type.html b/app/home/view/cate/flow_type.html index dfcb514..a6069be 100644 --- a/app/home/view/cate/flow_type.html +++ b/app/home/view/cate/flow_type.html @@ -6,7 +6,7 @@
    {/block} @@ -24,12 +24,15 @@ ,title:'审批模块列表' ,url: "/home/cate/flow_type" ,page: false - ,cellMinWidth: 80 + ,cellMinWidth: 120 ,cols: [[ {field:'id',width:80, title: 'ID号', align:'center'} ,{field:'title',title: '审批类型名称'} ,{field:'name',title: '审批类型标识'} - ,{field:'icon',title: '审批类型图标'} + ,{field:'icon',title: '审批类型图标',templet: function(d){ + var html=' '+d.icon; + return html; + }} ,{field:'type', title: '所属分类',width:100,align:'center',templet: function(d){ var html=''; if(d.type==1){ @@ -64,9 +67,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/flow_type_add.html b/app/home/view/cate/flow_type_add.html index 1d2a525..c9be497 100644 --- a/app/home/view/cate/flow_type_add.html +++ b/app/home/view/cate/flow_type_add.html @@ -32,7 +32,7 @@ 图标* - + 如:icon-jichupeizhi[查看图标] @@ -71,8 +71,8 @@ 图标* - - [查看图标] + + [查看图标] diff --git a/app/home/view/cate/industry_cate.html b/app/home/view/cate/industry_cate.html index cad2fee..33c09c4 100644 --- a/app/home/view/cate/industry_cate.html +++ b/app/home/view/cate/industry_cate.html @@ -6,7 +6,7 @@
    {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/seal_cate.html b/app/home/view/cate/seal_cate.html index 56ad67b..13bcde0 100644 --- a/app/home/view/cate/seal_cate.html +++ b/app/home/view/cate/seal_cate.html @@ -6,7 +6,7 @@ {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/services_cate.html b/app/home/view/cate/services_cate.html index 60389a8..c1f3c94 100644 --- a/app/home/view/cate/services_cate.html +++ b/app/home/view/cate/services_cate.html @@ -6,7 +6,7 @@ {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/subject.html b/app/home/view/cate/subject.html index 21c4103..a46e68d 100644 --- a/app/home/view/cate/subject.html +++ b/app/home/view/cate/subject.html @@ -6,7 +6,7 @@ {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/cate/work_cate.html b/app/home/view/cate/work_cate.html index da8c163..47732af 100644 --- a/app/home/view/cate/work_cate.html +++ b/app/home/view/cate/work_cate.html @@ -6,7 +6,7 @@ {/block} @@ -40,9 +40,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/flow/add.html b/app/home/view/flow/add.html index 345c03f..973d2eb 100644 --- a/app/home/view/flow/add.html +++ b/app/home/view/flow/add.html @@ -58,13 +58,14 @@ 审批流类型* - + + - + 审批流程* -
    +
    @@ -78,28 +79,67 @@
    - -
    - + +
    + +
    - + 添加审批层级 + + 添加审批层级

    温馨提示

    1、当选择 “当前部门负责人” 审批时。系统仅会通知当前部门的负责人。

    2、当选择 “上一级部门负责人” 审批时。系统仅会通知当前部门的上一级部门的负责人。

    -

    3、当选择 “指定人员(多人或签)” 时,表示指定用户中任意一人审批即可。

    -

    4、当选择 “指定人员(多人会签)” 时,表示指定人员中所有人都需要审批。

    +

    3、当选择 “指定人员(多人或签)” 时,表示指定用户中任意一人审批即可,可单选或多选。

    +

    4、当选择 “指定人员(多人会签)” 时,表示指定人员中所有人都需要审批,可单选或多选。

    5、如果指定用户没有分配查看审批模块的功能权限,系统会通知其审批,但是他无法查看此审批数据信息。

    + + 审批流程 + +
    +

    温馨提示

    +

    无需配置审批人,审批时,根据实际情况选择审批人即可,自由度最高。

    +
    + + + + 审批流程* + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    +
    + + 添加审批层级 +
    +

    温馨提示

    +

    1、指定人员单选。后期审批的时候,审批人只能该指定人员。

    +

    2、该审批流程可回退,当拒绝审核时,会自动回退到上一位审批人节点。

    +
    + + 抄送人 - + + @@ -151,13 +191,15 @@ 审批流类型* - + + - + 审批流程* -
    +
    + {eq name="$detail.check_type" value="1"} {volist name="detail.flow_list" id="vo"}
    @@ -173,8 +215,9 @@
    -
    - +
    + +
    {gt name="$key" value="0"} @@ -182,22 +225,105 @@ {/gt}
    {/volist} + {else/} +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + {/eq}
    - + 添加审批层级 + + 添加审批层级

    温馨提示

    1、当选择 “当前部门负责人” 审批时。系统仅会通知当前部门的负责人。

    2、当选择 “上一级部门负责人” 审批时。系统仅会通知当前部门的上一级部门的负责人。

    -

    3、当选择 “指定人员(多人或签)” 时,表示指定用户中任意一人审批即可。

    -

    4、当选择 “指定人员(多人会签)” 时,表示指定人员中所有人都需要审批。

    +

    3、当选择 “指定人员(多人或签)” 时,表示指定用户中任意一人审批即可,可单选或多选。

    +

    4、当选择 “指定人员(多人会签)” 时,表示指定人员中所有人都需要审批,可单选或多选。

    5、如果指定用户没有分配查看审批模块的功能权限,系统会通知其审批,但是他无法查看此审批数据信息。

    + + 审批流程* + +
    +

    温馨提示

    +

    无需配置审批人,审批时,根据实际情况选择审批人即可,自由度最高。

    +
    + + + + 审批流程* + +
    + {eq name="$detail.check_type" value="3"} + {volist name="detail.flow_list" id="vo"} +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    + {gt name="$key" value="0"} + 删除 + {/gt} +
    + {/volist} + {else/} +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + {/eq} +
    + + 添加审批层级 +
    +

    温馨提示

    +

    1、指定人员单选。后期审批的时候,审批人只能该指定人员。

    +

    2、该审批流程可回退,当拒绝审核时,会自动回退到上一位审批人节点。

    +
    + + 抄送人 - + + @@ -214,10 +340,11 @@ {block name="script"} {/block} diff --git a/app/home/view/flow/index.html b/app/home/view/flow/index.html index 2a3c6a0..fa9e74f 100644 --- a/app/home/view/flow/index.html +++ b/app/home/view/flow/index.html @@ -6,7 +6,7 @@
    {/block} @@ -28,11 +28,14 @@ ,cellMinWidth: 80 ,cols: [[ {field:'id',width:80, title: 'ID号', align:'center'} - ,{field:'name',title: '流程名称',width:120} - ,{field:'check_type',title: '流程类型', align:'center',width:100,templet:function(d){ - var html = '固定审批流'; + ,{field:'name',title: '流程名称',width:180} + ,{field:'check_type',title: '流程类型', align:'center',width:120,templet:function(d){ + var html = '固定审批流'; if(d.check_type==2){ - html = '授权审批人'; + html = '自由审批流'; + } + if(d.check_type==3){ + html = '可回退的审批流'; } return html; }} @@ -72,9 +75,9 @@ }} ,{width:100,title: '操作', align:'center',templet: function(d){ var html=''; - var btn='编辑'; + var btn='编辑'; var btn1='禁用'; - var btn2='启用'; + var btn2='启用'; if(d.status==1){ html = '
    '+btn+btn1+'
    '; } diff --git a/app/home/view/index/index.html b/app/home/view/index/index.html index fe62d6e..5a5cb5f 100644 --- a/app/home/view/index/index.html +++ b/app/home/view/index/index.html @@ -47,8 +47,8 @@ {:get_login_admin('nickname')}
    -
    基本资料
    -
    修改密码
    +
    基本资料
    +
    修改密码

    退出
    diff --git a/app/home/view/index/main.html b/app/home/view/index/main.html index 95dc50c..852f2d1 100644 --- a/app/home/view/index/main.html +++ b/app/home/view/index/main.html @@ -99,8 +99,8 @@ {:LAYUI_VERSION}Layui文档 - BUG反馈 - hdm58@qq.com + 合作联系微信号 + hdm588,业务合作、功能定制请备注 QQ交流群 @@ -120,7 +120,7 @@
    -

    员工动态

    更多
    +

    员工动态

    更多
      @@ -141,10 +141,10 @@ //公告 table.render({ elem: '#Note' - , url: "/api/index/get_note_list" //数据接口 + , url: "/home/api/get_note_list" //数据接口 , page: false //开启分页 , cols: [[ //表头 - { field: 'cate_title', title: '公告分类', align: 'center','width': 90 }, + { field: 'cate_title', title: '公告分类', align: 'center','width': 90}, { field: 'title', title: '公告标题',templet: ''}, { field: 'create_time', title: '发布时间', align: 'center','width': 136} ]] @@ -152,7 +152,7 @@ //文章 table.render({ elem: '#Article' - , url: "/api/index/get_article_list" //数据接口 + , url: "/home/api/get_article_list" //数据接口 , page: false //开启分页 , cols: [[ //表头 { field: 'cate_title', title: '知识分类', align: 'center','width': 90 }, @@ -164,7 +164,7 @@ //项目 table.render({ elem: '#Project' - , url: "/api/index/get_project_list" //数据接口 + , url: "/home/api/get_project_list" //数据接口 , page: false //开启分页 , cols: [[ //表头 { field: 'id', title: '项目编号', align: 'center','width': 90, templet: function (d) { @@ -197,7 +197,7 @@ function get_logs() { $.ajax({ - url: "/api/index/log_list", + url: "/home/api/log_list", type: 'get', data: { page: 1, @@ -232,7 +232,7 @@ var chartView = echarts.init(document.getElementById('chartView')); function get_view_data() { $.ajax({ - url: "/api/index/get_view_data", + url: "/home/api/get_view_data", type: 'get', data: {}, success: function (e) { diff --git a/app/home/view/keywords/index.html b/app/home/view/keywords/index.html index aed8917..d3f52a1 100644 --- a/app/home/view/keywords/index.html +++ b/app/home/view/keywords/index.html @@ -15,7 +15,7 @@ {/block} @@ -61,7 +61,7 @@ title: '操作', align: 'center', templet: function (d) { - var html = '
      '; + var html = '
      '; return html; } }] diff --git a/app/home/view/log/log_list.html b/app/home/view/log/log_list.html index 4f90d06..1dd1a89 100644 --- a/app/home/view/log/log_list.html +++ b/app/home/view/log/log_list.html @@ -49,7 +49,7 @@ var page=1,limit=20; function getLogs() { $.ajax({ - url: "/api/index/log_list", + url: "/home/api/log_list", type: 'post', data: { page:page, diff --git a/app/home/view/login/index.html b/app/home/view/login/index.html index 52eb5f5..c985e5c 100644 --- a/app/home/view/login/index.html +++ b/app/home/view/login/index.html @@ -67,7 +67,7 @@
      - {:get_system_config('web','copyright')} ,Powered by GouguCMS + {:get_system_config('web','copyright')} ,勾股OA - v{:CMS_VERSION},Powered by GouguCMS
      diff --git a/app/home/view/role/add.html b/app/home/view/role/add.html index 63cae8b..1882ca1 100644 --- a/app/home/view/role/add.html +++ b/app/home/view/role/add.html @@ -37,7 +37,7 @@ - 权限配置说明* + 权限配置说明* 注意:如果右侧子级权限有节点被勾选了,左侧的顶级权限就必须勾选,否则无法查看右侧的子级菜单。 @@ -78,8 +78,7 @@ - 备注内容 - + 备注内容 diff --git a/app/home/view/rule/add.html b/app/home/view/rule/add.html index 85c87f8..b5bc0a7 100644 --- a/app/home/view/rule/add.html +++ b/app/home/view/rule/add.html @@ -125,7 +125,7 @@ 菜单图标 - [查看图标] + [查看图标] diff --git a/app/home/view/rule/index.html b/app/home/view/rule/index.html index 3c28c2a..c50a9f5 100644 --- a/app/home/view/rule/index.html +++ b/app/home/view/rule/index.html @@ -30,7 +30,11 @@ , cols: [[ { field: 'id', width: 80, title: 'ID号', align: 'center' } , { field: 'sort', width: 60, title: '排序', align: 'center' } - , { field: 'title', width: 160, title: '菜单/节点名称' } + ,{field:'icon',title: '菜单图标',width: 80, align: 'center' ,templet: function(d){ + var html=''; + return html; + }} + , { field: 'title', width: 200, title: '菜单/节点名称' } , { field: 'pid', title: '父ID', width: 80, align: 'center' } , { field: 'src', title: 'URL链接' } , { diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index 39c82db..f6fc902 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -92,14 +92,14 @@ CREATE TABLE `oa_admin_module` ( -- Records of oa_admin_module -- ---------------------------- INSERT INTO `oa_admin_module` VALUES (1, '系统模块', 'home', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (2, '用户模块', 'user', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (3, '消息模块', 'message', 1, 1, 1639562910, 0); +INSERT INTO `oa_admin_module` VALUES (2, '人事模块', 'user', 1, 1, 1639562910, 0); +INSERT INTO `oa_admin_module` VALUES (3, '行政模块', 'adm', 1, 1, 1639562910, 0); INSERT INTO `oa_admin_module` VALUES (4, '公告模块', 'note', 1, 1, 1639562910, 0); INSERT INTO `oa_admin_module` VALUES (5, 'OA模块', 'oa', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (6, '客户模块', 'customer', 2, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (7, '合同模块', 'contract', 2, 1, 1656142368, 0); -INSERT INTO `oa_admin_module` VALUES (8, '项目模块', 'project', 2, 1, 1656142368, 0); -INSERT INTO `oa_admin_module` VALUES (9, '财务模块', 'finance', 2, 1, 1639562910, 0); +INSERT INTO `oa_admin_module` VALUES (6, '财务模块', 'finance', 2, 1, 1639562910, 0); +INSERT INTO `oa_admin_module` VALUES (7, '客户模块', 'customer', 2, 1, 1639562910, 0); +INSERT INTO `oa_admin_module` VALUES (8, '合同模块', 'contract', 2, 1, 1656142368, 0); +INSERT INTO `oa_admin_module` VALUES (9, '项目模块', 'project', 2, 1, 1656142368, 0); INSERT INTO `oa_admin_module` VALUES (10, '知识模块', 'article', 2, 1, 1656143065, 0); -- ---------------------------- @@ -127,8 +127,8 @@ CREATE TABLE `oa_admin_rule` ( -- ---------------------------- INSERT INTO `oa_admin_rule` VALUES (1, 0, '', '系统管理', '系统管理', 'home', 'icon-jichupeizhi', 1, 1, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (2, 0, '', '基础数据', '基础数据', 'home', 'icon-hetongshezhi', 1, 2, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (3, 0, '', '员工管理', '员工管理', 'user', 'icon-renshishezhi', 1, 3, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (4, 0, '', '消息通知', '消息通知', 'message', 'icon-xiaoxishezhi', 1, 4, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (3, 0, '', '人力资源', '人力资源', 'user', 'icon-renshishezhi', 1, 3, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (4, 0, '', '行政管理', '行政管理', 'adm', 'icon-banjiguanli', 1, 4, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (5, 0, '', '企业公告', '企业公告', 'note', 'icon-zhaoshengbaobiao', 1, 5, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (6, 0, '', '办公审批', '办公审批', 'oa', 'icon-shenpishezhi', 1, 6, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (7, 0, '', '日常办公', '日常办公', 'oa', 'icon-kaoshijihua', 1, 7, 1, 0, 0); @@ -181,197 +181,190 @@ INSERT INTO `oa_admin_rule` VALUES (42, 2, 'home/cate/cost_cate', '费用类型' INSERT INTO `oa_admin_rule` VALUES (43, 42, 'home/cate/cost_cate_add', '新建/编辑', '费用类型', 'home', '', 2, 1, 1, 0, 0); INSERT INTO `oa_admin_rule` VALUES (44, 42, 'home/cate/cost_cate_check', '设置', '费用类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (45, 2, 'home/cate/seal_cate', '印章类型', '印章类型', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (46, 45, 'home/cate/seal_cate_add', '新建/编辑', '印章类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (47, 45, 'home/cate/seal_cate_check', '设置', '印章类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (45, 2, 'home/cate/subject', '企业主体', '企业主体', 'home', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (46, 45, 'home/cate/subject_add', '新建/编辑', '企业主体', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (47, 45, 'home/cate/subject_check', '设置', '企业主体', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (48, 2, 'home/cate/car_cate', '车辆类型', '车辆类型', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (49, 48, 'home/cate/car_cate_add', '新建/编辑', '车辆类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (50, 48, 'home/cate/car_cate_check', '设置', '车辆类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (48, 2, 'home/cate/industry_cate', '行业类型', '行业类型', 'home', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (49, 48, 'home/cate/industry_cate_add', '新建/编辑', '行业类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (50, 48, 'home/cate/work_cate_check', '删除', '行业类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (51, 2, 'home/cate/subject', '企业主体', '企业主体', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (52, 51, 'home/cate/subject_add', '新建/编辑', '企业主体', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (53, 51, 'home/cate/subject_check', '设置', '企业主体', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (51, 2, 'home/cate/work_cate', '工作类别', '工作类别', 'home', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (52, 51, 'home/cate/work_cate_add', '新建/编辑', '工作类别', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (53, 51, 'home/cate/work_cate_check', '设置', '工作类别', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (54, 2, 'home/cate/industry_cate', '行业类型', '行业类型', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (55, 54, 'home/cate/industry_cate_add', '新建/编辑', '行业类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (56, 54, 'home/cate/work_cate_check', '删除', '行业类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (54, 2, 'home/cate/services_cate', '服务类型', '服务类型', 'home', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (55, 54, 'home/cate/services_cate_add', '新建/编辑', '服务类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (56, 54, 'home/cate/services_cate_check', '设置', '服务类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (57, 2, 'home/cate/work_cate', '工作类别', '工作类别', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (58, 57, 'home/cate/work_cate_add', '新建/编辑', '工作类别', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (59, 57, 'home/cate/work_cate_check', '设置', '工作类别', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (57, 2, 'home/keywords/index', '关 键 字','关键字', 'home', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (58, 57, 'home/keywords/add', '新建/编辑','关键字', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (59, 57, 'home/keywords/delete', '删除','关键字', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (60, 2, 'home/cate/services_cate', '服务类型', '服务类型', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (61, 60, 'home/cate/services_cate_add', '新建/编辑', '服务类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (62, 60, 'home/cate/services_cate_check', '设置', '服务类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (60, 3, 'user/department/index', '部门架构', '部门', 'user', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (61, 60, 'user/department/add', '新建/编辑', '部门', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (62, 60, 'user/department/delete', '删除', '部门', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (63, 2, 'home/keywords/index', '关 键 字','关键字', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (64, 63, 'home/keywords/add', '新建/编辑','关键字', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (65, 63, 'home/keywords/delete', '删除','关键字', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (63, 3, 'user/position/index', '岗位职称', '岗位职称', 'user', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (64, 63, 'user/position/add', '新建/编辑', '岗位职称', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (65, 63, 'user/position/delete', '删除', '岗位职称', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (66, 63, 'user/position/view', '查看', '岗位职称', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (66, 3, 'user/department/index', '部门架构', '部门', 'user', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (67, 66, 'user/department/add', '新建/编辑', '部门', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (68, 66, 'user/department/delete', '删除', '部门', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (67, 3, 'user/user/index', '企业员工', '员工', 'user', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (68, 67, 'user/user/add', '新建/编辑', '员工', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (69, 67, 'user/user/view', '查看', '员工信息', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (70, 67, 'user/user/set', '设置', '员工状态', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (71, 67, 'user/user/reset_psw', '重设密码', '员工密码', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (69, 3, 'user/position/index', '岗位职称', '岗位职称', 'user', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (70, 69, 'user/position/add', '新建/编辑', '岗位职称', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (71, 69, 'user/position/delete', '删除', '岗位职称', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (72, 69, 'user/position/view', '查看', '岗位职称', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (72, 3, 'user/personal/change', '人事调动', '人事调动', 'user', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (73, 72, 'user/personal/change_add', '新建/编辑', '人事调动', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (73, 3, 'user/user/index', '企业员工', '员工', 'user', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (74, 73, 'user/user/add', '新建/编辑', '员工', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (75, 73, 'user/user/view', '查看', '员工信息', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (76, 73, 'user/user/set', '设置', '员工状态', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (77, 73, 'user/user/reset_psw', '重设密码', '员工密码', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (74, 3, 'user/personal/leave', '离职档案', '离职档案', 'user', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (75, 74, 'user/personal/leave_add', '新建/编辑', '离职档案', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (76, 74, 'user/personal/leave_delete', '删除', '离职档案', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (78, 3, 'user/personal/change', '人事调动', '人事调动', 'user', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (79, 78, 'user/personal/change_add', '新建/编辑', '人事调动', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (77, 4, 'adm/seal/seal_cate', '印章管理', '印章', 'adm', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (78, 77, 'adm/seal/seal_cate_add', '新建/编辑', '印章', 'adm', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (79, 77, 'adm/seal/seal_cate_check', '设置', '印章', 'adm', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (80, 3, 'user/personal/leave', '离职档案', '离职档案', 'user', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (81, 80, 'user/personal/leave_add', '新建/编辑', '离职档案', 'user', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (82, 80, 'user/personal/leave_delete', '删除', '离职档案', 'user', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (80, 4, 'adm/car/car_cate', '车辆管理', '车辆', 'adm', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (81, 80, 'adm/car/car_cate_add', '新建/编辑', '车辆', 'adm', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (82, 80, 'adm/car/car_cate_check', '设置', '车辆', 'adm', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (83, 4, 'message/index/inbox', '收件箱', '收件箱', 'message', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (84, 83, 'message/index/add', '新建/编辑', '消息', 'message', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (85, 83, 'message/index/send', '发送', '消息', 'message', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (86, 83, 'message/index/save', '保存', '消息到草稿', 'message', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (87, 83, 'message/index/reply', '回复', '消息', 'message', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (88, 83, 'message/index/read', '查看', '消息', 'message', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (89, 83, 'message/index/check', '设置', '消息状态', 'message', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (83, 4, 'adm/meeting/meeting_cate', '会议室管理', '会议室', 'adm', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (84, 83, 'adm/meeting/meeting_cate_add', '新建/编辑', '会议室', 'adm', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (85, 83, 'adm/meeting/meeting_cate_check', '设置', '会议室', 'adm', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (90, 4, 'message/index/sendbox', '发件箱', '发件箱', 'message', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (91, 4, 'message/index/draft', '草稿箱', '草稿箱', 'message', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (92, 4, 'message/index/rubbish', '垃圾箱', '垃圾箱', 'message', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (86, 5, 'note/index/note_cate', '公告类型', '公告类型', 'note', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (87, 86, 'note/index/note_cate_add', '新建/编辑', '公告类型', 'note', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (88, 86, 'note/index/note_cate_delete', '删除', '公告类型', 'note', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (93, 5, 'note/index/note_cate', '公告类型', '公告类型', 'home', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (94, 93, 'note/index/note_cate_add', '新建/编辑', '公告类型', 'home', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (95, 93, 'note/index/note_cate_delete', '删除', '公告类型', 'home', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (89, 5, 'note/index/index', '公告列表', '公告', 'note', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (90, 89, 'note/index/add', '新建/编辑', '公告', 'note', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (91, 89, 'note/index/delete', '删除', '公告', 'note', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (92, 89, 'note/index/view', '查看', '公告', 'note', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (96, 5, 'note/index/index', '公告列表', '公告', 'note', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (97, 96, 'note/index/add', '新建/编辑', '公告', 'note', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (98, 96, 'note/index/delete', '删除', '公告', 'note', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (99, 96, 'note/index/view', '查看', '公告', 'note', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (93, 6, 'oa/approve/index', '我发起的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (94, 94, 'oa/approve/add', '新建/编辑', '办公审批', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (95, 94, 'oa/approve/view', '查看', '办公审批', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (100, 6, 'oa/approve/index', '我发起的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (101, 100, 'oa/approve/add', '新建/编辑', '办公审批', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (102, 100, 'oa/approve/view', '查看', '办公审批', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (103, 100, 'oa/approve/check', '审核', '办公审批', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (96, 6, 'oa/approve/list', '我处理的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (97, 6, 'oa/approve/copy', '抄送给我的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (104, 6, 'oa/approve/list', '我处理的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (105, 6, 'oa/approve/copy', '抄送给我的', '办公审批', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (98, 7, 'oa/plan/index', '日程安排', '日程安排', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (99, 98, 'oa/plan/add', '新建/编辑', '日程安排', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (100, 98, 'oa/plan/delete', '删除', '日程安排', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (101, 98, 'oa/plan/detail', '查看', '日程安排', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (106, 7, 'oa/plan/index', '日程安排', '日程安排', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (107, 106, 'oa/plan/add', '新建/编辑', '日程安排', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (108, 106, 'oa/plan/delete', '删除', '日程安排', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (109, 106, 'oa/plan/detail', '查看', '日程安排', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (102, 7, 'oa/plan/calendar', '日程日历', '日程安排', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (110, 7, 'oa/plan/calendar', '日程日历', '日程安排', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (103, 7, 'oa/schedule/index', '工作记录', '工作记录', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (104, 103, 'oa/schedule/add', '新建/编辑', '工作记录', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (105, 103, 'oa/schedule/delete', '删除', '工作记录', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (106, 103, 'oa/schedule/detail', '查看', '工作记录', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (107, 103, 'oa/schedule/update_labor_time', '更改工时', '工时', 'oa', '', 0, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (111, 7, 'oa/schedule/index', '工作记录', '工作记录', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (112, 111, 'oa/schedule/add', '新建/编辑', '工作记录', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (113, 111, 'oa/schedule/delete', '删除', '工作记录', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (114, 111, 'oa/schedule/detail', '查看', '工作记录', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (115, 111, 'oa/schedule/update_labor_time', '更改工时', '工时', 'oa', '', 0, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (108, 7, 'oa/schedule/calendar', '工作日历', '工作日历', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (116, 7, 'oa/schedule/calendar', '工作日历', '工作日历', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (109, 7, 'oa/work/index', '工作汇报', '工作汇报', 'oa', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (110, 109, 'oa/work/add', '新建/编辑', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (111, 109, 'oa/work/send', '发送', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (112, 109, 'oa/work/read', '查看', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (113, 109, 'oa/work/delete', '删除', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (117, 7, 'oa/work/index', '工作汇报', '工作汇报', 'oa', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (118, 117, 'oa/work/add', '新建/编辑', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (119, 117, 'oa/work/send', '发送', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (120, 117, 'oa/work/read', '查看', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (121, 117, 'oa/work/delete', '删除', '工作汇报', 'oa', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (114, 8, 'finance/expense/conf', '权限配置', '财务权限配置', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (115, 8, '', '报销管理', '报销', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (116, 115, 'finance/expense/index', '我申请的', '报销', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (117, 115, 'finance/expense/list', '我处理的', '报销', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (118, 115, 'finance/expense/copy', '抄送给我的', '报销', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (119, 115, 'finance/expense/checkedlist', '打款(管理专用)', '报销', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (122, 8, '', '报销管理', '报销', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (123, 122, 'finance/expense/index', '我申请的', '报销', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (124, 122, 'finance/expense/list', '我处理的', '报销', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (125, 122, 'finance/expense/copy', '抄送给我的', '报销', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (126, 122, 'finance/expense/checkedlist', '报销打款', '报销', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (120, 115, 'finance/expense/add', '新建/编辑', '报销', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (121, 115, 'finance/expense/delete', '删除', '报销', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (122, 115, 'finance/expense/view', '查看', '报销', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (127, 122, 'finance/expense/add', '新建/编辑', '报销', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (128, 122, 'finance/expense/delete', '删除', '报销', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (129, 122, 'finance/expense/view', '查看', '报销', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (130, 122, 'finance/expense/check', '审核', '报销', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (131, 122, 'finance/expense/topay', '打款', '报销', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (123, 8, '', '发票管理', '发票', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (124, 123, 'finance/invoice/index', '我申请的', '发票', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (125, 123, 'finance/invoice/list', '我处理的', '发票', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (126, 123, 'finance/invoice/copy', '抄送给我的', '发票', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (127, 123, 'finance/invoice/checkedlist', '开票(管理专用)', '发票', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (132, 8, '', '发票管理', '发票', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (133, 132, 'finance/invoice/index', '我申请的', '发票', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (134, 132, 'finance/invoice/list', '我处理的', '发票', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (135, 132, 'finance/invoice/copy', '抄送给我的', '发票', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (136, 132, 'finance/invoice/checkedlist', '发票开具', '发票', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (128, 123, 'finance/invoice/add', '新建/编辑', '发票', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (129, 123, 'finance/invoice/delete', '删除', '发票', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (130, 123, 'finance/invoice/view', '查看', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (137, 132, 'finance/invoice/add', '新建/编辑', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (138, 132, 'finance/invoice/delete', '删除', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (139, 132, 'finance/invoice/view', '查看', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (140, 132, 'finance/invoice/check', '审核', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (141, 132, 'finance/invoice/open', '开具', '发票', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (142, 132, 'finance/invoice/tovoid', '作废', '发票', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (131, 8, 'finance/income/index', '到账管理', '到账记录', 'finance', '', 1, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (132, 131, 'finance/income/add', '新建/编辑', '到账记录', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (133, 131, 'finance/income/view', '查看', '到账记录', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (134, 131, 'finance/income/delete', '删除', '到账记录', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (143, 8, 'finance/income/index', '到账管理', '到账记录', 'finance', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (144, 143, 'finance/income/add', '新建/编辑', '到账记录', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (145, 143, 'finance/income/view', '查看', '到账记录', 'finance', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (146, 143, 'finance/income/delete', '删除', '到账记录', 'finance', '', 2, 1, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (135, 0, '', '客户管理', '客户管理', 'customer', 'icon-kehuguanli', 1, 9, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (136, 135, 'customer/grade/conf', '权限配置', '客户权限配置', 'customer', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (137, 135, 'customer/grade/index', '客户等级', '客户等级', 'customer', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (138, 137, 'customer/grade/grade_add', '新建/编辑', '客户等级', 'customer', '', 2, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (139, 137, 'customer/grade/grade_check', '设置', '客户等级', 'customer', '', 2,0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (140, 135, 'customer/source/index', '客户渠道', '客户渠道', 'customer', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (141, 140, 'customer/source/source_add', '新建/编辑', '客户渠道', 'customer', '', 2, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (142, 140, 'customer/source/source_check', '设置', '客户渠道', 'customer', '', 2,0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (147, 0, '', '客户管理', '客户管理', 'customer', 'icon-huamingce', 1, 9, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (148, 147, 'customer/grade/conf', '权限配置', '客户权限配置', 'customer', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (149, 147, 'customer/grade/index', '客户等级', '客户等级', 'customer', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (150, 149, 'customer/grade/grade_add', '新建/编辑', '客户等级', 'customer', '', 2, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (151, 149, 'customer/grade/grade_check', '设置', '客户等级', 'customer', '', 2,0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (152, 147, 'customer/source/index', '客户渠道', '客户渠道', 'customer', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (153, 152, 'customer/source/source_add', '新建/编辑', '客户渠道', 'customer', '', 2, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (154, 152, 'customer/source/source_check', '设置', '客户渠道', 'customer', '', 2,0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (143, 135, 'customer/index/rush', '抢 客 宝', '抢客宝', 'customer', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (155, 147, 'customer/index/rush', '抢 客 宝', '抢客宝', 'customer', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (144, 135, 'customer/index/index', '客户列表', '客户列表', 'customer', '', 1, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (145, 144, 'customer/index/add', '新建/编辑', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (146, 144, 'customer/index/view', '查看', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (147, 144, 'customer/index/get', '获取', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (148, 144, 'customer/index/to_sea', '转入公海', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (149, 135, 'customer/index/sea', '公海客户', '客户', 'customer', '', 1, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (150, 149, 'customer/index/distribute', '分配客户', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (151, 149, 'customer/index/to_trash', '转入废弃池', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (152, 135, 'customer/index/trash', '废弃客户', '客户', 'customer', '', 1, 0, 1, 1556143065, 0); +INSERT INTO `oa_admin_rule` VALUES (153, 135, 'customer/contact/index', '客户联系人', '联系人', 'customer', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (154, 153, 'customer/contact/contact_add', '新建/编辑', '联系人', 'customer', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (155, 153, 'customer/contact/contact_del', '删除', '联系人', 'customer', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (156, 147, 'customer/index/index', '客户列表', '客户列表', 'customer', '', 1, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (157, 156, 'customer/index/add', '新建/编辑', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (158, 156, 'customer/index/view', '查看', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (159, 156, 'customer/index/get', '获取', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (160, 156, 'customer/index/to_sea', '转入公海', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (161, 147, 'customer/index/sea', '公海客户', '客户', 'customer', '', 1, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (162, 161, 'customer/index/distribute', '分配客户', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (163, 161, 'customer/index/to_trash', '转入废弃池', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (164, 147, 'customer/index/trash', '废弃客户', '客户', 'customer', '', 1, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (165, 164, 'customer/index/delete', '删除', '客户', 'customer', '', 2, 0, 1, 1556143065, 0); -INSERT INTO `oa_admin_rule` VALUES (166, 164, 'customer/index/revert', '还原', '客户', 'customer', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (167, 147, 'customer/contact/index', '客户联系人', '联系人', 'customer', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (168, 167, 'customer/contact/contact_add', '新建/编辑', '联系人', 'customer', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (169, 167, 'customer/contact/contact_del', '删除', '联系人', 'customer', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (156, 0, '', '合同协议', '合同协议', 'contract', 'icon-hetongyidong', 1, 10, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (157, 156, 'contract/cate/conf', '权限配置', '合同权限配置', 'contract', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (158, 156, 'contract/cate/cate', '合同类别', '合同类别', 'contract', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (159, 158, 'contract/cate/cate_add', '新建/编辑', '合同类别', 'contract', '', 2, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (160, 158, 'contract/cate/cate_check', '设置', '合同类别', 'contract', '', 2,0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (170, 0, '', '合同协议', '合同协议', 'contract', 'icon-hetongyidong', 1, 10, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (171, 170, 'contract/cate/conf', '权限配置', '合同权限配置', 'contract', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (172, 170, 'contract/cate/cate', '合同类别', '合同类别', 'contract', '', 1, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (173, 172, 'contract/cate/cate_add', '新建/编辑', '合同类别', 'contract', '', 2, 0, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (174, 172, 'contract/cate/cate_check', '设置', '合同类别', 'contract', '', 2,0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (161, 156, 'contract/index/index', '合同列表', '合同列表', 'contract', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (162, 161, 'contract/index/add', '新建/编辑', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (163, 161, 'contract/index/view', '查看', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (164, 161, 'contract/index/delete', '删除', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (165, 156, 'contract/index/archive', '合同归档', '合同归档', 'contract', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (175, 170, 'contract/index/index', '合同列表', '合同列表', 'contract', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (176, 175, 'contract/index/add', '新建/编辑', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (177, 175, 'contract/index/view', '查看', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (178, 175, 'contract/index/delete', '删除', '合同', 'contract', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (179, 170, 'contract/index/archive', '合同归档', '合同归档', 'contract', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (166, 0, '', '项目管理', '项目管理', 'project', 'icon-xiangmuguanli', 1, 11, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (167, 166, 'project/index/conf', '权限配置', '项目权限配置', 'project', '', 1, 0, 1, 0, 0); +INSERT INTO `oa_admin_rule` VALUES (168, 166, 'project/index/index', '项目列表', '项目', 'project', '', 1, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (169, 168, 'project/index/add', '新建', '项目', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (170, 168, 'project/index/edit', '编辑', '项目', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (171, 168, 'project/index/view', '查看', '项目', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (172, 168, 'project/index/delete', '删除', '项目', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (180, 0, '', '项目管理', '项目管理', 'project', 'icon-xiangmuguanli', 1, 11, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (181, 180, 'project/index/index', '项目列表', '项目', 'project', '', 1, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (182, 181, 'project/index/add', '新建', '项目', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (183, 181, 'project/index/edit', '编辑', '项目', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (184, 181, 'project/index/view', '查看', '项目', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (185, 181, 'project/index/delete', '删除', '项目', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (173, 166, 'project/task/index', '任务列表', '任务', 'project', '', 1, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (174, 173, 'project/task/add', '新建', '任务', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (175, 173, 'project/task/edit', '编辑', '任务', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (176, 173, 'project/task/view', '查看', '任务', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (177, 173, 'project/task/delete', '删除', '任务', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (186, 180, 'project/task/index', '任务列表', '任务', 'project', '', 1, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (187, 186, 'project/task/add', '新建', '任务', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (188, 186, 'project/task/edit', '编辑', '任务', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (189, 186, 'project/task/view', '查看', '任务', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (190, 186, 'project/task/delete', '删除', '任务', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (178, 166, 'project/task/task_time', '任务工时', '工时', 'project', '', 1, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (191, 0, '', '知识文章', '知识文章', 'article', 'icon-kecheng', 1, 12, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (192, 191, 'article/cate/cate', '知识类型', '知识类型', 'article', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (193, 192, 'article/cate/cate_add', '新建/编辑', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (194, 192, 'article/cate/cate_delete', '删除', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (179, 166, 'project/document/index', '文档列表', '文档', 'project', '', 1, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (180, 179, 'project/document/add', '新建/编辑', '文档', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (181, 179, 'project/document/view', '查看', '文档', 'project', '', 2, 0, 1, 1656142368, 0); +INSERT INTO `oa_admin_rule` VALUES (182, 179, 'project/document/delete', '删除', '文档', 'project', '', 2, 0, 1, 1656142368, 0); -INSERT INTO `oa_admin_rule` VALUES (195, 191, 'article/index/index', '共享知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (196, 191, 'article/index/list', '个人知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (197, 196, 'article/index/add', '新建/编辑', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (198, 196, 'article/index/view', '查看', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); -INSERT INTO `oa_admin_rule` VALUES (199, 196, 'article/index/delete', '删除', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (183, 0, '', '知识文章', '知识文章', 'article', 'icon-kecheng', 1, 12, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (184, 183, 'article/cate/cate', '知识类型', '知识类型', 'article', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (185, 184, 'article/cate/cate_add', '新建/编辑', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (186, 184, 'article/cate/cate_delete', '删除', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0); + +INSERT INTO `oa_admin_rule` VALUES (187, 183, 'article/index/index', '共享知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (188, 183, 'article/index/list', '个人知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (189, 188, 'article/index/add', '新建/编辑', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (190, 188, 'article/index/view', '查看', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); +INSERT INTO `oa_admin_rule` VALUES (191, 188, 'article/index/delete', '删除', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0); -- ---------------------------- -- Table structure for oa_admin_group @@ -392,9 +385,9 @@ CREATE TABLE `oa_admin_group` ( -- ---------------------------- -- Records of cms_admin_group -- ---------------------------- -INSERT INTO `oa_admin_group` VALUES (1, '超级员工权限', 1, '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', '超级员工权限,拥有系统的最高权限,不可修改。', 0, 0); -INSERT INTO `oa_admin_group` VALUES (2, '总经理权限', 1, '2,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,3,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,4,83,84,85,86,87,88,89,90,91,92,5,93,94,95,96,97,98,99,6,100,101,102,103,104,105,7,106,107,108,109,110,111,112,113,114,116,117,118,119,120,121,8,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,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', '总经理的管理权限,可根据公司的具体需求调整。', 0, 0); -INSERT INTO `oa_admin_group` VALUES (3, '普通员工权限', 1, '4,83,84,85,86,87,88,89,90,91,92,5,96,99,6,100,101,102,103,104,105,7,106,107,108,109,110,111,112,113,114,116,117,118,119,120,121,8,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,155,156,157,158,159,160,161,164,167,168,169,170,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,195,196,197,198,199', '普通员工管理权限,可根据公司的具体需求调整。', 0, 0); +INSERT INTO `oa_admin_group` VALUES (1, '超级员工权限', 1, '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', '超级员工权限,拥有系统的最高权限,不可修改。', 0, 0); +INSERT INTO `oa_admin_group` VALUES (2, '总经理权限', 1, '2,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,3,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,4,77,78,79,80,81,82,83,84,85,5,86,87,88,89,90,91,92,6,93,96,97,7,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,8,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', '总经理的管理权限,可根据公司的具体需求调整。', 0, 0); +INSERT INTO `oa_admin_group` VALUES (3, '普通员工权限', 1, '5,89,90,91,92,6,93,96,97,7,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,8,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,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', '普通员工管理权限,可根据公司的具体需求调整。', 0, 0); -- ---------------------------- -- Table structure for oa_data_auth @@ -410,6 +403,9 @@ CREATE TABLE `oa_data_auth` ( `expected_1` int(11) NOT NULL DEFAULT 0 COMMENT '预备字段1,可作为预备权限的控制', `expected_2` int(11) NOT NULL DEFAULT 0 COMMENT '预备字段2,可作为预备权限的控制', `expected_3` int(11) NOT NULL DEFAULT 0 COMMENT '预备字段3,可作为预备权限的控制', + `conf_1` text NULL COMMENT '配置字段1,可作为预配置内容', + `conf_2` text NULL COMMENT '配置字段2,可作为预配置内容', + `conf_3` text NULL COMMENT '配置字段3,可作为预配置内容', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE @@ -418,8 +414,10 @@ CREATE TABLE `oa_data_auth` ( -- ---------------------------- -- Records of oa_data_auth -- ---------------------------- -INSERT INTO `oa_data_auth` VALUES (1, '客户管理员','customer_admin','拥有该权限的员工可以查看、转移所有客户。', 'customer', '',10,0,0, 1656143065, 0); -INSERT INTO `oa_data_auth` VALUES (2, '合同管理员','contract_admin','拥有该权限的员工可以查看、编辑、审核、作废、中止所有合同。', 'contract', '',0,0,0, 1656143065, 0); +INSERT INTO `oa_data_auth` VALUES (1, '财务管理员','finance_admin','拥有该权限的员工开具发票、报销打款、财务到账。', 'customer', '',0,0,0,'','','',1656143065, 0); +INSERT INTO `oa_data_auth` VALUES (2, '客户管理员','customer_admin','拥有该权限的员工可以查看、转移所有客户。', 'customer', '',10,0,0,'','','',1656143065, 0); +INSERT INTO `oa_data_auth` VALUES (3, '合同管理员','contract_admin','拥有该权限的员工可以查看、编辑、作废、中止所有合同。', 'contract', '',0,0,0,'','','',1656143065, 0); +INSERT INTO `oa_data_auth` VALUES (4, '项目管理员','project_admin','拥有该权限的员工可以查看所有项目。', 'contract', '',0,0,0,'立项阶段|实施阶段|验收阶段|交付阶段','','',1656143065, 0); -- ---------------------------- -- Table structure for oa_config @@ -456,8 +454,8 @@ CREATE TABLE `oa_department` ( `phone` varchar(60) NOT NULL DEFAULT '' COMMENT '部门联系电话', `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '部门组织'; @@ -492,9 +490,9 @@ CREATE TABLE `oa_department_change` ( `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', `admin_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `move_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '调到时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `move_time` int(11) NOT NULL DEFAULT 0 COMMENT '调动时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '人事调动部门记录表'; @@ -510,9 +508,9 @@ CREATE TABLE `oa_personal_quit` ( `lead_admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '部门负责人', `connect_uids` varchar(100) NOT NULL DEFAULT '' COMMENT '交接人', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `quit_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '离职时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `quit_time` int(11) NOT NULL DEFAULT 0 COMMENT '离职时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '人事离职记录表'; @@ -527,8 +525,8 @@ CREATE TABLE `oa_flow_type` ( `name` varchar(100) NOT NULL DEFAULT '' COMMENT '审批标识', `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '审批类型'; @@ -619,8 +617,8 @@ CREATE TABLE `oa_cost_cate` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '费用类型名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '费用类型'; @@ -635,7 +633,6 @@ INSERT INTO `oa_cost_cate` VALUES (5, '通讯费', 1, 1639898564, 0); INSERT INTO `oa_cost_cate` VALUES (6, '采购付款', 1, 1639898564, 0); INSERT INTO `oa_cost_cate` VALUES (7, '其他', 1, 1639898564, 0); - -- ---------------------------- -- Table structure for oa_seal_cate -- ---------------------------- @@ -644,8 +641,8 @@ CREATE TABLE `oa_seal_cate` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '印章类型名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '印章类型'; @@ -657,6 +654,26 @@ INSERT INTO `oa_seal_cate` VALUES (2, '合同章', 1, 1639899140, 0); INSERT INTO `oa_seal_cate` VALUES (3, '法人章', 1, 1639899148, 0); INSERT INTO `oa_seal_cate` VALUES (4, '其他', 1, 1639899158, 0); +-- ---------------------------- +-- Table structure for oa_meeting_cate +-- ---------------------------- +DROP TABLE IF EXISTS `oa_meeting_cate`; +CREATE TABLE `oa_meeting_cate` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(100) NOT NULL DEFAULT '' COMMENT '会议室名称', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '会议室'; + +-- ---------------------------- +-- Records of oa_meeting_cate +-- ---------------------------- +INSERT INTO `oa_meeting_cate` VALUES (1, '会议室一', 1, 1639899124, 0); +INSERT INTO `oa_meeting_cate` VALUES (2, '会议室二', 1, 1639899140, 0); +INSERT INTO `oa_meeting_cate` VALUES (3, '会议室三', 1, 1639899148, 0); + -- ---------------------------- -- Table structure for oa_car_cate -- ---------------------------- @@ -666,8 +683,8 @@ CREATE TABLE `oa_car_cate` ( `title` varchar(100) NOT NULL DEFAULT '' COMMENT '车辆名称', `name` varchar(100) NOT NULL DEFAULT '' COMMENT '车辆号码', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '用车类型'; @@ -686,8 +703,8 @@ CREATE TABLE `oa_industry` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '行业名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '行业'; @@ -711,8 +728,8 @@ CREATE TABLE `oa_services` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '服务名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '企业服务'; @@ -738,19 +755,19 @@ CREATE TABLE `oa_expense` ( `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '报销人', `did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '报销部门ID', `ptid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联项目ID', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', `check_step_sort` int(11) NOT NULL DEFAULT 0 COMMENT '当前审批步骤', `check_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '当前审批人ID,如:1,2,3', `flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3', `copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3', `file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '附件ID,如:1,2,3', - `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态(0待审、1审批中、2通过、3失败、4撤销、5已打款)', + `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0待审核,1审核中,2审核通过,3审核不通过,4撤销审核,5已打款', `last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人', `pay_admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '打款人ID', `pay_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '打款时间', `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '报销表'; @@ -777,21 +794,6 @@ INSERT INTO `oa_expense_cate` VALUES (4, '招待费', 1, 1637987199, 0); INSERT INTO `oa_expense_cate` VALUES (5, '汽油费', 1, 1637987199, 0); INSERT INTO `oa_expense_cate` VALUES (6, '其他费', 1, 1637987199, 0); --- ---------------------------- --- Table structure for oa_expense_file_interfix --- ---------------------------- -DROP TABLE IF EXISTS `oa_expense_file_interfix`; -CREATE TABLE `oa_expense_file_interfix` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `exid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '报销ID', - `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', - `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '报销模块关联的附件表'; - -- ---------------------------- -- Table structure for oa_expense_interfix -- ---------------------------- @@ -803,8 +805,8 @@ CREATE TABLE `oa_expense_interfix` ( `cate_id` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '报销类型ID', `remarks` text NULL COMMENT '备注', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登记人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '报销关联数据表'; @@ -850,9 +852,9 @@ DROP TABLE IF EXISTS `oa_invoice`; CREATE TABLE `oa_invoice` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `code` varchar(100) NOT NULL DEFAULT '' COMMENT '发票号码', - `cmid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联客户ID', - `crid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联合同协议号ID', - `ptid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联项目ID', + `customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据', + `contract_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联合同协议ID', + `project_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联项目ID', `cash_type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '付款方式:1现金 2转账 3微信支付 4支付宝 5信用卡 6支票 7其他', `is_cash` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否到账:0未到账 1部分到账 2全部到账', `amount` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '发票金额', @@ -866,7 +868,7 @@ CREATE TABLE `oa_invoice` ( `delivery` varchar(100) NOT NULL DEFAULT '' COMMENT '快递单号', `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '抬头类型:1企业2个人', `invoice_subject` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联发票主体ID', - `invoice_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发票类型:1增值税专用发票2增值税普通发票', + `invoice_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发票类型:1增值税专用发票,2普通发票,3专用发票', `invoice_title` varchar(100) NOT NULL DEFAULT '' COMMENT '开票抬头', `invoice_phone` varchar(100) NOT NULL DEFAULT '' COMMENT '电话号码', `invoice_tax` varchar(100) NOT NULL DEFAULT '' COMMENT '纳税人识别号', @@ -879,14 +881,14 @@ CREATE TABLE `oa_invoice` ( `flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3', `copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3', `file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '附件ID,如:1,2,3', - `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '发票状态(0待审、1审批中、2通过、3失败、4撤销、5已开具、10已作废)', + `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废', `last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人', - `check_remark` text NULL COMMENT '审核不通过/撤销的理由', + `check_remark` text NULL COMMENT '撤销的理由', `remark` text NULL COMMENT '备注', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1正常', - `enter_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最新到账时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `enter_time` int(11) NOT NULL DEFAULT 0 COMMENT '最新到账时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '发票表'; @@ -899,10 +901,10 @@ CREATE TABLE `oa_invoice_income` ( `inid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发票ID', `amount` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '到账金额', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '到账登记人', - `enter_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '到账时间', + `enter_time` int(11) NOT NULL DEFAULT 0 COMMENT '到账时间', `remarks` text NULL COMMENT '备注', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1正常 6作废', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '发票到账记录表'; @@ -915,8 +917,8 @@ CREATE TABLE `oa_invoice_subject` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '主体名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '发票主体名称'; @@ -956,6 +958,7 @@ CREATE TABLE `oa_message` ( `title` varchar(100) NOT NULL DEFAULT '' COMMENT '消息主题', `template` tinyint(2) NOT NULL DEFAULT 0 COMMENT '消息模板,用于前端拼接消息0私人消息,1公告,2办公审批,3报销审批,4发票审批,5合同审批', `content` text NULL COMMENT '消息内容', + `file_ids` text NULL COMMENT '消息附件', `from_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发送人id', `to_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '接收人id', `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '阅览人类型:1 人员 2部门 3岗位 4全部', @@ -967,8 +970,8 @@ CREATE TABLE `oa_message` ( `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1已删除消息 0垃圾消息 1正常消息', `is_draft` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否是草稿:1正常消息 2草稿消息', `delete_source` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '垃圾消息来源: 1已发消息 2草稿消息 3已收消息', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', `module_name` varchar(30) NOT NULL COMMENT '模块', `controller_name` varchar(30) NOT NULL COMMENT '控制器', `action_name` varchar(30) NOT NULL COMMENT '方法', @@ -976,20 +979,6 @@ CREATE TABLE `oa_message` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '消息表'; --- ---------------------------- --- Table structure for oa_message_file_interfix --- ---------------------------- -DROP TABLE IF EXISTS `oa_message_file_interfix`; -CREATE TABLE `oa_message_file_interfix` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `mid` int(11) UNSIGNED NOT NULL COMMENT '消息id', - `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', - `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '消息关联的附件表'; - - -- ---------------------------- -- Table structure for oa_note_cate -- ---------------------------- @@ -1045,8 +1034,8 @@ CREATE TABLE `oa_position` ( `work_price` int(10) NOT NULL DEFAULT 0 COMMENT '工时单价', `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '岗位职称'; @@ -1055,6 +1044,7 @@ CREATE TABLE `oa_position` ( -- ---------------------------- INSERT INTO `oa_position` VALUES (1, '超级岗位', 1000, '超级岗位,不能轻易修改权限', 1, 0, 0); INSERT INTO `oa_position` VALUES (2, '人事总监', 1000, '人事部的最大领导', 1, 0, 0); +INSERT INTO `oa_position` VALUES (3, '普通员工', 500, '普通员工', 1, 0, 0); -- ---------------------------- -- Table structure for oa_position_group @@ -1073,6 +1063,7 @@ CREATE TABLE `oa_position_group` ( -- ---------------------------- INSERT INTO `oa_position_group` VALUES (1, 1, 1635755739, 0); INSERT INTO `oa_position_group` VALUES (2, 2, 1638007427, 0); +INSERT INTO `oa_position_group` VALUES (3, 3, 1638007427, 0); -- ---------------------------- -- Table structure for oa_plan @@ -1087,14 +1078,14 @@ CREATE TABLE `oa_plan` ( `ptid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联项目ID', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联创建员工ID', `did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属部门', - `start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '开始时间', - `end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '结束时间', + `start_time` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', + `end_time` int(11) NOT NULL DEFAULT 0 COMMENT '结束时间', `remind_type` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提醒类型', - `remind_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提醒时间', + `remind_time` int(11) NOT NULL DEFAULT 0 COMMENT '提醒时间', `remark` text NOT NULL COMMENT '描述', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '日程安排'; @@ -1111,14 +1102,14 @@ CREATE TABLE `oa_schedule` ( `tid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联任务ID', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联创建员工ID', `did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属部门', - `start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '开始时间', - `end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '结束时间', + `start_time` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', + `end_time` int(11) NOT NULL DEFAULT 0 COMMENT '结束时间', `labor_time` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '工时', `labor_type` int(1) NOT NULL DEFAULT 0 COMMENT '工作类型:1案头2外勤', `remark` text NOT NULL COMMENT '描述', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '工作记录'; @@ -1132,8 +1123,8 @@ CREATE TABLE `oa_schedule_interfix` ( `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联创建员工ID', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '工作记录关联的附件表'; @@ -1153,16 +1144,14 @@ CREATE TABLE `oa_approve` ( `start_time` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', `end_time` int(11) NOT NULL DEFAULT 0 COMMENT '结束时间', `duration` decimal(10, 1) NOT NULL DEFAULT 0.0 COMMENT '时长', - `create_admin_id` int(10) NOT NULL COMMENT '创建人ID', + `admin_id` int(10) NOT NULL COMMENT '创建人ID', `department_id` int(10) NOT NULL COMMENT '创建人部门ID', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', `check_step_sort` int(11) NOT NULL DEFAULT 0 COMMENT '当前审批步骤', `check_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '当前审批人ID,如:1,2,3', `flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3', `copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3', `file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '附件ID,如:1,2,3', - `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态(0待审、1审批中、2通过、3失败、4撤销)', + `check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0待审核,1审核中,2审核通过,3审核不通过,4撤销审核', `last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人', `detail_type` int(11) NOT NULL DEFAULT 0 COMMENT '假期类型:1事假,2年假,3调休假,4病假,5婚假,6丧假,7产假,8陪产假,9其他', `other_type` int(11) NOT NULL DEFAULT 0 COMMENT '其他类型:1公告类,2规则制度类,3合同类,4资质更新类,5员工证明,6其他', @@ -1173,6 +1162,9 @@ CREATE TABLE `oa_approve` ( `num` bigint(12) NOT NULL DEFAULT 0 COMMENT '数量', `num1` bigint(12) NOT NULL DEFAULT 0 COMMENT '数量1', `amount` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '金额', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '日常审批表'; @@ -1184,6 +1176,7 @@ CREATE TABLE `oa_flow_step` ( `id` int(11) NOT NULL AUTO_INCREMENT, `action_id` int(11) NOT NULL COMMENT '审批内容ID', `flow_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0自由指定,1当前部门负责人,2上一级部门负责人,3指定用户(任意一人),4指定用户(多人会签)', + `flow_name` varchar(255) NOT NULL DEFAULT '' COMMENT '流程名称', `flow_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '审批人ID (使用逗号隔开) 1,2,3', `sort` tinyint(4) NOT NULL DEFAULT 0 COMMENT '排序ID', `type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '审批类型:1日常审批,2报销审批,3发票审批,4合同审批', @@ -1202,8 +1195,8 @@ CREATE TABLE `oa_flow_record` ( `step_id` int(11) NOT NULL DEFAULT 0 COMMENT '审批步骤ID', `check_user_id` int(11) NOT NULL DEFAULT 0 COMMENT '审批人ID', `check_time` int(11) NOT NULL COMMENT '审批时间', - `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1审核通过2审核失败3撤销', - `type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '审批类型:1日常审批,2报销审批,3发票审批', + `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0发起审批1审核通过2审核拒绝3撤销', + `type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '审批类型:1日常审批,2报销审批,3发票审批,4合同审批', `content` varchar(500) NOT NULL DEFAULT '' COMMENT '审核意见', `is_invalid` tinyint(1) NOT NULL DEFAULT 0 COMMENT '审批失效(1标记为无效)', `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', @@ -1218,8 +1211,8 @@ CREATE TABLE `oa_work_cate` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '工作类型名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '工作类型'; @@ -1247,8 +1240,8 @@ CREATE TABLE `oa_work` ( `plans` text NULL COMMENT '计划工作内容', `remark` text NULL COMMENT '其他事项', `admin_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人id', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '汇报工作表'; @@ -1262,7 +1255,7 @@ CREATE TABLE `oa_work_file_interfix` ( `wid` int(11) UNSIGNED NOT NULL COMMENT '汇报工作id', `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '汇报工作关联的附件表'; @@ -1275,8 +1268,8 @@ CREATE TABLE `oa_work_record` ( `wid` int(11) UNSIGNED NOT NULL COMMENT '汇报工作id', `from_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发送人id', `to_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '接收人id', - `send_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发送日期', - `read_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '阅读时间', + `send_time` int(11) NOT NULL DEFAULT 0 COMMENT '发送日期', + `read_time` int(11) NOT NULL DEFAULT 0 COMMENT '阅读时间', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '汇报工作发送记录表'; @@ -1290,8 +1283,8 @@ CREATE TABLE `oa_customer_grade` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户等级名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户等级'; @@ -1312,8 +1305,8 @@ CREATE TABLE `oa_customer_source` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户渠道名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户来源'; @@ -1337,8 +1330,8 @@ CREATE TABLE `oa_customer_grade` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户等级名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户等级'; @@ -1359,8 +1352,8 @@ CREATE TABLE `oa_customer_source` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户渠道名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户来源'; @@ -1409,9 +1402,9 @@ CREATE TABLE `oa_customer` ( `tax_num` varchar(100) NOT NULL DEFAULT '' COMMENT '纳税人识别号', `cperson_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '开票电话', `cperson_address` varchar(200) NOT NULL DEFAULT '' COMMENT '开票地址', - `discard_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '废弃时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', + `discard_time` int(11) NOT NULL DEFAULT 0 COMMENT '废弃时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '客户表'; @@ -1431,9 +1424,9 @@ CREATE TABLE `oa_customer_trace` ( `follow_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '跟进时间', `next_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '下次跟进时间', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户跟进记录表'; @@ -1455,9 +1448,9 @@ CREATE TABLE `oa_customer_contact` ( `department` varchar(50) NOT NULL DEFAULT '' COMMENT '部门', `position` varchar(50) NOT NULL DEFAULT '' COMMENT '职务', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户联系人表'; @@ -1479,9 +1472,9 @@ CREATE TABLE `oa_customer_chance` ( `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', `belong_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属人', `assist_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户销售机会表'; @@ -1494,9 +1487,9 @@ CREATE TABLE `oa_customer_file` ( `customer_id` int(11) UNSIGNED NOT NULL COMMENT '关联客户id', `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户附件关联表'; @@ -1517,7 +1510,7 @@ CREATE TABLE `oa_customer_log` ( `old_content` text NULL COMMENT '修改前的内容', `new_content` text NULL COMMENT '修改后的内容', `remark` text NULL COMMENT '补充备注', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户操作记录表'; @@ -1529,8 +1522,8 @@ CREATE TABLE `oa_contract_cate` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '' COMMENT '合同类别名称', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同类别'; @@ -1556,7 +1549,7 @@ CREATE TABLE `oa_contract` ( `cate_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分类id', `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '合同性质:0未设置,1普通合同、2框架合同、3补充协议、4其他合同', `subject_id` varchar(255) NOT NULL DEFAULT '' COMMENT '签约主体', - `customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '客户ID,预设数据', + `customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据', `customer` varchar(255) NOT NULL DEFAULT '' COMMENT '客户名称', `customer_name` varchar(255) NOT NULL DEFAULT '' COMMENT '客户代表', `customer_mobile` varchar(255) NOT NULL DEFAULT '' COMMENT '客户电话', @@ -1573,7 +1566,12 @@ CREATE TABLE `oa_contract` ( `cost` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '合同金额', `is_tax` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否含税:0未含税,1含税', `tax` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '税点', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '合同状态:0未设置,1已录入,2待审核,3已审核,4已中止,5已作废', + `check_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '合同状态:0待审核,1审核中,2审核通过,3审核不通过,4撤销审核,5已中止,6已作废', + `check_step_sort` int(11) NOT NULL DEFAULT 0 COMMENT '当前审批步骤', + `check_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '当前审批人ID,如:1,2,3', + `flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3', + `last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人', + `copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3', `check_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核人', `check_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核时间', `check_remark` text NULL COMMENT '审核备注信息', @@ -1587,9 +1585,9 @@ CREATE TABLE `oa_contract` ( `archive_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '归档人', `archive_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '归档时间', `remark` text NULL COMMENT '备注信息', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '合同表'; @@ -1602,9 +1600,9 @@ CREATE TABLE `oa_contract_file` ( `contract_id` int(11) UNSIGNED NOT NULL COMMENT '关联合同id', `file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', - `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同附件关联表'; @@ -1621,10 +1619,45 @@ CREATE TABLE `oa_contract_log` ( `old_content` text NULL COMMENT '修改前的内容', `new_content` text NULL COMMENT '修改后的内容', `remark` text NULL COMMENT '补充备注', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同操作记录表'; +-- ---------------------------- +-- Table structure for oa_step +-- ---------------------------- +DROP TABLE IF EXISTS `oa_step`; +CREATE TABLE `oa_step` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `action_id` int(11) NOT NULL COMMENT '关联ID', + `flow_name` varchar(255) NOT NULL DEFAULT '' COMMENT '阶段名称', + `flow_uid` int(11) NOT NULL DEFAULT 0 COMMENT '阶段负责人ID', + `flow_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '阶段成员ID (使用逗号隔开) 1,2,3', + `sort` tinyint(4) NOT NULL DEFAULT 0 COMMENT '排序ID', + `type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '阶段类型:1合同,2项目', + `start_time` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间', + `end_time` int(11) NOT NULL DEFAULT 0 COMMENT '结束时间', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '阶段步骤表'; + +-- ---------------------------- +-- Table structure for oa_step_record +-- ---------------------------- +DROP TABLE IF EXISTS `oa_step_record`; +CREATE TABLE `oa_step_record` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `action_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联ID', + `step_id` int(11) NOT NULL DEFAULT 0 COMMENT '阶段步骤ID', + `check_uid` int(11) NOT NULL DEFAULT 0 COMMENT '审批人ID', + `check_time` int(11) NOT NULL COMMENT '审批时间', + `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1审核通过2审核拒绝3撤销', + `type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '阶段类型:1合同,2项目', + `content` varchar(500) NOT NULL DEFAULT '' COMMENT '审核意见', + `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '阶段步骤记录表'; -- ---------------------------- -- Table structure for oa_project @@ -1633,11 +1666,14 @@ DROP TABLE IF EXISTS `oa_project`; CREATE TABLE `oa_project` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '' COMMENT '项目名称', + `customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据', + `contract_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联合同协议ID', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', `director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目负责人', `start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目开始时间', `end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目结束时间', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:状态:0未设置,1未开始,2进行中,3已完成,4已关闭', + `step_sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '当前审核步骤', `content` text NULL COMMENT '项目描述', `md_content` text NULL COMMENT 'markdown项目描述', `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', @@ -1676,6 +1712,7 @@ CREATE TABLE `oa_project_task` ( `director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '指派给(负责人)', `assist_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3', `cate` tinyint(1) NOT NULL DEFAULT 1 COMMENT '所属工作类型', + `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '任务类型:1需求,2设计,3研发,4缺陷', `priority` tinyint(1) NOT NULL DEFAULT 1 COMMENT '优先级:1低,2中,3高,4紧急', `flow_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '流转状态:1待办的,2进行中,3已完成,4已拒绝,5已关闭', `done_ratio` int(2) NOT NULL DEFAULT 0 COMMENT '完成进度:0,20,40,50,60,80,100', @@ -1685,7 +1722,41 @@ CREATE TABLE `oa_project_task` ( `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '任务表'; +) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目任务表'; + +-- ---------------------------- +-- Table structure for oa_project_document +-- ---------------------------- +DROP TABLE IF EXISTS `oa_project_document`; +CREATE TABLE `oa_project_document` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id', + `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题', + `content` text NULL COMMENT '文档内容', + `md_content` text NULL COMMENT 'markdown文档内容', + `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', + `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目文档表'; + +-- ---------------------------- +-- Table structure for oa_project_link +-- ---------------------------- +DROP TABLE IF EXISTS `oa_project_link`; +CREATE TABLE `oa_project_link` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块', + `topic_id` int(11) UNSIGNED NOT NULL COMMENT '关联主题id', + `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '说明', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接', + `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', + `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间', + `delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '链接关联表'; -- ---------------------------- -- Table structure for oa_project_file @@ -1728,11 +1799,12 @@ CREATE TABLE `oa_project_comment` ( DROP TABLE IF EXISTS `oa_project_log`; CREATE TABLE `oa_project_log` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块', + `module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块:project,task,document', `action` varchar(100) NOT NULL DEFAULT 'edit' COMMENT '动作:add,edit,del,upload', `field` varchar(100) NOT NULL DEFAULT '' COMMENT '字段', `project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id', `task_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联任务id', + `document_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联文档id', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人', `old_content` text NULL COMMENT '修改前的内容', `new_content` text NULL COMMENT '修改后的内容', diff --git a/app/install/data/oa_reset.sql b/app/install/data/oa_reset.sql deleted file mode 100644 index 16767a7..0000000 --- a/app/install/data/oa_reset.sql +++ /dev/null @@ -1,442 +0,0 @@ --- ---------------------------- --- Table structure for oa_admin_group --- ---------------------------- -DROP TABLE IF EXISTS `oa_admin_group`; -CREATE TABLE `oa_admin_group` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL DEFAULT '', - `status` int(1) NOT NULL DEFAULT 1, - `rules` varchar(1000) NULL DEFAULT '' COMMENT '用户组拥有的规则id, 多个规则\",\"隔开', - `desc` text NULL COMMENT '备注', - `create_time` int(11) NOT NULL DEFAULT 0, - `update_time` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `id`(`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工权限分组表'; - --- ---------------------------- --- Records of cms_admin_group --- ---------------------------- -INSERT INTO `oa_admin_group` VALUES (1, '超级员工权限', 1, '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', '超级员工权限,拥有系统的最高权限,不可修改', 0, 0); -INSERT INTO `oa_admin_group` VALUES (2, '人事总监权限', 1, '2,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,3,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,4,78,79,80,81,82,83,84,85,86,87,5,88,89,90,91,6,92,93,94,95,96,7,97,100,101,102,98,99,8,103,105,106,107,104,108,110,111,112,113,109,114,115,116,117,118,9,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,10,142', '人力资源部门领导的最高管理权限', 0, 0); - --- ---------------------------- --- Table structure for oa_admin_module --- ---------------------------- -DROP TABLE IF EXISTS `oa_admin_module`; -CREATE TABLE `oa_admin_module` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL DEFAULT '' COMMENT '模块名称', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT '模块标识唯一,字母', - `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', - `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常', - `type` int(1) NOT NULL DEFAULT 2 COMMENT '模块类型,2普通模块,1系统模块', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '功能模块表'; - --- ---------------------------- --- Records of oa_admin_module --- ---------------------------- -INSERT INTO `oa_admin_module` VALUES (1, '系统模块', 'HOME', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (2, '用户模块', 'USER', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (3, '消息模块', 'MSG', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (4, '公告模块', 'NOTE', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (5, '知识模块', 'KQ', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (6, 'OA模块', 'OA', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (7, '财务模块', 'CF', '', 1, 1, 1639562910, 0); -INSERT INTO `oa_admin_module` VALUES (8, '统计模块', 'BI', '', 1, 1, 1639562910, 0); - - --- ---------------------------- --- Table structure for oa_admin_rule --- ---------------------------- -DROP TABLE IF EXISTS `oa_admin_rule`; -CREATE TABLE `oa_admin_rule` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父id', - `src` varchar(255) NOT NULL DEFAULT '' COMMENT 'url链接', - `title` varchar(255) NOT NULL DEFAULT '' COMMENT '名称', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT '日志操作名称', - `module` varchar(255) NOT NULL DEFAULT '' COMMENT '所属模块', - `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', - `menu` int(1) NOT NULL DEFAULT 0 COMMENT '是否是菜单,1是,2不是', - `sort` int(11) NOT NULL DEFAULT 1 COMMENT '越小越靠前', - `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '菜单及权限表'; - - --- ---------------------------- --- Records of oa_admin_rule --- ---------------------------- -INSERT INTO `oa_admin_rule` VALUES (1, 0, '', '系统管理', '系统管理', 'HOME', 'icon-jichupeizhi', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (2, 0, '', '基础数据', '基础数据', 'HOME', 'icon-hetongshezhi', 1, 2, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (3, 0, '', '员工管理', '员工管理', 'USER', 'icon-renshishezhi', 1, 3, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (4, 0, '', '消息通知', '消息通知', 'MSG', 'icon-xiaoxishezhi', 1, 4, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (5, 0, '', '企业公告', '企业公告', 'NOTE', 'icon-zhaoshengbaobiao', 1, 5, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (6, 0, '', '知识文章', '知识文章', 'KQ', 'icon-kecheng', 1, 6, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (7, 0, '', '办公审批', '办公审批', 'OA', 'icon-shenpishezhi', 1, 7, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (8, 0, '', '日常办公', '日常办公', 'OA', 'icon-kaoshijihua', 1, 8, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (9, 0, '', '财务管理', '财务管理', 'CF', 'icon-yuangongtidian', 1, 9, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (10, 0, '', '商业智能', '商业智能', 'BI', 'icon-jiaoxuetongji', 1, 10, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (11, 1, 'home/conf/index', '系统配置', '系统配置', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (12, 11, 'home/conf/add', '新建/编辑', '配置项', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (13, 11, 'home/conf/delete', '删除', '配置项', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (14, 11, 'home/conf/edit', '编辑', '配置详情', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (15, 1, 'home/module/index', '功能模块', '功能模块', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (16, 15, 'home/module/add', '新建/编辑', '功能模块', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (17, 15, 'home/module/disable', '禁用/启用', '功能模块', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (18, 1, 'home/rule/index', '功能节点', '功能节点', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (19, 18, 'home/rule/add', '新建/编辑', '功能节点', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (20, 18, 'home/rule/delete', '删除', '功能节点', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (21, 1, 'home/role/index', '权限角色', '权限角色', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (22, 21, 'home/role/add', '新建/编辑', '权限角色', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (23, 21, 'home/role/delete', '删除', '权限角色', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (24, 1, 'home/log/index', '操作日志', '操作日志', 'HOME', '', 1, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (25, 1, 'home/database/database', '备份数据', '数据备份', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (26, 25, 'home/database/backup', '备份数据表', '数据', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (27, 25, 'home/database/optimize', '优化数据表', '数据表', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (28, 25, 'home/database/repair', '修复数据表', '数据表', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (29, 1, 'home/database/backuplist', '还原数据', '数据还原', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (30, 29, 'home/database/import', '还原数据表', '数据', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (31, 29, 'home/database/downfile', '下载备份数据', '备份数据', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (32, 29, 'home/database/del', '删除备份数据', '备份数据', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (33, 2, 'home/cate/flow_type', '审批类型', '审批类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (34, 33, 'home/cate/flow_type_add', '新建/编辑', '审批类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (35, 33, 'home/cate/flow_type_check', '设置', '审批类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (36, 2, 'home/flow/index', '审批流程', '审批流程', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (37, 36, 'home/flow/add', '新建/编辑', '审批流程', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (38, 36, 'home/flow/delete', '删除', '审批流程', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (39, 36, 'home/flow/check', '设置', '审批流程', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (40, 2, 'home/cate/expense_cate', '报销类型', '报销类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (41, 40, 'home/cate/expense_cate_add', '新建/编辑', '报销类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (42, 40, 'home/cate/expense_cate_check', '设置', '报销类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (43, 2, 'home/cate/cost_cate', '费用类型', '费用类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (44, 43, 'home/cate/cost_cate_add', '新建/编辑', '费用类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (45, 43, 'home/cate/cost_cate_check', '设置', '费用类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (46, 2, 'home/cate/seal_cate', '印章类型', '印章类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (47, 46, 'home/cate/seal_cate_add', '新建/编辑', '印章类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (48, 46, 'home/cate/seal_cate_check', '设置', '印章类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (49, 2, 'home/cate/car_cate', '车辆类型', '车辆类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (50, 49, 'home/cate/car_cate_add', '新建/编辑', '车辆类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (51, 49, 'home/cate/car_cate_check', '设置', '车辆类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (52, 2, 'home/cate/subject', '发票主体', '发票主体', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (53, 52, 'home/cate/subject_add', '新建/编辑', '发票主体', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (54, 52, 'home/cate/subject_check', '设置', '发票主体', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (55, 2, 'home/cate/note_cate', '公告类型', '公告类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (56, 55, 'home/cate/note_cate_add', '新建/编辑', '公告类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (57, 55, 'home/cate/note_cate_delete', '删除', '公告类型', 'HOME', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (58, 2, 'home/cate/article_cate', '知识类型', '知识类型', 'HOME', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (59, 58, 'home/cate/article_cate_add', '新建/编辑', '知识类型', 'HOME', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (60, 58, 'home/cate/article_cate_delete', '删除', '知识类型', 'HOME', '', 2, 1, 1, 0, 0); - - -INSERT INTO `oa_admin_rule` VALUES (61, 3, 'user/department/index', '部门架构', '部门', 'USER', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (62, 61, 'user/department/add', '新建/编辑', '部门', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (63, 61, 'user/department/delete', '删除', '部门', 'USER', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (64, 3, 'user/position/index', '岗位职称', '岗位职称', 'USER', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (65, 64, 'user/position/add', '新建/编辑', '岗位职称', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (66, 64, 'user/position/delete', '删除', '岗位职称', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (67, 64, 'user/position/view', '查看', '岗位职称', 'USER', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (68, 3, 'user/user/index', '企业员工', '员工', 'USER', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (69, 68, 'user/user/add', '新建/编辑', '员工', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (70, 68, 'user/user/view', '查看', '员工信息', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (71, 68, 'user/user/set', '设置', '员工状态', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (72, 68, 'user/user/reset_psw', '重设密码', '员工密码', 'USER', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (73, 3, 'user/personal/change', '人事调动', '人事调动', 'USER', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (74, 73, 'user/personal/change_add', '新建/编辑', '人事调动', 'USER', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (75, 3, 'user/personal/leave', '离职档案', '离职档案', 'USER', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (76, 75, 'user/personal/leave_add', '新建/编辑', '离职档案', 'USER', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (77, 75, 'user/personal/leave_delete', '删除', '离职档案', 'USER', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (78, 4, 'message/index/inbox', '收件箱', '收件箱', 'MSG', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (79, 78, 'message/index/add', '新建/编辑', '消息', 'MSG', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (80, 78, 'message/index/send', '发送', '消息', 'MSG', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (81, 78, 'message/index/save', '保存', '消息到草稿', 'MSG', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (82, 78, 'message/index/reply', '回复', '消息', 'MSG', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (83, 78, 'message/index/read', '查看', '消息', 'MSG', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (84, 78, 'message/index/check', '设置', '消息状态', 'MSG', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (85, 4, 'message/index/sendbox', '发件箱', '发件箱', 'MSG', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (86, 4, 'message/index/draft', '草稿箱', '草稿箱', 'MSG', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (87, 4, 'message/index/rubbish', '垃圾箱', '垃圾箱', 'MSG', '', 1, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (88, 5, 'note/index/index', '公告列表', '公告', 'NOTE', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (89, 88, 'note/index/add', '新建/编辑', '公告', 'NOTE', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (90, 88, 'note/index/delete', '删除', '公告', 'NOTE', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (91, 88, 'note/index/view', '查看', '公告', 'NOTE', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (92, 6, 'article/index/index', '共享知识', '知识文章', 'KQ', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (93, 6, 'article/index/list', '个人知识', '知识文章', 'KQ', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (94, 93, 'article/index/add', '新建/编辑', '知识文章', 'KQ', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (95, 93, 'article/index/delete', '删除', '知识文章', 'KQ', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (96, 93, 'article/index/view', '查看', '知识文章', 'KQ', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (97, 7, 'oa/approve/index', '我发起的', '办公审批', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (98, 7, 'oa/approve/list', '我处理的', '办公审批', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (99, 7, 'oa/approve/copy', '抄送给我的', '办公审批', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (100, 97, 'oa/approve/add', '新建/编辑', '办公审批', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (101, 97, 'oa/approve/view', '查看', '办公审批', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (102, 97, 'oa/approve/check', '审核', '办公审批', 'OA', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (103, 8, 'oa/plan/calendar', '日程日历', '日程安排', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (104, 8, 'oa/plan/index', '日程安排', '日程安排', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (105, 103, 'oa/plan/add', '新建/编辑', '日程安排', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (106, 103, 'oa/plan/delete', '删除', '日程安排', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (107, 103, 'oa/plan/detail', '查看', '日程安排', 'OA', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (108, 8, 'oa/schedule/calendar', '工作日历', '工作日历', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (109, 8, 'oa/schedule/index', '工作记录', '工作记录', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (110, 108, 'oa/schedule/add', '新建/编辑', '工作记录', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (111, 108, 'oa/schedule/delete', '删除', '工作记录', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (112, 108, 'oa/schedule/detail', '查看', '工作记录', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (113, 108, 'oa/schedule/update_labor_time', '更改工时', '工时', 'OA', '', 0, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (114, 8, 'oa/work/index', '工作汇报', '工作汇报', 'OA', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (115, 114, 'oa/work/add', '新建/编辑', '工作汇报', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (116, 114, 'oa/work/send', '发送', '工作汇报', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (117, 114, 'oa/work/read', '查看', '工作汇报', 'OA', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (118, 114, 'oa/work/delete', '删除', '工作汇报', 'OA', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (119, 9, '', '报销管理', '报销', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (120, 119, 'finance/expense/index', '我申请的', '报销', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (121, 119, 'finance/expense/list', '我处理的', '报销', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (122, 119, 'finance/expense/checkedlist', '报销打款', '报销', 'CF', '', 1, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (123, 119, 'finance/expense/add', '新建/编辑', '报销', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (124, 119, 'finance/expense/delete', '删除', '报销', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (125, 119, 'finance/expense/view', '查看', '报销', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (126, 119, 'finance/expense/check', '审核', '报销', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (127, 119, 'finance/expense/topay', '打款', '报销', 'CF', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (128, 9, '', '发票管理', '发票', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (129, 128, 'finance/invoice/index', '我申请的', '发票', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (130, 128, 'finance/invoice/list', '我处理的', '发票', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (131, 128, 'finance/invoice/checkedlist', '发票开具', '发票', 'CF', '', 1, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (132, 128, 'finance/invoice/add', '新建/编辑', '发票', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (133, 128, 'finance/invoice/delete', '删除', '发票', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (134, 128, 'finance/invoice/view', '查看', '发票', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (135, 128, 'finance/invoice/check', '审核', '发票', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (136, 128, 'finance/invoice/open', '开具', '发票', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (137, 128, 'finance/invoice/tovoid', '作废', '发票', 'CF', '', 2, 1, 1, 0, 0); - -INSERT INTO `oa_admin_rule` VALUES (138, 9, 'finance/income/index', '到账管理', '到账记录', 'CF', '', 1, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (139, 138, 'finance/income/add', '新建/编辑', '到账记录', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (140, 138, 'finance/income/view', '查看', '到账记录', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (141, 138, 'finance/income/delete', '删除', '到账记录', 'CF', '', 2, 1, 1, 0, 0); -INSERT INTO `oa_admin_rule` VALUES (142, 10, 'business/analysis/index', '智能分析', '智能分析', 'BI', '', 1, 1, 1, 0, 0); - --- ---------------------------- --- Table structure for oa_config --- ---------------------------- -DROP TABLE IF EXISTS `oa_config`; -CREATE TABLE `oa_config` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL DEFAULT '' COMMENT '配置名称', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT '配置标识', - `content` text NULL COMMENT '配置内容', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COMMENT = '系统配置表'; - --- ---------------------------- --- Records of oa_config --- ---------------------------- -INSERT INTO `oa_config` VALUES (1, '网站配置', 'web', 'a:13:{s:2:\"id\";s:1:\"1\";s:11:\"admin_title\";s:8:\"勾股OA\";s:5:\"title\";s:8:\"勾股OA\";s:4:\"logo\";s:52:\"/storage/202111/fc507cc8332d5ef49d9425185e4a9697.jpg\";s:4:\"file\";s:0:\"\";s:6:\"domain\";s:23:\"https://oa.gougucms.com\";s:3:\"icp\";s:23:\"粤ICP备1xxxxxx11号-1\";s:8:\"keywords\";s:8:\"勾股OA\";s:5:\"beian\";s:29:\"粤公网安备1xxxxxx11号-1\";s:4:\"desc\";s:479:\"勾股办公是一款基于ThinkPHP6 + Layui + MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。 \";s:4:\"code\";s:0:\"\";s:9:\"copyright\";s:36:\"© 2022 gougucms.com GPL-2.0 license\";s:7:\"version\";s:6:\"1.0.22\";}', 1, 1612514630, 1638010154); -INSERT INTO `oa_config` VALUES (2, '邮箱配置', 'email', 'a:8:{s:2:\"id\";s:1:\"2\";s:4:\"smtp\";s:11:\"smtp.qq.com\";s:9:\"smtp_port\";s:3:\"465\";s:9:\"smtp_user\";s:15:\"gougucms@qq.com\";s:8:\"smtp_pwd\";s:6:\"123456\";s:4:\"from\";s:24:\"勾股CMS系统管理员\";s:5:\"email\";s:18:\"admin@gougucms.com\";s:8:\"template\";s:485:\"

      勾股办公是一款基于ThinkPHP6 + Layui + MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。

      \";}', 1, 1612521657, 1637075205); -INSERT INTO `oa_config` VALUES (3, 'Api Token配置', 'token', 'a:5:{s:2:\"id\";s:1:\"3\";s:3:\"iss\";s:15:\"oa.gougucms.com\";s:3:\"aud\";s:7:\"gouguoa\";s:7:\"secrect\";s:7:\"GOUGUOA\";s:7:\"exptime\";s:4:\"3600\";}', 1, 1627313142, 1638010233); -INSERT INTO `oa_config` VALUES (4, '其他配置', 'other', 'a:3:{s:2:\"id\";s:1:\"5\";s:6:\"author\";s:15:\"勾股工作室\";s:7:\"version\";s:13:\"v1.2021.07.28\";}', 1, 1613725791, 1635953640); - --- ---------------------------- --- Table structure for oa_department --- ---------------------------- -DROP TABLE IF EXISTS `oa_department`; -CREATE TABLE `oa_department` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` varchar(100) NOT NULL DEFAULT '' COMMENT '部门名称', - `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级部门id', - `leader_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '部门负责人ID', - `phone` varchar(60) NOT NULL DEFAULT '' COMMENT '部门联系电话', - `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '部门组织'; - --- ---------------------------- --- Records of oa_department --- ---------------------------- -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (1, '董事会', 0, 0, '13688888888'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (2, '人事部', 1, 0, '13688888889'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (3, '财务部', 1, 0, '13688888898'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (4, '市场部', 1, 0, '13688888978'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (5, '销售部', 1, 0, '13688889868'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (6, '技术部', 1, 0, '13688898858'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (7, '客服部', 1, 0, '13688988848'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (8, '销售一部', 5, 0, '13688998838'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (9, '销售二部', 5, 0, '13688999828'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (10, '销售三部', 5, 0, '13688999918'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (11, '产品部', 6, 0, '13688888886'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (12, '设计部', 6, 0, '13688888876'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (13, '研发部', 6, 0, '13688888666'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (14, '客服一部', 7, 0, '13688888865'); -INSERT INTO `oa_department`(`id`, `title`, `pid`, `leader_id`, `phone`) VALUES (15, '客服二部', 7, 0, '13688888855'); - --- ---------------------------- --- Table structure for oa_department_change --- ---------------------------- -DROP TABLE IF EXISTS `oa_department_change`; -CREATE TABLE `oa_department_change` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID', - `from_did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '原部门id', - `to_did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '调到部门id', - `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', - `admin_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `move_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '调到时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '人事调动部门记录表'; - --- ---------------------------- --- Table structure for oa_personal_quit --- ---------------------------- -DROP TABLE IF EXISTS `oa_personal_quit`; -CREATE TABLE `oa_personal_quit` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID', - `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', - `admin_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', - `lead_admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '部门负责人', - `connect_uids` varchar(100) NOT NULL DEFAULT '' COMMENT '交接人', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `quit_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '离职时间', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '人事离职记录表'; - --- ---------------------------- --- Table structure for oa_flow_type --- ---------------------------- -DROP TABLE IF EXISTS `oa_flow_type`; -CREATE TABLE `oa_flow_type` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1假勤,2行政,3财务,4人事,5其他,6报销,发票,合同', - `title` varchar(100) NOT NULL DEFAULT '' COMMENT '审批名称', - `name` varchar(100) NOT NULL DEFAULT '' COMMENT '审批标识', - `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', - `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '审批类型'; - --- ---------------------------- --- Records of oa_flow_type --- ---------------------------- -INSERT INTO `oa_flow_type` VALUES (1, 1, '请假', 'qingjia', 'icon-kechengziyuanguanli', 1, 1639896302, 0); -INSERT INTO `oa_flow_type` VALUES (2, 1, '出差', 'chuchai', 'icon-jiaoshiguanli', 1, 1641802838, 0); -INSERT INTO `oa_flow_type` VALUES (3, 1, '外出', 'waichu', 'icon-tuiguangguanli', 1, 1641802858, 0); -INSERT INTO `oa_flow_type` VALUES (4, 1, '加班', 'jiaban', 'icon-xueshengchengji', 1, 1641802892, 0); -INSERT INTO `oa_flow_type` VALUES (5, 2, '会议室预定', 'huiyishi', 'icon-kehuguanli', 1, 1641802939, 0); -INSERT INTO `oa_flow_type` VALUES (6, 2, '公文流转', 'gongwen', 'icon-jiaoxuejihua', 1, 1641802976, 0); -INSERT INTO `oa_flow_type` VALUES (7, 2, '物品维修', 'weixiu', 'icon-chuangjianxitong', 1, 1641803005, 0); -INSERT INTO `oa_flow_type` VALUES (8, 2, '用章', 'yongzhang', 'icon-shenpishezhi', 1, 1641804126, 0); -INSERT INTO `oa_flow_type` VALUES (9, 2, '用车', 'yongche', 'icon-dongtaiguanli', 1, 1641804283, 0); -INSERT INTO `oa_flow_type` VALUES (10, 2, '用车归还', 'yongcheguihai', 'icon-kaoheguanli', 1, 1641804411, 0); -INSERT INTO `oa_flow_type` VALUES (11, 3, '借款', 'jiekuan', 'icon-zhangbuguanli', 1, 1641804537, 0); -INSERT INTO `oa_flow_type` VALUES (12, 3, '付款', 'fukuan', 'icon-gongziguanli', 1, 1641804601, 0); -INSERT INTO `oa_flow_type` VALUES (13, 3, '奖励', 'jiangli', 'icon-bulujiesuan', 1, 1641804711, 0); -INSERT INTO `oa_flow_type` VALUES (14, 3, '采购', 'caigou', 'icon-shoufeiguanli', 1, 1641804917, 0); -INSERT INTO `oa_flow_type` VALUES (15, 3, '活动经费', 'huodong', 'icon-shoufeipeizhi', 1, 1641805110, 0); -INSERT INTO `oa_flow_type` VALUES (16, 4, '入职', 'ruzhi', 'icon-xueshengdaoru', 1, 1641893853, 0); -INSERT INTO `oa_flow_type` VALUES (17, 4, '转正', 'zhuanzheng', 'icon-wodeshenpi', 1, 1641893926, 0); -INSERT INTO `oa_flow_type` VALUES (18, 4, '离职', 'lizhi', 'icon-xuexitongji', 1, 1641894048, 0); -INSERT INTO `oa_flow_type` VALUES (19, 4, '转岗', 'zhuangang', 'icon-xueshengyidong', 1, 1654681664, 0); -INSERT INTO `oa_flow_type` VALUES (20, 4, '招聘需求', 'zhaopin', 'icon-xiaoxizhongxin', 1, 1641894080, 0); -INSERT INTO `oa_flow_type` VALUES (21, 5, '通用审批', 'tongyong', 'icon-zhaoshengzhunbei', 1, 1654685923, 0); -INSERT INTO `oa_flow_type` VALUES (22, 6, '报销', 'baoxiao', 'icon-jizhang', 1, 1641804488, 0); -INSERT INTO `oa_flow_type` VALUES (23, 7, '发票', 'fapiao', 'icon-fuwuliebiao', 1, 1642904833, 0); -INSERT INTO `oa_flow_type` VALUES (24, 8, '合同', 'hetong', 'icon-hetongshezhi', 1, 1654692083, 0); - --- ---------------------------- --- Table structure for oa_flow --- ---------------------------- -DROP TABLE IF EXISTS `oa_flow`; -CREATE TABLE `oa_flow` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL COMMENT '审批流名称', - `check_type` tinyint(4) NOT NULL COMMENT '1固定审批,2授权审批人', - `type` tinyint(4) NOT NULL COMMENT '应用模块,1假勤,2行政,3财务,4人事,5其他,6报销,7发票,8合同', - `flow_cate` tinyint(11) NOT NULL DEFAULT 0 COMMENT '应用审批类型id', - `department_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '应用部门ID(0为全部)1,2,3', - `copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID', - `remark` varchar(500) NOT NULL DEFAULT '' COMMENT '流程说明', - `flow_list` varchar(1000) NULL DEFAULT '' COMMENT '流程数据序列化', - `admin_id` int(11) NOT NULL COMMENT '创建人ID', - `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', - `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', - `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 1启用,0禁用', - `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间', - `delete_user_id` int(11) NOT NULL DEFAULT 0 COMMENT '删除人ID', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '审批流程表'; - --- ---------------------------- --- Records of oa_flow --- ---------------------------- -INSERT INTO `oa_flow` VALUES (1, '请假审批', 2, 1, 1, '', '', '请假审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644401970, 1644402071, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (2, '出差审批', 2, 1, 2, '', '', '请假审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402054, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (3, '外出审批', 2, 1, 3, '', '', '外出审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402116, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (4, '加班申请审批', 2, 1, 4, '', '', '加班申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402147, 1644456735, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (5, '会议室预定审批', 2, 2, 5, '', '', '会议室预定审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402193, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (6, '公文流转审批', 2, 2, 6, '', '', '公文流转审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402386, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (7, '物品维修审批', 2, 2, 7, '', '', '物品维修审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402473, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (8, '用章审批', 2, 2, 8, '', '', '用章审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402499, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (9, '用车审批', 2, 2, 9, '', '', '用车审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402525, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (10, '用车归还审批', 2, 2, 10, '', '', '用车归还审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402549, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (11, '借款申请审批', 2, 3, 11, '', '', '借款申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402611, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (12, '付款申请审批', 2, 3, 12, '', '', '付款申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402679, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (13, '奖励申请审批', 2, 3, 13, '', '', '奖励申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402705, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (14, '采购申请审批', 2, 3, 14, '', '', '采购申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402739, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (15, '活动经费审批', 2, 3, 15, '', '', '活动经费审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402762, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (16, '入职申请审批', 2, 4, 16, '', '', '入职申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402791, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (17, '转正申请审批', 2, 4, 17, '', '', '转正申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402812, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (18, '离职申请审批', 2, 4, 18, '', '', '离职申请审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402834, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (19, '转岗申请审批', 2, 4, 19, '', '', '转岗申请审核流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1654681954, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (20, '招聘需求审批', 2, 4, 20, '', '', '招聘需求审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644402855, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (21, '通用审批', 2, 5, 21, '', '', '通用审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1654686338, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (22, '报销审批', 2, 6, 22, '', '', '报销审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644490024, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (23, '发票审批', 2, 7, 23, '', '', '发票审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1644490053, 0, 1, 0, 0); -INSERT INTO `oa_flow` VALUES (24, '合同审批', 2, 8, 24, '', '', '合同审批流程', 'a:1:{i:0;a:2:{s:9:\"flow_type\";s:1:\"1\";s:9:\"flow_uids\";s:0:\"\";}}', 1, 1654692519, 0, 1, 0, 0); \ No newline at end of file diff --git a/app/install/view/index/step3.html b/app/install/view/index/step3.html index 412ee09..91b5e03 100644 --- a/app/install/view/index/step3.html +++ b/app/install/view/index/step3.html @@ -145,6 +145,18 @@ form = layui.form, element = layui.element; var n = 0; + function install_ajax(){ + $.ajax({ + url:"https://www.gougucms.com/index.php?s=home/get_module/install_ajax", + dataType:'jsonp', + data:{'name':'勾股OA'}, + jsonp:'callback', + success:function(result) { + console.log(result); + }, + timeout:3000 + }); + } //监听提交 form.on('submit(install)', function (data) { $('#progress').css('display', 'block'); @@ -163,10 +175,7 @@ data: data.field, beforeSend: function () { // 禁用按钮防止重复提交 - $("#install").attr({ - disabled: "disabled" - }); - $('#install').html('创建中...'); + $("#install").attr({disabled: "disabled"}).html('创建中...'); }, success: function (res) { if (res.code == 1) { @@ -188,21 +197,11 @@ } }, 500) } + install_ajax(); } }, complete: function () { - $.ajax({ - url:"https://www.gougucms.com/index.php?s=home/login/install_ajax", - dataType:'jsonp', - data:{'name':'勾股OA'}, - jsonp:'callback', - success:function(result) { - console.log(result); - }, - timeout:3000 - }); - $("#install").removeAttr("disabled"); - $('#install').html('提交'); + $("#install").removeAttr("disabled").html('提交'); } }) return false; diff --git a/app/message/controller/Index.php b/app/message/controller/Index.php index 027773c..1bb8e06 100644 --- a/app/message/controller/Index.php +++ b/app/message/controller/Index.php @@ -15,58 +15,7 @@ use think\facade\Db; use think\facade\View; class Index extends BaseController -{ - //获取消息列表 - public function getList($map = [], $param = [],$uid) - { - $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; - //垃圾箱列表特殊处理 - if ($param['status'] == 0) { - $where = [['from_uid', '=', $uid], ['to_uid', '=', $uid]]; - $mail = MessageList::withoutField('content') - ->where($map) - ->where(function ($query) use ($where) {$query->whereOr($where);}) - ->order('create_time desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - if($item->template==0){ - $item->msg_type = '个人信息'; - $item->from_name = Db::name('Admin')->where(['id' => $item->from_uid])->value('name'); - } - else{ - $item->msg_type = '系统信息'; - $item->from_name = '系统'; - } - $item->send_time = empty($item->send_time) ? '-' : date('Y-m-d H:i:s', $item->send_time); - $item->to_name = Db::name('Admin')->where(['id' => $item->to_uid])->value('name'); - $item->type_title = MessageList::$Type[(int)$item->type]; - $item->delete_source_title = MessageList::$Source[(int)$item->delete_source]; - $item->files = Db::name('MessageFileInterfix')->where(['mid' => $item->id])->count(); - }); - return $mail; - } else { - $mail = MessageList::withoutField('content') - ->where($map) - ->order('create_time desc') - ->paginate($rows, false, ['query' => $param]) - ->each(function ($item, $key) { - if($item->template==0){ - $item->msg_type = '个人信息'; - $item->from_name = Db::name('Admin')->where(['id' => $item->from_uid])->value('name'); - } - else{ - $item->msg_type = '系统信息'; - $item->from_name = '系统'; - } - $item->send_time = empty($item->send_time) ? '-' : date('Y-m-d H:i:s', $item->send_time); - $item->to_name = Db::name('Admin')->where(['id' => $item->to_uid])->value('name'); - $item->type_title = MessageList::$Type[(int)$item->type]; - $item->files = Db::name('MessageFileInterfix')->where(['mid' => $item->id])->count(); - }); - return $mail; - } - } - +{ //收件箱 public function inbox() { @@ -99,9 +48,22 @@ class Index extends BaseController if ($start_time > 0 && $end_time > 0) { $map[] = ['send_time', 'between', "$start_time,$end_time"]; } - $list = $this->getList($map, $param, $this->uid); + $model = new MessageList(); + $list = $model->get_list($param,$map,$this->uid); return table_assign(0, '', $list); } else { + $where1 = [['from_uid', '=', $this->uid]]; + $where2 = [['to_uid', '=', $this->uid]]; + $count = [ + 'inbox' => MessageList::where([['to_uid', '=', $this->uid],['status', '=', 1]])->count(), + 'sendbox' => MessageList::where([['from_uid', '=', $this->uid],['to_uid', '=', 0],['is_draft', '=', 1],['status', '=', 1]])->count(), + 'draft' => MessageList::where([['from_uid', '=', $this->uid],['is_draft', '=', 2],['status', '=', 1]])->count(), + 'rubbish' => MessageList::where([['status', '=', 0]])->where(function($query) use ($where1,$where2) { + $query->where($where1)->whereor($where2); + })->count() + ]; + View::assign('count', $count); + View::assign('action', $this->action); return view(); } } @@ -125,9 +87,22 @@ class Index extends BaseController if ($start_time > 0 && $end_time > 0) { $map[] = ['send_time', 'between', "$start_time,$end_time"]; } - $list = $this->getList($map, $param, $this->uid); + $model = new MessageList(); + $list = $model->get_list($param,$map,$this->uid); return table_assign(0, '', $list); } else { + $where1 = [['from_uid', '=', $this->uid]]; + $where2 = [['to_uid', '=', $this->uid]]; + $count = [ + 'inbox' => MessageList::where([['to_uid', '=', $this->uid],['status', '=', 1]])->count(), + 'sendbox' => MessageList::where([['from_uid', '=', $this->uid],['to_uid', '=', 0],['is_draft', '=', 1],['status', '=', 1]])->count(), + 'draft' => MessageList::where([['from_uid', '=', $this->uid],['is_draft', '=', 2],['status', '=', 1]])->count(), + 'rubbish' => MessageList::where([['status', '=', 0]])->where(function($query) use ($where1,$where2) { + $query->where($where1)->whereor($where2); + })->count() + ]; + View::assign('count', $count); + View::assign('action', $this->action); return view(); } } @@ -151,9 +126,22 @@ class Index extends BaseController if ($start_time > 0 && $end_time > 0) { $map[] = ['send_time', 'between', "$start_time,$end_time"]; } - $list = $this->getList($map, $param, $this->uid); + $model = new MessageList(); + $list = $model->get_list($param,$map,$this->uid); return table_assign(0, '', $list); } else { + $where1 = [['from_uid', '=', $this->uid]]; + $where2 = [['to_uid', '=', $this->uid]]; + $count = [ + 'inbox' => MessageList::where([['to_uid', '=', $this->uid],['status', '=', 1]])->count(), + 'sendbox' => MessageList::where([['from_uid', '=', $this->uid],['to_uid', '=', 0],['is_draft', '=', 1],['status', '=', 1]])->count(), + 'draft' => MessageList::where([['from_uid', '=', $this->uid],['is_draft', '=', 2],['status', '=', 1]])->count(), + 'rubbish' => MessageList::where([['status', '=', 0]])->where(function($query) use ($where1,$where2) { + $query->where($where1)->whereor($where2); + })->count() + ]; + View::assign('count', $count); + View::assign('action', $this->action); return view(); } } @@ -175,9 +163,22 @@ class Index extends BaseController if ($start_time > 0 && $end_time > 0) { $map[] = ['send_time', 'between', "$start_time,$end_time"]; } - $list = $this->getList($map, $param, $this->uid); + $model = new MessageList(); + $list = $model->get_list($param,$map,$this->uid); return table_assign(0, '', $list); } else { + $where1 = [['from_uid', '=', $this->uid]]; + $where2 = [['to_uid', '=', $this->uid]]; + $count = [ + 'inbox' => MessageList::where([['to_uid', '=', $this->uid],['status', '=', 1]])->count(), + 'sendbox' => MessageList::where([['from_uid', '=', $this->uid],['to_uid', '=', 0],['is_draft', '=', 1],['status', '=', 1]])->count(), + 'draft' => MessageList::where([['from_uid', '=', $this->uid],['is_draft', '=', 2],['status', '=', 1]])->count(), + 'rubbish' => MessageList::where([['status', '=', 0]])->where(function($query) use ($where1,$where2) { + $query->where($where1)->whereor($where2); + })->count() + ]; + View::assign('count', $count); + View::assign('action', $this->action); return view(); } } @@ -188,10 +189,14 @@ class Index extends BaseController $id = empty(get_params('id')) ? 0 : get_params('id'); $fid = 0; if ($id > 0) { - $detail = Db::name('Message')->where(['id' => $id, 'from_uid' => $this->uid])->find(); + $model = new MessageList(); + $detail = $model->detail($id); if (empty($detail)) { - echo '
      该信息不存在
      ';exit; + throw new \think\exception\HttpException(406, '找不到记录'); } + if ($detail['from_uid'] != $this->uid) { + throw new \think\exception\HttpException(406, '找不到记录'); + } $fid = $detail['fid']; $person_name = []; if ($detail['type'] == 1) { //人员 @@ -207,29 +212,6 @@ class Index extends BaseController $person_name = array_column($positions, 'title'); } $detail['person_name'] = implode(",", $person_name); - $file_array = Db::name('MessageFileInterfix') - ->field('mf.id,mf.mid,mf.file_id,f.name,f.filesize,f.filepath') - ->alias('mf') - ->join('file f', 'mf.file_id = f.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.mid' => $id)) - ->select()->toArray(); - $interfix_ids = array_column($file_array, 'file_id'); - $detail['file_ids'] = implode(",", $interfix_ids); - - //引用消息的附件 - if($fid>0){ - $detail['from_content'] = Db::name('Message')->where(['id' => $fid])->value('content'); - $from_file_array = Db::name('MessageFileInterfix') - ->field('mf.id,mf.mid,mf.file_id,f.name,f.filesize,f.filepath') - ->alias('mf') - ->join('file f', 'mf.file_id = f.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.mid' => $fid)) - ->select()->toArray(); - $detail['from_file_array'] = $from_file_array; - } - View::assign('file_array', $file_array); View::assign('detail', $detail); } View::assign('id', $id); @@ -242,25 +224,16 @@ class Index extends BaseController { $id = empty(get_params('id')) ? 0 : get_params('id'); $type = empty(get_params('type')) ? 0 : get_params('type'); - $detail = Db::name('Message')->where(['id' => $id, 'template' => 0])->find(); + $model = new MessageList(); + $detail = $model->detail($id); if (empty($detail)) { - echo '
      该信息不存在
      ';exit; + throw new \think\exception\HttpException(406, '找不到记录'); } if ($detail['to_uid'] != $this->uid && $detail['from_uid'] != $this->uid) { - echo '
      该信息不存在
      ';exit; + throw new \think\exception\HttpException(406, '找不到记录'); } $sender = get_admin($detail['from_uid']); $detail['person_name'] = $sender['name']; - $file_array = Db::name('MessageFileInterfix') - ->field('mf.id,mf.mid,mf.file_id,f.name,f.filesize,f.filepath') - ->alias('mf') - ->join('file f', 'mf.file_id = f.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.mid' => $id)) - ->select()->toArray(); - $interfix_ids = array_column($file_array, 'file_id'); - $detail['file_ids'] = implode(",", $interfix_ids); - View::assign('file_array', $file_array); View::assign('detail', $detail); View::assign('fid', $id); View::assign('type', $type); @@ -272,12 +245,13 @@ class Index extends BaseController { $param = get_params(); $id = $param['id']; - $detail = Db::name('Message')->where(['id' => $id])->find(); + $model = new MessageList(); + $detail = $model->detail($id); if (empty($detail)) { - echo '
      该信息不存在
      ';exit; + throw new \think\exception\HttpException(406, '找不到记录'); } if ($detail['to_uid'] != $this->uid && $detail['from_uid'] != $this->uid) { - echo '
      该信息不存在
      ';exit; + throw new \think\exception\HttpException(406, '找不到记录'); } Db::name('Message')->where(['id' => $id])->update(['read_time' => time()]); if($detail['from_uid']==0){ @@ -287,37 +261,20 @@ class Index extends BaseController $sender = get_admin($detail['from_uid']); $detail['person_name'] = $sender['name']; } - //引用消息的附件 - if($detail['fid']>0){ - $detail['from_content'] = Db::name('Message')->where(['id' => $detail['fid']])->value('content'); - $from_file_array = Db::name('MessageFileInterfix') - ->field('mf.id,mf.mid,mf.file_id,f.name,f.filesize,f.filepath') - ->alias('mf') - ->join('file f', 'mf.file_id = f.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.mid' => $detail['fid'])) - ->select()->toArray(); - $detail['from_file_array'] = $from_file_array; - } - - //当前消息的附件 - $file_array = Db::name('MessageFileInterfix') - ->field('mf.id,mf.mid,mf.file_id,f.name,f.filesize,f.filepath') - ->alias('mf') - ->join('file f', 'mf.file_id = f.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.mid' => $detail['id'])) - ->select()->toArray(); - $detail['file_array'] = $file_array; - $detail['send_time'] = date('Y-m-d H:i:s',$detail['send_time']); + if($detail['send_time']>0){ + $detail['send_time'] = date('Y-m-d H:i:s',$detail['send_time']); + } + else{ + $detail['send_time'] = '-'; + } //发送人查询 $user_names=[]; //已读回执 $read_user_names = []; if($detail['from_uid'] == $this->uid){ - $mails= Db::name('Message')->where(['pid' => $id])->select()->toArray(); - $read_mails= Db::name('Message')->where([['pid','=',$id],['read_time','>',2]])->select()->toArray(); + $mails= MessageList::where(['pid' => $id])->select()->toArray(); + $read_mails= MessageList::where([['pid','=',$id],['read_time','>',2]])->select()->toArray(); $read_user_ids = array_column($read_mails, 'to_uid'); $read_users = Db::name('Admin')->where('status', 1)->where('id', 'in', $read_user_ids)->select()->toArray(); $read_user_names = array_column($read_users, 'name'); @@ -330,7 +287,6 @@ class Index extends BaseController $users = Db::name('Admin')->where('id', $detail['to_uid'])->value('name'); array_push($user_names,$users); } - $detail['users'] = implode(",", $user_names); $detail['read_users'] = implode(",", $read_user_names); View::assign('detail', $detail); @@ -375,6 +331,7 @@ class Index extends BaseController $basedata['type'] = $param['type']; $basedata['type_user'] = $type_user; $basedata['content'] = $param['content']; + $basedata['file_ids'] = $param['file_ids']; $basedata['controller_name'] = $this->controller; $basedata['module_name'] = $this->module; $basedata['action_name'] = $this->action; @@ -382,39 +339,19 @@ class Index extends BaseController //编辑信息的情况 $basedata['update_time'] = time(); $basedata['id'] = $id; - $res = Db::name('Message')->strict(false)->field(true)->update($basedata); + $res = MessageList::strict(false)->field(true)->update($basedata); } else { //新增信息的情况 $basedata['create_time'] = time(); - $res = Db::name('Message')->strict(false)->field(true)->insertGetId($basedata); + $res = MessageList::strict(false)->field(true)->insertGetId($basedata); } if ($res !== false) { //信息附件处理 if ($id > 0) { $mid = $id; - Db::name('MessageFileInterfix')->where(['mid' => $mid])->delete(); } else { $mid = $res; } - //附件插入附件 - if (!empty($param['file_ids'])) { - $file_array = explode(',', $param['file_ids']); - $file_data = array(); - foreach ($file_array as $key => $value) { - if (!$value) { - continue; - } - $file_data[] = array( - 'file_id' => $value, - 'mid' => $mid, - 'admin_id' => $admin_id, - 'create_time' => time() - ); - } - if ($file_data) { - $sql = Db::name('MessageFileInterfix')->insertAll($file_data); - } - } add_log('save',$mid); return to_assign(0, '保存成功', $mid); } else { @@ -427,7 +364,7 @@ class Index extends BaseController { $param = get_params(); //查询要发的消息 - $msg = Db::name('Message')->where(['id' => $param['id']])->find(); + $msg = MessageList::where(['id' => $param['id']])->find(); $users = []; if ($msg) { $admin_id = $msg['from_uid']; @@ -455,6 +392,7 @@ class Index extends BaseController 'fid' => $msg['fid'],//转发或回复消息关联id 'title' => $msg['title'], 'content' => $msg['content'], + 'file_ids' => $msg['file_ids'], 'type' => $msg['type'],//接收人类型 'type_user' => $msg['type_user'],//接收人数据 'from_uid' => $this->uid,//发送人 @@ -465,32 +403,10 @@ class Index extends BaseController 'create_time' => time() ); } - $res = Db::name('Message')->strict(false)->field(true)->insertAll($send_data); + $res = MessageList::strict(false)->field(true)->insertAll($send_data); if ($res!==false) { - //查询原来的附件,并插入 - $file_array = Db::name('MessageFileInterfix')->where('mid', $msg['id'])->select()->toArray(); - if ($file_array) { - $mids = Db::name('Message')->where('pid', $msg['id'])->select()->toArray(); - foreach ($mids as $k => $v) { - $file_data = array(); - foreach ($file_array as $key => $value) { - if (!$value) { - continue; - } - $file_data[] = array( - 'mid' => $v['id'], - 'file_id' => $value['file_id'], - 'create_time' => time(), - 'admin_id' => $admin_id, - ); - } - if ($file_data) { - Db::name('MessageFileInterfix')->strict(false)->field(true)->insertAll($file_data); - } - } - } //草稿消息变成已发消息 - Db::name('Message')->where(['id' => $msg['id']])->update(['is_draft' => '1', 'send_time' => time(), 'update_time' => time()]); + MessageList::where(['id' => $msg['id']])->update(['is_draft' => '1', 'send_time' => time(), 'update_time' => time()]); add_log('send',$msg['id']); return to_assign(0, '发送成功'); } else { @@ -542,7 +458,7 @@ class Index extends BaseController } foreach ($list as $key => $v) { - if (Db::name('Message')->update($v) !== false) { + if (MessageList::update($v) !== false) { if ($type = 1) { add_log('view', $v['id']); } else if ($type = 2) { diff --git a/app/message/model/Message.php b/app/message/model/Message.php index 360dc58..60ebbf4 100644 --- a/app/message/model/Message.php +++ b/app/message/model/Message.php @@ -33,4 +33,74 @@ class Message extends Model self::THREE => '岗位', self::FOUR => '全部', ]; + + //获取消息列表 + public function get_list($param = [],$map = [], $uid) + { + $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; + //垃圾箱列表特殊处理 + if ($param['status'] == 0) { + $where = [['from_uid', '=', $uid], ['to_uid', '=', $uid]]; + $list = Message::withoutField('content') + ->where($map) + ->where(function ($query) use ($where) {$query->whereOr($where);}) + ->order('create_time desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + if($item->template==0){ + $item->msg_type = '个人信息'; + $item->from_name = Db::name('Admin')->where(['id' => $item->from_uid])->value('name'); + } + else{ + $item->msg_type = '系统信息'; + $item->from_name = '系统'; + } + $item->send_time = empty($item->send_time) ? '-' : date('Y-m-d H:i:s', $item->send_time); + $item->to_name = Db::name('Admin')->where(['id' => $item->to_uid])->value('name'); + $item->type_title = Message::$Type[(int)$item->type]; + $item->delete_source_title = Message::$Source[(int)$item->delete_source]; + }); + return $list; + } else { + $list = Message::withoutField('content') + ->where($map) + ->order('create_time desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + if($item->template==0){ + $item->msg_type = '个人信息'; + $item->from_name = Db::name('Admin')->where(['id' => $item->from_uid])->value('name'); + } + else{ + $item->msg_type = '系统信息'; + $item->from_name = '系统'; + } + $item->send_time = empty($item->send_time) ? '-' : date('Y-m-d H:i:s', $item->send_time); + $item->to_name = Db::name('Admin')->where(['id' => $item->to_uid])->value('name'); + $item->type_title = Message::$Type[(int)$item->type]; + }); + return $list; + } + } + + //消息详情 + public function detail($id) + { + $detail = Db::name('Message')->where(['id' => $id])->find(); + if(!empty($detail)){ + //消息附件 + $file_array = Db::name('File')->order('create_time desc')->where([['id','in',$detail['file_ids']]])->select()->toArray(); + $detail['file_array'] = $file_array; + //引用消息附件 + if($detail['fid']>0){ + $from_msg = Db::name('Message')->field('content,file_ids')->where(['id' => $detail['fid']])->find(); + $detail['from_content'] = $from_msg['content']; + $detail['from_file_ids'] = $from_msg['file_ids']; + + $from_file_array = Db::name('File')->order('create_time desc')->where([['id','in',$detail['from_file_ids']]])->select()->toArray(); + $detail['from_file_array'] = $from_file_array; + } + } + return $detail; + } } diff --git a/app/message/view/index/add.html b/app/message/view/index/add.html index ff61f27..db29cc3 100644 --- a/app/message/view/index/add.html +++ b/app/message/view/index/add.html @@ -35,22 +35,10 @@ - 消息附件 - -
      - 最大只能上传{:get_system_info('upload_max_filesize')}的文件,超过{:get_system_info('upload_max_filesize')}请压缩成多个文件上传。 - +
      附件
      + +
      +
      @@ -122,34 +110,24 @@ - 消息附件 - -
      - 最大只能上传{:get_system_info('upload_max_filesize')}的文件,超过{:get_system_info('upload_max_filesize')}请压缩成多个文件上传。 -
      - - - - - - - - - - {notempty name="$file_array"} - {volist name="file_array" id="vo"} - - - - - - {/volist} - {/notempty} - -
      文件名文件大小操作
      {$vo.name}{$vo.filesize/1048576|round=2}MB - 删除 -
      +
      附件
      + +
      + + {notempty name="$detail.file_ids"} + {volist name="$detail.file_array" id="vo"} +
      +
      + +
      {$vo.name}
      +
      + + +
      +
      + {/volist} + {/notempty}
      @@ -168,21 +146,29 @@ {block name="script"} {/block} diff --git a/app/message/view/index/draft.html b/app/message/view/index/draft.html index d870d8d..7190b44 100644 --- a/app/message/view/index/draft.html +++ b/app/message/view/index/draft.html @@ -2,22 +2,25 @@ {block name="body"}
      - -
      - -
      -
      -
      - + {include file="index/msgmenu" /} +
      + +
      +
      - ~ -
      - +
      +
      + +
      + ~ +
      + +
      -
      - - -
      + + +
      +
      {/block} diff --git a/app/message/view/index/rubbish.html b/app/message/view/index/rubbish.html index 7804178..8f32b76 100644 --- a/app/message/view/index/rubbish.html +++ b/app/message/view/index/rubbish.html @@ -2,22 +2,25 @@ {block name="body"}
      -
      -
      - -
      -
      -
      - + {include file="index/msgmenu" /} +
      + +
      +
      - ~ -
      - +
      +
      + +
      + ~ +
      + +
      -
      - - -
      + + +
      +
      {/block} @@ -48,10 +48,15 @@ field: 'cate_title', title: '公告分类', align: 'center', - width: 136 + width: 136, + templet: function (d) { + var html = ''+d.cate_title+''; + return html; + } }, { field: 'title', - title: '公告标题' + title: '公告标题', + templet: '' }, { field: 'cate_title', title: '公告展示期间', @@ -71,7 +76,7 @@ field: 'right', title: '操作', toolbar: '#barDemo', - width: 136, + width: 110, align: 'center' } ] @@ -89,10 +94,6 @@ //监听行工具事件 table.on('tool(test)', function(obj) { var data = obj.data; - if (obj.event === 'view') { - tool.side("/note/index/view?id="+data.id); - return; - } if (obj.event === 'edit') { tool.side("/note/index/add?id="+data.id); return; diff --git a/app/note/view/index/note_cate.html b/app/note/view/index/note_cate.html index d03ed58..b3663e5 100644 --- a/app/note/view/index/note_cate.html +++ b/app/note/view/index/note_cate.html @@ -3,7 +3,7 @@ {block name="body"}
      - +
      @@ -37,7 +37,7 @@ ,{field:'title', title: '分类名称'} ,{field:'pid', title: '父级ID', width:80, align:'center'} ,{width:160,title: '操作', align:'center',templet: function(d){ - var html = ''; + var html = ''; return html; } } diff --git a/app/oa/common.php b/app/oa/common.php index e7d8c96..3a2e692 100644 --- a/app/oa/common.php +++ b/app/oa/common.php @@ -18,6 +18,13 @@ function oa_seal_cate() return $list; } +//读取会议室 +function oa_meeting_cate() +{ + $list = Db::name('MeetingCate')->where(['status' => 1])->select()->toArray(); + return $list; +} + //读取车辆类型 function oa_car_cate() { diff --git a/app/oa/controller/Approve.php b/app/oa/controller/Approve.php index 8c35115..2c37af7 100644 --- a/app/oa/controller/Approve.php +++ b/app/oa/controller/Approve.php @@ -31,12 +31,12 @@ class Approve extends BaseController $where[] = ['check_status','>',2]; } } - $where[] = ['create_admin_id','=',$this->uid]; + $where[] = ['admin_id','=',$this->uid]; $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $list = Db::name('Approve') ->field('f.*,a.name,d.title as department_name,t.title as flow_type') ->alias('f') - ->join('Admin a', 'a.id = f.create_admin_id', 'left') + ->join('Admin a', 'a.id = f.admin_id', 'left') ->join('Department d', 'd.id = f.department_id', 'left') ->join('FlowType t', 't.id = f.type', 'left') ->where($where) @@ -77,7 +77,7 @@ class Approve extends BaseController $list = Db::name('Approve') ->field('f.*,a.name,d.title as department_name,t.title as flow_type') ->alias('f') - ->join('Admin a', 'a.id = f.create_admin_id', 'left') + ->join('Admin a', 'a.id = f.admin_id', 'left') ->join('Department d', 'd.id = f.department_id', 'left') ->join('FlowType t', 't.id = f.type', 'left') ->whereOr([$map1,$map2]) @@ -99,7 +99,7 @@ class Approve extends BaseController $list = Db::name('Approve') ->field('f.*,a.name,d.title as department_name,t.title as flow_type') ->alias('f') - ->join('Admin a', 'a.id = f.create_admin_id', 'left') + ->join('Admin a', 'a.id = f.admin_id', 'left') ->join('Department d', 'd.id = f.department_id', 'left') ->join('FlowType t', 't.id = f.type', 'left') ->where($map1) @@ -120,7 +120,7 @@ class Approve extends BaseController $list = Db::name('Approve') ->field('f.*,a.name,d.title as department_name,t.title as flow_type') ->alias('f') - ->join('Admin a', 'a.id = f.create_admin_id', 'left') + ->join('Admin a', 'a.id = f.admin_id', 'left') ->join('Department d', 'd.id = f.department_id', 'left') ->join('FlowType t', 't.id = f.type', 'left') ->where($map2) @@ -156,7 +156,7 @@ class Approve extends BaseController $list = Db::name('Approve') ->field('f.*,a.name,d.title as department_name,t.title as flow_type') ->alias('f') - ->join('Admin a', 'a.id = f.create_admin_id', 'left') + ->join('Admin a', 'a.id = f.admin_id', 'left') ->join('Department d', 'd.id = f.department_id', 'left') ->join('FlowType t', 't.id = f.type', 'left') ->where($map) @@ -255,6 +255,15 @@ class Approve extends BaseController ); $res = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); } + //添加提交申请记录 + $checkData=array( + 'action_id' => $param['id'], + 'check_user_id' => $this->uid, + 'content' => '重新提交申请', + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); add_log('edit', $param['id'], $param); //发送消息通知 $msg=[ @@ -265,7 +274,7 @@ class Approve extends BaseController $users = $param['check_admin_ids']; sendMessage($users,21,$msg); } else { - $param['create_admin_id'] = $this->uid; + $param['admin_id'] = $this->uid; $param['department_id'] = $this->did; $param['create_time'] = time(); @@ -308,8 +317,17 @@ class Approve extends BaseController 'flow_uids' => $param['check_admin_ids'], 'create_time' => time() ); - $res = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); + $step_id = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); } + //添加提交申请记录 + $checkData=array( + 'action_id' => $aid, + 'check_user_id' => $this->uid, + 'content' => '提交申请', + 'check_time' => time(), + 'create_time' => time() + ); + $record_id = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); add_log('add', $aid, $param); //给审核人发送消息通知 $msg=[ @@ -343,7 +361,7 @@ class Approve extends BaseController } $department = $this->did; //获取审批流程 - $flows = get_flows($type,$department); + $flows = get_cate_department_flows($type,$department); $moban=Db::name('FlowType')->where('id',$type)->value('name'); $module = strtolower(app('http')->getName()); $class = strtolower(app('request')->controller()); @@ -357,7 +375,7 @@ class Approve extends BaseController if(isTemplate($template)){ return view('add_'.$moban); }else{ - return view('Base@common/errortemplate',['file' =>$template]); + return view('../../base/view/common/errortemplate',['file' =>$template]); } } } @@ -367,6 +385,7 @@ class Approve extends BaseController { $param = get_params(); $detail = Db::name('Approve')->where('id',$param['id'])->find(); + $check_record = []; if($detail['start_time']>0){ $detail['start_time'] = date('Y-m-d H:i',$detail['start_time']); } @@ -380,7 +399,7 @@ class Approve extends BaseController $detail['days'] = floor($detail['duration']*10/75); $detail['hours'] = (($detail['duration']*10)%75)/10; - $detail['create_user'] = Db::name('Admin')->where('id',$detail['create_admin_id'])->value('name'); + $detail['create_user'] = Db::name('Admin')->where('id',$detail['admin_id'])->value('name'); $flows = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>1,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); $detail['check_user'] = '-'; $detail['copy_user'] = '-'; @@ -411,7 +430,7 @@ class Approve extends BaseController $is_check_admin = 0; $is_create_admin = 0; - if($detail['create_admin_id'] == $this->uid){ + if($detail['admin_id'] == $this->uid){ $is_create_admin = 1; } if(in_array($this->uid,$check_user_ids)){ @@ -425,6 +444,25 @@ class Approve extends BaseController } } } + $check_record = Db::name('FlowRecord')->field('f.*,a.name,a.thumb') + ->alias('f') + ->join('Admin a', 'a.id = f.check_user_id', 'left') + ->where(['f.action_id'=>$detail['id'],'f.type'=>1]) + ->order('check_time desc') + ->select()->toArray(); + foreach ($check_record as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d :H:i', $vv['check_time']); + $vv['status_str'] = '提交'; + if($vv['status'] == 1){ + $vv['status_str'] = '审核通过'; + } + else if($vv['status'] == 2){ + $vv['status_str'] = '审核拒绝'; + } + if($vv['status'] == 3){ + $vv['status_str'] = '撤销'; + } + } $moban=Db::name('FlowType')->where('id',$detail['type'])->value('name'); $module = strtolower(app('http')->getName()); $class = strtolower(app('request')->controller()); @@ -432,198 +470,13 @@ class Approve extends BaseController $template = $module . '/view/'. $class .'/view_'.$moban.'.html'; View::assign('is_create_admin', $is_create_admin); View::assign('is_check_admin', $is_check_admin); + View::assign('check_record', $check_record); View::assign('detail', $detail); View::assign('flows', $flows); if(isTemplate($template)){ return view('view_'.$moban); }else{ - return view('Base@common/errortemplate',['file' =>$template]); + return view('../../base/view/common/errortemplate',['file' =>$template]); } } - - //审核 - public function check() - { - $param = get_params(); - $detail = Db::name('Approve')->where('id',$param['id'])->find(); - //当前审核节点详情 - $step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>1,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find(); - //审核通过 - if($param['status'] == 1){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //多人会签审批 - if($step['flow_type'] == 4){ - //查询当前会签记录数 - $check_count = Db::name('FlowRecord')->where(['action_id'=>$detail['id'],'type'=>1,'step_id'=>$step['id']])->count(); - //当前会签记应有记录数 - $param['check_admin_ids'] = $step['flow_uids']; - $flow_count = explode(',', $step['flow_uids']); - if(($check_count+1) >=count($flow_count)){ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>1,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - $param['check_admin_ids'] = $next_step['flow_uids']; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - else{ - $param['check_status'] = 1; - } - } - else if($step['flow_type'] == 0){ - //自由人审批 - if($param['check_node'] == 2){ - $next_step = $detail['check_step_sort']+1; - $flow_step = array( - 'action_id' => $detail['id'], - 'sort' => $next_step, - 'flow_uids' => $param['check_admin_ids'], - 'create_time' => time() - ); - $fid = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step); - //下一步审核步骤 - $param['check_step_sort'] = $next_step; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - else{ - $next_step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>1,'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find(); - if($next_step){ - //存在下一步审核 - if($next_step['flow_type'] == 1){ - $param['check_admin_ids'] = get_department_leader($this->uid); - } - else if($next_step['flow_type'] == 2){ - $param['check_admin_ids'] = get_department_leader($this->uid,1); - } - else{ - $param['check_admin_ids'] = $next_step['flow_uids']; - } - $param['check_step_sort'] = $detail['check_step_sort']+1; - $param['check_status'] = 1; - } - else{ - //不存在下一步审核,审核结束 - $param['check_status'] = 2; - $param['check_admin_ids'] =''; - } - } - if($param['check_status'] == 1 && $param['check_admin_ids']==''){ - return to_assign(1,'找不到下一步的审批人,该审批流程设置有问题,请联系HR或者管理员'); - } - //审核通过数据操作 - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('check', $param['id'], $param); - - //发送消息通知 - $msg=[ - 'from_uid'=>$detail['create_admin_id'], - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'title' => Db::name('FlowType')->where('id',$detail['type'])->value('title'), - 'action_id'=>$detail['id'] - ]; - if($param['check_status'] == 1){ - $users = $param['check_admin_ids']; - sendMessage($users,21,$msg); - } - if($param['check_status'] == 2){ - $users = $detail['create_admin_id']; - sendMessage($users,22,$msg); - } - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 2){ - $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); - if (!in_array($this->uid, $check_admin_ids)){ - return to_assign(1,'您没权限审核该审批'); - } - //拒绝审核,数据操作 - $param['check_status'] = 3; - $param['last_admin_id'] = $this->uid; - $param['flow_admin_ids'] = $detail['flow_admin_ids'].$this->uid.','; - $param['check_admin_ids'] =''; - $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => $step['id'], - 'check_user_id' => $this->uid, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('refue', $param['id'], $param); - //发送消息通知 - $msg=[ - 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']), - 'title' => Db::name('FlowType')->where('id',$detail['type'])->value('title'), - 'action_id'=>$detail['id'] - ]; - $users = $detail['create_admin_id']; - sendMessage($users,23,$msg); - return to_assign(); - } - else{ - return to_assign(1,'操作失败'); - } - } - else if($param['status'] == 3){ - if($detail['create_admin_id'] != $this->uid){ - return to_assign(1,'你没权限操作'); - } - //撤销审核,数据操作 - $param['check_status'] = 4; - $param['check_admin_ids'] =''; - $res = Db::name('Approve')->strict(false)->field('check_step_sort,check_status,last_admin_id,flow_admin_ids,check_admin_ids')->update($param); - if($res!==false){ - $checkData=array( - 'action_id' => $detail['id'], - 'step_id' => 0, - 'check_user_id' => $this->uid, - 'check_time' => time(), - 'status' => $param['status'], - 'content' => $param['content'], - 'create_time' => time() - ); - $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); - add_log('back', $param['id'], $param); - return to_assign(); - }else{ - return to_assign(1,'操作失败'); - } - } - } } diff --git a/app/oa/view/approve/add.html b/app/oa/view/approve/add.html deleted file mode 100644 index 339ce05..0000000 --- a/app/oa/view/approve/add.html +++ /dev/null @@ -1,486 +0,0 @@ -{extend name="../../base/view/common/base" /} -{block name="style"} - -{/block} - -{block name="body"} -
      -

      请假审批

      - {eq name="$id" value="0"} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      请假类型* - -
      开始时间* - - - - 结束时间* - - - - -
      请假工时-请假天数-
      请假事由* - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      - {else/} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      请假类型* - -
      开始时间* - - - - 结束时间* - - - - -
      请假工时共{$detail.duration}工时请假天数共{$detail.days}天,{$detail.hours}小时
      请假事由* - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      - {/eq} -
      - - - - -
      -
      -{/block} - - - -{block name="script"} - -{/block} - \ No newline at end of file diff --git a/app/oa/view/approve/add_caigou.html b/app/oa/view/approve/add_caigou.html index ad9864d..cfbe6a6 100644 --- a/app/oa/view/approve/add_caigou.html +++ b/app/oa/view/approve/add_caigou.html @@ -42,29 +42,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -116,37 +93,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -154,73 +103,16 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_chuchai.html b/app/oa/view/approve/add_chuchai.html index 2a23060..3f85174 100644 --- a/app/oa/view/approve/add_chuchai.html +++ b/app/oa/view/approve/add_chuchai.html @@ -93,29 +93,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -218,37 +195,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -256,28 +205,10 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_flow.html b/app/oa/view/approve/add_flow.html new file mode 100644 index 0000000..0b18d41 --- /dev/null +++ b/app/oa/view/approve/add_flow.html @@ -0,0 +1,230 @@ + + + + + + + + + + + + + +
      选择审批流程* + +
      审核人* + +
      抄送人 + +
      +
      + + + + +
      + diff --git a/app/oa/view/approve/add_fukuan.html b/app/oa/view/approve/add_fukuan.html index dc1bc27..5f01213 100644 --- a/app/oa/view/approve/add_fukuan.html +++ b/app/oa/view/approve/add_fukuan.html @@ -59,29 +59,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -150,37 +127,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -188,186 +137,23 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_gongwen.html b/app/oa/view/approve/add_gongwen.html index 7409168..c88168a 100644 --- a/app/oa/view/approve/add_gongwen.html +++ b/app/oa/view/approve/add_gongwen.html @@ -40,29 +40,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -97,37 +74,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -135,10 +84,12 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_huiyishi.html b/app/oa/view/approve/add_huiyishi.html index 9382fe3..7ff7478 100644 --- a/app/oa/view/approve/add_huiyishi.html +++ b/app/oa/view/approve/add_huiyishi.html @@ -9,6 +9,15 @@ {eq name="$id" value="0"} + + - - - - - - - - - - - - - - - - -
      会议室选择* + + 开始时间* @@ -75,43 +84,25 @@
      会议室名称*
      备注 +
      审批流程* - -
      审核人* - -
      抄送人 - -
      {else/} + + - - - - - - - - - - - - - - - - -
      会议室选择* + + 开始时间* @@ -178,47 +169,15 @@
      会议室名称*
      备注 +
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -226,10 +185,12 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_huodong.html b/app/oa/view/approve/add_huodong.html index dce5172..2409357 100644 --- a/app/oa/view/approve/add_huodong.html +++ b/app/oa/view/approve/add_huodong.html @@ -101,29 +101,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -234,37 +211,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -272,74 +221,15 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_jiaban.html b/app/oa/view/approve/add_jiaban.html index ea79d29..eb81e00 100644 --- a/app/oa/view/approve/add_jiaban.html +++ b/app/oa/view/approve/add_jiaban.html @@ -131,29 +131,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -280,37 +257,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -343,9 +292,13 @@ function leaveTime() { } -const moduleInit = ['tool','formSelects','employeepicker']; +const moduleInit = ['tool','employeepicker']; function gouguInit() { - var form = layui.form,tool=layui.tool, formSelects = layui.formSelects, employeepicker = layui.employeepicker,laydate = layui.laydate; + var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate; + + if (typeof (flowStep) == "function") { + flowStep(); + } //日期时间范围 laydate.render({ elem: '#start_time_a', @@ -392,111 +345,6 @@ const moduleInit = ['tool','formSelects','employeepicker']; } $('[name="duration"]').val(hours); }); - - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ - if($('[name="flow_id"]').val()==''){ - layer.msg('请先选择审批流程'); - return false; - } - employeepicker.init({ - department_url: "/api/index/get_department_tree", - employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); - } - }); - }) - - //监听提交 - form.on('submit(webform)', function(data){ - console.log(data.field); - //return false; - $.ajax({ - url: "/oa/approve/add", - type:'post', - data:data.field, - success: function (e) { - layer.msg(e.msg); - if (e.code == 0) { - parent.layui.tool.close(1000); - } - } - }) - return false; - }); - - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, - }); - - form.on('select(flowtype)', function(data){ - var check_type = data.elem[data.elem.selectedIndex].title; - var formHtml='审核人*\ - \ - \ - '; - if(check_type == 2){ - $('#flow_tr').html(formHtml); - form.render(); - } - if(data.value==''){ - return false; - } - $.ajax({ - url: "/api/index/get_flow_users", - type:'get', - data:{id:data.value}, - success: function (e) { - if (e.code == 0) { - var flowLi=''; - var flow_data = e.data.flow_data; - if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); - } - if(check_type == 1){ - for(var a=0;a'+flow_data[a].user_id_info[b].name+''; - } - } - flowLi+='
    • \ - \ -
      \ -

      第'+(a+1)+'级审批'+sign_type+'

      \ -
        '+userList+'
      \ -
      \ -
    • '; - } - formHtml = '审批流程\ - \ -
        '+flowLi+'
      \ - '; - $('#flow_tr').html(formHtml); - } - } - } - }) - }); } {/block} diff --git a/app/oa/view/approve/add_jiangli.html b/app/oa/view/approve/add_jiangli.html index 0101885..ab7ec73 100644 --- a/app/oa/view/approve/add_jiangli.html +++ b/app/oa/view/approve/add_jiangli.html @@ -36,29 +36,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -104,37 +81,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -142,73 +91,16 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_jiekuan.html b/app/oa/view/approve/add_jiekuan.html index 4aafacb..caaeac5 100644 --- a/app/oa/view/approve/add_jiekuan.html +++ b/app/oa/view/approve/add_jiekuan.html @@ -47,29 +47,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -112,37 +89,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -150,10 +99,12 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_lizhi.html b/app/oa/view/approve/add_lizhi.html index 1a165be..7902e8c 100644 --- a/app/oa/view/approve/add_lizhi.html +++ b/app/oa/view/approve/add_lizhi.html @@ -58,29 +58,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -148,37 +125,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -186,73 +135,15 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_qingjia.html b/app/oa/view/approve/add_qingjia.html index 2cc94b7..fefab81 100644 --- a/app/oa/view/approve/add_qingjia.html +++ b/app/oa/view/approve/add_qingjia.html @@ -100,29 +100,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -232,37 +209,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -334,31 +283,16 @@ function leaveTime() { return hour; } -// 查找指定的元素在数组中的位置 -Array.prototype.indexOf = function (val) { - for (var i = 0; i < this.length; i++) { - if (this[i] == val) { - return i; - } - } - return -1; -}; -// 通过索引删除数组元素 -Array.prototype.remove = function (val) { - var index = this.indexOf(val); - if (index > -1) { - this.splice(index, 1); - } -}; - -const moduleInit = ['tool','formSelects','employeepicker']; +const moduleInit = ['tool','employeepicker']; function gouguInit() { var form = layui.form, - upload = layui.upload, tool=layui.tool, - formSelects = layui.formSelects, - employeepicker = layui.employeepicker, - laydate = layui.laydate; + laydate = layui.laydate; + + if (typeof (flowStep) == "function") { + flowStep(); + } + //日期时间范围 laydate.render({ elem: '#start_time_a', @@ -382,47 +316,6 @@ const moduleInit = ['tool','formSelects','employeepicker']; } }); - //多附件上传 - upload.render({ - elem: '#upFile' - ,url: "/api/index/upload" - ,multiple: true - ,accept: 'file' //普通文件 - ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 - ,done: function(res){ - layer.msg(res.msg); - if (res.code == 0) { - //上传成功 - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.push(res.data.id); - $('#fileList input').attr('value', idsArray.join(',')); - let temp = `
      -
      - -
      ${res.data.name}
      -
      - - -
      -
      -
      `; - $('#fileList').append(temp); - } - } - }); - $('#fileList').on('click', '.btn-delete', function () { - var _id = $(this).data('id'); - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.remove(_id); - $('#fileList input').attr('value', idsArray.join(',')); - $('#uploadImg' + _id).remove(); - }) //日期时间范围 laydate.render({ @@ -462,110 +355,6 @@ const moduleInit = ['tool','formSelects','employeepicker']; } $('[name="duration"]').val(hours/10); }); - - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ - if($('[name="flow_id"]').val()==''){ - layer.msg('请先选择审批流程'); - return false; - } - employeepicker.init({ - department_url: "/api/index/get_department_tree", - employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); - } - }); - }) - //监听提交 - form.on('submit(webform)', function(data){ - console.log(data.field); - //return false; - $.ajax({ - url: "/oa/approve/add", - type:'post', - data:data.field, - success: function (e) { - layer.msg(e.msg); - if (e.code == 0) { - parent.layui.tool.close(1000); - } - } - }) - return false; - }); - - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, - }); - - form.on('select(flowtype)', function(data){ - var check_type = data.elem[data.elem.selectedIndex].title; - var formHtml='审核人*\ - \ - \ - '; - if(check_type == 2){ - $('#flow_tr').html(formHtml); - form.render(); - } - if(data.value==''){ - return false; - } - $.ajax({ - url: "/api/index/get_flow_users", - type:'get', - data:{id:data.value}, - success: function (e) { - if (e.code == 0) { - var flowLi=''; - var flow_data = e.data.flow_data; - if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); - } - if(check_type == 1){ - for(var a=0;a'+flow_data[a].user_id_info[b].name+''; - } - } - flowLi+='
    • \ - \ -
      \ -

      第'+(a+1)+'级审批'+sign_type+'

      \ -
        '+userList+'
      \ -
      \ -
    • '; - } - formHtml = '审批流程\ - \ -
        '+flowLi+'
      \ - '; - $('#flow_tr').html(formHtml); - } - } - } - }) - }); } {/block} diff --git a/app/oa/view/approve/add_ruzhi.html b/app/oa/view/approve/add_ruzhi.html index bfda987..20f8989 100644 --- a/app/oa/view/approve/add_ruzhi.html +++ b/app/oa/view/approve/add_ruzhi.html @@ -51,29 +51,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -120,37 +97,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -158,121 +107,20 @@ {block name="script"} {/block} \ No newline at end of file diff --git a/app/oa/view/approve/add_tongyong.html b/app/oa/view/approve/add_tongyong.html index 081113d..e125083 100644 --- a/app/oa/view/approve/add_tongyong.html +++ b/app/oa/view/approve/add_tongyong.html @@ -35,29 +35,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -102,37 +79,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -140,176 +89,12 @@ {block name="script"} {/block} \ No newline at end of file diff --git a/app/oa/view/approve/add_waichu.html b/app/oa/view/approve/add_waichu.html index c960562..d9828b4 100644 --- a/app/oa/view/approve/add_waichu.html +++ b/app/oa/view/approve/add_waichu.html @@ -87,29 +87,6 @@
      - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -206,37 +183,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -308,31 +257,15 @@ function leaveTime() { return hour; } -// 查找指定的元素在数组中的位置 -Array.prototype.indexOf = function (val) { - for (var i = 0; i < this.length; i++) { - if (this[i] == val) { - return i; - } - } - return -1; -}; -// 通过索引删除数组元素 -Array.prototype.remove = function (val) { - var index = this.indexOf(val); - if (index > -1) { - this.splice(index, 1); - } -}; - -const moduleInit = ['tool','formSelects','employeepicker']; +const moduleInit = ['tool','employeepicker']; function gouguInit() { var form = layui.form, - upload = layui.upload, tool=layui.tool, - formSelects = layui.formSelects, - employeepicker = layui.employeepicker, - laydate = layui.laydate; + laydate = layui.laydate; + + if (typeof (flowStep) == "function") { + flowStep(); + } //日期时间范围 laydate.render({ elem: '#start_time_a', @@ -377,168 +310,7 @@ const moduleInit = ['tool','formSelects','employeepicker']; } $('[name="duration"]').val(hours/10); } - }); - - form.on('select(time_b)', function(data){ - var hours = leaveTime(); - if(hours == 0){ - $('#hours,#days').html('-'); - } - else{ - $('#hours').html('共'+hours/10+'小时'); - var days = 0; - if(hours>=75){ - days = parseInt(hours/75); - } - $('#days').html('共'+days+'天,'+(hours%75)/10+'小时'); - } - $('[name="duration"]').val(hours/10); - }); - - //多附件上传 - upload.render({ - elem: '#upFile' - ,url: "/api/index/upload" - ,multiple: true - ,accept: 'file' //普通文件 - ,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式 - ,done: function(res){ - layer.msg(res.msg); - if (res.code == 0) { - //上传成功 - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.push(res.data.id); - $('#fileList input').attr('value', idsArray.join(',')); - let temp = `
      -
      - -
      ${res.data.name}
      -
      - - -
      -
      -
      `; - $('#fileList').append(temp); - } - } - }); - $('#fileList').on('click', '.btn-delete', function () { - var _id = $(this).data('id'); - var idsStr = $('#fileList input').val(),idsArray = []; - if (idsStr != '') { - idsArray = idsStr.split(","); - } - idsArray.remove(_id); - $('#fileList input').attr('value', idsArray.join(',')); - $('#uploadImg' + _id).remove(); - }) - - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ - if($('[name="flow_id"]').val()==''){ - layer.msg('请先选择审批流程'); - return false; - } - employeepicker.init({ - department_url: "/api/index/get_department_tree", - employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); - } - }); - }) - - //监听提交 - form.on('submit(webform)', function(data){ - $.ajax({ - url: "/oa/approve/add", - type:'post', - data:data.field, - success: function (e) { - layer.msg(e.msg); - if (e.code == 0) { - parent.layui.tool.close(1000); - } - } - }) - return false; - }); - - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, - }); - - form.on('select(flowtype)', function(data){ - var check_type = data.elem[data.elem.selectedIndex].title; - var formHtml='审核人*\ - \ - \ - '; - if(check_type == 2){ - $('#flow_tr').html(formHtml); - form.render(); - } - if(data.value==''){ - return false; - } - $.ajax({ - url: "/api/index/get_flow_users", - type:'get', - data:{id:data.value}, - success: function (e) { - if (e.code == 0) { - var flowLi=''; - var flow_data = e.data.flow_data; - if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); - } - if(check_type == 1){ - for(var a=0;a'+flow_data[a].user_id_info[b].name+''; - } - } - flowLi+='
    • \ - \ -
      \ -

      第'+(a+1)+'级审批'+sign_type+'

      \ -
        '+userList+'
      \ -
      \ -
    • '; - } - formHtml = '审批流程\ - \ -
        '+flowLi+'
      \ - '; - $('#flow_tr').html(formHtml); - } - } - } - }) - }); + }); } {/block} diff --git a/app/oa/view/approve/add_weixiu.html b/app/oa/view/approve/add_weixiu.html index f61f3b1..de4db4a 100644 --- a/app/oa/view/approve/add_weixiu.html +++ b/app/oa/view/approve/add_weixiu.html @@ -43,29 +43,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -118,37 +95,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -156,31 +105,15 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_yongche.html b/app/oa/view/approve/add_yongche.html index 3c07c65..64afa4c 100644 --- a/app/oa/view/approve/add_yongche.html +++ b/app/oa/view/approve/add_yongche.html @@ -144,29 +144,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -306,37 +283,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -368,10 +317,12 @@ function leaveTime() { return hours; } -const moduleInit = ['tool','formSelects','employeepicker']; +const moduleInit = ['tool','employeepicker']; function gouguInit() { - var form = layui.form,tool=layui.tool, formSelects = layui.formSelects, employeepicker = layui.employeepicker,laydate = layui.laydate; - + var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate; + if (typeof (flowStep) == "function") { + flowStep(); + } //日期时间范围 laydate.render({ elem: '#start_time_a', @@ -419,108 +370,7 @@ const moduleInit = ['tool','formSelects','employeepicker']; $('[name="duration"]').val(hours); }); - //选择人员 - $('.layui-form').on('click','[name="check_admin_name"]',function(){ - if($('[name="flow_id"]').val()==''){ - layer.msg('请先选择审批流程'); - return false; - } - employeepicker.init({ - department_url: "/api/index/get_department_tree", - employee_url: "/api/index/get_employee", - type:0, - callback:function(ids,names){ - $('[name="check_admin_ids"]').val(ids), - $('[name="check_admin_name"]').val(names); - } - }); - }) - - //监听提交 - form.on('submit(webform)', function(data){ - $.ajax({ - url: "/oa/approve/add", - type:'post', - data:data.field, - success: function (e) { - layer.msg(e.msg); - if (e.code == 0) { - parent.layui.tool.close(1000); - } - } - }) - return false; - }); - //选择抄送人员 - var copy_uids = $('#copy_uids').attr('xm-selected'); - formSelects.data('selectcopy', 'server', { - url: '/api/index/get_employee_select', - keyword: copy_uids, - }); - - form.on('select(flowtype)', function(data){ - var check_type = data.elem[data.elem.selectedIndex].title; - var formHtml='审核人*\ - \ - \ - '; - if(check_type == 2){ - $('#flow_tr').html(formHtml); - form.render(); - } - if(data.value==''){ - return false; - } - $.ajax({ - url: "/api/index/get_flow_users", - type:'get', - data:{id:data.value}, - success: function (e) { - if (e.code == 0) { - var flowLi=''; - var flow_data = e.data.flow_data; - if(e.data.copy_uids && e.data.copy_uids !=''){ - formSelects.value('selectcopy', e.data.copy_uids.split(',')); - } - if(check_type == 1){ - for(var a=0;a'+flow_data[a].user_id_info[b].name+''; - } - } - flowLi+='
    • \ - \ -
      \ -

      第'+(a+1)+'级审批'+sign_type+'

      \ -
        '+userList+'
      \ -
      \ -
    • '; - } - formHtml = '审批流程\ - \ -
        '+flowLi+'
      \ - '; - $('#flow_tr').html(formHtml); - } - } - } - }) - }); } {/block} diff --git a/app/oa/view/approve/add_yongcheguihai.html b/app/oa/view/approve/add_yongcheguihai.html index bc8703e..2afe972 100644 --- a/app/oa/view/approve/add_yongcheguihai.html +++ b/app/oa/view/approve/add_yongcheguihai.html @@ -35,29 +35,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -88,37 +65,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -126,120 +75,19 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_yongzhang.html b/app/oa/view/approve/add_yongzhang.html index 9a33953..9e6c0de 100644 --- a/app/oa/view/approve/add_yongzhang.html +++ b/app/oa/view/approve/add_yongzhang.html @@ -59,29 +59,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -150,37 +127,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -188,32 +137,15 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_zhaopin.html b/app/oa/view/approve/add_zhaopin.html index a0fc3fc..cb712db 100644 --- a/app/oa/view/approve/add_zhaopin.html +++ b/app/oa/view/approve/add_zhaopin.html @@ -58,29 +58,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -148,37 +125,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -186,73 +135,15 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_zhuangang.html b/app/oa/view/approve/add_zhuangang.html index 0ab45d0..b571866 100644 --- a/app/oa/view/approve/add_zhuangang.html +++ b/app/oa/view/approve/add_zhuangang.html @@ -78,29 +78,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -188,37 +165,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -226,73 +175,14 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/add_zhuanzheng.html b/app/oa/view/approve/add_zhuanzheng.html index d82adda..96690c3 100644 --- a/app/oa/view/approve/add_zhuanzheng.html +++ b/app/oa/view/approve/add_zhuanzheng.html @@ -50,29 +50,6 @@ - - 审批流程* - - - - - - 审核人* - - - - - - 抄送人 - - - - {else/} @@ -132,37 +109,9 @@ - - - - - - - - - - - -
      审批流程* - -
      审核人* - -
      抄送人 - -
      {/eq} -
      - - - - -
      + {include file="/approve/add_flow" /} {/block} @@ -170,32 +119,16 @@ {block name="script"} {/block} diff --git a/app/oa/view/approve/index.html b/app/oa/view/approve/index.html index fb86f7f..9edfe6c 100644 --- a/app/oa/view/approve/index.html +++ b/app/oa/view/approve/index.html @@ -1,11 +1,12 @@ {extend name="../../base/view/common/base" /} {block name="style"} diff --git a/app/oa/view/approve/view_huiyishi.html b/app/oa/view/approve/view_huiyishi.html index 049ec13..296a9fa 100644 --- a/app/oa/view/approve/view_huiyishi.html +++ b/app/oa/view/approve/view_huiyishi.html @@ -8,8 +8,12 @@

      会议室预定审批

      - - + + diff --git a/app/oa/view/approve/view_script.html b/app/oa/view/approve/view_script.html index 7e52265..4c465bb 100644 --- a/app/oa/view/approve/view_script.html +++ b/app/oa/view/approve/view_script.html @@ -8,150 +8,113 @@ const moduleInit = ['tool','employeepicker']; type:'get', data:{id:$('[name="id"]').val()}, success: function (e) { - if (e.code == 0) { - console.log(e); - let flowHtml='',list = e.data,record_list=''; - for(var f=0;f0){ - if(list[f].check_list[0].status == 1){ - iconStatus =''; - strStatus ='
      通过
      '; + if (e.code == 0) { + let flowHtml='',list = e.data,record_list='',sort = $('[name="check_step_sort"]').val(); + for(var f=0;f0){ + if(list[f].check_list[0].status == 1){ + iconStatus =''; + strStatus ='
      通过
      '; + } + else if(list[f].check_list[0].status == 2){ + iconStatus =''; + strStatus ='
      拒绝
      '; + } } - else if(list[f].check_list[0].status == 2){ + } + else if(list[f].flow_type == 0 ){ + checkUser=list[f].user_id_info[0].name; + if(list[f].check_list.length>0){ iconStatus =''; strStatus ='
      拒绝
      '; - } - } - } - else if(list[f].flow_type == 0 ){ - checkUser=list[f].user_id_info[0].name; - if(list[f].check_list.length>0){ - iconStatus =''; - strStatus ='
      拒绝
      '; - for(var m=0;m0){ + else if(list[f].flow_type == 3 ){ + checkUser='多人或签'; + if(list[f].user_id_info.length>0){ + iconStatus =''; + strStatus ='
      待审核
      '; + for(var m=0;m0){ + iconStatus =''; + strStatus ='
      通过
      '; + for(var m=0;m0){ + iconStatus =''; + strStatus ='
      通过
      '; + for(var m=0;m'+iconStatus+'\ +
      '+checkUser+'
      '+strStatus+iconRight+'\ + '; } - else if(list[f].flow_type == 4){ - checkUser='多人会签'; - if(list[f].user_id_info.length>0){ - iconStatus =''; - strStatus ='
      通过
      '; - for(var m=0;m'+iconStatus+'\ -
      '+checkUser+'
      '+strStatus+iconRight+'\ - '; - - //审批历史数据 - var sign_type = '',user_check_list=''; - if(list[f].check_list.length>0){ - if(list[f].flow_type==3){ - sign_type= ' 或签' - } - if(list[f].flow_type==4){ - sign_type= ' 会签' - } - for(var b=0;b'+list[f].check_list[b].name+''+list[f].check_list[b].check_time_str+status_str+'
      '+list[f].check_list[b].content+'
      '; - } - - record_list+='
    • \ - \ -
      \ -

      第'+(f+1)+'级'+sign_type+'

      \ -
        '+user_check_list+'
      \ -
      \ -
    • '; - } + $('#flowList').append(flowHtml); } - - $('#flowList').append(flowHtml); - if(record_list == ''){ - record_list='
      无审批记录
      '; - } - dropdown.render({ - elem: '#showRecord' - ,trigger: 'click' - ,content: ['
      ' - ,'
        '+record_list+'
      ' - ,'
      '].join('') - }); - - for(var f=0;f待审核此申请'; - } - else if(list[f].user_id_info[a].status==1){ - user_list+='
    • '+list[f].user_id_info[a].check_time+'
           '+list[f].user_id_info[a].name+'已通过此申请
    • '; - }else if(list[f].user_id_info[a].status==2){ - user_list+='
    • '+list[f].user_id_info[a].check_time+'
           '+list[f].user_id_info[a].name+'已拒绝此申请
    • '; - } - } - dropdown.render({ - elem: '#flow'+f - ,trigger: 'hover' - ,content: ['
      ' - ,'
        '+user_list+'
      ' - ,'
      '].join('') - }); - } - } } - } - }) + }) //选择人员 $('.layui-form').on('click','[name="check_admin_name"]',function(){ @@ -199,19 +162,20 @@ const moduleInit = ['tool','employeepicker']; } layer.confirm(confirmTips, function(index){ $.ajax({ - url: "/oa/approve/check", + url: "/api/index/flow_check", type:'post', data:{ id:id, + type:1, check_node:check_node, check_admin_ids:check_admin_ids, - status:check_status, + check:check_status, content:content }, success: function (e) { layer.msg(e.msg); if (e.code == 0) { - parent.layui.tool.close(1000); + tool.sideClose(1000); } } }) @@ -229,17 +193,18 @@ const moduleInit = ['tool','employeepicker']; return false; } $.ajax({ - url: "/oa/approve/check", + url: "/api/index/flow_check", type:'post', data:{ id:id, - status:check_status, + type:1, + check:check_status, content:value }, success: function (e) { layer.msg(e.msg); if (e.code == 0) { - parent.layui.tool.close(1000); + tool.sideClose(1000); } } }) diff --git a/app/oa/view/approve/view_step.html b/app/oa/view/approve/view_step.html index f599cc1..2de8982 100644 --- a/app/oa/view/approve/view_step.html +++ b/app/oa/view/approve/view_step.html @@ -1,19 +1,16 @@ -
      会议室名称{$detail.name}会议室 + {volist name=":oa_meeting_cate()" id="vo"} + {eq name="$detail.detail_type" value="$vo.id"}{$vo.title}{/eq} + {/volist} +
      预定时间
      +
      - - + @@ -28,6 +25,21 @@ + {notempty name="$check_record"} + + + + + {/notempty} {if ( $detail.check_status lt 2) AND ( $is_check_admin eq 1) } {eq name="$flows.flow_type" value="0"} @@ -51,11 +63,12 @@
      审核状态{eq name="$detail.check_status" value="0"}待审批{/eq} - {eq name="$detail.check_status" value="1"}审批中{/eq} - {eq name="$detail.check_status" value="2"}已通过{/eq} - {eq name="$detail.check_status" value="3"}已拒绝{/eq} - {eq name="$detail.check_status" value="4"}已撤销{/eq} - 查看审批记录 + {eq name="$detail.check_status" value="0"}待审批{/eq} + {eq name="$detail.check_status" value="1"}审批中{/eq} + {eq name="$detail.check_status" value="2"}已通过{/eq} + {eq name="$detail.check_status" value="3"}已拒绝{/eq} + {eq name="$detail.check_status" value="4"}已撤销{/eq} 当前审核人 {$detail.check_user} 抄送人 - {$detail.copy_user} - {$detail.copy_user}
      审批流程
      审批记录 +
        + {volist name="$check_record" id="vo"} +
      • + +

        {$vo.check_time_str}{$vo.name}{$vo.status_str}了此申请。操作意见:{$vo.content}

        +
      • + {/volist} +
      +
      +
      {if ( $detail.check_status lt 2)} {eq name="$is_check_admin" value='1'} 通过 - 拒绝 + {$flows.flow_type == 5?'回退':'拒绝'} {/eq} {eq name="$is_create_admin" value='1'} 撤回 diff --git a/app/oa/view/approve/view_style.html b/app/oa/view/approve/view_style.html index 5e4d4ea..21a524a 100644 --- a/app/oa/view/approve/view_style.html +++ b/app/oa/view/approve/view_style.html @@ -5,41 +5,7 @@ .layui-form-item .layui-btn-danger{display:none; margin-top:-8px} .layui-form-item:hover .layui-btn-danger{display:inline-block;} .select-1,.select-2{display:none;} -.check-items{overflow-x: auto; padding: 10px 0;} -.flow-flex-row {box-direction: row; - box-orient: horizontal; - -webkit-box-orient: horizontal; - -ms-flex-direction: row; - flex-direction: row; -} -.flow-flexbox { width: 100%;text-align: left; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - display: -webkit-flex; - box-align: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} -.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0;} -.check-item i{font-size:20px; margin-right:3px; color:#4285f4;} -.check-item span{color:#999;margin:0 3px;} -.layui-icon[data-ok]{color:#34a853} -.layui-icon[data-no]{color:#FF5722;} -.check-item-status{color:#999; font-size:12px; margin-left:3px;} -.flow-tips{padding:6px 10px;} -.flow-tips li{padding:5px 0;} -.flow-tips li i{color:#4285f4;} -.flow-tips li span{color:#999; font-size:12px; margin-left:4px;} - -.flow-record{padding:10px 10px 0;} -.flow-record .layui-icon {font-size:20px;} -.flow-record .layui-timeline-item{padding-bottom:10px;} -.layui-timeline-content ul{font-size:12px;} -.check-status{color:#999; margin-left:5px;} -.check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;} .file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding:8px 0; margin:4px 8px 4px 0; -webkit-box-align: center; -ms-flex-align: center; @@ -55,4 +21,60 @@ -webkit-box-orient: vertical;width: calc(100% - 80px); } .file-card .file-tool .layui-icon{font-size:22px; padding:2px; cursor:pointer;} + +.log-timeline{ position: relative; min-height:600px; padding-left: 48px; background-color:#fff;} +.log-timeline:after {content: ""; position: absolute; top: 0; left: 24px; width: 1px; height: 100%; background: #e3e9ed;} +.log-timeline dl{padding-bottom: 8px; position: relative;} +.log-timeline dt{font-size: 16px; line-height: 2.4; color: #323232; font-weight:600} +.log-timeline dd{font-size: 14px; line-height: 1.6; padding:5px 0} +.log-timeline .date-second-point{width: 10px; height: 10px; display: block; border-radius: 50%; border: 3px solid #FBBC05; background: #fff; position: absolute; z-index: 99; left:-32px; top:9px} +.log-timeline .log-thumb{width: 24px; height: 24px; border-radius: 50%; margin-right:4px;} +.log-timeline .open-a{margin:0 4px;} +.log-item i{font-weight:800; color:#323232} +.log-content strong{margin:0 4px; color:#323232} + +.check-items{overflow-x: auto; padding: 2px 0;} +.flow-flex-row {box-direction: row; + box-orient: horizontal; + -webkit-box-orient: horizontal; + -ms-flex-direction: row; + flex-direction: row; +} +.flow-flexbox { width: 100%;text-align: left; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + display: -webkit-flex; + box-align: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + flex-wrap: wrap; +} + +.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0; padding:4px 0} +.check-item i{ margin-right:3px; color:#646464;} +.check-item span{color:#999;margin:0 3px;} +.check-item .layui-icon {font-size:20px;} +.check-item .layui-icon.layui-icon-right{font-size:12px;} +.layui-icon[data-ok]{color:#34a853} +.layui-icon[data-no]{color:#FF5722;} +.check-item-status{color:#999; font-size:12px; margin-left:3px;} + +.flow-tips{padding:6px 10px;} +.flow-tips li{padding:5px 0;} +.flow-tips li i{color:#4285f4;} +.flow-tips li span{color:#999; font-size:12px; margin-left:4px;} + +.flow-record{padding:4px 4px 0;} +.flow-record .layui-timeline-item{text-decoration:line-through; color:#acacac; padding-bottom:10px;} +.flow-record .layui-timeline-item.delete-0{text-decoration:none; color:#323232;} +.layui-timeline-content ul{font-size:12px;} +.check-status{color:#999; margin-left:5px;} +.check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;} +.check-record{line-height:1.5; padding:4px 0} +.flow-this{font-weight:800;} +.flow-this i{color:#4285f4} +.layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;} +.layui-table-min td{font-size:13px; padding:6px;text-align:center;} \ No newline at end of file diff --git a/app/oa/view/plan/index.html b/app/oa/view/plan/index.html index 329732d..bf1ce50 100644 --- a/app/oa/view/plan/index.html +++ b/app/oa/view/plan/index.html @@ -24,7 +24,7 @@
      - +
      @@ -32,7 +32,7 @@
      {/block} diff --git a/app/oa/view/schedule/index.html b/app/oa/view/schedule/index.html index 5e77bde..932090c 100644 --- a/app/oa/view/schedule/index.html +++ b/app/oa/view/schedule/index.html @@ -24,7 +24,7 @@
      - +
      @@ -32,7 +32,7 @@
      {/block} diff --git a/app/oa/view/work/index.html b/app/oa/view/work/index.html index 5ac12f0..cb56544 100644 --- a/app/oa/view/work/index.html +++ b/app/oa/view/work/index.html @@ -76,7 +76,7 @@ diff --git a/app/project/controller/Api.php b/app/project/controller/Api.php index a2d15f8..d091a5f 100644 --- a/app/project/controller/Api.php +++ b/app/project/controller/Api.php @@ -9,6 +9,7 @@ namespace app\project\controller; use app\api\BaseController; use app\oa\model\Schedule as ScheduleList; +use app\project\model\Project as ProjectList; use app\project\model\ProjectLog; use app\project\model\ProjectComment; use think\facade\Db; @@ -59,8 +60,8 @@ class Api extends BaseController if ($schedules) { $date_schedules = hour_count($schedules); } - $res['task_pie'] = $task_pie; + $res['bug_status'] = $bug_status; $res['date_tasks'] = $date_tasks; $res['date_tasks_ok'] = $date_tasks_ok; $res['date_schedules'] = $date_schedules; @@ -117,6 +118,79 @@ class Api extends BaseController } } + //链接添加修改 + public function add_link() + { + $param = get_params(); + $validate = \think\facade\Validate::rule([ + 'url' => 'url', + ]); + if (!$validate->check($param)) { + return to_assign(1, $validate->getError()); + } + if (!empty($param['id']) && $param['id'] > 0) { + $param['update_time'] = time(); + $res = Db::name('ProjectLink')->where('id', $param['id'])->strict(false)->field(true)->update($param); + if ($res) { + $log_data = array( + 'module' => $param['module'], + 'field' => 'link', + 'action' => 'edit', + $param['module'] . '_id' => $param['topic_id'], + 'admin_id' => $this->uid, + 'old_content' => $param['url'], + 'new_content' => $param['desc'], + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, '编辑成功'); + } + } else { + $param['create_time'] = time(); + $param['admin_id'] = $this->uid; + $lid = Db::name('ProjectLink')->strict(false)->field(true)->insertGetId($param); + if ($lid) { + $log_data = array( + 'module' => $param['module'], + 'field' => 'link', + 'action' => 'add', + $param['module'] . '_id' => $param['topic_id'], + 'admin_id' => $this->uid, + 'new_content' => $param['desc'], + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, '添加成功', $lid); + } + } + } + + //删除 + public function delete_link() + { + if (request()->isDelete()) { + $id = get_params("id"); + $detail = Db::name('ProjectLink')->where('id', $id)->find(); + if (Db::name('ProjectLink')->where('id', $id)->update(['delete_time' => time()]) !== false) { + $log_data = array( + 'module' => $detail['module'], + 'field' => 'link', + 'action' => 'delete', + $detail['module'] . '_id' => $detail['topic_id'], + 'admin_id' => $this->uid, + 'new_content' => $detail['desc'], + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, "删除成功"); + } else { + return to_assign(0, "删除失败"); + } + } else { + return to_assign(1, "错误的请求"); + } + } + //工作记录列表 public function schedule() { @@ -416,7 +490,7 @@ class Api extends BaseController unset($param['padmin_id']); $res = ProjectComment::where(['admin_id' => $this->uid,'id'=>$param['id']])->strict(false)->field(true)->update($param); if ($res) { - add_log('edit', $param['id'], $param); + add_log('edit', $param['id'], $param,'评论'); return to_assign(); } } else { @@ -424,7 +498,7 @@ class Api extends BaseController $param['admin_id'] = $this->uid; $cid = ProjectComment::strict(false)->field(true)->insertGetId($param); if ($cid) { - add_log('add', $cid, $param); + add_log('add', $cid, $param,'评论'); return to_assign(); } } @@ -437,7 +511,7 @@ class Api extends BaseController $id = get_params("id"); $res = ProjectComment::where('id',$id)->strict(false)->field(true)->update(['delete_time'=>time()]); if ($res) { - add_log('delete', $id); + add_log('delete', $id,[],'评论'); return to_assign(0, "删除成功"); } else { return to_assign(1, "删除失败"); @@ -448,14 +522,153 @@ class Api extends BaseController } //获取项目列表 - public function get_project($pid = 0) + public function get_project() { $where = []; $where[] = ['delete_time', '=', 0]; - if ($pid > 0) { - $where[] = ['product_id', '=', $pid]; - } $project = Db::name('Project')->field('id,name as title')->where($where)->select(); return to_assign(0, '', $project); } + + //编辑阶段 + public function reset_check() + { + $param = get_params(); + $id = isset($param['id']) ? $param['id'] : 0; + $detail = (new ProjectList())->detail($id); + if (request()->isPost()) { + if ($this->uid == $detail['admin_id'] || $this->uid == $detail['director_uid']) { + $flowNameData = isset($param['flowName']) ? $param['flowName'] : ''; + $flowUidsData = isset($param['chargeIds']) ? $param['chargeIds'] : ''; + $flowIdsData = isset($param['membeIds']) ? $param['membeIds'] : ''; + $flowDateData = isset($param['cycleDate']) ? $param['cycleDate'] : ''; + $flow = []; + $time_1 = $detail['start_time']; + $time_2 = $detail['end_time']; + foreach ($flowNameData as $key => $value) { + if (!$value) { + continue; + } + $flowDate = explode('到',$flowDateData[$key]); + $start_time = strtotime(urldecode(trim($flowDate[0]))); + $end_time = strtotime(urldecode(trim($flowDate[1]))); + if($start_time<$time_1){ + if($key == 0){ + return to_assign(1, '第'.($key+1).'阶段的开始时间不能小于计划开始时间'); + } + else{ + return to_assign(1, '第'.($key+1).'阶段的开始时间不能小于第'.($key).'阶段的结束时间'); + } + break; + } + if($end_time>$time_2){ + return to_assign(1, '第'.($key+1).'阶段的结束时间不能大于计划结束时间'); + break; + } + else{ + $time_1 = $end_time; + } + $item = []; + $item['action_id'] = $id; + $item['flow_name'] = $value; + $item['type'] = 2; + $item['flow_uid'] = $flowUidsData[$key]; + $item['flow_ids'] = $flowIdsData[$key]; + $item['sort'] = $key; + $item['start_time'] = $start_time; + $item['end_time'] = $end_time; + $item['create_time'] = time(); + $flow[]=$item; + } + //删除原来的阶段步骤 + Db::name('Step')->where(['action_id'=>$id,'type'=>2,'delete_time'=>0])->update(['delete_time'=>time()]); + Db::name('StepRecord')->where(['action_id'=>$id,'type'=>2,'delete_time'=>0])->update(['delete_time'=>time()]); + $res = Db::name('Step')->strict(false)->field(true)->insertAll($flow); + if ($res) { + $res = Db::name('Project')->where('id', $id)->strict(false)->field(true)->update(['step_sort'=>0,'update_time'=>time()]); + add_log('reset', $param['id'], $param,'项目阶段'); + } + return to_assign(); + } else { + return to_assign(1, '只有创建人或者负责人才有权限编辑'); + } + } + } + + //审核 + public function step_check() + { + $param = get_params(); + $detail = Db::name('Project')->where(['id' => $param['id']])->find(); + //当前审核节点详情 + $step = Db::name('Step')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>$detail['step_sort'],'delete_time'=>0])->find(); + if ($this->uid != $step['flow_uid']){ + return to_assign(1,'您没权限操作'); + } + //审核通过 + if($param['check'] == 1){ + $next_step = Db::name('Step')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>($detail['step_sort']+1),'delete_time'=>0])->find(); + if($next_step){ + $param['step_sort'] = $next_step['sort']; + $param['status'] = 2; + } + else{ + //不存在下一步审核,审核结束 + $param['status'] = 3; + $param['step_sort'] = $detail['step_sort']+1; + } + //审核通过数据操作 + $res = Db::name('Project')->strict(false)->field('step_sort,status')->update($param); + if($res!==false){ + $checkData=array( + 'action_id' => $detail['id'], + 'step_id' => $step['id'], + 'check_uid' => $this->uid, + 'type' => 2, + 'check_time' => time(), + 'status' => $param['check'], + 'create_time' => time() + ); + $aid = Db::name('StepRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('check', $param['id'], $param,'项目阶段'); + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } + //拒绝审核 + else if($param['check'] == 2){ + //获取上一步的审核信息 + $prev_step = Db::name('Step')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>($detail['step_sort']-1),'delete_time'=>0])->find(); + if($prev_step){ + //存在上一步审核 + $param['step_sort'] = $prev_step['sort']; + } + else{ + //不存在上一步审核,审核初始化步骤 + $param['step_sort'] = 0; + $param['status'] = 1; + } + } + $res = Db::name('Project')->strict(false)->field('step_sort,status')->update($param); + if($res!==false){ + $checkData=array( + 'action_id' => $detail['id'], + 'step_id' => $step['id'], + 'check_uid' => $this->uid, + 'type' => 2, + 'check_time' => time(), + 'status' => $param['check'], + 'content' => $param['content'], + 'create_time' => time() + ); + $aid = Db::name('StepRecord')->strict(false)->field(true)->insertGetId($checkData); + add_log('refue', $param['id'], $param,'项目阶段'); + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } } diff --git a/app/project/controller/Document.php b/app/project/controller/Document.php new file mode 100644 index 0000000..3669bd8 --- /dev/null +++ b/app/project/controller/Document.php @@ -0,0 +1,152 @@ +isAjax()) { + $param = get_params(); + $param['uid'] = $this->uid; + $list = (new DocumentList())->list($param); + return table_assign(0, '', $list); + } else { + View::assign('project', get_project($this->uid)); + return view(); + } + } + + //添加 + public function add() + { + $param = get_params(); + if (request()->isPost()) { + if (isset($param['end_time'])) { + $param['end_time'] = strtotime(urldecode($param['end_time'])); + }if (isset($param['flow_status'])) { + if ($param['flow_status'] == 3) { + $param['over_time'] = time(); + } else { + $param['over_time'] = 0; + } + } + if (!empty($param['id']) && $param['id'] > 0) { + $detail = (new DocumentList())->detail($param['id']); + try { + validate(DocumentCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + $res = DocumentList::where('id', $param['id'])->strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + add_project_log($this->uid,'document',$param, $detail); + } + return to_assign(); + } else { + try { + validate(DocumentCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $param['admin_id'] = $this->uid; + $sid = DocumentList::strict(false)->field(true)->insertGetId($param); + if ($sid) { + add_log('add', $sid, $param); + $log_data = array( + 'module' => 'document', + 'document_id' => $sid, + 'new_content' => $param['title'], + 'field' => 'new', + 'action' => 'add', + 'admin_id' => $this->uid, + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + } + return to_assign(); + } + } else { + $id = isset($param['id']) ? $param['id'] : 0; + $project_id = isset($param['project_id']) ? $param['project_id'] : 0; + if($id>0){ + View::assign('detail', (new DocumentList())->detail($param['id'])); + } + View::assign('project_id', $project_id); + View::assign('id', $id); + return view(); + } + } + + //查看 + public function view() + { + $param = get_params(); + $id = isset($param['id']) ? $param['id'] : 0; + $detail = (new DocumentList())->detail($id); + if (empty($detail)) { + if (empty($detail)) { + echo '
      该文档不存在
      ';exit; + } + } else { + $project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id'); + if (in_array($detail['project_id'], $project_ids) || ($this->uid = $detail['admin_id'])) { + View::assign('detail', $detail); + View::assign('id', $id); + return view(); + } + else{ + echo '
      您没权限查看该文档
      ';exit; + } + } + } + + //删除 + public function delete() + { + if (request()->isDelete()) { + $id = get_params("id"); + $detail = Db::name('ProjectDocument')->where('id', $id)->find(); + if ($detail['admin_id'] != $this->uid) { + return to_assign(1, "你不是该文档的创建人,无权限删除"); + } + if (Db::name('ProjectDocument')->where('id', $id)->update(['delete_time' => time()]) !== false) { + $log_data = array( + 'module' => 'document', + 'field' => 'delete', + 'action' => 'delete', + 'document_id' => $detail['id'], + 'admin_id' => $this->uid, + 'old_content' => '', + 'new_content' => $detail['title'], + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + return to_assign(0, "删除成功"); + } else { + return to_assign(0, "删除失败"); + } + } else { + return to_assign(1, "错误的请求"); + } + } +} diff --git a/app/project/controller/Index.php b/app/project/controller/Index.php index 31e5f33..1d57893 100644 --- a/app/project/controller/Index.php +++ b/app/project/controller/Index.php @@ -18,14 +18,37 @@ use think\facade\View; class Index extends BaseController { + public function conf() + { + $param = get_params(); + if (request()->isPost()) { + $param['update_time'] = time(); + $res = Db::name('DataAuth')->strict(false)->field(true)->update($param); + return to_assign(); + } else { + $detail = Db::name('DataAuth')->where('name','project_admin')->find(); + $uids = Db::name('Admin')->where('id', 'in', $detail['uids'])->column('name'); + $detail['unames'] = implode(',', $uids); + View::assign('detail', $detail); + return view(); + } + } + public function index() { if (request()->isAjax()) { $param = get_params(); $project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id'); $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + + $auth = isAuth($this->uid,'contract_admin'); + $where = []; + $where[] = ['delete_time', '=', 0]; + if($auth == 0){ + $where[] = ['id', 'in', $project_ids]; + } $list = ProjectList::withoutField('content,md_content') - ->where([['delete_time', '=', 0], ['id', 'in', $project_ids]]) + ->where($where) ->order('id desc') ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { @@ -48,6 +71,15 @@ class Index extends BaseController } else { $item->tasks_pensent = "100%"; } + + if($item->status == 2){ + $step = Db::name('Step')->where(['action_id' => $item->id,'sort'=>$item->step_sort,'type'=>2,'delete_time'=>0])->find(); + $item->step_user = Db::name('Admin')->where(['id'=>$step['flow_uid']])->value('name'); + $item->step = $step['flow_name'] . '-' . $item->step_user; + } + else{ + $item->step = '-'; + } }); return table_assign(0, '', $list); } else { @@ -66,90 +98,103 @@ class Index extends BaseController if (isset($param['end_time'])) { $param['end_time'] = strtotime(urldecode($param['end_time'])); } - if (!empty($param['id']) && $param['id'] > 0) { - $project = (new ProjectList())->detail($param['id']); - if ($this->uid == $project['admin_id'] || $this->uid == $project['director_uid']) { - if (isset($param['start_time'])) { - if ($param['start_time'] >= $project['end_time']) { - return to_assign(1, '开始时间不能大于计划结束时间'); - } - } - if (isset($param['end_time'])) { - if ($param['end_time'] <= $project['start_time']) { - return to_assign(1, '计划结束时间不能小于开始时间'); - } - } - if (isset($param['flow_status'])) { - if ($param['flow_status'] > 2) { - $param['over_time'] = time(); - } else { - $param['over_time'] = 0; - } - } - try { - validate(ProjectCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - //add_project_log('edit', $param['id'], $param, $project); - $param['update_time'] = time(); - $res = ProjectList::where('id', $param['id'])->strict(false)->field(true)->update($param); - if ($res) { - add_log('edit', $param['id'], $param); - add_project_log($this->uid,'project',$param, $project); - } - return to_assign(); - } else { - return to_assign(1, '只有创建人或者负责人才有权限编辑'); - } - } else { - try { - validate(ProjectCheck::class)->scene('add')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $param['create_time'] = time(); - $param['admin_id'] = $this->uid; - $sid = ProjectList::strict(false)->field(true)->insertGetId($param); - if ($sid) { - $project_users = $this->uid; - if (!empty($param['director_uid'])){ - $project_users.=",".$param['director_uid']; - } - if (!empty($param['team_admin_ids'])){ - $project_users.=",".$param['team_admin_ids']; - } - $project_array = explode(",",(string)$project_users); - $project_array = array_unique($project_array); - $project_user_array=[]; - foreach ($project_array as $k => $v) { - if (is_numeric($v)) { - $project_user_array[]=array( - 'uid'=>$v, - 'admin_id'=>$this->uid, - 'project_id'=>$sid, - 'create_time'=>time(), - ); - } - } - Db::name('ProjectUser')->strict(false)->field(true)->insertAll($project_user_array); - add_log('add', $sid, $param); - $log_data = array( - 'module' => 'project', - 'project_id' => $sid, - 'new_content' => $param['name'], - 'field' => 'new', - 'action' => 'add', - 'admin_id' => $this->uid, - 'old_content' => '', - 'create_time' => time(), - ); - Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); - } - return to_assign(); - } + + $param['step_sort'] = 0; + $flowNameData = isset($param['flowName']) ? $param['flowName'] : ''; + $flowUidsData = isset($param['chargeIds']) ? $param['chargeIds'] : ''; + $flowIdsData = isset($param['membeIds']) ? $param['membeIds'] : ''; + $flowDateData = isset($param['cycleDate']) ? $param['cycleDate'] : ''; + $flow = []; + $time_1 = $param['start_time']; + $time_2 = $param['end_time']; + foreach ($flowNameData as $key => $value) { + if (!$value) { + continue; + } + $flowDate = explode('到',$flowDateData[$key]); + $start_time = strtotime(urldecode(trim($flowDate[0]))); + $end_time = strtotime(urldecode(trim($flowDate[1]))); + if($start_time<$time_1){ + if($key == 0){ + return to_assign(1, '第'.($key+1).'阶段的开始时间不能小于计划开始时间'); + } + else{ + return to_assign(1, '第'.($key+1).'阶段的开始时间不能小于第'.($key).'阶段的结束时间'); + } + break; + } + if($end_time>$time_2){ + return to_assign(1, '第'.($key+1).'阶段的结束时间不能大于计划结束时间'); + break; + } + else{ + $time_1 = $end_time; + } + $item = []; + $item['flow_name'] = $value; + $item['type'] = 2; + $item['flow_uid'] = $flowUidsData[$key]; + $item['flow_ids'] = $flowIdsData[$key]; + $item['sort'] = $key; + $item['start_time'] = $start_time; + $item['end_time'] = $end_time; + $item['create_time'] = time(); + $flow[]=$item; + } + //var_dump($flow);exit; + + try { + validate(ProjectCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $param['admin_id'] = $this->uid; + $sid = ProjectList::strict(false)->field(true)->insertGetId($param); + if ($sid) { + $project_users = $this->uid; + if (!empty($param['director_uid'])){ + $project_users.=",".$param['director_uid']; + } + if (!empty($param['team_admin_ids'])){ + $project_users.=",".$param['team_admin_ids']; + } + $project_array = explode(",",(string)$project_users); + $project_array = array_unique($project_array); + $project_user_array=[]; + foreach ($project_array as $k => $v) { + if (is_numeric($v)) { + $project_user_array[]=array( + 'uid'=>$v, + 'admin_id'=>$this->uid, + 'project_id'=>$sid, + 'create_time'=>time(), + ); + } + } + Db::name('ProjectUser')->strict(false)->field(true)->insertAll($project_user_array); + + //增加阶段 + foreach ($flow as $key => &$value) { + $value['action_id'] = $sid; + } + Db::name('Step')->strict(false)->field(true)->insertAll($flow); + + add_log('add', $sid, $param); + $log_data = array( + 'module' => 'project', + 'project_id' => $sid, + 'new_content' => $param['name'], + 'field' => 'new', + 'action' => 'add', + 'admin_id' => $this->uid, + 'old_content' => '', + 'create_time' => time(), + ); + Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data); + } + return to_assign(); } else { $id = isset($param['id']) ? $param['id'] : 0; if ($id > 0) { @@ -159,6 +204,13 @@ class Index extends BaseController } View::assign('detail', $detail); } + $section = ['立项阶段']; + $section_conf = Db::name('DataAuth')->where('name','project_admin')->value('conf_1'); + if(!empty($section_conf)){ + $section = explode('|', $section_conf); + } + View::assign('section', $section); + View::assign('user_info', get_login_admin()); View::assign('id', $id); return view(); } @@ -169,23 +221,79 @@ class Index extends BaseController { $param = get_params(); $id = isset($param['id']) ? $param['id'] : 0; - $detail = (new ProjectList())->detail($id); - if (empty($detail)) { - return to_assign(1, '项目不存在'); - } else { - $file_array = Db::name('FileInterfix') - ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name') - ->alias('mf') - ->join('File f', 'mf.file_id = f.id', 'LEFT') - ->join('Admin a', 'mf.admin_id = a.id', 'LEFT') - ->order('mf.create_time desc') - ->where(array('mf.topic_id' => $id, 'mf.module' => 'project')) - ->select()->toArray(); - View::assign('file_array', $file_array); - View::assign('detail', $detail); - View::assign('id', $id); - return view(); - } + $detail = (new ProjectList())->detail($id); + if (request()->isPost()) { + if ($this->uid == $detail['admin_id'] || $this->uid == $detail['director_uid']) { + if (isset($param['start_time'])) { + if ($param['start_time'] >= $detail['end_time']) { + return to_assign(1, '开始时间不能大于计划结束时间'); + } + } + if (isset($param['end_time'])) { + if ($param['end_time'] <= $detail['start_time']) { + return to_assign(1, '计划结束时间不能小于开始时间'); + } + } + try { + validate(ProjectCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + $res = ProjectList::where('id', $param['id'])->strict(false)->field(true)->update($param); + if ($res) { + if(isset($param['director_uid'])){ + $project_user=array( + 'uid'=>$param['director_uid'], + 'admin_id'=>$this->uid, + 'project_id'=>$param['id'], + 'create_time'=>time(), + 'delete_time'=>0, + ); + $has = Db::name('ProjectUser')->where(array('uid'=>$param['director_uid'],'project_id'=>$param['id']))->find(); + if(empty($has)){ + Db::name('ProjectUser')->strict(false)->field(true)->insert($project_user); + } + else{ + Db::name('ProjectUser')->where(array('id'=>$has['id']))->strict(false)->field(true)->update($project_user); + } + + } + + add_log('edit', $param['id'], $param); + add_project_log($this->uid,'project',$param, $detail); + } + return to_assign(); + } else { + return to_assign(1, '只有创建人或者负责人才有权限编辑'); + } + } + else{ + if (empty($detail)) { + return to_assign(1, '项目不存在'); + } else { + //项目阶段 + $step_array = Db::name('Step') + ->field('s.*,a.name as check_name') + ->alias('s') + ->join('Admin a', 'a.id = s.flow_uid', 'LEFT') + ->order('s.sort asc') + ->where(array('s.action_id' => $id, 's.type' => 2, 's.delete_time' => 0)) + ->select()->toArray(); + foreach ($step_array as $kk => &$vv) { + $vv['start_time'] = date('Y-m-d', $vv['start_time']); + $vv['end_time'] = date('Y-m-d', $vv['end_time']); + $flow_names = Db::name('Admin')->where([['id','in',$vv['flow_ids']]])->column('name'); + $vv['flow_names'] = implode(',',$flow_names); + } + + View::assign('step_array', $step_array); + View::assign('detail', $detail); + View::assign('id', $id); + return view(); + } + } } //查看 @@ -201,10 +309,11 @@ class Index extends BaseController $detail['schedules'] = Db::name('Schedule')->where([['tid', 'in', $tids], ['delete_time', '=', 0]])->count(); $detail['hours'] = Db::name('Schedule')->where([['tid', 'in', $tids], ['delete_time', '=', 0]])->sum('labor_time'); $detail['plan_hours'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['delete_time', '=', 0]])->sum('plan_hours'); - $detail['tasks'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['delete_time', '=', 0]])->count(); - $detail['tasks_finish'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['flow_status', '>', 2], ['delete_time', '=', 0]])->count(); + + $detail['tasks'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']],['delete_time', '=', 0]])->count(); + $detail['tasks_finish'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']],['flow_status', '>', 2], ['delete_time', '=', 0]])->count(); $detail['tasks_unfinish'] = $detail['tasks'] - $detail['tasks_finish']; - + $task_map = []; $task_map[] = ['project_id', '=', $detail['id']]; $task_map[] = ['delete_time', '=', 0]; @@ -216,7 +325,12 @@ class Index extends BaseController if ($detail['admin_id'] == $this->uid) { $role = 2; //创建人 } + $auth = isAuth($this->uid,'contract_admin'); + if ($auth == 1) { + $role = 3; //项目管理员 + } + //相关附件 $file_array = Db::name('ProjectFile') ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name') ->alias('mf') @@ -226,7 +340,66 @@ class Index extends BaseController ->where(array('mf.topic_id' => $id, 'mf.module' => 'project')) ->select()->toArray(); + //相关链接 + $link_array = Db::name('ProjectLink') + ->field('i.id,i.topic_id,i.admin_id,i.desc,i.url,a.name as admin_name') + ->alias('i') + ->join('Admin a', 'i.admin_id = a.id', 'LEFT') + ->order('i.create_time desc') + ->where(array('i.topic_id' => $id, 'i.module' => 'project', 'delete_time' => 0)) + ->select()->toArray(); + + //项目阶段 + $step_array = Db::name('Step') + ->field('s.*,a.name as check_name') + ->alias('s') + ->join('Admin a', 'a.id = s.flow_uid', 'LEFT') + ->order('s.sort asc') + ->where(array('s.action_id' => $id, 's.type' => 2, 's.delete_time' => 0)) + ->select()->toArray(); + + //阶段操作记录 + $step_record = Db::name('StepRecord') + ->field('s.*,a.name as check_name,p.flow_name') + ->alias('s') + ->join('Admin a', 'a.id = s.check_uid', 'LEFT') + ->join('Step p', 'p.id = s.step_id', 'LEFT') + ->order('s.check_time asc') + ->where(array('s.action_id' => $id, 's.type' => 2)) + ->select()->toArray(); + foreach ($step_record as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d :H:i', $vv['check_time']); + $vv['status_str'] = '提交'; + if($vv['status'] == 1){ + $vv['status_str'] = '确认完成'; + } + else if($vv['status'] == 2){ + $vv['status_str'] = '回退'; + } + if($vv['status'] == 3){ + $vv['status_str'] = '撤销'; + } + if($vv['content'] == ''){ + $vv['content'] = '无'; + } + } + + //当前项目阶段 + $step = Db::name('Step')->where(array('action_id' => $id, 'type' => 2, 'sort' => $detail['step_sort'],'delete_time'=>0))->find(); + if(!empty($step)){ + $step['check_name'] = Db::name('Admin')->where(['id' => $step['flow_uid']])->value('name'); + $flow_names = Db::name('Admin')->where([['id','in',$step['flow_ids']]])->column('name'); + $step['flow_names'] = implode(',',$flow_names); + if ($this->uid == $step['flow_uid']){ + $is_check_admin = 1; + } + } + View::assign('file_array', $file_array); + View::assign('link_array', $link_array); + View::assign('step', $step); + View::assign('step_array', $step_array); + View::assign('step_record', $step_record); View::assign('detail', $detail); View::assign('role', $role); View::assign('id', $id); diff --git a/app/project/controller/Task.php b/app/project/controller/Task.php index 9fad4e1..147dbb0 100644 --- a/app/project/controller/Task.php +++ b/app/project/controller/Task.php @@ -11,6 +11,7 @@ namespace app\project\controller; use app\base\BaseController; use app\project\model\ProjectTask as TaskList; +use app\oa\model\Schedule as ScheduleList; use app\project\validate\TaskCheck; use think\exception\ValidateException; use think\facade\Db; @@ -166,4 +167,63 @@ class Task extends BaseController return to_assign(1, "错误的请求"); } } + + public function task_time() { + if (request()->isAjax()) { + $param = get_params(); + //按时间检索 + $start_time = isset($param['start_time']) ? strtotime($param['start_time']) : 0; + $end_time = isset($param['end_time']) ? strtotime($param['end_time']) : 0; + $tid = isset($param['tid']) ? $param['tid'] : 0; + $where = []; + if ($tid>0) { + $task_ids = Db::name('ProjectTask')->where(['delete_time' => 0, 'project_id' => $param['tid']])->column('id'); + $where[] = ['a.tid', 'in', $task_ids]; + } + else{ + if (!empty($param['uid'])) { + $where[] = ['a.admin_id', '=', $param['uid']]; + } else { + $where[] = ['a.admin_id', '=', $this->uid]; + } + if (!empty($param['keywords'])) { + $where[] = ['a.title', 'like', '%' . trim($param['keywords']) . '%']; + } + if ($start_time > 0 && $end_time > 0) { + $where[] = ['a.start_time', 'between', [$start_time, $end_time]]; + } + } + $where[] = ['a.delete_time', '=', 0]; + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $schedule = ScheduleList::where($where) + ->field('a.*,u.name,d.title as department,w.title as work_cate') + ->alias('a') + ->join('Admin u', 'a.admin_id = u.id', 'LEFT') + ->join('Department d', 'u.did = d.id', 'LEFT') + ->join('WorkCate w', 'w.id = a.cid', 'LEFT') + ->order('a.end_time desc') + ->paginate($rows, false) + ->each(function ($item, $key) { + $item->labor_type_string = '案头工作'; + if($item->labor_type == 2){ + $item->labor_type_string = '外勤工作'; + } + if($item->tid > 0){ + $task = Db::name('ProjectTask')->where(['id' => $item->tid])->find(); + $item->task = $task['title']; + $item->project = Db::name('Project')->where(['id' => $task['project_id']])->value('name'); + } + $item->start_time_a = empty($item->start_time) ? '' : date('Y-m-d', $item->start_time); + $item->start_time_b = empty($item->start_time) ? '' : date('H:i', $item->start_time); + $item->end_time_a = empty($item->end_time) ? '' : date('Y-m-d', $item->end_time); + $item->end_time_b = empty($item->end_time) ? '' : date('H:i', $item->end_time); + $item->start_time = empty($item->start_time) ? '' : date('Y-m-d H:i', $item->start_time); + //$item->end_time = empty($item->end_time) ? '': date('Y-m-d H:i', $item->end_time); + $item->end_time = empty($item->end_time) ? '' : date('H:i', $item->end_time); + }); + return table_assign(0, '', $schedule); + } else { + return view(); + } + } } diff --git a/app/project/model/Project.php b/app/project/model/Project.php index 9d52c00..471d1cc 100644 --- a/app/project/model/Project.php +++ b/app/project/model/Project.php @@ -31,8 +31,8 @@ class Project extends Model $detail['team_admin_names'] = implode(',', $team_admin_names); $detail['status_name'] = self::$Status[(int) $detail['status']]; $detail['times'] = time_trans($detail['create_time']); - $detail['start_time'] = date('Y-m-d', $detail['start_time']); - $detail['end_time'] = date('Y-m-d', $detail['end_time']); + $detail['start_time_str'] = date('Y-m-d', $detail['start_time']); + $detail['end_time_str'] = date('Y-m-d', $detail['end_time']); $detail['users'] = Db::name('ProjectUser')->where(['delete_time' => 0,'project_id'=>$id])->count(); $detail['comments'] = Db::name('ProjectComment')->where([['module','=','project'],['topic_id','=',$detail['id']],['delete_time','=',0]])->count(); $detail['logs'] = Db::name('ProjectLog')->where(['module' => 'project', 'project_id' => $detail['id']])->count(); diff --git a/app/project/model/ProjectDocument.php b/app/project/model/ProjectDocument.php new file mode 100644 index 0000000..ed08709 --- /dev/null +++ b/app/project/model/ProjectDocument.php @@ -0,0 +1,62 @@ +where(['uid' => $param['uid'], 'delete_time' => 0])->column('project_id'); + $map1[] = ['admin_id', '=', $param['uid']]; + $map2[] = ['project_id', 'in', $project_ids]; + } + if (!empty($param['keywords'])) { + $where[] = ['title|content', 'like', '%' . $param['keywords'] . '%']; + } + $where[] = ['delete_time', '=', 0]; + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $list = Db::name('ProjectDocument')->where(function ($query) use ($map1, $map2) { + $query->where($map1)->whereor($map2); + })->where($where) + ->withoutField('content,md_content') + ->order('id desc') + ->paginate($rows, false, ['query' => $param]) + ->each(function ($item, $key) { + $item['project_name'] = Db::name('Project')->where(['id' => $item['project_id']])->value('name'); + $item['admin_name'] = Db::name('Admin')->where(['id' => $item['admin_id']])->value('name'); + $item['create_time'] = date('Y-m-d H:i', $item['create_time']); + return $item; + }); + return $list; + } + + //详情 + public function detail($id) + { + $detail = Db::name('ProjectDocument')->where(['id' => $id])->find(); + if (!empty($detail)) { + $detail['project_name'] = '-'; + if ($detail['project_id'] > 0) { + $detail['project_name'] = Db::name('Project')->where(['id' => $detail['project_id']])->value('name'); + } + $detail['admin_name'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name'); + $detail['times'] = time_trans($detail['create_time']); + $detail['create_time'] = date('Y-m-d', $detail['create_time']); + } + return $detail; + } +} diff --git a/app/project/model/ProjectLog.php b/app/project/model/ProjectLog.php index 588463b..efffe9b 100644 --- a/app/project/model/ProjectLog.php +++ b/app/project/model/ProjectLog.php @@ -24,6 +24,7 @@ class ProjectLog extends Model 'status' => array('icon' => 'icon-wodedianping', 'title' => '状态'), 'content' => array('icon' => 'icon-wodedianping', 'title' => '项目描述'), 'file' => array('icon' => 'icon-sucaiziyuan', 'title' => '项目文件'), + 'link' => array('icon' => 'icon-sucaiziyuan', 'title' => '项目链接'), 'user' => array('icon' => 'icon-xueshengzhuce', 'title' => '项目成员'), 'new' => array('icon' => 'icon-zidingyishezhi', 'title' => '项目'), 'delete' => array('icon' => 'icon-shanchu', 'title' => '项目'), @@ -31,6 +32,7 @@ class ProjectLog extends Model 'task' => [ 'priority' => ['', '低', '中', '高', '紧急'], 'flow_status' => ['', '未开始', '进行中', '已完成', '已拒绝', '已关闭'], + 'type' => ['', '需求', '设计', '研发', '缺陷'], 'field_array' => [ 'director_uid' => array('icon' => 'icon-xueshengzhuce', 'title' => '负责人'), 'assist_admin_ids' => array('icon' => 'icon-xueshengbaoming', 'title' => '协作人'), @@ -41,13 +43,20 @@ class ProjectLog extends Model 'priority' => array('icon' => 'icon-wodedianping', 'title' => '等级'), 'type' => array('icon' => 'icon-wodedianping', 'title' => '任务类型'), 'cate' => array('icon' => 'icon-wodedianping', 'title' => '任务类别'), - 'is_bug' => array('icon' => 'icon-wodedianping', 'title' => '任务性质'), 'done_ratio' => array('icon' => 'icon-wodedianping', 'title' => '完成进度'), 'project_id' => array('icon' => 'icon-wodedianping', 'title' => '关联项目'), 'content' => array('icon' => 'icon-wodedianping', 'title' => '描述'), 'file' => array('icon' => 'icon-sucaiziyuan', 'title' => '文件'), 'new' => array('icon' => 'icon-zidingyishezhi', 'title' => '任务'), 'delete' => array('icon' => 'icon-shanchu', 'title' => '任务'), + ]], + 'document' => [ + 'field_array' => [ + 'title' => array('icon' => 'icon-wodedianping', 'title' => '标题'), + 'project_id' => array('icon' => 'icon-wodedianping', 'title' => '关联项目'), + 'content' => array('icon' => 'icon-wodedianping', 'title' => '描述'), + 'new' => array('icon' => 'icon-zidingyishezhi', 'title' => '任务'), + 'delete' => array('icon' => 'icon-shanchu', 'title' => '任务'), ]] ]; @@ -122,6 +131,7 @@ class ProjectLog extends Model public function project_log($param = []) { $task_ids = Db::name('ProjectTask')->where(['project_id' => $param['topic_id'], 'delete_time' => 0])->column('id'); + $document_ids = Db::name('ProjectDocument')->where(['project_id' => $param['topic_id'], 'delete_time' => 0])->column('id'); $where1 = []; $where2 = []; @@ -132,6 +142,9 @@ class ProjectLog extends Model $where2[] = ['a.module', '=', 'task']; $where2[] = ['a.task_id', 'in', $task_ids]; + + $where3[] = ['a.module', '=', 'document']; + $where3[] = ['a.document_id', 'in', $document_ids]; $page = intval($param['page']); $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $content = Db::name('ProjectLog') @@ -139,13 +152,14 @@ class ProjectLog extends Model ->alias('a') ->join('Admin u', 'u.id = a.admin_id') ->order('a.create_time desc') - ->whereOr([$where1, $where2]) + ->whereOr([$where1, $where2, $where3]) ->page($page, $rows) ->select()->toArray(); $module = [ 'project' => '', 'task' => '任务', + 'document' => '文档', ]; $action = get_config('log.type_action'); $data = []; diff --git a/app/project/model/ProjectTask.php b/app/project/model/ProjectTask.php index ef8b11b..b514753 100644 --- a/app/project/model/ProjectTask.php +++ b/app/project/model/ProjectTask.php @@ -32,6 +32,14 @@ class ProjectTask extends Model self::FOUR => '已拒绝', self::FIVE => '已关闭', ]; + + public static $Type = [ + self::ZERO => '未设置', + self::ONE => '需求', + self::TWO => '设计', + self::THREE => '研发', + self::FOUR => '缺陷', + ]; //列表 function list($param) { @@ -95,6 +103,7 @@ class ProjectTask extends Model } $item['priority_name'] = self::$Priority[(int) $item['priority']]; $item['flow_name'] = self::$FlowStatus[(int) $item['flow_status']]; + $item['type_name'] = self::$Type[(int) $item['type']]; return $item; }); return $list; @@ -123,6 +132,7 @@ class ProjectTask extends Model } $detail['priority_name'] = self::$Priority[(int) $detail['priority']]; $detail['flow_name'] = self::$FlowStatus[(int) $detail['flow_status']]; + $detail['type_name'] = self::$Type[(int) $detail['type']]; $detail['times'] = time_trans($detail['create_time']); $detail['end_time'] = date('Y-m-d', $detail['end_time']); $detail['delay'] = 0; diff --git a/app/project/validate/DocumentCheck.php b/app/project/validate/DocumentCheck.php new file mode 100644 index 0000000..469d5ef --- /dev/null +++ b/app/project/validate/DocumentCheck.php @@ -0,0 +1,22 @@ + 'require', + 'id' => 'require', + ]; + + protected $message = [ + 'title.require' => '文档标题不能为空', + 'id.require' => '缺少更新条件', + ]; + + protected $scene = [ + 'add' => ['title'], + 'edit' => ['id'], + ]; +} diff --git a/app/project/view/document/add.html b/app/project/view/document/add.html new file mode 100644 index 0000000..c00bf03 --- /dev/null +++ b/app/project/view/document/add.html @@ -0,0 +1,102 @@ +{extend name="../../base/view/common/base" /} +{block name="body"} +
      + {eq name="id" value ="0"} +

      新建文档

      + + + + + + + + + + + +
      文档名称* + + 关联项目* + +
      文档内容* + +
      +
      + {else/} +

      编辑文档

      + + + + + + + + + + + +
      文档名称* + + + 关联项目* + +
      文档内容* + +
      + {/eq} +
      + + + +
      + +{/block} + + + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/app/project/view/document/index.html b/app/project/view/document/index.html new file mode 100644 index 0000000..8d6d8dc --- /dev/null +++ b/app/project/view/document/index.html @@ -0,0 +1,147 @@ +{extend name="../../base/view/common/base" /} + +{block name="style"} + +{/block} +{block name="body"} +
      +
      +
      +
      + +
      +
      + +
      + + +
      +
      +
      +
      + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/project/view/document/view.html b/app/project/view/document/view.html new file mode 100644 index 0000000..f7956e1 --- /dev/null +++ b/app/project/view/document/view.html @@ -0,0 +1,42 @@ +{extend name="../../base/view/common/base" /} +{block name="style"} + + +{/block} + +{block name="body"} +
      +

      {$detail.title}

      +
      + {$detail.admin_name}发表于:{$detail.create_time | date='Y-m-d H:i:s'}关联项目:{$detail.project_name} +
      +
      + {$detail.content|raw} +
      + +{/block} + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/project/view/index/add.html b/app/project/view/index/add.html index 425c64a..0f3e4fc 100644 --- a/app/project/view/index/add.html +++ b/app/project/view/index/add.html @@ -1,4 +1,12 @@ {extend name="../../base/view/common/base" /} +{block name="style"} + +{/block} {block name="body"} @@ -23,13 +31,13 @@ 负责人* + - 项目成员* + - @@ -38,6 +46,94 @@ + + 项目阶段* + + + +
      + {volist name = "$section" id="vo" key="k"} + {eq name="key" value="0"} +
      +
      + +
      + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + +
      +
      +
      + {else/} +
      +
      + +
      + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + +
      +
      + 删除 +
      + {/eq} + {/volist} +
      + + 添加自定义阶段 +
      +

      温馨提示

      +

      1、项目开始流转前,请确保已完善好各项目信息。

      +

      2、项目开始流转后,只有项目管理员,创建人和负责人可修改项目信息。

      +

      3、项目管理员,创建人和负责人可以修改项目阶段的信息,但是修改完成后已流转的项目阶段需要重新走一遍流程。

      +
      + +
      @@ -58,11 +154,21 @@ laydate.render({ elem: '#date', range: ['#start_time', '#end_time'] + }); + + //日期 + lay('.select-time-range').each(function () { + laydate.render({ + elem: this, + range: '到', + trigger: 'click' + }); }); - - //选择产品负责人弹窗 - $('body').on('click','[name="director_name"]',function () { - var ids=$('[name="director_uid"]').val(),names=$('[name="director_name"]').val(); + + //选择员工单人弹窗 + $('body').on('click','.picker-one',function () { + let that = $(this); + let ids=that.next().val()+'',names = that.val()+''; employeepicker.init({ ids:ids, names:names, @@ -70,32 +176,127 @@ department_url: "/api/index/get_department_tree", employee_url: "/api/index/get_employee", callback:function(ids,names,dids,departments){ - $('[name="director_uid"]').val(ids); - $('[name="director_name"]').val(names); + that.val(names); + that.next().val(ids); } }); - }); - - - //选择项目成员弹窗 - $('body').on('click','#team_admin_names',function () { - var ids=$('#team_admin_ids').val(),names=$(this).val(),team_admin_id_array=[],team_admin_name_array=[]; + }); + + //选择员工多人人弹窗 + $('body').on('click','.picker-more',function () { + let that = $(this); + let ids=that.next().val()+'',names = that.val()+'',ids_array=[],names_array=[]; if(ids.length>0){ - team_admin_id_array=ids.split(','); - team_admin_name_array=names.split(','); + ids_array=ids.split(','); + names_array=names.split(','); } employeepicker.init({ - ids:team_admin_id_array, - names:team_admin_name_array, + ids:ids_array, + names:names_array, type:1, department_url: "/api/index/get_department_tree", employee_url: "/api/index/get_employee", callback:function(ids,names,dids,departments){ - $('#team_admin_ids').val(ids); - $('#team_admin_names').val(names); + that.val(names.join(',')); + that.next().val(ids.join(',')); } }); }); + + + $('.add-flow').on('click',function(){ + let len = $('#flowList').find('.layui-form-item').length; + let index = len+1; + let type = $(this).data('type');; + let tem=['
      \ +
      \ + \ +
      \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ +
      \ +
      \ + 删除\ +
      ', + '
      \ +
      \ + \ +
      \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ +
      \ + \ +
      \ +
      \ + 删除\ +
      ' + ]; + $('#flowList').append(tem[type]); + form.render(); + //日期 + lay('.select-time-range').each(function () { + laydate.render({ + elem: this, + range: '到', + trigger: 'click' + }); + }); + }); + $('#flowList').on('click','.layui-btn-danger',function(){ + $(this).parents('.layui-form-item').remove(); + var items = $('.label-index').length; + if(items>0){ + $('.label-index').each(function(index,item){ + $(this).html('第'+(index+2)+'阶段'); + }) + } + }); + //监听提交 form.on('submit(webform)', function (data) { diff --git a/app/project/view/index/conf.html b/app/project/view/index/conf.html new file mode 100644 index 0000000..6d93a17 --- /dev/null +++ b/app/project/view/index/conf.html @@ -0,0 +1,94 @@ +{extend name="../../base/view/common/base" /} + +{block name="body"} + +

      权限配置

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

      项目模块使用说明:

      +

      1、设置项目管理员,可设置多个

      +

      a、拥有项目管理员权限的员工可以查看所有项目。

      +

      b、非项目管理员的员工,可查看(项目创建人,项目负责人,项目成员)相关联的项目。

      +

      c、项目的编辑权限只有项目录入人、项目负责人、项目管理员拥有。

      +

      2、系统会记录每一次项目的操作记录

      +

      a、记录每一次项目的操作记录,防止合同被误操作和后期问题追踪。

      +
      权限名称 + + {$detail.title} + 权限标识{$detail.name}
      默认阶段配置* + + +
      权限人员* + + + +
      + {$detail.desc} +
      +
      + + +
      + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/project/view/index/edit.html b/app/project/view/index/edit.html new file mode 100644 index 0000000..12e57e8 --- /dev/null +++ b/app/project/view/index/edit.html @@ -0,0 +1,254 @@ +{extend name="../../base/view/common/base" /} +{block name="style"} + +{/block} + +{block name="body"} +
      +

      编辑项目阶段

      + + + + + + + + + + + + + + + + + + + + + + + +
      项目名称*{$detail.name}计划完成周期{$detail.start_time_str} - {$detail.end_time_str}
      负责人{$detail.director_name}项目成员{$detail.team_admin_names}
      项目简介{$detail.content}
      项目阶段*
      +
      + {volist name="$step_array" id="vo"} +
      +
      + +
      + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + + +
      +
      +
      + +
      + +
      +
      +
      + {/volist} +
      + + 添加自定义阶段 +
      +

      温馨提示

      +

      1、项目开始流转前,请确保已完善好各项目信息。

      +

      2、项目开始流转后,只有项目负责人可修改项目信息。

      +

      3、项目负责人可以修改项目阶段的信息,但是修改完成后已流转的项目阶段需要重新走一遍流程。

      +
      +
      +
      + + + +
      +
      +{/block} + + + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/app/project/view/index/index.html b/app/project/view/index/index.html index 4ccdfa2..c35b2c2 100644 --- a/app/project/view/index/index.html +++ b/app/project/view/index/index.html @@ -2,11 +2,13 @@ {block name="body"}
      -
      - -
      + {/block} @@ -18,8 +20,9 @@ var table = layui.table, form = layui.form, tool = layui.tool; layui.pageTable = table.render({ elem: '#projectList', + toolbar: '#toolbarDemo', title: '项目列表', - cellMinWidth: 300, + cellMinWidth: 220, page: true, //开启分页 limit: 20, url: "/project/index/index", //数据接口 @@ -41,9 +44,10 @@ return html; } } - , { field: 'director_name', title: '负责人', align: 'center', width: 80, rowspan: 2 } , { field: 'plan_time', title: '项目周期', align: 'center', width: 190, rowspan: 2 } + ,{field: 'step',title: '当前阶段及负责人',align: 'center',width: 140,rowspan: 2 } , { align: 'center', title: '关联任务', colspan: 3 } + , { field: 'director_name', fixed: 'right', title: '负责人', align: 'center', width: 80, rowspan: 2 } ], [ { field: 'tasks_unfinish', align: 'center', style: 'color: #91CC75;', width: 72, 'title': '进行中' } , { field: 'tasks_finish', align: 'center', style: 'color: #FAC858;', width: 70, 'title': '已完成' } @@ -51,8 +55,15 @@ ]] }); - $('.gg-form-bar').on('click','.add-project', function () { - tool.side('/project/index/add'); + + //触发事件 + table.on('toolbar(project)', function(obj){ + var checkStatus = table.checkStatus(obj.config.id); + switch(obj.event){ + case 'add': + tool.side('/project/index/add'); + break; + }; }); } diff --git a/app/project/view/index/view.html b/app/project/view/index/view.html index 91466a2..f13e201 100644 --- a/app/project/view/index/view.html +++ b/app/project/view/index/view.html @@ -8,23 +8,6 @@ .layui-card-tips {color: #969696;} .layui-card-value {padding: 4px 0 16px;font-size: 18px;color: #1E9FFF;} -.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding: 8px; margin:8px; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} -.file-card .file-icon{font-size:42px; color:#999; margin-right: 8px;} -.file-card .file-title {font-size: 14px; color: #409eff; letter-spacing: 0; margin-right: 8px; line-height: 18px; cursor: pointer; word-break: break-all; overflow: hidden; text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - line-clamp: 2; - -webkit-box-orient: vertical;width: calc(100% - 110px); -} -.file-card .file-tool .iconfont{font-size:16px; padding:4px; cursor:pointer;} - .log-timeline{ position: relative; min-height:600px; padding-left: 48px; background-color:#fff;} .log-timeline:after {content: ""; position: absolute; top: 0; left: 24px; width: 1px; height: 100%; background: #e3e9ed;} .log-timeline dl{padding-bottom: 8px; position: relative;} @@ -35,6 +18,8 @@ .log-timeline .open-a{margin:0 4px;} .log-item i{font-weight:800; color:#323232} .log-content strong{margin:0 4px; color:#323232} +.layui-timeline-item{color:#c9c9c9; padding-bottom:8px} +.layui-timeline-item.delete_0{color:#646464;} .comment-input .comment-image{width:40px; height:40px; border-radius:50%} .comment-item .comment-avatar{width:50px; float:left} @@ -44,6 +29,33 @@ .comment-item .comment-actions a{color:#8c95a8; cursor:pointer; font-size:12px;} .comment-item .comment-actions a:hover{color:#3582fb;} .comment-meta span{font-size:12px;} + +.check-items{overflow-x: auto; padding: 2px 0;} +.flow-flex-row {box-direction: row; + box-orient: horizontal; + -webkit-box-orient: horizontal; + -ms-flex-direction: row; + flex-direction: row; +} +.flow-flexbox { width: 100%;text-align: left; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + display: -webkit-flex; + box-align: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + flex-wrap: wrap; +} +.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0; padding:4px 0;} +.check-item i{font-size:20px; margin-right:3px;} +.check-item span{color:#999;margin:0 1px;} +.layui-icon[data-ok]{color:#34a853} +.layui-icon[data-no]{color:#FF5722;} +.layui-icon[data-on]{color:#4285f4;} +.check-item-status{color:#969696; font-size:12px; margin-left:3px;} +.check-item:last-child .layui-icon-right{display:none;} {/block} @@ -70,6 +82,7 @@
    • 项目概览
    • 项目任务
    • 工作记录
    • +
    • 项目文档
    • 项目人员
    • 项目动态
    • 项目评论
    • @@ -87,6 +100,10 @@ {include file="/index/view_schedule" /}
      +
      + {include file="/index/view_document" /} +
      +
      {include file="/index/view_user" /}
      @@ -200,14 +217,14 @@ }, data: [{ value: 1048, - name: '延误', + name: '延迟', itemStyle: { color: "#ED6666", } }, { value: 735, - name: '按时完成', + name: '未延迟', itemStyle: { color: "#91CC75", } @@ -217,6 +234,7 @@ ] }; + var chartCross = document.getElementById('cross'); var crossChart = echarts.init(chartCross); var optionD; @@ -498,24 +516,26 @@ function gouguInit() { var element = layui.element; - overview(layui); + overview(); element.on('tab(project)', function(data){ let index = data.index; - console.log(index); if(index == 1){ - task(layui); + project_task(); } else if(index == 2){ - schedule(layui); + project_schedule(); } else if(index == 3){ - user(layui); + project_document(); } else if(index == 4){ - log(layui); + project_user(); } else if(index == 5){ - comment(layui); + project_log(); + } + else if(index == 6){ + project_comment(); } }); } diff --git a/app/project/view/index/view_comment.html b/app/project/view/index/view_comment.html index ba2f51c..190eb4e 100644 --- a/app/project/view/index/view_comment.html +++ b/app/project/view/index/view_comment.html @@ -5,11 +5,11 @@
      + \ No newline at end of file diff --git a/app/project/view/index/view_log.html b/app/project/view/index/view_log.html index ab90757..8769a8f 100644 --- a/app/project/view/index/view_log.html +++ b/app/project/view/index/view_log.html @@ -2,11 +2,11 @@
      {/block} @@ -77,6 +79,7 @@ layui.taskTable = table.render({ elem: '#task', title: '任务列表', + toolbar: '#toolbarDemo', cellMinWidth: 200, url: "/project/task/index", //数据接口 page: true, //开启分页 @@ -93,6 +96,11 @@ return html; } } + , { field: 'cate_name', title: '工作类型', width: 90, align: 'center' } + , { field: 'type_name', title: '任务类型', width: 90, align: 'center',templet:function(d){ + var html = ''+d.type_name+''; + return html; + }} , { field: 'title', title: '任务主题', rowspan: 2, templet: function (d) { var html = '' + d.priority_name + ' ' + d.title + ''; @@ -101,13 +109,12 @@ } , { field: 'director_name', title: '负责人', align: 'center', width: 80 } , { field: 'assist_admin_names', title: '协作人', width: 200 } - , { field: 'cate_name', title: '工作类型', width: 90, align: 'center' } , { field: 'plan_hours', title: '预估工时', align: 'center', width: 80 } , { field: 'end_time', title: '预计结束日期', width: 150, templet: function (d) { var html = d.end_time; if (d.delay > 0) { - html += '逾期' + d.delay + '天'; + html += '逾期' + d.delay + '天'; } return html; } @@ -136,10 +143,15 @@ } }); }); - - //新增 - $('#taskList').on('click', '.add-new', function () { - tool.side('/project/task/add'); + + //触发事件 + table.on('toolbar(task)', function(obj){ + var checkStatus = table.checkStatus(obj.config.id); + switch(obj.event){ + case 'add': + tool.side('/project/task/add'); + break; + }; }); //查看模式 diff --git a/app/project/view/task/task_time.html b/app/project/view/task/task_time.html new file mode 100644 index 0000000..3fe5b45 --- /dev/null +++ b/app/project/view/task/task_time.html @@ -0,0 +1,241 @@ +{extend name="../../base/view/common/base" /} +{block name="style"} + +{/block} + +{block name="body"} +
      +
      +
      +
      + +
      + ~ +
      + +
      +
      +
      + + +
      +
      + +
      + +
      +
      +
      +
      +
      +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/project/view/task/view.html b/app/project/view/task/view.html index 4fdfaf0..00be45d 100644 --- a/app/project/view/task/view.html +++ b/app/project/view/task/view.html @@ -22,6 +22,7 @@ {/block} {block name="body"} +

      {$detail.title} @@ -40,14 +41,25 @@
      - + - + + + + + + + - - - - - + + + + + - - - - - - + +
      负责人任务负责人 {$detail.director_name} 协作人{$detail.assist_admin_names}
      计划完成日期{$detail.end_time| + date='Y-m-d'}{gt name="$detail.delay" value="0"}逾期 + {$detail.delay} 天{/gt}预估工时{$detail.plan_hours} 工作类型 {$detail.cate_name}
      预估工时{$detail.plan_hours}计划完成日期{$detail.end_time| - date='Y-m-d'}{gt name="$detail.delay" value="0"}逾期 - {$detail.delay} 天{/gt}
      实际完成日期{eq name="$detail.over_time" value="0"}-{else/}{$detail.over_time| + date='Y-m-d'}{/eq}实际工时{eq name="$detail.work_hours" value="0"}-{else/}{$detail.work_hours}{/eq} + 任务状态 {$detail.flow_name} -
      实际工时{eq name="$detail.work_hours" value="0"}-{else/}{$detail.work_hours}{/eq} - 实际完成日期{eq name="$detail.over_time" value="0"}-{else/}{$detail.over_time| - date='Y-m-d'}{/eq} 完成进度 {$detail.done_ratio}% -
      @@ -183,6 +185,12 @@ { 'id': 4, 'title': '不解决' }, { 'id': 5, 'title': '已关闭' } ], + type: [ + { 'id': 1, 'title': '需求' }, + { 'id': 2, 'title': '设计' }, + { 'id': 3, 'title': '研发' }, + { 'id': 4, 'title': '缺陷' } + ], priority: [ { 'id': 1, 'title': '低' }, { 'id': 2, 'title': '中' }, @@ -349,7 +357,7 @@ if (name == "assist_admin_ids") { edit.employee_more(id, name, show_txt, real_txt, editPost); } - if (name == "flow_status" || name == "priority" || name == "done_ratio") { + if (name == "flow_status" || name == "priority" || name == "done_ratio" || name == "type") { edit.dropdown(id, name, real_txt, opsData[name], editPost); } if (name == "cate") { diff --git a/app/user/view/department/index.html b/app/user/view/department/index.html index b9615d1..2ca6a16 100644 --- a/app/user/view/department/index.html +++ b/app/user/view/department/index.html @@ -3,7 +3,7 @@ {block name="body"}
      - +
      @@ -36,7 +36,7 @@ , { field: 'leader', title: '部门负责人',width: 120, align: 'center'} , { field: 'phone', title: '部门电话',width: 160,} , { width:180, title: '操作', align: 'center', templet: function (d) { - var html = ''; + var html = ''; return html; } } diff --git a/app/user/view/personal/change.html b/app/user/view/personal/change.html index 9f2b85a..64bf567 100644 --- a/app/user/view/personal/change.html +++ b/app/user/view/personal/change.html @@ -4,7 +4,7 @@
      - +
      @@ -13,7 +13,7 @@ {/block} @@ -42,7 +42,7 @@ width: 80, title: '操作', align: 'center' , templet: function (d) { var html = ''; - var delBtn = ''; + var delBtn = ''; return delBtn; } } diff --git a/app/user/view/personal/leave.html b/app/user/view/personal/leave.html index 2ee3775..9de2717 100644 --- a/app/user/view/personal/leave.html +++ b/app/user/view/personal/leave.html @@ -4,7 +4,7 @@
      - +
      @@ -13,7 +13,7 @@ {/block} @@ -44,7 +44,7 @@ width: 100, title: '操作',fixed:'right', align: 'center' , templet: function (d) { var html='
      '; - html+=''; + html+=''; html+=''; html+='
      '; return html; diff --git a/app/user/view/position/index.html b/app/user/view/position/index.html index 9406ada..aacecfd 100644 --- a/app/user/view/position/index.html +++ b/app/user/view/position/index.html @@ -10,7 +10,7 @@